1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/About-BdIJp2Yy.js","assets/dollar-sign-BDYHvjIq.js","assets/Events-B6Z7RwE0.js","assets/useQuery-DCER3NzV.js","assets/map-BGos7SEi.js","assets/ruler-L5csRX3K.js","assets/mountain-BV30XMYl.js","assets/history-DmSZ8q5Z.js","assets/PartnerRegister-CTZi-vw1.js","assets/info-CK7CaAaJ.js","assets/Gallery-BuW-wA3y.js","assets/tabs-CXFGBUnK.js","assets/camera-BO6twGg3.js","assets/film-CKBCniMW.js","assets/link-2-CUjyipaX.js","assets/chevron-left-C5gI7Bao.js","assets/Profile-Cs4Dle2X.js","assets/avatar-B25PoqdE.js","assets/index-SSeNUWKo.js","assets/switch-5nMfL5C7.js","assets/send-BiNicmZ4.js","assets/accordion-Nsayht8g.js","assets/table-CHZFxP31.js","assets/trophy-Chf00AqI.js","assets/tent-FWw3F7zc.js","assets/index-D6gi0CvP.js","assets/ticket-DUVV7Qrv.js","assets/copy-xjlC3KC1.js","assets/external-link-DW49lBch.js","assets/download-Dr2kzgCW.js","assets/lightbulb-XSzYkC69.js","assets/chart-column-CS5wESM8.js","assets/useMutation-CSyS1bY4.js","assets/circle-check-big-BEA8hdK2.js","assets/mail-x-Bm2J-6Zv.js","assets/settings-D6yTFcbH.js","assets/Settings-Wjw2-BRG.js","assets/imageCrop-DTiQ5wvz.js","assets/slider-CK4G9QxL.js","assets/upload-p8PDaxto.js","assets/zoom-in-bMa4aNDY.js","assets/save-Ekil53vy.js","assets/MyOrders-vPbKPS8I.js","assets/orderHelpers-j2iy3T-r.js","assets/file-text-vqVvaZrR.js","assets/OrderDetail-DFT-QCai.js","assets/AdminDashboard-6HgUxDx8.js","assets/mail-check-DQ_4R4Ul.js","assets/image-BQ-yTslK.js","assets/search-37Hs1tHq.js","assets/Story-D34MGbnG.js","assets/purify.es-C
vendor: 6,712 bytes, lines 1-10
15KSVp3G.js","assets/Press-DqD1kQAR.js","assets/Support-cfOZWkkP.js","assets/Nominate-C7AJjydf.js","assets/log-in-DuSUJUWD.js","assets/Course-DWFe6nQ6.js","assets/trending-down-PlW0swHp.js","assets/generateCategoricalChart-COugthD5.js","assets/index-Dh4i1-J3.js","assets/AreaChart-Cu9lkW5L.js","assets/CartesianGrid-D77_WPGl.js","assets/VirtualCourses-Bjia559h.js","assets/smartphone-BIdCmV-G.js","assets/timer-CKBZCiFa.js","assets/Unsubscribe-dB_Xq0SC.js","assets/EmailPreferences-DCRvINmB.js","assets/ConfirmEmailChange-BjylnyUr.js","assets/circle-x-DuvGBqQT.js","assets/CheckIn-XAoasxjQ.js","assets/progress-bL13uGCR.js","assets/undo-2-BowwnNgk.js","assets/MerchPickup-BqTzeY_2.js","assets/MerchLanding-BWIbzPPg.js"])))=>i.map(i=>d[i]); 2var hC=Object.defineProperty;var Sy=e=>{throw TypeError(e)};var mC=(e,t,r)=>t in e?hC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var bn=(e,t,r)=>mC(e,typeof t!="symbol"?t+"":t,r),ff=(e,t,r)=>t.has(e)||Sy("Cannot "+r);var U=(e,t,r)=>(ff(e,t,"read from private field"),r?r.call(e):t.get(e)),Re=(e,t,r)=>t.has(e)?Sy("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),we=(e,t,r,n)=>(ff(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),jt=(e,t,r)=>(ff(e,t,"access private method"),r);var wc=(e,t,r,n)=>({set _(s){we(e,t,s,r)},get _(){return U(e,t,n)}});function pC(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(n,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(s){if(s.ep)return;s.ep=!0;const o=r(s);fetch(s.href,o)}})();var Z6=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tw={exports:{}},dd={},rw={exports:{}},Ne={};/** 3 * @license React 4 * react.production.min.js 5 * 6 * Copyright (c) Facebook, Inc. and its affiliates. 7 * 8 * This source code is licensed under the MIT license found in the 9 * LICENSE file in the root directory of this source tree. 10 */var Yl=Symbol.for("react.element"),gC=Symbol.for("react.portal"),yC=Symbol.for("react.fragment"),vC=Symbol.for("react.strict_mode"),xC=Symbol.for("react.profiler"),wC=Symbol.for("react.provider"),bC=Symbol.for("react.context"),_C=Symbol.for("react.forward_ref"),SC=Symbol.for("react.suspense"),kC=Symbol.for("react.memo"),jC=Symbol.for("react.lazy"),ky=Symbol.iterator;function NC(e){return e===null||typeof e!="object"?null:(e=ky&&e[ky]||e["@@iterator"],typeof e=="function"?e:null)}var nw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},sw=Object.assign,ow={};function ii(e,t,r){this.props=e,this.context=t,this.refs=ow,this.updater=r||nw}ii.prototype.isReactComponent={};ii.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")};ii.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function aw(){}aw.prototype=ii.prototype;function ap(e,t,r){this.props=e,this.context=t,this.refs=ow,this.updater=r||nw}var ip=ap.prototype=new aw;ip.constructor=ap;sw(ip,ii.prototype);ip.isPureReactComponent=!0;var jy=Array.isArray,iw=Object.prototype.hasOwnProperty,lp={current:null},lw={key:!0,ref:!0,__self:!0,__source:!0};function cw(e,t,r){var n,s={},o=null,a=null;if(t!=null)for(n in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)iw.call(t,n)&&!lw.hasOwnProperty(n)&&(s[n]=t[n]);var l=arguments.length-2;if(l===1)s.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];s.children=c}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)s[n]===void 0&&(s[n]=l[n]);return{$$typeof:Yl,type:e,key:o,ref:a,props:s,_owner:lp.current}}function CC(e,t){return{$$typeof:Yl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function cp(e){return typeof e=="object"&&e!==null&&e.$$typeof===Yl}function EC(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Ny=/\/+/g;function hf(e,t){return typeof e=="object"&&e!==null&&e.key!=null?EC(""+e.key):t.toString(36)}function Zc(e,t,r,n,s){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case Yl:case gC:a=!0}}if(a)return a=e,s=s(a),e=n===""?"."+hf(a,0):n,jy(s)?(r="",e!=null&&(r=e.replace(Ny,"$&/")+"/"),Zc(s,t,r,"",function(u){return u})):s!=null&&(cp(s)&&(s=CC(s,r+(!s.key||a&&a.key===s.key?"":(""+s.key).replace(Ny,"$&/")+"/")+e)),t.push(s)),1;if(a=0,n=n===""?".":n+":",jy(e))for(var l=0;l<e.length;l++){o=e[l];var c=n+hf(o,l);a+=Zc(o,t,r,c,s)}else if(c=NC(e),typeof c=="function")for(e=c.call(e),l=0;!(o=e.next()).done;)o=o.value,c=n+hf(o,l++),a+=Zc(o,t,r,c,s);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function bc(e,t,r){if(e==null)return e;var n=[],s=0;return Zc(e,n,"","",function(o){return t.call(r,o,s++)}),n}function TC(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var zt={current:null},Xc={transition:null},PC={ReactCurrentDispatcher:zt,ReactCurrentBatchConfig:Xc,ReactCurrentOwner:lp};function uw(){throw Error("act(...) is not supported in production builds of React.")}
vendor: 9,037 bytes, lines 10-34
10Ne.Children={map:bc,forEach:function(e,t,r){bc(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return bc(e,function(){t++}),t},toArray:function(e){return bc(e,function(t){return t})||[]},only:function(e){if(!cp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ne.Component=ii;Ne.Fragment=yC;Ne.Profiler=xC;Ne.PureComponent=ap;Ne.StrictMode=vC;Ne.Suspense=SC;Ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=PC;Ne.act=uw;Ne.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=sw({},e.props),s=e.key,o=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,a=lp.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)iw.call(t,c)&&!lw.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];n.children=l}return{$$typeof:Yl,type:e.type,key:s,ref:o,props:n,_owner:a}};Ne.createContext=function(e){return e={$$typeof:bC,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:wC,_context:e},e.Consumer=e};Ne.createElement=cw;Ne.createFactory=function(e){var t=cw.bind(null,e);return t.type=e,t};Ne.createRef=function(){return{current:null}};Ne.forwardRef=function(e){return{$$typeof:_C,render:e}};Ne.isValidElement=cp;Ne.lazy=function(e){return{$$typeof:jC,_payload:{_status:-1,_result:e},_init:TC}};Ne.memo=function(e,t){return{$$typeof:kC,type:e,compare:t===void 0?null:t}};Ne.startTransition=function(e){var t=Xc.transition;Xc.transition={};try{e()}finally{Xc.transition=t}};Ne.unstable_act=uw;Ne.useCallback=function(e,t){return zt.current.useCallback(e,t)};Ne.useContext=function(e){return zt.current.useContext(e)};Ne.useDebugValue=function(){};Ne.useDeferredValue=function(e){return zt.current.useDeferredValue(e)};Ne.useEffect=function(e,t){return zt.current.useEffect(e,t)};Ne.useId=function(){return zt.current.useId()};Ne.useImperativeHandle=function(e,t,r){return zt.current.useImperativeHandle(e,t,r)};Ne.useInsertionEffect=function(e,t){return zt.current.useInsertionEffect(e,t)};Ne.useLayoutEffect=function(e,t){return zt.current.useLayoutEffect(e,t)};Ne.useMemo=function(e,t){return zt.current.useMemo(e,t)};Ne.useReducer=function(e,t,r){return zt.current.useReducer(e,t,r)};Ne.useRef=function(e){return zt.current.useRef(e)};Ne.useState=function(e){return zt.current.useState(e)};Ne.useSyncExternalStore=function(e,t,r){return zt.current.useSyncExternalStore(e,t,r)};Ne.useTransition=function(){return zt.current.useTransition()};Ne.version="18.3.1";rw.exports=Ne;var h=rw.exports;const W=Gl(h),up=pC({__proto__:null,default:W},[h]);/** 11 * @license React 12 * react-jsx-runtime.production.min.js 13 * 14 * Copyright (c) Facebook, Inc. and its affiliates. 15 * 16 * This source code is licensed under the MIT license found in the 17 * LICENSE file in the root directory of this source tree. 18 */var RC=h,OC=Symbol.for("react.element"),AC=Symbol.for("react.fragment"),IC=Object.prototype.hasOwnProperty,DC=RC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,MC={key:!0,ref:!0,__self:!0,__source:!0};function dw(e,t,r){var n,s={},o=null,a=null;r!==void 0&&(o=""+r),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(n in t)IC.call(t,n)&&!MC.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:OC,type:e,key:o,ref:a,props:s,_owner:DC.current}}dd.Fragment=AC;dd.jsx=dw;dd.jsxs=dw;tw.exports=dd;var i=tw.exports,fw={exports:{}},fr={},hw={exports:{}},mw={};/** 19 * @license React 20 * scheduler.production.min.js 21 * 22 * Copyright (c) Facebook, Inc. and its affiliates. 23 * 24 * This source code is licensed under the MIT license found in the 25 * LICENSE file in the root directory of this source tree. 26 */(function(e){function t(C,j){var I=C.length;C.push(j);e:for(;0<I;){var F=I-1>>>1,B=C[F];if(0<s(B,j))C[F]=j,C[I]=B,I=F;else break e}}function r(C){return C.length===0?null:C[0]}function n(C){if(C.length===0)return null;var j=C[0],I=C.pop();if(I!==j){C[0]=I;e:for(var F=0,B=C.length,J=B>>>1;F<J;){var Z=2*(F+1)-1,Se=C[Z],je=Z+1,V=C[je];if(0>s(Se,I))je<B&&0>s(V,Se)?(C[F]=V,C[je]=I,F=je):(C[F]=Se,C[Z]=I,F=Z);else if(je<B&&0>s(V,I))C[F]=V,C[je]=I,F=je;else break e}}return j}function s(C,j){var I=C.sortIndex-j.sortIndex;return I!==0?I:C.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,f=null,m=3,p=!1,w=!1,g=!1,b=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(C){for(var j=r(u);j!==null;){if(j.callback===null)n(u);else if(j.startTime<=C)n(u),j.sortIndex=j.expirationTime,t(c,j);else break;j=r(u)}}function _(C){if(g=!1,x(C),!w)if(r(c)!==null)w=!0,P(S);else{var j=r(u);j!==null&&M(_,j.startTime-C)}}function S(C,j){w=!1,g&&(g=!1,v(E),E=-1),p=!0;var I=m;try{for(x(j),f=r(c);f!==null&&(!(f.expirationTime>j)||C&&!L());){var F=f.callback;if(typeof F=="function"){f.callback=null,m=f.priorityLevel;var B=F(f.expirationTime<=j);j=e.unstable_now(),typeof B=="function"?f.callback=B:f===r(c)&&n(c),x(j)}else n(c);f=r(c)}if(f!==null)var J=!0;else{var Z=r(u);Z!==null&&M(_,Z.startTime-j),J=!1}return J}finally{f=null,m=I,p=!1}}var k=!1,N=null,E=-1,T=5,R=-1;function L(){return!(e.unstable_now()-R<T)}function O(){if(N!==null){var C=e.unstable_now();R=C;var j=!0;try{j=N(!0,C)}finally{j?A():(k=!1,N=null)}}else k=!1}var A;if(typeof y=="function")A=function(){y(O)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,z=$.port2;$.port1.onmessage=O,A=function(){z.postMessage(null)}}else A=function(){b(O,0)};function P(C){N=C,k||(k=!0,A())}function M(C,j){E=b(function(){C(e.unstable_now())},j)}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(C){C.callback=null},e.unstable_continueExecution=function(){w||p||(w=!0,P(S))},e.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<C?Math.floor(1e3/C):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(C){switch(m){case 1:case 2:case 3:var j=3;break;default:j=m}var I=m;m=j;try{return C()}finally{m=I}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(C,j){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var I=m;m=C;try{return j()}finally{m=I}},e.unstable_scheduleCallback=function(C,j,I){var F=e.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?F+I:F):I=F,C){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=I+B,C={id:d++,callback:j,priorityLevel:C,startTime:I,expirationTime:B,sortIndex:-1},I>F?(C.sortIndex=I,t(u,C),r(c)===null&&C===r(u)&&(g?(v(E),E=-1):g=!0,M(_,I-F))):(C.sortIndex=B,t(c,C),w||p||(w=!0,P(S))),C},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(C){var j=m;return function(){var I=m;m=j;try{return C.apply(this,arguments)}finally{m=I}}}})(mw);hw.exports=mw;var LC=hw.exports;/** 27 * @license React 28 * react-dom.production.min.js 29 * 30 * Copyright (c) Facebook, Inc. and its affiliates. 31 * 32 * This source code is licensed under the MIT license found in the 33 * LICENSE file in the root directory of this source tree. 34 */var $C=h,cr=LC;function H(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);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 pw=new Set,il={};function Uo(e,t){Ha(e,t),Ha(e+"Capture",t)}function Ha(e,t){for(il[e]=t,e=0;e<t.length;e++)pw.add(t[e])}var An=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yh=Object.prototype.hasOwnProperty,FC=/^[: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]*$/,Cy={},Ey={};
vendor: 4,394 bytes, line 34
34function UC(e){return yh.call(Ey,e)?!0:yh.call(Cy,e)?!1:FC.test(e)?Ey[e]=!0:(Cy[e]=!0,!1)}function zC(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function BC(e,t,r,n){if(t===null||typeof t>"u"||zC(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.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 Bt(e,t,r,n,s,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var kt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){kt[e]=new Bt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];kt[t]=new Bt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){kt[e]=new Bt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){kt[e]=new Bt(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){kt[e]=new Bt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){kt[e]=new Bt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){kt[e]=new Bt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){kt[e]=new Bt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){kt[e]=new Bt(e,5,!1,e.toLowerCase(),null,!1,!1)});var dp=/[\-:]([a-z])/g;function fp(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(dp,fp);kt[t]=new Bt(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(dp,fp);kt[t]=new Bt(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(dp,fp);kt[t]=new Bt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){kt[e]=new Bt(e,1,!1,e.toLowerCase(),null,!1,!1)});kt.xlinkHref=new Bt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){kt[e]=new Bt(e,1,!1,e.toLowerCase(),null,!0,!0)});function hp(e,t,r,n){var s=kt.hasOwnProperty(t)?kt[t]:null;(s!==null?s.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(BC(t,r,s,n)&&(r=null),n||s===null?UC(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):s.mustUseProperty?e[s.propertyName]=r===null?s.type===3?!1:"":r:(t=s.attributeName,n=s.attributeNamespace,r===null?e.removeAttribute(t):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}
vendor: 5,027 bytes, lines 34-38
34var Un=$C.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,_c=Symbol.for("react.element"),la=Symbol.for("react.portal"),ca=Symbol.for("react.fragment"),mp=Symbol.for("react.strict_mode"),vh=Symbol.for("react.profiler"),gw=Symbol.for("react.provider"),yw=Symbol.for("react.context"),pp=Symbol.for("react.forward_ref"),xh=Symbol.for("react.suspense"),wh=Symbol.for("react.suspense_list"),gp=Symbol.for("react.memo"),ss=Symbol.for("react.lazy"),vw=Symbol.for("react.offscreen"),Ty=Symbol.iterator;function _i(e){return e===null||typeof e!="object"?null:(e=Ty&&e[Ty]||e["@@iterator"],typeof e=="function"?e:null)}var Je=Object.assign,mf;function $i(e){if(mf===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);mf=t&&t[1]||""}return` 35`+mf+e}var pf=!1;function gf(e,t){if(!e||pf)return"";pf=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var n=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){n=u}e.call(t.prototype)}else{try{throw Error()}catch(u){n=u}e()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var s=u.stack.split(` 36`),o=n.stack.split(` 37`),a=s.length-1,l=o.length-1;1<=a&&0<=l&&s[a]!==o[l];)l--;for(;1<=a&&0<=l;a--,l--)if(s[a]!==o[l]){if(a!==1||l!==1)do if(a--,l--,0>l||s[a]!==o[l]){var c=` 38`+s[a].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=a&&0<=l);break}}}finally{pf=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?$i(e):""}function VC(e){switch(e.tag){case 5:return $i(e.type);case 16:return $i("Lazy");case 13:return $i("Suspense");case 19:return $i("SuspenseList");case 0:case 2:case 15:return e=gf(e.type,!1),e;case 11:return e=gf(e.type.render,!1),e;case 1:return e=gf(e.type,!0),e;default:return""}}function bh(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 ca:return"Fragment";case la:return"Portal";case vh:return"Profiler";case mp:return"StrictMode";case xh:return"Suspense";case wh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case yw:return(e.displayName||"Context")+".Consumer";case gw:return(e._context.displayName||"Context")+".Provider";case pp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case gp:return t=e.displayName||null,t!==null?t:bh(e.type)||"Memo";case ss:t=e._payload,e=e._init;try{return bh(e(t))}catch{}}return null}function HC(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 bh(t);case 8:return t===mp?"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 Is(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function WC(e){var t=xw(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(a){n=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Sc(e){e._valueTracker||(e._valueTracker=WC(e))}function ww(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=xw(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function yu(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 _h(e,t){var r=t.checked;return Je({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Py(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Is(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}
vendor: 4,651 bytes, line 38
38function bw(e,t){t=t.checked,t!=null&&hp(e,"checked",t,!1)}function Sh(e,t){bw(e,t);var r=Is(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?kh(e,t.type,r):t.hasOwnProperty("defaultValue")&&kh(e,t.type,Is(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ry(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function kh(e,t,r){(t!=="number"||yu(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Fi=Array.isArray;function Sa(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s<r.length;s++)t["$"+r[s]]=!0;for(r=0;r<e.length;r++)s=t.hasOwnProperty("$"+e[r].value),e[r].selected!==s&&(e[r].selected=s),s&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Is(r),t=null,s=0;s<e.length;s++){if(e[s].value===r){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function jh(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(H(91));return Je({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Oy(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(H(92));if(Fi(r)){if(1<r.length)throw Error(H(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Is(r)}}function _w(e,t){var r=Is(t.value),n=Is(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function Ay(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Sw(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 Nh(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Sw(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var kc,kw=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,s){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(kc=kc||document.createElement("div"),kc.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=kc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ll(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Yi={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},qC=["Webkit","ms","Moz","O"];Object.keys(Yi).forEach(function(e){qC.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Yi[t]=Yi[e]})});function jw(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Yi.hasOwnProperty(e)&&Yi[e]?(""+t).trim():t+"px"}function Nw(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=jw(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var KC=Je({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 Ch(e,t){if(t){if(KC[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function Eh(e,t){if(e.indexOf("-")===-1)return typeof t.is=="str
38ing";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 Th=null;function yp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ph=null,ka=null,ja=null;function Iy(e){if(e=Zl(e)){if(typeof Ph!="function")throw Error(H(280));var t=e.stateNode;t&&(t=gd(t),Ph(e.stateNode,e.type,t))}}function Cw(e){ka?ja?ja.push(e):ja=[e]:ka=e}function Ew(){if(ka){var e=ka,t=ja;if(ja=ka=null,Iy(e),t)for(e=0;e<t.length;e++)Iy(t[e])}}function Tw(e,t){return e(t)}function Pw(){}var yf=!1;function Rw(e,t,r){if(yf)return e(t,r);yf=!0;try{return Tw(e,t,r)}finally{yf=!1,(ka!==null||ja!==null)&&(Pw(),Ew())}}function cl(e,t){var r=e.stateNode;if(r===null)return null;var n=gd(r);if(n===null)return null;r=n[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":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(H(231,t,typeof r));return r}var Rh=!1;if(An)try{var Si={};Object.defineProperty(Si,"passive",{get:function(){Rh=!0}}),window.addEventListener("test",Si,Si),window.removeEventListener("test",Si,Si)}catch{Rh=!1}function GC(e,t,r,n,s,o,a,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(d){this.onError(d)}}var Qi=!1,vu=null,xu=!1,Oh=null,YC={onError:function(e){Qi=!0,vu=e}};function QC(e,t,r,n,s,o,a,l,c){Qi=!1,vu=null,GC.apply(YC,arguments)}function JC(e,t,r,n,s,o,a,l,c){if(QC.apply(this,arguments),Qi){if(Qi){var u=vu;Qi=!1,vu=null}else throw Error(H(198));xu||(xu=!0,Oh=u)}}function zo(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function Ow(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 Dy(e){if(zo(e)!==e)throw Error(H(188))}function ZC(e){var t=e.alternate;if(!t){if(t=zo(e),t===null)throw Error(H(188));return t!==e?null:e}for(var r=e,n=t;;){var s=r.return;if(s===null)break;var o=s.alternate;if(o===null){if(n=s.return,n!==null){r=n;continue}break}if(s.child===o.child){for(o=s.child;o;){if(o===r)return Dy(s),e;if(o===n)return Dy(s),t;o=o.sibling}throw Error(H(188))}if(r.return!==n.return)r=s,n=o;else{for(var a=!1,l=s.child;l;){if(l===r){a=!0,r=s,n=o;break}if(l===n){a=!0,n=s,r=o;break}l=l.sibling}if(!a){for(l=o.child;l;){if(l===r){a=!0,r=o,n=s;break}if(l===n){a=!0,n=o,r=s;break}l=l.sibling}if(!a)throw Error(H(189))}}if(r.alternate!==n)throw Error(H(190))}if(r.tag!==3)throw Error(H(188));return r.stateNode.current===r?e:t}function Aw(e){return e=ZC(e),e!==null?Iw(e):null}function Iw(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Iw(e);if(t!==null)return t;e=e.sibling}return null}var Dw=cr.unstable_scheduleCallback,My=cr.unstable_cancelCallback,XC=cr.unstable_shouldYield,eE=cr.unstable_requestPaint,nt=cr.unstable_now,tE=cr.unstable_getCurrentPriorityLevel,vp=cr.unstable_ImmediatePriority,Mw=cr.unstable_UserBlockingPriority,wu=cr.unstable_NormalPriority,rE=cr.unstable_LowPriority,Lw=cr.unstable_IdlePriority,fd=null,un=null;function nE(e){if(un&&typeof un.onCommitFiberRoot=="function")try{un.onCommitFiberRoot(fd,e,void 0,(e.current.flags&128)===128)}catch{}}var Wr=Math.clz32?Math.clz32:aE,sE=Math.log,oE=Math.LN2;function aE(e){return e>>>=0,e===0?32:31-(sE(e)/oE|0)|0}var jc=64,Nc=4194304;function Ui(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 bu(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,o=e.pingedLanes,a=r&268435455;if(a!==0){var l=a&~s;l!==0?n=Ui(l):(o&=a,o!==0&&(n=Ui(o)))}else a=r&~s,a!==0?n=Ui(a):o!==0&&(n=Ui(o));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-Wr(t),s=1<<r,n|=e[r],t&=~s;return n}function iE(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 lE(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var a=31-Wr(o),l=1<<a,c=s[a];c===-1?(!(l&r)||l&n)&&(s[a]=iE(l,t)):c<=t&&(e.expiredLanes|=l),o&=~l}}function Ah(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function $w(){var e=jc;return jc<<=1,!(jc&4194240)&&(jc=64),e}function vf(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}
vendor: 2,789 bytes, line 38
38function Ql(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Wr(t),e[t]=r}function cE(e,t){var r=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 n=e.eventTimes;for(e=e.expirationTimes;0<r;){var s=31-Wr(r),o=1<<s;t[s]=0,n[s]=-1,e[s]=-1,r&=~o}}function xp(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-Wr(r),s=1<<n;s&t|e[n]&t&&(e[n]|=t),r&=~s}}var Me=0;function Fw(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Uw,wp,zw,Bw,Vw,Ih=!1,Cc=[],ws=null,bs=null,_s=null,ul=new Map,dl=new Map,ls=[],uE="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 Ly(e,t){switch(e){case"focusin":case"focusout":ws=null;break;case"dragenter":case"dragleave":bs=null;break;case"mouseover":case"mouseout":_s=null;break;case"pointerover":case"pointerout":ul.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":dl.delete(t.pointerId)}}function ki(e,t,r,n,s,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:o,targetContainers:[s]},t!==null&&(t=Zl(t),t!==null&&wp(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function dE(e,t,r,n,s){switch(t){case"focusin":return ws=ki(ws,e,t,r,n,s),!0;case"dragenter":return bs=ki(bs,e,t,r,n,s),!0;case"mouseover":return _s=ki(_s,e,t,r,n,s),!0;case"pointerover":var o=s.pointerId;return ul.set(o,ki(ul.get(o)||null,e,t,r,n,s)),!0;case"gotpointercapture":return o=s.pointerId,dl.set(o,ki(dl.get(o)||null,e,t,r,n,s)),!0}return!1}function Hw(e){var t=oo(e.target);if(t!==null){var r=zo(t);if(r!==null){if(t=r.tag,t===13){if(t=Ow(r),t!==null){e.blockedOn=t,Vw(e.priority,function(){zw(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function eu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Dh(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);Th=n,r.target.dispatchEvent(n),Th=null}else return t=Zl(r),t!==null&&wp(t),e.blockedOn=r,!1;t.shift()}return!0}function $y(e,t,r){eu(e)&&r.delete(t)}function fE(){Ih=!1,ws!==null&&eu(ws)&&(ws=null),bs!==null&&eu(bs)&&(bs=null),_s!==null&&eu(_s)&&(_s=null),ul.forEach($y),dl.forEach($y)}function ji(e,t){e.blockedOn===t&&(e.blockedOn=null,Ih||(Ih=!0,cr.unstable_scheduleCallback(cr.unstable_NormalPriority,fE
vendor: 11,326 bytes, line 38
38)))}function fl(e){function t(s){return ji(s,e)}if(0<Cc.length){ji(Cc[0],e);for(var r=1;r<Cc.length;r++){var n=Cc[r];n.blockedOn===e&&(n.blockedOn=null)}}for(ws!==null&&ji(ws,e),bs!==null&&ji(bs,e),_s!==null&&ji(_s,e),ul.forEach(t),dl.forEach(t),r=0;r<ls.length;r++)n=ls[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<ls.length&&(r=ls[0],r.blockedOn===null);)Hw(r),r.blockedOn===null&&ls.shift()}var Na=Un.ReactCurrentBatchConfig,_u=!0;function hE(e,t,r,n){var s=Me,o=Na.transition;Na.transition=null;try{Me=1,bp(e,t,r,n)}finally{Me=s,Na.transition=o}}function mE(e,t,r,n){var s=Me,o=Na.transition;Na.transition=null;try{Me=4,bp(e,t,r,n)}finally{Me=s,Na.transition=o}}function bp(e,t,r,n){if(_u){var s=Dh(e,t,r,n);if(s===null)Ef(e,t,n,Su,r),Ly(e,n);else if(dE(s,e,t,r,n))n.stopPropagation();else if(Ly(e,n),t&4&&-1<uE.indexOf(e)){for(;s!==null;){var o=Zl(s);if(o!==null&&Uw(o),o=Dh(e,t,r,n),o===null&&Ef(e,t,n,Su,r),o===s)break;s=o}s!==null&&n.stopPropagation()}else Ef(e,t,n,null,r)}}var Su=null;function Dh(e,t,r,n){if(Su=null,e=yp(n),e=oo(e),e!==null)if(t=zo(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Ow(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Su=e,null}function Ww(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(tE()){case vp:return 1;case Mw:return 4;case wu:case rE:return 16;case Lw:return 536870912;default:return 16}default:return 16}}var gs=null,_p=null,tu=null;function qw(){if(tu)return tu;var e,t=_p,r=t.length,n,s="value"in gs?gs.value:gs.textContent,o=s.length;for(e=0;e<r&&t[e]===s[e];e++);var a=r-e;for(n=1;n<=a&&t[r-n]===s[o-n];n++);return tu=s.slice(e,1<n?1-n:void 0)}function ru(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 Ec(){return!0}function Fy(){return!1}function hr(e){function t(r,n,s,o,a){this._reactName=r,this._targetInst=s,this.type=n,this.nativeEvent=o,this.target=a,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(o):o[l]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Ec:Fy,this.isPropagationStopped=Fy,this}return Je(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Ec)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Ec)},persist:function(){},isPersistent:Ec}),t}var li={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sp=hr(li),Jl=Je({},li,{view:0,detail:0}),pE=hr(Jl),xf,wf,Ni,hd=Je({},Jl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kp,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!==Ni&&(Ni&&e.type==="mousemove"?(xf=e.screenX-Ni.screenX,wf=e.screenY-Ni.screenY):wf=xf=0,Ni=e),xf)},movementY:function(e){return"movementY"in e?e.movementY:wf}}),Uy=hr(hd),gE=Je({},hd,{dataTransfer:0}),yE=hr(gE),vE=Je({},Jl,{relatedTarget:0}),bf=hr(vE),xE=Je({},li,{animationName:0,elapsedTime:0,pseudoElement:0}),wE=hr(xE),bE=Je({},li,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),_E=hr(bE),SE=Je({},li,{data:0}),zy=hr(SE),kE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jE={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"},NE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function CE(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=NE[e])?!!t[e]:!1}function kp(){return CE}var EE=Je({},Jl,{key:function(e){if(e.key){var t=kE[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ru(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?jE[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kp,charCode:function(e){return e.type==="keypress"?ru(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ru(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),TE=hr(EE),PE=Je({},hd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),By=hr(PE),RE=Je({},Jl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kp}),OE=hr(RE),AE=Je({},li,{propertyName:0,elapsedTime:0,pseudoElement:0}),IE=hr(AE),DE=Je({},hd,{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}),ME=hr(DE),LE=[9,13,27,32],jp=An&&"CompositionEvent"in window,Ji=null;An&&"documentMode"in document&&(Ji=document.documentMode);var $E=An&&"TextEvent"in window&&!Ji,Kw=An&&(!jp||Ji&&8<Ji&&11>=Ji),Vy=" ",Hy=!1;function Gw(e,t){switch(e){case"keyup":return LE.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yw(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ua=!1;function FE(e,t){switch(e){case"compositionend":return Yw(t);case"keypress":return t.which!==32?null:(Hy=!0,Vy);case"textInput":return e=t.data,e===Vy&&Hy?null:e;default:return null}}function UE(e,t){if(ua)return e==="compositionend"||!jp&&Gw(e,t)?(e=qw(),tu=_p=gs=null,ua=!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 Kw&&t.locale!=="ko"?null:t.data;default:return null}}var zE={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 Wy(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!zE[e.type]:t==="textarea"}function Qw(e,t,r,n){Cw(n),t=ku(t,"onChange"),0<t.length&&(r=new Sp("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Zi=null,hl=null;function BE(e){ib(e,0)}function md(e){var t=ha(e);if(ww(t))return e}function VE(e,t){if(e==="change")return t}var Jw=!1;if(An){var _f;if(An){var Sf="oninput"in document;if(!Sf){var qy=document.createElement("div");qy.setAttribute("oninput","return;"),Sf=typeof qy.oninput=="function"}_f=Sf}else _f=!1;Jw=_f&&(!document.documentMode||9<document.documentMode)}function Ky(){Zi&&(Zi.detachEvent("onpropertychange",Zw),hl=Zi=null)}function Zw(e){if(e.propertyName==="value"&&md(hl)){var t=[];Qw(t,hl,e,yp(e)),Rw(BE,t)}}function HE(e,t,r){e==="focusin"?(Ky(),Zi=t,hl=r,Zi.attachEvent("onpropertychange",Zw)):e==="focusout"&&Ky()}function WE(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return md(hl)}function qE(e,t){if(e==="click")return md(t)}function KE(e,t){if(e==="input"||e==="change")return md(t)}function GE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Gr=typeof Object.is=="function"?Object.is:GE;function ml(e,t){if(Gr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var s=r[n];if(!yh.call(t,s)||!Gr(e[s],t[s]))return!1}return!0}function Gy(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Yy(e,t){var r=Gy(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Gy(r)}}function Xw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Xw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function eb(){for(var e=window,t=yu();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=yu(e.document)}return t}function Np(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 YE(e){var t=eb(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Xw(r.ownerDocument.documentElement,r)){if(n!==null&&Np(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,o=Math.min(n.start,s);n=n.end===void 0?o:Math.min(n.end,s),!e.extend&&o>n&&(s=n,n=o,o=s),s=Yy(r,o);var a=Yy(r,n);s&&a&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>n?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var QE=An&&"documentMode"in document&&11>
vendor: 4,874 bytes, line 38
38=document.documentMode,da=null,Mh=null,Xi=null,Lh=!1;function Qy(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Lh||da==null||da!==yu(n)||(n=da,"selectionStart"in n&&Np(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Xi&&ml(Xi,n)||(Xi=n,n=ku(Mh,"onSelect"),0<n.length&&(t=new Sp("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=da)))}function Tc(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var fa={animationend:Tc("Animation","AnimationEnd"),animationiteration:Tc("Animation","AnimationIteration"),animationstart:Tc("Animation","AnimationStart"),transitionend:Tc("Transition","TransitionEnd")},kf={},tb={};An&&(tb=document.createElement("div").style,"AnimationEvent"in window||(delete fa.animationend.animation,delete fa.animationiteration.animation,delete fa.animationstart.animation),"TransitionEvent"in window||delete fa.transitionend.transition);function pd(e){if(kf[e])return kf[e];if(!fa[e])return e;var t=fa[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in tb)return kf[e]=t[r];return e}var rb=pd("animationend"),nb=pd("animationiteration"),sb=pd("animationstart"),ob=pd("transitionend"),ab=new Map,Jy="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 Us(e,t){ab.set(e,t),Uo(t,[e])}for(var jf=0;jf<Jy.length;jf++){var Nf=Jy[jf],JE=Nf.toLowerCase(),ZE=Nf[0].toUpperCase()+Nf.slice(1);Us(JE,"on"+ZE)}Us(rb,"onAnimationEnd");Us(nb,"onAnimationIteration");Us(sb,"onAnimationStart");Us("dblclick","onDoubleClick");Us("focusin","onFocus");Us("focusout","onBlur");Us(ob,"onTransitionEnd");Ha("onMouseEnter",["mouseout","mouseover"]);Ha("onMouseLeave",["mouseout","mouseover"]);Ha("onPointerEnter",["pointerout","pointerover"]);Ha("onPointerLeave",["pointerout","pointerover"]);Uo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Uo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Uo("onBeforeInput",["compositionend","keypress","textInput","paste"]);Uo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Uo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Uo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zi="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(" "),XE=new Set("cancel close invalid load scroll toggle".split(" ").concat(zi));function Zy(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,JC(n,t,void 0,e),e.currentTarget=null}function ib(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],s=n.event;n=n.listeners;e:{var o=void 0;if(t)for(var a=n.length-1;0<=a;a--){var l=n[a],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==o&&s.isPropagationStopped())break e;Zy(s,l,u),o=c}else for(a=0;a<n.length;a++){if(l=n[a],c=l.instance,u=l.currentTarget,l=l.listener,c!==o&&s.isPropagationStopped())break e;Zy(s,l,u),o=c}}}if(xu)throw e=Oh,xu=!1,Oh=null,e}function Ve(e,t){var r=t[Bh];r===void 0&&(r=t[Bh]=new Set);var n=e+"__bubble";r.has(n)||(lb(t,e,2,!1),r.add(n))}function Cf(e,t,r){var n=0;t&&(n|=4),lb(r,e,n,t)}var Pc="_reactListening"+Math.random().toString(36).slice(2);function pl(e){if(!e[Pc]){e[Pc]=!0,pw.forEach(function(r){r!=="selectionchange"&&(XE.has(r)||Cf(r,!1,e),Cf(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Pc]||(t[Pc]=!0,Cf("selectionchange",!1,t))}}function lb(e,t,r,n){switch(Ww(t)){case 1:var s=hE;break;case 4:s=mE;break;default:s=bp}r=s.bind(null,t,r,e),s=void 0,!Rh||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,r,{capture:!0,passive:s}):e.addEventListener(t,r,!0):s!==void 0?e.addEventListener(t,r,{passive:s}):e.addEventListener(t,r,!1)}function Ef(e,t,r,n,s){var o=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var a=n.tag;if(a===3||a===4){var l=n.stateNode.containerInfo;
vendor: 2,527 bytes, line 38
38if(l===s||l.nodeType===8&&l.parentNode===s)break;if(a===4)for(a=n.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;a=a.return}for(;l!==null;){if(a=oo(l),a===null)return;if(c=a.tag,c===5||c===6){n=o=a;continue e}l=l.parentNode}}n=n.return}Rw(function(){var u=o,d=yp(r),f=[];e:{var m=ab.get(e);if(m!==void 0){var p=Sp,w=e;switch(e){case"keypress":if(ru(r)===0)break e;case"keydown":case"keyup":p=TE;break;case"focusin":w="focus",p=bf;break;case"focusout":w="blur",p=bf;break;case"beforeblur":case"afterblur":p=bf;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Uy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=yE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=OE;break;case rb:case nb:case sb:p=wE;break;case ob:p=IE;break;case"scroll":p=pE;break;case"wheel":p=ME;break;case"copy":case"cut":case"paste":p=_E;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=By}var g=(t&4)!==0,b=!g&&e==="scroll",v=g?m!==null?m+"Capture":null:m;g=[];for(var y=u,x;y!==null;){x=y;var _=x.stateNode;if(x.tag===5&&_!==null&&(x=_,v!==null&&(_=cl(y,v),_!=null&&g.push(gl(y,_,x)))),b)break;y=y.return}0<g.length&&(m=new p(m,w,null,r,d),f.push({event:m,listeners:g}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",m&&r!==Th&&(w=r.relatedTarget||r.fromElement)&&(oo(w)||w[In]))break e;if((p||m)&&(m=d.window===d?d:(m=d.ownerDocument)?m.defaultView||m.parentWindow:window,p?(w=r.relatedTarget||r.toElement,p=u,w=w?oo(w):null,w!==null&&(b=zo(w),w!==b||w.tag!==5&&w.tag!==6)&&(w=null)):(p=null,w=u),p!==w)){if(g=Uy,_="onMouseLeave",v="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(g=By,_="onPointerLeave",v="onPointerEnter",y="pointer"),b=p==null?m:ha(p),x=w==null?m:ha(w),m=new g(_,y+"leave",p,r,d),m.target=b,m.relatedTarget=x,_=null,oo(d)===u&&(g=new g(v,y+"enter",w,r,d),g.target=x,g.relatedTarget=b,_=g),b=_,p&&w)t:{for(g=p,v=w,y=0,x=g;x;x=qo(x))y++;for(x=0,_=v;_;_=qo(_))x++;for(;0<y-x;)g=qo(g),y--;for(;0<x-y;)v=qo(v),x--;for(;y--;){if(g===v||v!==null&&g===v.alternate)break t;g=qo(g),v=qo(v)}g=null}else g=null;p!==null&&Xy(f,m,p,g,!1),w!==null&&b!==null&&Xy(f,b,w,g,!0)}}
vendor: 4,435 bytes, lines 38-39
38e:{if(m=u?ha(u):window,p=m.nodeName&&m.nodeName.toLowerCase(),p==="select"||p==="input"&&m.type==="file")var S=VE;else if(Wy(m))if(Jw)S=KE;else{S=WE;var k=HE}else(p=m.nodeName)&&p.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(S=qE);if(S&&(S=S(e,u))){Qw(f,S,r,d);break e}k&&k(e,m,u),e==="focusout"&&(k=m._wrapperState)&&k.controlled&&m.type==="number"&&kh(m,"number",m.value)}switch(k=u?ha(u):window,e){case"focusin":(Wy(k)||k.contentEditable==="true")&&(da=k,Mh=u,Xi=null);break;case"focusout":Xi=Mh=da=null;break;case"mousedown":Lh=!0;break;case"contextmenu":case"mouseup":case"dragend":Lh=!1,Qy(f,r,d);break;case"selectionchange":if(QE)break;case"keydown":case"keyup":Qy(f,r,d)}var N;if(jp)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 ua?Gw(e,r)&&(E="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(E="onCompositionStart");E&&(Kw&&r.locale!=="ko"&&(ua||E!=="onCompositionStart"?E==="onCompositionEnd"&&ua&&(N=qw()):(gs=d,_p="value"in gs?gs.value:gs.textContent,ua=!0)),k=ku(u,E),0<k.length&&(E=new zy(E,e,null,r,d),f.push({event:E,listeners:k}),N?E.data=N:(N=Yw(r),N!==null&&(E.data=N)))),(N=$E?FE(e,r):UE(e,r))&&(u=ku(u,"onBeforeInput"),0<u.length&&(d=new zy("onBeforeInput","beforeinput",null,r,d),f.push({event:d,listeners:u}),d.data=N))}ib(f,t)})}function gl(e,t,r){return{instance:e,listener:t,currentTarget:r}}function ku(e,t){for(var r=t+"Capture",n=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=cl(e,r),o!=null&&n.unshift(gl(e,o,s)),o=cl(e,t),o!=null&&n.push(gl(e,o,s))),e=e.return}return n}function qo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Xy(e,t,r,n,s){for(var o=t._reactName,a=[];r!==null&&r!==n;){var l=r,c=l.alternate,u=l.stateNode;if(c!==null&&c===n)break;l.tag===5&&u!==null&&(l=u,s?(c=cl(r,o),c!=null&&a.unshift(gl(r,c,l))):s||(c=cl(r,o),c!=null&&a.push(gl(r,c,l)))),r=r.return}a.length!==0&&e.push({event:t,listeners:a})}var eT=/\r\n?/g,tT=/\u0000|\uFFFD/g;function ev(e){return(typeof e=="string"?e:""+e).replace(eT,` 39`).replace(tT,"")}function Rc(e,t,r){if(t=ev(t),ev(e)!==t&&r)throw Error(H(425))}function ju(){}var $h=null,Fh=null;function Uh(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 zh=typeof setTimeout=="function"?setTimeout:void 0,rT=typeof clearTimeout=="function"?clearTimeout:void 0,tv=typeof Promise=="function"?Promise:void 0,nT=typeof queueMicrotask=="function"?queueMicrotask:typeof tv<"u"?function(e){return tv.resolve(null).then(e).catch(sT)}:zh;function sT(e){setTimeout(function(){throw e})}function Tf(e,t){var r=t,n=0;do{var s=r.nextSibling;if(e.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(n===0){e.removeChild(s),fl(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);fl(t)}function Ss(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 rv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var ci=Math.random().toString(36).slice(2),an="__reactFiber$"+ci,yl="__reactProps$"+ci,In="__reactContainer$"+ci,Bh="__reactEvents$"+ci,oT="__reactListeners$"+ci,aT="__reactHandles$"+ci;function oo(e){var t=e[an];if(t)return t;for(var r=e.parentNode;r;){if(t=r[In]||r[an]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=rv(e);e!==null;){if(r=e[an])return r;e=rv(e)}return t}e=r,r=e.parentNode}return null}function Zl(e){return e=e[an]||e[In],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ha(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(H(33))}function gd(e){return e[yl]||null}var Vh=[],ma=-1;function zs(e){return{current:e}}function He(e){0>ma||(e.current=Vh[ma],Vh[ma]=null,ma--)}function Ue(e,t){ma++,Vh[ma]=e.current,e.current=t}var Ds={},At=zs(Ds),Yt=zs(!1),ko=Ds;function Wa(e,t){var r=e.type.contextTypes;if(!r)return Ds;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},o;
vendor: 14,449 bytes, line 39
39for(o in r)s[o]=t[o];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Qt(e){return e=e.childContextTypes,e!=null}function Nu(){He(Yt),He(At)}function nv(e,t,r){if(At.current!==Ds)throw Error(H(168));Ue(At,t),Ue(Yt,r)}function cb(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(H(108,HC(e)||"Unknown",s));return Je({},r,n)}function Cu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ds,ko=At.current,Ue(At,e),Ue(Yt,Yt.current),!0}function sv(e,t,r){var n=e.stateNode;if(!n)throw Error(H(169));r?(e=cb(e,t,ko),n.__reactInternalMemoizedMergedChildContext=e,He(Yt),He(At),Ue(At,e)):He(Yt),Ue(Yt,r)}var Nn=null,yd=!1,Pf=!1;function ub(e){Nn===null?Nn=[e]:Nn.push(e)}function iT(e){yd=!0,ub(e)}function Bs(){if(!Pf&&Nn!==null){Pf=!0;var e=0,t=Me;try{var r=Nn;for(Me=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Nn=null,yd=!1}catch(s){throw Nn!==null&&(Nn=Nn.slice(e+1)),Dw(vp,Bs),s}finally{Me=t,Pf=!1}}return null}var pa=[],ga=0,Eu=null,Tu=0,gr=[],yr=0,jo=null,En=1,Tn="";function Xs(e,t){pa[ga++]=Tu,pa[ga++]=Eu,Eu=e,Tu=t}function db(e,t,r){gr[yr++]=En,gr[yr++]=Tn,gr[yr++]=jo,jo=e;var n=En;e=Tn;var s=32-Wr(n)-1;n&=~(1<<s),r+=1;var o=32-Wr(t)+s;if(30<o){var a=s-s%5;o=(n&(1<<a)-1).toString(32),n>>=a,s-=a,En=1<<32-Wr(t)+s|r<<s|n,Tn=o+e}else En=1<<o|r<<s|n,Tn=e}function Cp(e){e.return!==null&&(Xs(e,1),db(e,1,0))}function Ep(e){for(;e===Eu;)Eu=pa[--ga],pa[ga]=null,Tu=pa[--ga],pa[ga]=null;for(;e===jo;)jo=gr[--yr],gr[yr]=null,Tn=gr[--yr],gr[yr]=null,En=gr[--yr],gr[yr]=null}var ar=null,or=null,We=!1,Br=null;function fb(e,t){var r=vr(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function ov(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ar=e,or=Ss(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ar=e,or=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=jo!==null?{id:En,overflow:Tn}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=vr(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,ar=e,or=null,!0):!1;default:return!1}}function Hh(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Wh(e){if(We){var t=or;if(t){var r=t;if(!ov(e,t)){if(Hh(e))throw Error(H(418));t=Ss(r.nextSibling);var n=ar;t&&ov(e,t)?fb(n,r):(e.flags=e.flags&-4097|2,We=!1,ar=e)}}else{if(Hh(e))throw Error(H(418));e.flags=e.flags&-4097|2,We=!1,ar=e}}}function av(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ar=e}function Oc(e){if(e!==ar)return!1;if(!We)return av(e),We=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Uh(e.type,e.memoizedProps)),t&&(t=or)){if(Hh(e))throw hb(),Error(H(418));for(;t;)fb(e,t),t=Ss(t.nextSibling)}if(av(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(H(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){or=Ss(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}or=null}}else or=ar?Ss(e.stateNode.nextSibling):null;return!0}function hb(){for(var e=or;e;)e=Ss(e.nextSibling)}function qa(){or=ar=null,We=!1}function Tp(e){Br===null?Br=[e]:Br.push(e)}var lT=Un.ReactCurrentBatchConfig;function Ci(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(H(309));var n=r.stateNode}if(!n)throw Error(H(147,e));var s=n,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(a){var l=s.refs;a===null?delete l[o]:l[o]=a},t._stringRef=o,t)}if(typeof e!="string")throw Error(H(284));if(!r._owner)throw Error(H(290,e))}return e}function Ac(e,t){throw e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function iv(e){var t=e._init;return t(e._payload)}function mb(e){function t(v,y){if(e){var x=v.deletions;x===null?(v.deletions=[y],v.flags|=16):x.push(y)}}function r(v,y){if(!e)return null;for(;y!==null;)t(v,y),y=y.sibling;return null}function n(v,y){for(v=new Map;y!==null;)y.key!==null?v.set(y.key,y):v.set(y.index,y),y=y.sibling;return v}function s(v,y){return v=Cs(v,y),v.index=0,v.sibling=null,v}function o(v,y,x){return v.index=x,e?(x=v.alternate,x!==null?(x=x.index,x<y?(v.flags|=2,y):x):(v.flags|=2,y)):(v.flags|=1048576,y)}function a(v){return e&&v.alternate===null&&(v.flags|=2),v}function l(v,y,x,_){return y===null||y.tag!==6?(y=Lf(x,v.mode,_),y.return=v,y):(y=s(y,x),y.return=v,y)}function c(v,y,x,_){var S=x.type;return S===ca?d(v,y,x.props.children,_,x.key):y!==null&&(y.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===ss&&iv(S)===y.type)?(_=s(y,x.props),_.ref=Ci(v,y,x),_.return=v,_):(_=cu(x.type,x.key,x.props,null,v.mode,_),_.ref=Ci(v,y,x),_.return=v,_)}function u(v,y,x,_){return y===null||y.tag!==4||y.stateNode.containerInfo!==x.containerInfo||y.stateNode.implementation!==x.implementation?(y=$f(x,v.mode,_),y.return=v,y):(y=s(y,x.children||[]),y.return=v,y)}function d(v,y,x,_,S){return y===null||y.tag!==7?(y=wo(x,v.mode,_,S),y.return=v,y):(y=s(y,x),y.return=v,y)}function f(v,y,x){if(typeof y=="string"&&y!==""||typeof y=="number")return y=Lf(""+y,v.mode,x),y.return=v,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case _c:return x=cu(y.type,y.key,y.props,null,v.mode,x),x.ref=Ci(v,null,y),x.return=v,x;case la:return y=$f(y,v.mode,x),y.return=v,y;case ss:var _=y._init;return f(v,_(y._payload),x)}if(Fi(y)||_i(y))return y=wo(y,v.mode,x,null),y.return=v,y;Ac(v,y)}return null}function m(v,y,x,_){var S=y!==null?y.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return S!==null?null:l(v,y,""+x,_);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case _c:return x.key===S?c(v,y,x,_):null;case la:return x.key===S?u(v,y,x,_):null;case ss:return S=x._init,m(v,y,S(x._payload),_)}if(Fi(x)||_i(x))return S!==null?null:d(v,y,x,_,null);Ac(v,x)}return null}function p(v,y,x,_,S){if(typeof _=="string"&&_!==""||typeof _=="number")return v=v.get(x)||null,l(y,v,""+_,S);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case _c:return v=v.get(_.key===null?x:_.key)||null,c(y,v,_,S);case la:return v=v.get(_.key===null?x:_.key)||null,u(y,v,_,S);case ss:var k=_._init;return p(v,y,x,k(_._payload),S)}if(Fi(_)||_i(_))return v=v.get(x)||null,d(y,v,_,S,null);Ac(y,_)}return null}function w(v,y,x,_){for(var S=null,k=null,N=y,E=y=0,T=null;N!==null&&E<x.length;E++){N.index>E?(T=N,N=null):T=N.sibling;var R=m(v,N,x[E],_);if(R===null){N===null&&(N=T);break}e&&N&&R.alternate===null&&t(v,N),y=o(R,y,E),k===null?S=R:k.sibling=R,k=R,N=T}if(E===x.length)return r(v,N),We&&Xs(v,E),S;if(N===null){for(;E<x.length;E++)N=f(v,x[E],_),N!==null&&(y=o(N,y,E),k===null?S=N:k.sibling=N,k=N);return We&&Xs(v,E),S}for(N=n(v,N);E<x.length;E++)T=p(N,v,E,x[E],_),T!==null&&(e&&T.alternate!==null&&N.delete(T.key===null?E:T.key),y=o(T,y,E),k===null?S=T:k.sibling=T,k=T);return e&&N.forEach(function(L){return t(v,L)}),We&&Xs(v,E),S}function g(v,y,x,_){var S=_i(x);if(typeof S!="function")throw Error(H(150));if(x=S.call(x),x==null)throw Error(H(151));for(var k=S=null,N=y,E=y=0,T=null,R=x.next();N!==null&&!R.done;E++,R=x.next()){N.index>E?(T=N,N=null):T=N.sibling;var L=m(v,N,R.value,_);if(L===null){N===null&&(N=T);break}e&&N&&L.alternate===null&&t(v,N),y=o(L,y,E),k===null?S=L:k.sibling=L,k=L,N=T}if(R.done)return r(v,N),We&&Xs(v,E),S;if(N===null){for(;!R.done;E++,R=x.next())R=f(v,R.value,_),R!==null&&(y=o(R,y,E),k===null?S=R:k.sibling=R,k=R);return We&&Xs(v,E),S}for(N=n(v,N);!R.done;E++,R=x.next())R=p(N,v,E,R.value,_),R!==null&&(e&&R.alternate!==null&&N.delete(R.key===null?E:R.key),y=o(R,y,E),k===null?S=R:k.sibling=R,k=R);return e&&N.forEach(function(O){return t(v,O)}),We&&Xs(v,E),S}function b(v,y,x,_){if(typeof x=="object"&&x!==null&&x.type===ca&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case _c:e:{for(var S=x.key,k=y;k!==null;){if(k.key===S){if(S=x.type,S===ca){if(k.tag===7){r(v,k.sibling),y=s(k,x.props.children),y.return=v,v=y;break e}}else if(k.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===ss&&iv(S)===k.type){r(v,k.sibling),y=s(k,x.props),y.ref=Ci(v,k,x),y.return=v,v=y;break e}r(v,k);break}else t(v,k);k=k.sibling}x.type===ca?(y=wo(x.props.children,v.mode,_,x.key),y.return=v,v=y):(_=cu(x.type,x.key,x.props,null,v.mode,_),_.ref=Ci(v,y,x),_.return=v,v=_)}return a(v);case la:e:{for(k=x.key;y!==null;){if(y.key===k)if(y.tag===4&&y.stateNode.containerInfo===x.containerInfo&&y.stateNode.implementation===x.implementation){r(v,y.sibling),y=s(y,x.children||[]),y.return=v,v=y;break e}else{r(v,y);break}else t(v,y);y=y.sibling}y=$f(x,v.mode,_),y.return=v,v=y}return a(v);case ss:return k=x._init,b(v,y,k(x._payload),_)}if(Fi(x))return w(v,y,x,_);if(_i(x))return g(v,y,x,_);Ac(v,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,y!==null&&y.tag===6?(r(v,y.sibling),y=s(y,x),y.return=v,v=y):(r(v,y),y=Lf(x,v.mode,_),y.return=v,v=y),a(v)):r(v,y)}return b}var Ka=mb(!0),pb=mb(!1),Pu=zs(null),Ru=null,ya=null,Pp=null;function Rp(){Pp=ya=Ru=null}function Op(e){var t=Pu.current;He(Pu),e._currentValue=t}function qh(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Ca(e,t){Ru=e,Pp=ya=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Gt=!0),e.firstContext=null)}function br(e){var t=e._currentValue;if(Pp!==e)if(e={context:e,memoizedValue:t,next:null},ya===null){if(Ru===null)throw Error(H(308));ya=e,Ru.dependencies={lanes:0,firstContext:e}}else ya=ya.next=e;return t}var ao=null;function Ap(e){ao===null?ao=[e]:ao.push(e)}function gb(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,Ap(t)):(r.next=s.next,s.next=r),t.interleaved=r,Dn(e,n)}function Dn(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var os=!1;function Ip(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function yb(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 Rn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ks(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Te&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,Dn(e,r)}return s=n.interleaved,s===null?(t.next=t,Ap(n)):(t.next=s.next,s.next=t),n.interleaved=t,Dn(e,r)}function nu(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,xp(e,r)}}function lv(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,o=null;if(r=r.firstBaseUpdate,r!==null){do{var a={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};o===null?s=o=a:o=o.next=a,r=r.next}while(r!==null);o===null?s=o=t:o=o.next=t}else s=o=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Ou(e,t,r,n){var s=e.updateQueue;os=!1;var o=s.firstBaseUpdate,a=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?o=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(o!==null){var f=s.baseState;a=0,d=u=c=null,l=o;do{var m=l.lane,p=l.eventTime;if((n&m)===m){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var w=e,g=l;switch(m=t,p=r,g.tag){case 1:if(w=g.payload,typeof w=="function"){f=w.call(p,f,m);break e}f=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=g.payload,m=typeof w=="function"?w.call(p,f,m):w,m==null)break e;f=Je({},f,m);break e;case 2:os=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,m=s.effects,m===null?s.effects=[l]:m.push(l))}else p={eventTime:p,lane:m,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,a|=m;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;m=l,l=m.next,m.next=null,s.lastBaseUpdate=m,s.shared.pending=null}}while(!0);if(d===null&&(c=f),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do a|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);Co|=a,e.lanes=a,e.memoizedState=f}}function cv(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],s=n.callback;if(s!==null){if(n.callback=null,n=r,typeof s!="function")throw Error(H(191,s));s.call(n)}}}var Xl={},dn=zs(Xl),vl=zs(Xl),xl=zs(Xl);function io(e){if(e===Xl)throw Error(H(174));return e}function Dp(e,t){switch(Ue(xl,t),Ue(vl,e),Ue(dn,Xl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Nh(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Nh(t,e)}He(dn),Ue(dn,t)}function Ga(){He(dn),He(vl),He(xl)}function vb(e){io(xl.current);var t=io(dn.current),r=Nh(t,e.type);t!==r&&(Ue(vl,e),Ue(dn,r))}function Mp(e){vl.current===e&&(He(dn),He(vl))}var Ke=zs(0);function Au(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.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 Rf=[];function Lp(){for(var e=0;e<Rf.length;e++)Rf[e]._workInProgressVersionPrimary=null;Rf.length=0}var su=Un.ReactCurrentDispatcher,Of=Un.ReactCurrentBatchConfig,No=0,Qe=null,dt=null,mt=null,Iu=!1,el=!1,wl=0,cT=0;
vendor: 5,808 bytes, line 39
39function Nt(){throw Error(H(321))}function $p(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Gr(e[r],t[r]))return!1;return!0}function Fp(e,t,r,n,s,o){if(No=o,Qe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,su.current=e===null||e.memoizedState===null?hT:mT,e=r(n,s),el){o=0;do{if(el=!1,wl=0,25<=o)throw Error(H(301));o+=1,mt=dt=null,t.updateQueue=null,su.current=pT,e=r(n,s)}while(el)}if(su.current=Du,t=dt!==null&&dt.next!==null,No=0,mt=dt=Qe=null,Iu=!1,t)throw Error(H(300));return e}function Up(){var e=wl!==0;return wl=0,e}function rn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mt===null?Qe.memoizedState=mt=e:mt=mt.next=e,mt}function _r(){if(dt===null){var e=Qe.alternate;e=e!==null?e.memoizedState:null}else e=dt.next;var t=mt===null?Qe.memoizedState:mt.next;if(t!==null)mt=t,dt=e;else{if(e===null)throw Error(H(310));dt=e,e={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},mt===null?Qe.memoizedState=mt=e:mt=mt.next=e}return mt}function bl(e,t){return typeof t=="function"?t(e):t}function Af(e){var t=_r(),r=t.queue;if(r===null)throw Error(H(311));r.lastRenderedReducer=e;var n=dt,s=n.baseQueue,o=r.pending;if(o!==null){if(s!==null){var a=s.next;s.next=o.next,o.next=a}n.baseQueue=s=o,r.pending=null}if(s!==null){o=s.next,n=n.baseState;var l=a=null,c=null,u=o;do{var d=u.lane;if((No&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:e(n,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=f,a=n):c=c.next=f,Qe.lanes|=d,Co|=d}u=u.next}while(u!==null&&u!==o);c===null?a=n:c.next=l,Gr(n,t.memoizedState)||(Gt=!0),t.memoizedState=n,t.baseState=a,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){s=e;do o=s.lane,Qe.lanes|=o,Co|=o,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function If(e){var t=_r(),r=t.queue;if(r===null)throw Error(H(311));r.lastRenderedReducer=e;var n=r.dispatch,s=r.pending,o=t.memoizedState;if(s!==null){r.pending=null;var a=s=s.next;do o=e(o,a.action),a=a.next;while(a!==s);Gr(o,t.memoizedState)||(Gt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),r.lastRenderedState=o}return[o,n]}function xb(){}function wb(e,t){var r=Qe,n=_r(),s=t(),o=!Gr(n.memoizedState,s);if(o&&(n.memoizedState=s,Gt=!0),n=n.queue,zp(Sb.bind(null,r,n,e),[e]),n.getSnapshot!==t||o||mt!==null&&mt.memoizedState.tag&1){if(r.flags|=2048,_l(9,_b.bind(null,r,n,s,t),void 0,null),gt===null)throw Error(H(349));No&30||bb(r,t,s)}return s}function bb(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Qe.updateQueue,t===null?(t={lastEffect:null,stores:null},Qe.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function _b(e,t,r,n){t.value=r,t.getSnapshot=n,kb(t)&&jb(e)}function Sb(e,t,r){return r(function(){kb(t)&&jb(e)})}function kb(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Gr(e,r)}catch{return!0}}function jb(e){var t=Dn(e,1);t!==null&&qr(t,e,1,-1)}function uv(e){var t=rn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bl,lastRenderedState:e},t.queue=e,e=e.dispatch=fT.bind(null,Qe,e),[t.memoizedState,e]}function _l(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Qe.updateQueue,t===null?(t={lastEffect:null,stores:null},Qe.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function Nb(){return _r().memoizedState}function ou(e,t,r,n){var s=rn();Qe.flags|=e,s.memoizedState=_l(1|t,r,void 0,n===void 0?null:n)}function vd(e,t,r,n){var s=_r();n=n===void 0?null:n;var o=void 0;if(dt!==null){var a=dt.memoizedState;if(o=a.destroy,n!==null&&$p(n,a.deps)){s.memoizedState=_l(t,r,o,n);return}}Qe.flags|=e,s.memoizedState=_l(1|t,r,o,n)}function dv(e,t){return ou(8390656,8,e,t)}function zp(e,t){return vd(2048,8,e,t)}function Cb(e,t){return vd(4,2,e,t)}function Eb(e,t){return vd(4,4,e,t)}function Tb(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,r){return r=r!=null?r.concat([e]):null,vd(4,4,Tb.bind(null,t,e),r)}function Bp(){}function Rb(e,t){var r=_r();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&$p(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Ob(e,t){var r=_r();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&$p(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function Ab(e,t,r){return No&21?(Gr(r,t)||(r=$w(),Qe.lanes|=r,Co|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Gt=!0),e.memoizedState=r)}function uT(e,t){var r=Me;Me=r!==0&&4>r?r:4,e(!0);var n=Of.transition;Of.transition={};try{e(!1),t()}finally{Me=r,Of.transition=n}}function Ib(){return _r().memoizedState}function dT(e,t,r){var n=Ns(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Db(e))Mb(t,r);else if(r=gb(e,t,r,n),r!==null){var s=Ft();qr(r,e,n,s),Lb(r,t,n)}}function fT(e,t,r){var n=Ns(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Db(e))Mb(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,l=o(a,r);if(s.hasEagerState=!0,s.eagerState=l,Gr(l,a)){var c=t.interleaved;c===null?(s.next=s,Ap(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}r=gb(e,t,s,n),r!==null&&(s=Ft(),qr(r,e,n,s),Lb(r,t,n))}}function Db(e){var t=e.alternate;return e===Qe||t!==null&&t===Qe}function Mb(e,t){el=Iu=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}
vendor: 6,634 bytes, lines 39-41
39function Lb(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,xp(e,r)}}var Du={readContext:br,useCallback:Nt,useContext:Nt,useEffect:Nt,useImperativeHandle:Nt,useInsertionEffect:Nt,useLayoutEffect:Nt,useMemo:Nt,useReducer:Nt,useRef:Nt,useState:Nt,useDebugValue:Nt,useDeferredValue:Nt,useTransition:Nt,useMutableSource:Nt,useSyncExternalStore:Nt,useId:Nt,unstable_isNewReconciler:!1},hT={readContext:br,useCallback:function(e,t){return rn().memoizedState=[e,t===void 0?null:t],e},useContext:br,useEffect:dv,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,ou(4194308,4,Tb.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ou(4194308,4,e,t)},useInsertionEffect:function(e,t){return ou(4,2,e,t)},useMemo:function(e,t){var r=rn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=rn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=dT.bind(null,Qe,e),[n.memoizedState,e]},useRef:function(e){var t=rn();return e={current:e},t.memoizedState=e},useState:uv,useDebugValue:Bp,useDeferredValue:function(e){return rn().memoizedState=e},useTransition:function(){var e=uv(!1),t=e[0];return e=uT.bind(null,e[1]),rn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Qe,s=rn();if(We){if(r===void 0)throw Error(H(407));r=r()}else{if(r=t(),gt===null)throw Error(H(349));No&30||bb(n,t,r)}s.memoizedState=r;var o={value:r,getSnapshot:t};return s.queue=o,dv(Sb.bind(null,n,o,e),[e]),n.flags|=2048,_l(9,_b.bind(null,n,o,r,t),void 0,null),r},useId:function(){var e=rn(),t=gt.identifierPrefix;if(We){var r=Tn,n=En;r=(n&~(1<<32-Wr(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=wl++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=cT++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},mT={readContext:br,useCallback:Rb,useContext:br,useEffect:zp,useImperativeHandle:Pb,useInsertionEffect:Cb,useLayoutEffect:Eb,useMemo:Ob,useReducer:Af,useRef:Nb,useState:function(){return Af(bl)},useDebugValue:Bp,useDeferredValue:function(e){var t=_r();return Ab(t,dt.memoizedState,e)},useTransition:function(){var e=Af(bl)[0],t=_r().memoizedState;return[e,t]},useMutableSource:xb,useSyncExternalStore:wb,useId:Ib,unstable_isNewReconciler:!1},pT={readContext:br,useCallback:Rb,useContext:br,useEffect:zp,useImperativeHandle:Pb,useInsertionEffect:Cb,useLayoutEffect:Eb,useMemo:Ob,useReducer:If,useRef:Nb,useState:function(){return If(bl)},useDebugValue:Bp,useDeferredValue:function(e){var t=_r();return dt===null?t.memoizedState=e:Ab(t,dt.memoizedState,e)},useTransition:function(){var e=If(bl)[0],t=_r().memoizedState;return[e,t]},useMutableSource:xb,useSyncExternalStore:wb,useId:Ib,unstable_isNewReconciler:!1};function Dr(e,t){if(e&&e.defaultProps){t=Je({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Kh(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:Je({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var xd={isMounted:function(e){return(e=e._reactInternals)?zo(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Ft(),s=Ns(e),o=Rn(n,s);o.payload=t,r!=null&&(o.callback=r),t=ks(e,o,s),t!==null&&(qr(t,e,s,n),nu(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Ft(),s=Ns(e),o=Rn(n,s);o.tag=1,o.payload=t,r!=null&&(o.callback=r),t=ks(e,o,s),t!==null&&(qr(t,e,s,n),nu(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Ft(),n=Ns(e),s=Rn(r,n);s.tag=2,t!=null&&(s.callback=t),t=ks(e,s,n),t!==null&&(qr(t,e,n,r),nu(t,e,n))}};function fv(e,t,r,n,s,o,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,o,a):t.prototype&&t.prototype.isPureReactComponent?!ml(r,n)||!ml(s,o):!0}function $b(e,t,r){var n=!1,s=Ds,o=t.contextType;return typeof o=="object"&&o!==null?o=br(o):(s=Qt(t)?ko:At.current,n=t.contextTypes,o=(n=n!=null)?Wa(e,s):Ds),t=new t(r,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=xd,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function hv(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&xd.enqueueReplaceState(t,t.state,null)}function Gh(e,t,r,n){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs={},Ip(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=br(o):(o=Qt(t)?ko:At.current,s.context=Wa(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Kh(e,t,o,r),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&xd.enqueueReplaceState(s,s.state,null),Ou(e,r,s,n),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Ya(e,t){try{var r="",n=t;do r+=VC(n),n=n.return;while(n);var s=r}catch(o){s=` 40Error generating stack: `+o.message+` 41`+o.stack}return{value:e,source:t,stack:s,digest:null}}function Df(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Yh(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var gT=typeof WeakMap=="function"?WeakMap:Map;function Fb(e,t,r){r=Rn(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Lu||(Lu=!0,om=n),Yh(e,t)},r}function Ub(e,t,r){r=Rn(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var s=t.value;r.payload=function(){return n(s)},r.callback=function(){Yh(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(r.callback=function(){Yh(e,t),typeof n!="function"&&(js===null?js=new Set([this]):js.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),r}function mv(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new gT;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(r)||(s.add(r),e=PT.bind(null,e,t,r),t.then(e,e))}function pv(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}
vendor: 6,594 bytes, line 41
41function gv(e,t,r,n,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Rn(-1,1),t.tag=2,ks(r,t,1))),r.lanes|=1),e)}var yT=Un.ReactCurrentOwner,Gt=!1;function Lt(e,t,r,n){t.child=e===null?pb(t,null,r,n):Ka(t,e.child,r,n)}function yv(e,t,r,n,s){r=r.render;var o=t.ref;return Ca(t,s),n=Fp(e,t,r,n,o,s),r=Up(),e!==null&&!Gt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Mn(e,t,s)):(We&&r&&Cp(t),t.flags|=1,Lt(e,t,n,s),t.child)}function vv(e,t,r,n,s){if(e===null){var o=r.type;return typeof o=="function"&&!Qp(o)&&o.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=o,zb(e,t,o,n,s)):(e=cu(r.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&s)){var a=o.memoizedProps;if(r=r.compare,r=r!==null?r:ml,r(a,n)&&e.ref===t.ref)return Mn(e,t,s)}return t.flags|=1,e=Cs(o,n),e.ref=t.ref,e.return=t,t.child=e}function zb(e,t,r,n,s){if(e!==null){var o=e.memoizedProps;if(ml(o,n)&&e.ref===t.ref)if(Gt=!1,t.pendingProps=n=o,(e.lanes&s)!==0)e.flags&131072&&(Gt=!0);else return t.lanes=e.lanes,Mn(e,t,s)}return Qh(e,t,r,n,s)}function Bb(e,t,r){var n=t.pendingProps,s=n.children,o=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ue(xa,tr),tr|=r;else{if(!(r&1073741824))return e=o!==null?o.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ue(xa,tr),tr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=o!==null?o.baseLanes:r,Ue(xa,tr),tr|=n}else o!==null?(n=o.baseLanes|r,t.memoizedState=null):n=r,Ue(xa,tr),tr|=n;return Lt(e,t,s,r),t.child}function Vb(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Qh(e,t,r,n,s){var o=Qt(r)?ko:At.current;return o=Wa(t,o),Ca(t,s),r=Fp(e,t,r,n,o,s),n=Up(),e!==null&&!Gt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Mn(e,t,s)):(We&&n&&Cp(t),t.flags|=1,Lt(e,t,r,s),t.child)}function xv(e,t,r,n,s){if(Qt(r)){var o=!0;Cu(t)}else o=!1;if(Ca(t,s),t.stateNode===null)au(e,t),$b(t,r,n),Gh(t,r,n,s),n=!0;else if(e===null){var a=t.stateNode,l=t.memoizedProps;a.props=l;var c=a.context,u=r.contextType;typeof u=="object"&&u!==null?u=br(u):(u=Qt(r)?ko:At.current,u=Wa(t,u));var d=r.getDerivedStateFromProps,f=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==n||c!==u)&&hv(t,a,n,u),os=!1;var m=t.memoizedState;a.state=m,Ou(t,n,a,s),c=t.memoizedState,l!==n||m!==c||Yt.current||os?(typeof d=="function"&&(Kh(t,r,d,n),c=t.memoizedState),(l=os||fv(t,r,l,n,m,c,u))?(f||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),a.props=n,a.state=c,a.context=u,n=l):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{a=t.stateNode,yb(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Dr(t.type,l),a.props=u,f=t.pendingProps,m=a.context,c=r.contextType,typeof c=="object"&&c!==null?c=br(c):(c=Qt(r)?ko:At.current,c=Wa(t,c));var p=r.getDerivedStateFromProps;(d=typeof p=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==f||m!==c)&&hv(t,a,n,c),os=!1,m=t.memoizedState,a.state=m,Ou(t,n,a,s);var w=t.memoizedState;l!==f||m!==w||Yt.current||os?(typeof p=="function"&&(Kh(t,r,p,n),w=t.memoizedState),(u=os||fv(t,r,u,n,m,w,c)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(n,w,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(n,w,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=w),a.props=n,a.state=w,a.context=c,n=u):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),n=!1)}return Jh(e,t,r,n,o,s)}function Jh(e,t,r,n,s,o){Vb(e,t);var a=(t.flags&128)!==0;if(!n&&!a)return s&&sv(t,r,!1),Mn(e,t,o);n=t.stateNode,yT.current=t;var l=a&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&a?(t.child=Ka(t,e.child,null,o),t.child=Ka(t,null,l,o)):Lt(e,t,l,o),t.memoizedState=n.state,s&&sv(t,r,!0),t.child}function Hb(e){var t=e.stateNode;t.pendingContext?nv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&nv(e,t.context,!1),Dp(e,t.containerInfo)}function wv(e,t,r,n,s){return qa(),Tp(s),t.flags|=256,Lt(e,t,r,n),t.child}var Zh={dehydrated:null,treeContext:null,retryLane:0};function Xh(e){return{baseLanes:e,cachePool:null,transitions:null}}function Wb(e,t,r){var n=t.pendingProps,s=Ke.current,o=!1,a=(t.flags&128)!==0,l;if((l=a)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),Ue(Ke,s&1),e===null)return Wh(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=n.children,e=n.fallback,o?(n=t.mode,o=t.child,a={mode:"hidden",children:a},!(n&1)&&o!==null?(o.childLanes=0,o.pendingProps=a):o=_d(a,n,0,null),e=wo(e,n,r,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Xh(r),t.memoizedState=Zh,e):Vp(t,a));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return vT(e,t,a,n,l,s,r);if(o){o=n.fallback,a=t.mode,s=e.child,l=s.sibling;var c={mode:"hidden",children:n.children};return!(a&1)&&t.child!==s?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=Cs(s,c),n.subtreeFlags=s.subtreeFlags&14680064),l!==null?o=Cs(l,o):(o=wo(o,a,r,null),o.flags|=2),o.return=t,n.return=t,n.sibling=o,t.child=n,n=o,o=t.child,a=e.child.memoizedState,a=a===null?Xh(r):{base
vendor: 6,920 bytes, line 41
41Lanes:a.baseLanes|r,cachePool:null,transitions:a.transitions},o.memoizedState=a,o.childLanes=e.childLanes&~r,t.memoizedState=Zh,n}return o=e.child,e=o.sibling,n=Cs(o,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function Vp(e,t){return t=_d({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ic(e,t,r,n){return n!==null&&Tp(n),Ka(t,e.child,null,r),e=Vp(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function vT(e,t,r,n,s,o,a){if(r)return t.flags&256?(t.flags&=-257,n=Df(Error(H(422))),Ic(e,t,a,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=n.fallback,s=t.mode,n=_d({mode:"visible",children:n.children},s,0,null),o=wo(o,s,a,null),o.flags|=2,n.return=t,o.return=t,n.sibling=o,t.child=n,t.mode&1&&Ka(t,e.child,null,a),t.child.memoizedState=Xh(a),t.memoizedState=Zh,o);if(!(t.mode&1))return Ic(e,t,a,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var l=n.dgst;return n=l,o=Error(H(419)),n=Df(o,n,void 0),Ic(e,t,a,n)}if(l=(a&e.childLanes)!==0,Gt||l){if(n=gt,n!==null){switch(a&-a){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|a)?0:s,s!==0&&s!==o.retryLane&&(o.retryLane=s,Dn(e,s),qr(n,e,s,-1))}return Yp(),n=Df(Error(H(421))),Ic(e,t,a,n)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=RT.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,or=Ss(s.nextSibling),ar=t,We=!0,Br=null,e!==null&&(gr[yr++]=En,gr[yr++]=Tn,gr[yr++]=jo,En=e.id,Tn=e.overflow,jo=t),t=Vp(t,n.children),t.flags|=4096,t)}function bv(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),qh(e.return,t,r)}function Mf(e,t,r,n,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=n,o.tail=r,o.tailMode=s)}function qb(e,t,r){var n=t.pendingProps,s=n.revealOrder,o=n.tail;if(Lt(e,t,n.children,r),n=Ke.current,n&2)n=n&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&&bv(e,r,t);else if(e.tag===19)bv(e,r,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}n&=1}if(Ue(Ke,n),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&Au(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),Mf(t,!1,s,r,o);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Au(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}Mf(t,!0,r,null,o);break;case"together":Mf(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function au(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Mn(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Co|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(H(153));if(t.child!==null){for(e=t.child,r=Cs(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Cs(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function xT(e,t,r){switch(t.tag){case 3:Hb(t),qa();break;case 5:vb(t);break;case 1:Qt(t.type)&&Cu(t);break;case 4:Dp(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,s=t.memoizedProps.value;Ue(Pu,n._currentValue),n._currentValue=s;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Ue(Ke,Ke.current&1),t.flags|=128,null):r&t.child.childLanes?Wb(e,t,r):(Ue(Ke,Ke.current&1),e=Mn(e,t,r),e!==null?e.sibling:null);Ue(Ke,Ke.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return qb(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Ue(Ke,Ke.current),n)break;return null;case 22:case 23:return t.lanes=0,Bb(e,t,r)}return Mn(e,t,r)}var Kb,em,Gb,Yb;Kb=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};em=function(){};Gb=function(e,t,r,n){var s=e.memoizedProps;if(s!==n){e=t.stateNode,io(dn.current);var o=null;switch(r){case"input":s=_h(e,s),n=_h(e,n),o=[];break;case"select":s=Je({},s,{value:void 0}),n=Je({},n,{value:void 0}),o=[];break;case"textarea":s=jh(e,s),n=jh(e,n),o=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=ju)}Ch(r,n);var a;r=null;for(u in s)if(!n.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var l=s[u];for(a in l)l.hasOwnProperty(a)&&(r||(r={}),r[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(il.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in n){var c=n[u];if(l=s!=null?s[u]:void 0,n.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(r||(r={}),r[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(r||(r={}),r[a]=c[a])}else r||(o||(o=[]),o.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(o=o||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(o=o||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(il.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&Ve("scroll",e),o||l===c||(o=[])):(o=o||[]).push(u,c))}r&&(o=o||[]).push("style",r);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};Yb=function(e,t,r,n){r!==n&&(t.flags|=4)};function Ei(e,t){if(!We)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Ct(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function wT(e,t,r){var n=t.pendingProps;
vendor: 33,923 bytes, line 41
41switch(Ep(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ct(t),null;case 1:return Qt(t.type)&&Nu(),Ct(t),null;case 3:return n=t.stateNode,Ga(),He(Yt),He(At),Lp(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Oc(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Br!==null&&(lm(Br),Br=null))),em(e,t),Ct(t),null;case 5:Mp(t);var s=io(xl.current);if(r=t.type,e!==null&&t.stateNode!=null)Gb(e,t,r,n,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(H(166));return Ct(t),null}if(e=io(dn.current),Oc(t)){n=t.stateNode,r=t.type;var o=t.memoizedProps;switch(n[an]=t,n[yl]=o,e=(t.mode&1)!==0,r){case"dialog":Ve("cancel",n),Ve("close",n);break;case"iframe":case"object":case"embed":Ve("load",n);break;case"video":case"audio":for(s=0;s<zi.length;s++)Ve(zi[s],n);break;case"source":Ve("error",n);break;case"img":case"image":case"link":Ve("error",n),Ve("load",n);break;case"details":Ve("toggle",n);break;case"input":Py(n,o),Ve("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!o.multiple},Ve("invalid",n);break;case"textarea":Oy(n,o),Ve("invalid",n)}Ch(r,o),s=null;for(var a in o)if(o.hasOwnProperty(a)){var l=o[a];a==="children"?typeof l=="string"?n.textContent!==l&&(o.suppressHydrationWarning!==!0&&Rc(n.textContent,l,e),s=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(o.suppressHydrationWarning!==!0&&Rc(n.textContent,l,e),s=["children",""+l]):il.hasOwnProperty(a)&&l!=null&&a==="onScroll"&&Ve("scroll",n)}switch(r){case"input":Sc(n),Ry(n,o,!0);break;case"textarea":Sc(n),Ay(n);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(n.onclick=ju)}n=s,t.updateQueue=n,n!==null&&(t.flags|=4)}else{a=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Sw(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=a.createElement(r,{is:n.is}):(e=a.createElement(r),r==="select"&&(a=e,n.multiple?a.multiple=!0:n.size&&(a.size=n.size))):e=a.createElementNS(e,r),e[an]=t,e[yl]=n,Kb(e,t,!1,!1),t.stateNode=e;e:{switch(a=Eh(r,n),r){case"dialog":Ve("cancel",e),Ve("close",e),s=n;break;case"iframe":case"object":case"embed":Ve("load",e),s=n;break;case"video":case"audio":for(s=0;s<zi.length;s++)Ve(zi[s],e);s=n;break;case"source":Ve("error",e),s=n;break;case"img":case"image":case"link":Ve("error",e),Ve("load",e),s=n;break;case"details":Ve("toggle",e),s=n;break;case"input":Py(e,n),s=_h(e,n),Ve("invalid",e);break;case"option":s=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},s=Je({},n,{value:void 0}),Ve("invalid",e);break;case"textarea":Oy(e,n),s=jh(e,n),Ve("invalid",e);break;default:s=n}Ch(r,s),l=s;for(o in l)if(l.hasOwnProperty(o)){var c=l[o];o==="style"?Nw(e,c):o==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&kw(e,c)):o==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&ll(e,c):typeof c=="number"&&ll(e,""+c):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(il.hasOwnProperty(o)?c!=null&&o==="onScroll"&&Ve("scroll",e):c!=null&&hp(e,o,c,a))}switch(r){case"input":Sc(e),Ry(e,n,!1);break;case"textarea":Sc(e),Ay(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Is(n.value));break;case"select":e.multiple=!!n.multiple,o=n.value,o!=null?Sa(e,!!n.multiple,o,!1):n.defaultValue!=null&&Sa(e,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=ju)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ct(t),null;case 6:if(e&&t.stateNode!=null)Yb(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(H(166));if(r=io(xl.current),io(dn.current),Oc(t)){if(n=t.stateNode,r=t.memoizedProps,n[an]=t,(o=n.nodeValue!==r)&&(e=ar,e!==null))switch(e.tag){case 3:Rc(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Rc(n.nodeValue,r,(e.mode&1)!==0)}o&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[an]=t,t.stateNode=n}return Ct(t),null;case 13:if(He(Ke),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(We&&or!==null&&t.mode&1&&!(t.flags&128))hb(),qa(),t.flags|=98560,o=!1;else if(o=Oc(t),n!==null&&n.dehydrated!==null){if(e===null){if(!o)throw Error(H(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(H(317));o[an]=t}else qa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ct(t),o=!1}else Br!==null&&(lm(Br),Br=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||Ke.current&1?ft===0&&(ft=3):Yp())),t.updateQueue!==null&&(t.flags|=4),Ct(t),null);case 4:return Ga(),em(e,t),e===null&&pl(t.stateNode.containerInfo),Ct(t),null;case 10:return Op(t.type._context),Ct(t),null;case 17:return Qt(t.type)&&Nu(),Ct(t),null;case 19:if(He(Ke),o=t.memoizedState,o===null)return Ct(t),null;if(n=(t.flags&128)!==0,a=o.rendering,a===null)if(n)Ei(o,!1);else{if(ft!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Au(e),a!==null){for(t.flags|=128,Ei(o,!1),n=a.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)o=r,e=n,o.flags&=14680066,a=o.alternate,a===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=a.childLanes,o.lanes=a.lanes,o.child=a.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=a.memoizedProps,o.memoizedState=a.memoizedState,o.updateQueue=a.updateQueue,o.type=a.type,e=a.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ue(Ke,Ke.current&1|2),t.child}e=e.sibling}o.tail!==null&&nt()>Qa&&(t.flags|=128,n=!0,Ei(o,!1),t.lanes=4194304)}else{if(!n)if(e=Au(a),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ei(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!We)return Ct(t),null}else 2*nt()-o.renderingStartTime>Qa&&r!==1073741824&&(t.flags|=128,n=!0,Ei(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(r=o.last,r!==null?r.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=nt(),t.sibling=null,r=Ke.current,Ue(Ke,n?r&1|2:r&1),t):(Ct(t),null);case 22:case 23:return Gp(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?tr&1073741824&&(Ct(t),t.subtreeFlags&6&&(t.flags|=8192)):Ct(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function bT(e,t){switch(Ep(t),t.tag){case 1:return Qt(t.type)&&Nu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ga(),He(Yt),He(At),Lp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Mp(t),null;case 13:if(He(Ke),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));qa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return He(Ke),null;case 4:return Ga(),null;case 10:return Op(t.type._context),null;case 22:case 23:return Gp(),null;case 24:return null;default:return null}}var Dc=!1,Rt=!1,_T=typeof WeakSet=="function"?WeakSet:Set,X=null;function va(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){rt(e,t,n)}else r.current=null}function tm(e,t,r){try{r()}catch(n){rt(e,t,n)}}var _v=!1;function ST(e,t){if($h=_u,e=eb(),Np(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var a=0,l=-1,c=-1,u=0,d=0,f=e,m=null;t:for(;;){for(var p;f!==r||s!==0&&f.nodeType!==3||(l=a+s),f!==o||n!==0&&f.nodeType!==3||(c=a+n),f.nodeType===3&&(a+=f.nodeValue.length),(p=f.firstChild)!==null;)m=f,f=p;for(;;){if(f===e)break t;if(m===r&&++u===s&&(l=a),m===o&&++d===n&&(c=a),(p=f.nextSibling)!==null)break;f=m,m=f.parentNode}f=p}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Fh={focusedElem:e,selectionRange:r},_u=!1,X=t;X!==null;)if(t=X,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,X=e;else for(;X!==null;){t=X;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var g=w.memoizedProps,b=w.memoizedState,v=t.stateNode,y=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:Dr(t.type,g),b);v.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(_){rt(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,X=e;break}X=t.return}return w=_v,_v=!1,w}function tl(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&tm(t,r,o)}s=s.next}while(s!==n)}}function wd(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function rm(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Qb(e){var t=e.alternate;t!==null&&(e.alternate=null,Qb(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[an],delete t[yl],delete t[Bh],delete t[oT],delete t[aT])),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 Jb(e){return e.tag===5||e.tag===3||e.tag===4}function Sv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Jb(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 nm(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=ju));else if(n!==4&&(e=e.child,e!==null))for(nm(e,t,r),e=e.sibling;e!==null;)nm(e,t,r),e=e.sibling}function sm(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(sm(e,t,r),e=e.sibling;e!==null;)sm(e,t,r),e=e.sibling}var bt=null,Ur=!1;function Jn(e,t,r){for(r=r.child;r!==null;)Zb(e,t,r),r=r.sibling}function Zb(e,t,r){if(un&&typeof un.onCommitFiberUnmount=="function")try{un.onCommitFiberUnmount(fd,r)}catch{}switch(r.tag){case 5:Rt||va(r,t);case 6:var n=bt,s=Ur;bt=null,Jn(e,t,r),bt=n,Ur=s,bt!==null&&(Ur?(e=bt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):bt.removeChild(r.stateNode));break;case 18:bt!==null&&(Ur?(e=bt,r=r.stateNode,e.nodeType===8?Tf(e.parentNode,r):e.nodeType===1&&Tf(e,r),fl(e)):Tf(bt,r.stateNode));break;case 4:n=bt,s=Ur,bt=r.stateNode.containerInfo,Ur=!0,Jn(e,t,r),bt=n,Ur=s;break;case 0:case 11:case 14:case 15:if(!Rt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var o=s,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&tm(r,t,a),s=s.next}while(s!==n)}Jn(e,t,r);break;case 1:if(!Rt&&(va(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){rt(r,t,l)}Jn(e,t,r);break;case 21:Jn(e,t,r);break;case 22:r.mode&1?(Rt=(n=Rt)||r.memoizedState!==null,Jn(e,t,r),Rt=n):Jn(e,t,r);break;default:Jn(e,t,r)}}function kv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new _T),t.forEach(function(n){var s=OT.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function Rr(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var s=r[n];try{var o=e,a=t,l=a;e:for(;l!==null;){switch(l.tag){case 5:bt=l.stateNode,Ur=!1;break e;case 3:bt=l.stateNode.containerInfo,Ur=!0;break e;case 4:bt=l.stateNode.containerInfo,Ur=!0;break e}l=l.return}if(bt===null)throw Error(H(160));Zb(o,a,s),bt=null,Ur=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(u){rt(s,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Xb(t,e),t=t.sibling}function Xb(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Rr(t,e),tn(e),n&4){try{tl(3,e,e.return),wd(3,e)}catch(g){rt(e,e.return,g)}try{tl(5,e,e.return)}catch(g){rt(e,e.return,g)}}break;case 1:Rr(t,e),tn(e),n&512&&r!==null&&va(r,r.return);break;case 5:if(Rr(t,e),tn(e),n&512&&r!==null&&va(r,r.return),e.flags&32){var s=e.stateNode;try{ll(s,"")}catch(g){rt(e,e.return,g)}}if(n&4&&(s=e.stateNode,s!=null)){var o=e.memoizedProps,a=r!==null?r.memoizedProps:o,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&o.type==="radio"&&o.name!=null&&bw(s,o),Eh(l,a);var u=Eh(l,o);for(a=0;a<c.length;a+=2){var d=c[a],f=c[a+1];d==="style"?Nw(s,f):d==="dangerouslySetInnerHTML"?kw(s,f):d==="children"?ll(s,f):hp(s,d,f,u)}switch(l){case"input":Sh(s,o);break;case"textarea":_w(s,o);break;case"select":var m=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var p=o.value;p!=null?Sa(s,!!o.multiple,p,!1):m!==!!o.multiple&&(o.defaultValue!=null?Sa(s,!!o.multiple,o.defaultValue,!0):Sa(s,!!o.multiple,o.multiple?[]:"",!1))}s[yl]=o}catch(g){rt(e,e.return,g)}}break;case 6:if(Rr(t,e),tn(e),n&4){if(e.stateNode===null)throw Error(H(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(g){rt(e,e.return,g)}}break;case 3:if(Rr(t,e),tn(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{fl(t.containerInfo)}catch(g){rt(e,e.return,g)}break;case 4:Rr(t,e),tn(e);break;case 13:Rr(t,e),tn(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(qp=nt())),n&4&&kv(e);break;case 22:if(d=r!==null&&r.memoizedState!==null,e.mode&1?(Rt=(u=Rt)||d,Rr(t,e),Rt=u):Rr(t,e),tn(e),n&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(X=e,d=e.child;d!==null;){for(f=X=d;X!==null;){switch(m=X,p=m.child,m.tag){case 0:case 11:case 14:case 15:tl(4,m,m.return);break;case 1:va(m,m.return);var w=m.stateNode;if(typeof w.componentWillUnmount=="function"){n=m,r=m.return;try{t=n,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(g){rt(n,r,g)}}break;case 5:va(m,m.return);break;case 22:if(m.memoizedState!==null){Nv(f);continue}}p!==null?(p.return=m,X=p):Nv(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{s=f.stateNode,u?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(l=f.stateNode,c=f.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=jw("display",a))}catch(g){rt(e,e.return,g)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(g){rt(e,e.return,g)}}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;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Rr(t,e),tn(e),n&4&&kv(e);break;case 21:break;default:Rr(t,e),tn(e)}}function tn(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Jb(r)){var n=r;break e}r=r.return}throw Error(H(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(ll(s,""),n.flags&=-33);var o=Sv(e);sm(e,o,s);break;case 3:case 4:var a=n.stateNode.containerInfo,l=Sv(e);nm(e,l,a);break;default:throw Error(H(161))}}catch(c){rt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function kT(e,t,r){X=e,e_(e)}function e_(e,t,r){for(var n=(e.mode&1)!==0;X!==null;){var s=X,o=s.child;if(s.tag===22&&n){var a=s.memoizedState!==null||Dc;if(!a){var l=s.alternate,c=l!==null&&l.memoizedState!==null||Rt;l=Dc;var u=Rt;if(Dc=a,(Rt=c)&&!u)for(X=s;X!==null;)a=X,c=a.child,a.tag===22&&a.memoizedState!==null?Cv(s):c!==null?(c.return=a,X=c):Cv(s);for(;o!==null;)X=o,e_(o),o=o.sibling;X=s,Dc=l,Rt=u}jv(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,X=o):jv(e)}}function jv(e){for(;X!==null;){var t=X;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Rt||wd(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Rt)if(r===null)n.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:Dr(t.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&cv(t,o,n);break;case 3:var a=t.updateQueue;if(a!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}cv(t,a,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&fl(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}Rt||t.flags&512&&rm(t)}catch(m){rt(t,t.return,m)}}if(t===e){X=null;break}if(r=t.sibling,r!==null){r.return=t.return,X=r;break}X=t.return}}function Nv(e){for(;X!==null;){var t=X;if(t===e){X=null;break}var r=t.sibling;if(r!==null){r.return=t.return,X=r;break}X=t.return}}function Cv(e){for(;X!==null;){var t=X;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{wd(4,t)}catch(c){rt(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var s=t.return;try{n.componentDidMount()}catch(c){rt(t,s,c)}}var o=t.return;try{rm(t)}catch(c){rt(t,o,c)}break;case 5:var a=t.return;try{rm(t)}catch(c){rt(t,a,c)}}}catch(c){rt(t,t.return,c)}if(t===e){X=null;break}var l=t.sibling;if(l!==null){l.return=t.return,X=l;break}X=t.return}}var jT=Math.ceil,Mu=Un.ReactCurrentDispatcher,Hp=Un.ReactCurrentOwner,xr=Un.ReactCurrentBatchConfig,Te=0,gt=null,lt=null,St=0,tr=0,xa=zs(0),ft=0,Sl=null,Co=0,bd=0,Wp=0,rl=null,Kt=null,qp=0,Qa=1/0,kn=null,Lu=!1,om=null,js=null,Mc=!1,ys=null,$u=0,nl=0,am=null,iu=-1,lu=0;function Ft(){return Te&6?nt():iu!==-1?iu:iu=nt()}function Ns(e){return e.mode&1?Te&2&&St!==0?St&-St:lT.transition!==null?(lu===0&&(lu=$w()),lu):(e=Me,e!==0||(e=window.event,e=e===void 0?16:Ww(e.type)),e):1}function qr(e,t,r,n){if(50<nl)throw nl=0,am=null,Error(H(185));Ql(e,r,n),(!(Te&2)||e!==gt)&&(e===gt&&(!(Te&2)&&(bd|=r),ft===4&&cs(e,St)),Jt(e,n),r===1&&Te===0&&!(t.mode&1)&&(Qa=nt()+500,yd&&Bs()))}function Jt(e,t){var r=e.callbackNode;lE(e,t);var n=bu(e,e===gt?St:0);if(n===0)r!==null&&My(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&My(r),t===1)e.tag===0?iT(Ev.bind(null,e)):ub(Ev.bind(null,e)),nT(function(){!(Te&6)&&Bs()}),r=null;else{switch(Fw(n)){case 1:r=vp;break;case 4:r=Mw;break;case 16:r=wu;break;case 536870912:r=Lw;break;default:r=wu}r=l_(r,t_.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function t_(e,t){if(iu=-1,lu=0,Te&6)throw Error(H(327));var r=e.callbackNode;if(Ea()&&e.callbackNode!==r)return null;var n=bu(e,e===gt?St:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Fu(e,n);else{t=n;var s=Te;Te|=2;var o=n_();(gt!==e||St!==t)&&(kn=null,Qa=nt()+500,xo(e,t));do try{ET();break}catch(l){r_(e,l)}while(!0);Rp(),Mu.current=o,Te=s,lt!==null?t=0:(gt=null,St=0,t=ft)}if(t!==0){if(t===2&&(s=Ah(e),s!==0&&(n=s,t=im(e,s))),t===1)throw r=Sl,xo(e,0),cs(e,n),Jt(e,nt()),r;if(t===6)cs(e,n);else{if(s=e.current.alternate,!(n&30)&&!NT(s)&&(t=Fu(e,n),t===2&&(o=Ah(e),o!==0&&(n=o,t=im(e,o))),t===1))throw r=Sl,xo(e,0),cs(e,n),Jt(e,nt()),r;switch(e.finishedWork=s,e.finishedLanes=n,t){case 0:case 1:throw Error(H(345));case 2:eo(e,Kt,kn);break;case 3:if(cs(e,n),(n&130023424)===n&&(t=qp+500-nt(),10<t)){if(bu(e,0)!==0)break;if(s=e.suspendedLanes,(s&n)!==n){Ft(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=zh(eo.bind(null,e,Kt,kn),t);break}eo(e,Kt,kn);break;case 4:if(cs(e,n),(n&4194240)===n)break;for(t=e.eventTimes,s=-1;0<n;){var a=31-Wr(n);o=1<<a,a=t[a],a>s&&(s=a),n&=~o}if(n=s,n=nt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*jT(n/1960))-n,10<n){e.timeoutHandle=zh(eo.bind(null,e,Kt,kn),n);break}eo(e,Kt,kn);break;case 5:eo(e,Kt,kn);break;default:throw Error(H(329))}}}return Jt(e,nt()),e.callbackNode===r?t_.bind(null,e):null}function im(e,t){var r=rl;return e.current.memoizedState.isDehydrated&&(xo(e,t).flags|=256),e=Fu(e,t),e!==2&&(t=Kt,Kt=r,t!==null&&lm(t)),e}function lm(e){Kt===null?Kt=e:Kt.push.apply(Kt,e)}function NT(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var s=r[n],o=s.getSnapshot;s=s.value;try{if(!Gr(o(),s))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 cs(e,t){for(t&=~Wp,t&=~bd,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Wr(t),n=1<<r;e[r]=-1,t&=~n}}function Ev(e){if(Te&6)throw Error(H(327));Ea();var t=bu(e,0);if(!(t&1))return Jt(e,nt()),null;var r=Fu(e,t);if(e.tag!==0&&r===2){var n=Ah(e);n!==0&&(t=n,r=im(e,n))}if(r===1)throw r=Sl,xo(e,0),cs(e,t),Jt(e,nt()),r;if(r===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,eo(e,Kt,kn),Jt(e,nt()),null}function Kp(e,t){var r=Te;Te|=1;try{return e(t)}finally{Te=r,Te===0&&(Qa=nt()+500,yd&&Bs())}}function Eo(e){ys!==null&&ys.tag===0&&!(Te&6)&&Ea();var t=Te;Te|=1;var r=xr.transition,n=Me;try{if(xr.transition=null,Me=1,e)return e()}finally{Me=n,xr.transition=r,Te=t,!(Te&6)&&Bs()}}function Gp(){tr=xa.current,He(xa)}function xo(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,rT(r)),lt!==null)for(r=lt.return;r!==null;){var n=r;switch(Ep(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Nu();break;case 3:Ga(),He(Yt),He(At),Lp();break;case 5:Mp(n);break;case 4:Ga();break;case 13:He(Ke);break;case 19:He(Ke);break;case 10:Op(n.type._context);break;case 22:case 23:Gp()}r=r.return}if(gt=e,lt=e=Cs(e.current,null),St=tr=t,ft=0,Sl=null,Wp=bd=Co=0,Kt=rl=null,ao!==null){for(t=0;t<ao.length;t++)if(r=ao[t],n=r.interleaved,n!==null){r.interleaved=null;var s=n.next,o=r.pending;if(o!==null){var a=o.next;o.next=s,n.next=a}r.pending=n}ao=null}return e}function r_(e,t){do{var r=lt;try{if(Rp(),su.current=Du,Iu){for(var n=Qe.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}Iu=!1}if(No=0,mt=dt=Qe=null,el=!1,wl=0,Hp.current=null,r===null||r.return===null){ft=1,Sl=t,lt=null;break}e:{var o=e,a=r.return,l=r,c=t;if(t=St,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var m=d.alternate;m?(d.updateQueue=m.updateQueue,d.memoizedState=m.memoizedState,d.lanes=m.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=pv(a);if(p!==null){p.flags&=-257,gv(p,a,l,o,t),p.mode&1&&mv(o,u,t),t=p,c=u;var w=t.updateQueue;if(w===null){var g=new Set;g.add(c),t.updateQueue=g}else w.add(c);break e}else{if(!(t&1)){mv(o,u,t),Yp();break e}c=Error(H(426))}}else if(We&&l.mode&1){var b=pv(a);if(b!==null){!(b.flags&65536)&&(b.flags|=256),gv(b,a,l,o,t),Tp(Ya(c,l));break e}}o=c=Ya(c,l),ft!==4&&(ft=2),rl===null?rl=[o]:rl.push(o),o=a;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=Fb(o,c,t);lv(o,v);break e;case 1:l=c;var y=o.type,x=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(js===null||!js.has(x)))){o.flags|=65536,t&=-t,o.lanes|=t;var _=Ub(o,l,t);lv(o,_);break e}}o=o.return}while(o!==null)}o_(r)}catch(S){t=S,lt===r&&r!==null&&(lt=r=r.return);continue}break}while(!0)}function n_(){var e=Mu.current;return Mu.current=Du,e===null?Du:e}function Yp(){(ft===0||ft===3||ft===2)&&(ft=4),gt===null||!(Co&268435455)&&!(bd&268435455)||cs(gt,St)}function Fu(e,t){var r=Te;Te|=2;var n=n_();(gt!==e||St!==t)&&(kn=null,xo(e,t));do try{CT();break}catch(s){r_(e,s)}while(!0);if(Rp(),Te=r,Mu.current=n,lt!==null)throw Error(H(261));return gt=null,St=0,ft}function CT(){for(;lt!==null;)s_(lt)}function ET(){for(;lt!==null&&!XC();)s_(lt)}function s_(e){var t=i_(e.alternate,e,tr);e.memoizedProps=e.pendingProps,t===null?o_(e):lt=t,Hp.current=null}function o_(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=bT(r,t),r!==null){r.flags&=32767,lt=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ft=6,lt=null;return}}else if(r=wT(r,t,tr),r!==null){lt=r;return}if(t=t.sibling,t!==null){lt=t;return}lt=t=e}while(t!==null);ft===0&&(ft=5)}function eo(e,t,r){var n=Me,s=xr.transition;try{xr.transition=null,Me=1,TT(e,t,r,n)}finally{xr.transition=s,Me=n}return null}function TT(e,t,r,n){do Ea();while(ys!==null);if(Te&6)throw Error(H(327));r=e.finishedWork;var s=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(H(177));e.callbackNode=null,e.callbackPriority=0;var o=r.lanes|r.childLanes;if(cE(e,o),e===gt&&(lt=gt=null,St=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Mc||(Mc=!0,l_(wu,function(){return Ea(),null})),o=(r.flags&15990)!==0,r.subtreeFlags&15990||o){o=xr.transition,xr.transition=null;var a=Me;Me=1;var l=Te;Te|=4,Hp.current=null,ST(e,r),Xb(r,e),YE(Fh),_u=!!$h,Fh=$h=null,e.current=r,kT(r),eE(),Te=l,Me=a,xr.transition=o}else e.current=r;if(Mc&&(Mc=!1,ys=e,$u=s),o=e.pendingLanes,o===0&&(js=null),nE(r.stateNode),Jt(e,nt()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)s=t[r],n(s.value,{componentStack:s.stack,digest:s.digest});if(Lu)throw Lu=!1,e=om,om=null,e;return $u&1&&e.tag!==0&&Ea(),o=e.pendingLanes,o&1?e===am?nl++:(nl=0,am=e):nl=0,Bs(),null}function Ea(){if(ys!==null){var e=Fw($u),t=xr.transition,r=Me;try{if(xr.transition=null,Me=16>e?16:e,ys===null)var n=!1;else{if(e=ys,ys=null,$u=0,Te&6)throw Error(H(331));var s=Te;for(Te|=4,X=e.current;X!==null;){var o=X,a=o.child;if(X.flags&16){var l=o.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(X=u;X!==null;){var d=X;switch(d.tag){case 0:case 11:case 15:tl(8,d,o)}var f=d.child;if(f!==null)f.return=d,X=f;else for(;X!==null;){d=X;var m=d.sibling,p=d.return;if(Qb(d),d===u){X=null;break}if(m!==null){m.return=p,X=m;break}X=p}}}var w=o.alternate;if(w!==null){var g=w.child;if(g!==null){w.child=null;do{var b=g.sibling;g.sibling=null,g=b}while(g!==null)}}X=o}}if(o.subtreeFlags&2064&&a!==null)a.return=o,X=a;else e:for(;X!==null;){if(o=X,o.flags&2048)switch(o.tag){case 0:case 11:case 15:tl(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,X=v;break e}X=o.return}}var y=e.current;for(X=y;X!==null;){a=X;var x=a.child;if(a.subtreeFlags&2064&&x!==null)x.return=a,X=x;else e:for(a=y;X!==null;){if(l=X,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:wd(9,l)}}catch(S){rt(l,l.return,S)}if(l===a){X=null;break e}var _=l.sibling;if(_!==null){_.return=l.return,X=_;break e}X=l.return}}if(Te=s,Bs(),un&&typeof un.onPostCommitFiberRoot=="function")try{un.onPostCommitFiberRoot(fd,e)}catch{}n=!0}return n}finally{Me=r,xr.transition=t}}return!1}function Tv(e,t,r){t=Ya(r,t),t=Fb(e,t,1),e=ks(e,t,1),t=Ft(),e!==null&&(Ql(e,1,t),Jt(e,t))}function rt(e,t,r){if(e.tag===3)Tv(e,e,r);else for(;t!==null;){if(t.tag===3){Tv(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(js===null||!js.has(n))){e=Ya(r,e),e=Ub(t,e,1),t=ks(t,e,1),e=Ft(),t!==null&&(Ql(t,1,e),Jt(t,e));break}}t=t.return}}function PT(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=Ft(),e.pingedLanes|=e.suspendedLanes&r,gt===e&&(St&r)===r&&(ft===4||ft===3&&(St&130023424)===St&&500>nt()-qp?xo(e,0):Wp|=r),Jt(e,t)}function a_(e,t){t===0&&(e.mode&1?(t=Nc,Nc<<=1,!(Nc&130023424)&&(Nc=4194304)):t=1);var r=Ft();e=Dn(e,t),e!==null&&(Ql(e,t,r),Jt(e,r))}function RT(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),a_(e,r)}function OT(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(H(314))}n!==null&&n.delete(t),a_(e,r)}var i_;i_=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Yt.current)Gt=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Gt=!1,xT(e,t,r);Gt=!!(e.flags&131072)}else Gt=!1,We&&t.flags&1048576&&db(t,Tu,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;au(e,t),e=t.pendingProps;var s=Wa(t,At.current);Ca(t,r),s=Fp(null,t,n,e,s,r);var o=Up();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Qt(n)?(o=!0,Cu(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Ip(t),s.updater=xd,t.stateNode=s,s._reactInternals=t,Gh(t,n,e,r),t=Jh(null,t,n,!0,o,r)):(t.tag=0,We&&o&&Cp(t),Lt(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(au(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=IT(n),e=Dr(n,e),s){case 0:t=Qh(null,t,n,e,r);break e;case 1:t=xv(null,t,n,e,r);break e;case 11:t=yv(null,t,n,e,r);break e;case 14:t=vv(null,t,n,Dr(n.type,e),r);break e}throw Error(H(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Dr(n,s),Qh(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Dr(n,s),xv(e,t,n,s,r);case 3:e:{if(Hb(t),e===null)throw Error(H(387));n=t.pendingProps,o=t.memoizedState,s=o.element,yb(e,t),Ou(t,n,null,r);var a=t.memoizedState;if(n=a.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=Ya(Error(H(423)),t),t=wv(e,t,n,r,s);break e}else if(n!==s){s=Ya(Error(H(424)),t),t=wv(e,t,n,r,s);break e}else for(or=Ss(t.stateNode.containerInfo.firstChild),ar=t,We=!0,Br=null,r=pb(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(qa(),n===s){t=Mn(e,t,r);break e}Lt(e,t,n,r)}t=t.child}return t;case 5:return vb(t),e===null&&Wh(t),n=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,a=s.children,Uh(n,s)?a=null:o!==null&&Uh(n,o)&&(t.flags|=32),Vb(e,t),Lt(e,t,a,r),t.child;case 6:return e===null&&Wh(t),null;case 13:return Wb(e,t,r);case 4:return Dp(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Ka(t,null,n,r):Lt(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Dr(n,s),yv(e,t,n,s,r);case 7:return Lt(e,t,t.pendingProps,r),t.child;case 8:return Lt(e,t,t.pendingProps.children,r),t.child;case 12:return Lt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,o=t.memoizedProps,a=s.value,Ue(Pu,n._currentValue),n._currentValue=a,o!==null)if(Gr(o.value,a)){if(o.children===s.children&&!Yt.current){t=Mn(e,t,r);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){a=o.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(o.tag===1){c=Rn(-1,r&-r),c.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}o.lanes|=r,c=o.alternate,c!==null&&(c.lanes|=r),qh(o.return,r,t),l.lanes|=r;break}c=c.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(H(341));a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),qh(a,r,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}Lt(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,Ca(t,r),s=br(s),n=n(s),t.flags|=1,Lt(e,t,n,r),t.child;case 14:return n=t.type,s=Dr(n,t.pendingProps),s=Dr(n.type,s),vv(e,t,n,s,r);case 15:return zb(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Dr(n,s),au(e,t),t.tag=1,Qt(n)?(e=!0,Cu(t)):e=!1,Ca(t,r),$b(t,n,s),Gh(t,n,s,r),Jh(null,t,n,!0,e,r);case 19:return qb(e,t,r);case 22:return Bb(e,t,r)}throw Error(H(156,t.tag))};function l_(e,t){return Dw(e,t)}function AT(e,t,r,n){this.tag=e,this.key=r,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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vr(e,t,r,n){return new AT(e,t,r,n)}function Qp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function IT(e){if(typeof e=="function")return Qp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===pp)return 11;if(e===gp)return 14}return 2}function Cs(e,t){var r=e.alternate;return r===null?(r=vr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.depen
vendor: 10,051 bytes, line 41
41dencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function cu(e,t,r,n,s,o){var a=2;if(n=e,typeof e=="function")Qp(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case ca:return wo(r.children,s,o,t);case mp:a=8,s|=8;break;case vh:return e=vr(12,r,t,s|2),e.elementType=vh,e.lanes=o,e;case xh:return e=vr(13,r,t,s),e.elementType=xh,e.lanes=o,e;case wh:return e=vr(19,r,t,s),e.elementType=wh,e.lanes=o,e;case vw:return _d(r,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case gw:a=10;break e;case yw:a=9;break e;case pp:a=11;break e;case gp:a=14;break e;case ss:a=16,n=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=vr(a,r,t,s),t.elementType=e,t.type=n,t.lanes=o,t}function wo(e,t,r,n){return e=vr(7,e,n,t),e.lanes=r,e}function _d(e,t,r,n){return e=vr(22,e,n,t),e.elementType=vw,e.lanes=r,e.stateNode={isHidden:!1},e}function Lf(e,t,r){return e=vr(6,e,null,t),e.lanes=r,e}function $f(e,t,r){return t=vr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function DT(e,t,r,n,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=vf(0),this.expirationTimes=vf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vf(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Jp(e,t,r,n,s,o,a,l,c){return e=new DT(e,t,r,l,c),t===1?(t=1,o===!0&&(t|=8)):t=0,o=vr(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ip(o),e}function MT(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:la,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function c_(e){if(!e)return Ds;e=e._reactInternals;e:{if(zo(e)!==e||e.tag!==1)throw Error(H(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Qt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(H(171))}if(e.tag===1){var r=e.type;if(Qt(r))return cb(e,r,t)}return t}function u_(e,t,r,n,s,o,a,l,c){return e=Jp(r,n,!0,e,s,o,a,l,c),e.context=c_(null),r=e.current,n=Ft(),s=Ns(r),o=Rn(n,s),o.callback=t??null,ks(r,o,s),e.current.lanes=s,Ql(e,s,n),Jt(e,n),e}function Sd(e,t,r,n){var s=t.current,o=Ft(),a=Ns(s);return r=c_(r),t.context===null?t.context=r:t.pendingContext=r,t=Rn(o,a),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=ks(s,t,a),e!==null&&(qr(e,s,a,o),nu(e,s,a)),a}function Uu(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 Pv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Zp(e,t){Pv(e,t),(e=e.alternate)&&Pv(e,t)}function LT(){return null}var d_=typeof reportError=="function"?reportError:function(e){console.error(e)};function Xp(e){this._internalRoot=e}kd.prototype.render=Xp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));Sd(e,t,null,null)};kd.prototype.unmount=Xp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Eo(function(){Sd(null,e,null,null)}),t[In]=null}};function kd(e){this._internalRoot=e}kd.prototype.unstable_scheduleHydration=function(e){if(e){var t=Bw();e={blockedOn:null,target:e,priority:t};for(var r=0;r<ls.length&&t!==0&&t<ls[r].priority;r++);ls.splice(r,0,e),r===0&&Hw(e)}};function eg(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function jd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Rv(){}function $T(e,t,r,n,s){if(s){if(typeof n=="function"){var o=n;n=function(){var u=Uu(a);o.call(u)}}var a=u_(t,n,e,0,null,!1,!1,"",Rv);return e._reactRootContainer=a,e[In]=a.current,pl(e.nodeType===8?e.parentNode:e),Eo(),a}for(;s=e.lastChild;)e.removeChild(s);if(typeof n=="function"){var l=n;n=function(){var u=Uu(c);l.call(u)}}var c=Jp(e,0,!1,null,null,!1,!1,"",Rv);return e._reactRootContainer=c,e[In]=c.current,pl(e.nodeType===8?e.parentNode:e),Eo(function(){Sd(t,c,r,n)}),c}function Nd(e,t,r,n,s){var o=r._reactRootContainer;if(o){var a=o;if(typeof s=="function"){var l=s;s=function(){var c=Uu(a);l.call(c)}}Sd(t,a,e,s)}else a=$T(r,t,e,s,n);return Uu(a)}Uw=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Ui(t.pendingLanes);r!==0&&(xp(t,r|1),Jt(t,nt()),!(Te&6)&&(Qa=nt()+500,Bs()))}break;case 13:Eo(function(){var n=Dn(e,1);if(n!==null){var s=Ft();qr(n,e,1,s)}}),Zp(e,1)}};wp=function(e){if(e.tag===13){var t=Dn(e,134217728);if(t!==null){var r=Ft();qr(t,e,134217728,r)}Zp(e,134217728)}};zw=function(e){if(e.tag===13){var t=Ns(e),r=Dn(e,t);if(r!==null){var n=Ft();qr(r,e,t,n)}Zp(e,t)}};Bw=function(){return Me};Vw=function(e,t){var r=Me;try{return Me=e,t()}finally{Me=r}};Ph=function(e,t,r){switch(t){case"input":if(Sh(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var s=gd(n);if(!s)throw Error(H(90));ww(n),Sh(n,s)}}}break;case"textarea":_w(e,r);break;case"select":t=r.value,t!=null&&Sa(e,!!r.multiple,t,!1)}};Tw=Kp;Pw=Eo;var FT={usingClientEntryPoint:!1,Events:[Zl,ha,gd,Cw,Ew,Kp]},Ti={findFiberByHostInstance:oo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},UT={bundleType:Ti.bundleType,version:Ti.version,rendererPackageName:Ti.rendererPackageName,rendererConfig:Ti.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Un.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Aw(e),e===null?null:e.stateNode},findFiberByHostInstance:Ti.findFiberByHostInstance||LT,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 Lc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Lc.isDisabled&&Lc.supportsFiber)try{fd=Lc.inject(UT),un=Lc}catch{}}fr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=FT;fr.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!eg(t))throw Error(H(200));return MT(e,t,null,r)};fr.createRoot=function(e,t){if(!eg(e))throw Error(H(299));var r=!1,n="",s=d_;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Jp(e,1,!1,null,null,r,!1,n,s),e[In]=t.current,pl(e.nodeType===8?e.parentNode:e),new Xp(t)};fr.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(H(188)):(e=Object.keys(e).join(","),Error(H(268,e)));return e=Aw(t),e=e===null?null:e.stateNode,e};fr.flushSync=function(e){return Eo(e)};fr.hydrate=function(e,t,r){if(!jd(t))throw Error(H(200));return Nd(null,e,t,!0,r)};fr.hydrateRoot=function(e,t,r){if(!eg(e))throw Error(H(405));var n=r!=null&&r.hydratedSources||null,s=!1,o="",a=d_;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(o=r.identifierPrefix),r.onRecoverableError!==void 0&&(a=r.onRecoverableError)),t=u_(t,null,e,1,r??null,s,!1,o,a),e[In]=t.current,pl(e),n)for(e=0;e<n.length;e++)r=n[e],s=r._getVersion,s=s(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,s]:t.mutableSourceEagerHydrationData.push(r,s);return new kd(t)};fr.render=function(e,t,r){if(!jd(t))throw Error(H(200));return Nd(null,e,t,!1,r)};fr.unmountComponentAtNode=function(e){if(!jd(e))throw Error(H(40));return e._reactRootContainer?(Eo(function(){Nd(null,null,e,!1,function(){e._reactRootContainer=null,e[In]=null})}),!0):!1};fr.unstable_batchedUpdates=Kp;fr.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!jd(r))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return Nd(e,t,r,!1,n)};fr.version="18.3.1-next-f1338f8080-20240426";function f_(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f_)}catch(e){console.error(e)}}f_(),fw.exports=fr;var ui=fw.exports;const h_=Gl(ui);var m_,Ov=ui;m_=Ov.createRoot,Ov.hydrateRoot;const zT="modulepreload",BT=function(e){return"/"+e},Av={},ze=function(t,r,n){let s=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(r.map(c=>{if(c=BT(c),c in Av)return;Av[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":zT,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((m,p)=>{f.addEventListener("load",m),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function o(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return s.then(a=>{for(const l of a||[])l.status==="rejected"&&o(l.reason);return t().catch(o)})};
41var Iv=["light","dark"],VT="(prefers-color-scheme: dark)",HT=h.createContext(void 0),WT={setTheme:e=>{},themes:[]},qT=()=>{var e;return(e=h.useContext(HT))!=null?e:WT};h.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:s,defaultTheme:o,value:a,attrs:l,nonce:c})=>{let u=o==="system",d=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(w=>`'${w}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,f=s?Iv.includes(o)&&o?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",m=(w,g=!1,b=!0)=>{let v=a?a[w]:w,y=g?w+"|| ''":`'${v}'`,x="";return s&&b&&!g&&Iv.includes(w)&&(x+=`d.style.colorScheme = '${w}';`),r==="class"?g||v?x+=`c.add(${y})`:x+="null":v&&(x+=`d[s](n,${y})`),x},p=e?`!function(){${d}${m(e)}}()`:n?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${VT}',m=window.matchMedia(t);if(m.media!==t||m.matches){${m("dark")}}else{${m("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${m(a?"x[e]":"e",!0)}}${u?"":"else{"+m(o,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${m(a?"x[e]":"e",!0)}}else{${m(o,!1,!1)};}${f}}catch(t){}}();`;return h.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:p}})});var KT=e=>{switch(e){case"success":return QT;case"info":return ZT;case"warning":return JT;case"error":return XT;default:return null}},GT=Array(12).fill(0),YT=({visible:e,className:t})=>W.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},W.createElement("div",{className:"sonner-spinner"},GT.map((r,n)=>W.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),QT=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.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"})),JT=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},W.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"})),ZT=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.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"})),XT=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.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"})),eP=W.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"},W.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),W.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),tP=()=>{let[e,t]=W.useState(document.hidden);return W.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},cm=1,rP=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:r,...n}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:cm++,o=this.toasts.find(l=>l.id===s),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),o?this.toasts=this.toasts.map(l
41=>l.id===s?(this.publish({...l,...e,id:s,title:r}),{...l,...e,id:s,dismissible:a,title:r}):l):this.addToast({title:r,...n,dismissible:a,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({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)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),s=r!==void 0,o,a=n.then(async c=>{if(o=["resolve",c],W.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(sP(c)&&!c.ok){s=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,d=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:r,type:"error",message:u,description:d})}else if(t.success!==void 0){s=!1;let u=typeof t.success=="function"?await t.success(c):t.success,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"success",message:u,description:d})}}).catch(async c=>{if(o=["reject",c],t.error!==void 0){s=!1;let u=typeof t.error=="function"?await t.error(c):t.error,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"error",message:u,description:d})}}).finally(()=>{var c;s&&(this.dismiss(r),r=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,u)=>a.then(()=>o[0]==="reject"?u(o[1]):c(o[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||cm++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},qt=new rP,nP=(e,t)=>{let r=(t==null?void 0:t.id)||cm++;return qt.addToast({title:e,...t,id:r}),r},sP=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",oP=nP,aP=()=>qt.toasts,iP=()=>qt.getActiveToasts(),re=Object.assign(oP,{success:qt.success,info:qt.info,warning:qt.warning,error:qt.error,custom:qt.custom,message:qt.message,promise:qt.promise,dismiss:qt.dismiss,loading:qt.loading},{getHistory:aP,getToasts:iP});function lP(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}lP(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
41left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
41:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
41--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} 42`);function $c(e){return e.label!==void 0}var cP=3,uP="32px",dP="16px",Dv=4e3,fP=356,hP=14,mP=20,pP=200;function Or(...e){return e.filter(Boolean).join(" ")}function gP(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var yP=e=>{var t,r,n,s,o,a,l,c,u,d,f;let{invert:m,toast:p,unstyled:w,interacting:g,setHeights:b,visibleToasts:v,heights:y,index:x,toasts:_,expanded:S,removeToast:k,defaultRichColors:N,closeButton:E,style:T,cancelButtonStyle:R,actionButtonStyle:L,className:O="",descriptionClassName:A="",duration:$,position:z,gap:P,loadingIcon:M,expandByDefault:C,classNames:j,icons:I,closeButtonAriaLabel:F="Close toast",pauseWhenPageIsHidden:B}=e,[J,Z]=W.useState(null),[Se,je]=W.useState(null),[V,le]=W.useState(!1),[ge,de]=W.useState(!1),[ne,q]=W.useState(!1),[pe,Ce]=W.useState(!1),[Le,Ze]=W.useState(!1),[K,xe]=W.useState(0),[Ee,ct]=W.useState(0),Ht=W.useRef(p.duration||$||Dv),Wn=W.useRef(null),Xt=W.useRef(null),pc=x===0,gc=x+1<=v,Wt=p.type,wn=p.dism
42issible!==!1,lf=p.className||"",xi=p.descriptionClassName||"",Nr=W.useMemo(()=>y.findIndex(me=>me.toastId===p.id)||0,[y,p.id]),wi=W.useMemo(()=>{var me;return(me=p.closeButton)!=null?me:E},[p.closeButton,E]),Ho=W.useMemo(()=>p.duration||$||Dv,[p.duration,$]),qn=W.useRef(0),Kn=W.useRef(0),yc=W.useRef(0),Gn=W.useRef(null),[cf,uf]=z.split("-"),bi=W.useMemo(()=>y.reduce((me,Ie,$e)=>$e>=Nr?me:me+Ie.height,0),[y,Nr]),vc=tP(),xc=p.invert||m,Wo=Wt==="loading";Kn.current=W.useMemo(()=>Nr*P+bi,[Nr,bi]),W.useEffect(()=>{Ht.current=Ho},[Ho]),W.useEffect(()=>{le(!0)},[]),W.useEffect(()=>{let me=Xt.current;if(me){let Ie=me.getBoundingClientRect().height;return ct(Ie),b($e=>[{toastId:p.id,height:Ie,position:p.position},...$e]),()=>b($e=>$e.filter(Er=>Er.toastId!==p.id))}},[b,p.id]),W.useLayoutEffect(()=>{if(!V)return;let me=Xt.current,Ie=me.style.height;me.style.height="auto";let $e=me.getBoundingClientRect().height;me.style.height=Ie,ct($e),b(Er=>Er.find(Tr=>Tr.toastId===p.id)?Er.map(Tr=>Tr.toastId===p.id?{...Tr,height:$e}:Tr):[{toastId:p.id,height:$e,position:p.position},...Er])},[V,p.title,p.description,b,p.id]);let Cr=W.useCallback(()=>{de(!0),xe(Kn.current),b(me=>me.filter(Ie=>Ie.toastId!==p.id)),setTimeout(()=>{k(p)},pP)},[p,k,b,Kn]);W.useEffect(()=>{if(p.promise&&Wt==="loading"||p.duration===1/0||p.type==="loading")return;let me;return S||g||B&&vc?(()=>{if(yc.current<qn.current){let Ie=new Date().getTime()-qn.current;Ht.current=Ht.current-Ie}yc.current=new Date().getTime()})():Ht.current!==1/0&&(qn.current=new Date().getTime(),me=setTimeout(()=>{var Ie;(Ie=p.onAutoClose)==null||Ie.call(p,p),Cr()},Ht.current)),()=>clearTimeout(me)},[S,g,p,Wt,B,vc,Cr]),W.useEffect(()=>{p.delete&&Cr()},[Cr,p.delete]);function df(){var me,Ie,$e;return I!=null&&I.loading?W.createElement("div",{className:Or(j==null?void 0:j.loader,(me=p==null?void 0:p.classNames)==null?void 0:me.loader,"sonner-loader"),"data-visible":Wt==="loading"},I.loading):M?W.createElement("div",{className:Or(j==null?void 0:j.loader,(Ie=p==null?void 0:p.classNames)==null?void 0:Ie.loader,"sonner-loader"),"data-visible":Wt==="loading"},M):W.createElement(YT,{className:Or(j==null?void 0:j.loader,($e=p==null?void 0:p.classNames)==null?void 0:$e.loader),visible:Wt==="loading"})}return W.createElement("li",{tabIndex:0,ref:Xt,className:Or(O,lf,j==null?void 0:j.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,j==null?void 0:j.default,j==null?void 0:j[Wt],(r=p==null?void 0:p.classNames)==null?void 0:r[Wt]),"data-sonner-toast":"","data-rich-colors":(n=p.richColors)!=null?n:N,"data-styled":!(p.jsx||p.unstyled||w),"data-mounted":V,"data-promise":!!p.promise,"data-swiped":Le,"data-removed":ge,"data-visible":gc,"data-y-position":cf,"data-x-position":uf,"data-index":x,"data-front":pc,"data-swiping":ne,"data-dismissible":wn,"data-type":Wt,"data-invert":xc,"data-swipe-out":pe,"data-swipe-direction":Se,"data-expanded":!!(S||C&&V),style:{"--index":x,"--toasts-before":x,"--z-index":_.length-x,"--offset":`${ge?K:Kn.current}px`,"--initial-height":C?"auto":`${Ee}px`,...T,...p.style},onDragEnd:()=>{q(!1),Z(null),Gn.current=null},onPointerDown:me=>{Wo||!wn||(Wn.current=new Date,xe(Kn.current),me.target.setPointerCapture(me.pointerId),me.target.tagName!=="BUTTON"&&(q(!0),Gn.current={x:me.clientX,y:me.clientY}))},onPointerUp:()=>{var me,Ie,$e,Er;if(pe||!wn)return;Gn.current=null;let Tr=Number(((me=Xt.current)==null?void 0:me.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Yn=Number(((Ie=Xt.current)==null?void 0:Ie.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ys=new Date().getTime()-(($e=Wn.current)==null?void 0:$e.getTime()),Pr=J==="x"?Tr:Yn,Qn=Math.abs(Pr)/Ys;if(Math.abs(Pr)>=mP||Qn>.11){xe(Kn.current),(Er=p.onDismiss)==null||Er.call(p,p),je(J==="x"?Tr>0?"right":"left":Yn>0?"down":"up"),Cr(),Ce(!0),Ze(!1);return}q(!1),Z(null)},onPointerMove:me=>{var Ie,$e,Er,Tr;if(!Gn.current||!wn||((Ie=window.getSelection())==null?void 0:Ie.toString().length)>0)return;let Yn=me.clientY-Gn.current.y,Ys=me.clientX-Gn.current.x,Pr=($e=e.swipeDirections)!=null?$e:gP(z);!J&&(Math.abs(Ys)>1||Math.abs(Yn)>1)&&Z(Math.abs(Ys)>Math.abs(Yn)?"x":"y");let Qn={x:0,y:0};J==="y"?(Pr.includes("top")||Pr.includes("bottom"))&&(Pr.includes("top")&&Yn<0||Pr.includes("bottom")&&Yn>0)&&(Qn.y=Yn):J==="x"&&(Pr.includes("left")||Pr.includes("right"))&&(Pr.includes("left")&&Ys<0||Pr.includes("right")&&Ys>0)&&(Qn.x=Ys),(Math.abs(Qn.x)>0||Math.abs(Qn.y)>0)&&Ze(!0),(Er=Xt.current)==null||Er.style.setProperty("--swipe-amount-x",`${Qn.x}px`),(Tr=Xt.current)==null||Tr.style.setProperty("--swipe-amount-y",`${Qn.y}px`)}},wi&&!p.jsx?W.createElement("button",{"aria-label":F,"data-disabled":Wo,"data-close-button":!0,onClick:Wo||!wn?()=>{}:()=>{var me;Cr(),(me=p.onDismiss)==null||me.call(p,p)},className:Or(j==null?void 0:j.closeButton,(s=p==null?void 0:p.classNames)==null?void 0:s.closeButton)},(o=I==null?void 0:I.close)!=null?o:eP):null,p.jsx||h.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:W.createElement(W.Fragment,null,Wt||p.icon||p.promise?W.createElement("div",{"data-icon":"",className:Or(j==null?void 0:j.icon,(a=p==null?void 0:p.classNames)==null?void 0:a.icon)}
42,p.promise||p.type==="loading"&&!p.icon?p.icon||df():null,p.type!=="loading"?p.icon||(I==null?void 0:I[Wt])||KT(Wt):null):null,W.createElement("div",{"data-content":"",className:Or(j==null?void 0:j.content,(l=p==null?void 0:p.classNames)==null?void 0:l.content)},W.createElement("div",{"data-title":"",className:Or(j==null?void 0:j.title,(c=p==null?void 0:p.classNames)==null?void 0:c.title)},typeof p.title=="function"?p.title():p.title),p.description?W.createElement("div",{"data-description":"",className:Or(A,xi,j==null?void 0:j.description,(u=p==null?void 0:p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),h.isValidElement(p.cancel)?p.cancel:p.cancel&&$c(p.cancel)?W.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||R,onClick:me=>{var Ie,$e;$c(p.cancel)&&wn&&(($e=(Ie=p.cancel).onClick)==null||$e.call(Ie,me),Cr())},className:Or(j==null?void 0:j.cancelButton,(d=p==null?void 0:p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,h.isValidElement(p.action)?p.action:p.action&&$c(p.action)?W.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||L,onClick:me=>{var Ie,$e;$c(p.action)&&(($e=(Ie=p.action).onClick)==null||$e.call(Ie,me),!me.defaultPrevented&&Cr())},className:Or(j==null?void 0:j.actionButton,(f=p==null?void 0:p.classNames)==null?void 0:f.actionButton)},p.action.label):null))};function Mv(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function vP(e,t){let r={};return[e,t].forEach((n,s)=>{let o=s===1,a=o?"--mobile-offset":"--offset",l=o?dP:uP;function c(u){["top","right","bottom","left"].forEach(d=>{r[`${a}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${a}-${u}`]=l:r[`${a}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):c(l)}),r}var xP=h.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:o,closeButton:a,className:l,offset:c,mobileOffset:u,theme:d="light",richColors:f,duration:m,style:p,visibleToasts:w=cP,toastOptions:g,dir:b=Mv(),gap:v=hP,loadingIcon:y,icons:x,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:S}=e,[k,N]=W.useState([]),E=W.useMemo(()=>Array.from(new Set([n].concat(k.filter(B=>B.position).map(B=>B.position)))),[k,n]),[T,R]=W.useState([]),[L,O]=W.useState(!1),[A,$]=W.useState(!1),[z,P]=W.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),M=W.useRef(null),C=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=W.useRef(null),I=W.useRef(!1),F=W.useCallback(B=>{N(J=>{var Z;return(Z=J.find(Se=>Se.id===B.id))!=null&&Z.delete||qt.dismiss(B.id),J.filter(({id:Se})=>Se!==B.id)})},[]);return W.useEffect(()=>qt.subscribe(B=>{if(B.dismiss){N(J=>J.map(Z=>Z.id===B.id?{...Z,delete:!0}:Z));return}setTimeout(()=>{h_.flushSync(()=>{N(J=>{let Z=J.findIndex(Se=>Se.id===B.id);return Z!==-1?[...J.slice(0,Z),{...J[Z],...B},...J.slice(Z+1)]:[B,...J]})})})}),[]),W.useEffect(()=>{if(d!=="system"){P(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?P("dark"):P("light")),typeof window>"u")return;let B=window.matchMedia("(prefers-color-scheme: dark)");try{B.addEventListener("change",({matches:J})=>{P(J?"dark":"light")})}catch{B.addListener(({matches:Z})=>{try{P(Z?"dark":"light")}catch(Se){console.error(Se)}})}},[d]),W.useEffect(()=>{k.length<=1&&O(!1)},[k]),W.useEffect(()=>{let B=J=>{var Z,Se;s.every(je=>J[je]||J.code===je)&&(O(!0),(Z=M.current)==null||Z.focus()),J.code==="Escape"&&(document.activeElement===M.current||(Se=M.current)!=null&&Se.contains(document.activeElement))&&O(!1)};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[s]),W.useEffect(()=>{if(M.current)return()=>{j.current&&(j.current.focus({preventScroll:!0}),j.current=null,I.current=!1)}},[M.current]),W.createElement("section",{ref:t,"aria-label":`${_} ${C}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},E.map((B,J)=>{var Z;let[Se,je]=B.split("-");return k.length?W.createElement("ol",{key:B,dir:b==="auto"?Mv():b,tabIndex:-1,ref:M,className:l,"data-sonner-toaster":!0,"data-theme":z,"data-y-position":Se,"data-lifted":L&&k.length>1&&!o,"data-x-position":je,style:{"--front-toast-height":`${((Z=T[0])==null?void 0:Z.height)||0}px`,"--width":`${fP}px`,"--gap":`${v}px`,...p,...vP(c,u)},onBlur:V=>{I.current&&!V.currentTarget.contains(V.relatedTarget)&&(I.current=!1,j.current&&(j.current.focus({preventScroll:!0}),j.current=null))},onFocus:V=>{V.target instanceof HTMLElement&&V.target.dataset.dismissible==="false"||I.current||(I.current=!0,j.current=V.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{A||O(!1)},onDragEnd:()=>O(!1),onPointerDown:V=>{V.target instanceof HTMLElement&&V.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},k.filter(V=>!V.position&&J===0||V.position===B).map((V,le)=>{var ge,de;return W.createElement(yP,{key:V.id,icons:x,index:le,toast:V,defaultRichColors:f,duration:(ge=g==null?void 0:g.duration)!=null?ge:m,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:r,visibleToasts:w,closeButton:(de=g==null?void 0:g.closeButton)!=null?de:a,interacting:A,position:B,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:F,toasts:k.filter(ne=>ne.position==V.position),heights:T.filter(ne=>ne.position==V.position),setHeights:R,expandByDefault:o,gap:v,loadingIcon:y,expanded:L,pauseWhenPageIsHidden:S,swipeDirections:e.swipeDirections})})):null}))});const wP=({...e})=>{const{theme:t="system"}=qT();return i.jsx(xP,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};function Y(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function Lv(e,t){if(typeof e=="function")return e(t);
vendor: 17,328 bytes, line 42
42e!=null&&(e.current=t)}function Cd(...e){return t=>{let r=!1;const n=e.map(s=>{const o=Lv(s,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s<n.length;s++){const o=n[s];typeof o=="function"?o():Lv(e[s],null)}}}}function be(...e){return h.useCallback(Cd(...e),e)}function bP(e,t){const r=h.createContext(t),n=o=>{const{children:a,...l}=o,c=h.useMemo(()=>l,Object.values(l));return i.jsx(r.Provider,{value:c,children:a})};n.displayName=e+"Provider";function s(o){const a=h.useContext(r);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[n,s]}function Zt(e,t=[]){let r=[];function n(o,a){const l=h.createContext(a),c=r.length;r=[...r,a];const u=f=>{var v;const{scope:m,children:p,...w}=f,g=((v=m==null?void 0:m[e])==null?void 0:v[c])||l,b=h.useMemo(()=>w,Object.values(w));return i.jsx(g.Provider,{value:b,children:p})};u.displayName=o+"Provider";function d(f,m){var g;const p=((g=m==null?void 0:m[e])==null?void 0:g[c])||l,w=h.useContext(p);if(w)return w;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[u,d]}const s=()=>{const o=r.map(a=>h.createContext(a));return function(l){const c=(l==null?void 0:l[e])||o;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[n,_P(s,...t)]}function _P(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const a=n.reduce((l,{useScope:c,scopeName:u})=>{const f=c(o)[`__scope${u}`];return{...l,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function To(e){const t=kP(e),r=h.forwardRef((n,s)=>{const{children:o,...a}=n,l=h.Children.toArray(o),c=l.find(jP);if(c){const u=c.props.children,d=l.map(f=>f===c?h.Children.count(u)>1?h.Children.only(null):h.isValidElement(u)?u.props.children:null:f);return i.jsx(t,{...a,ref:s,children:h.isValidElement(u)?h.cloneElement(u,void 0,d):null})}return i.jsx(t,{...a,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}var SP=To("Slot");function kP(e){const t=h.forwardRef((r,n)=>{const{children:s,...o}=r;if(h.isValidElement(s)){const a=CP(s),l=NP(o,s.props);return s.type!==h.Fragment&&(l.ref=n?Cd(n,a):a),h.cloneElement(s,l)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var p_=Symbol("radix.slottable");function g_(e){const t=({children:r})=>i.jsx(i.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=p_,t}function jP(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===p_}function NP(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...l)=>{const c=o(...l);return s(...l),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function CP(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var EP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ue=EP.reduce((e,t)=>{const r=To(`Primitive.${t}`),n=h.forwardRef((s,o)=>{const{asChild:a,...l}=s,c=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...l,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function y_(e,t){e&&ui.flushSync(()=>e.dispatchEvent(t))}function pt(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function TP(e,t=globalThis==null?void 0:globalThis.document){const r=pt(e);h.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var PP="DismissableLayer",um="dismissableLayer.update",RP="dismissableLayer.pointerDownOutside",OP="dismissableLayer.focusOutside",$v,v_=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ec=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...c}=e,u=h.useContext(v_),[d,f]=h.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=h.useState({}),w=be(t,N=>f(N)),g=Array.from(u.layers),[b]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(b),y=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,_=y>=v,S=DP(N=>{const E=N.target,T=[...u.branches].some(R=>R.contains(E));!_||T||(s==null||s(N),a==null||a(N),N.defaultPrevented||l==null||l())},m),k=MP(N=>{const E=N.target;[...u.branches].some(R=>R.contains(E))||(o==null||o(N),a==null||a(N),N.defaultPrevented||l==null||l())},m);return TP(N=>{y===u.layers.size-1&&(n==null||n(N),!N.defaultPrevented&&l&&(N.preventDefault(),l()))},m),h.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&($v=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Fv(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=$v)}},[d,m,r,u]),h.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Fv())},[d,u]),h.useEffect(()=>{const N=()=>p({});return document.addEventListener(um,N),()=>document.removeEventListener(um,N)},[]),i.jsx(ue.div,{...c,ref:w,style:{pointerEvents:x?_?"auto":"none":void 0,...e.style},onFocusCapture:Y(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Y(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Y(e.onPointerDownCapture,S.onPointerDownCapture)})});ec.displayName=PP;var AP="DismissableLayerBranch",IP=h.forwardRef((e,t)=>{const r=h.useContext(v_),n=h.useRef(null),s=be(t,n);return h.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),i.jsx(ue.div,{...e,ref:s})});IP.displayName=AP;function DP(e,t=globalThis==null?void 0:globalThis.document){const r=pt(e),n=h.useRef(!1),s=h.useRef(()=>{});return h.useEffect(()=>{const o=l=>{if(l.target&&!n.current){let c=function(){x_(RP,r,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function MP(e,t=globalThis==null?void 0:globalThis.document){const r=pt(e),n=h.useRef(!1);return h.useEffect(()=>{const s=o=>{o.target&&!n.current&&x_(OP,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Fv(){const e=new CustomEvent(um);document.dispatchEvent(e)}function x_(e,t,r,{discrete:n}){const s=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?y_(s,o):s.dispatchEvent(o)}var yt=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},LP=up[" useId ".trim().toString()]||(()=>{}),$P=0;function ir(e){const[t,r]=h.useState(LP());return yt(()=>{r(n=>n??String($P++))},[e]),t?`radix-${t}`:""}const FP=["top","right","bottom","left"],Ms=Math.min,rr=Math.max,zu=Math.round,Fc=Math.floor,fn=e=>({x:e,y:e}),UP={left:"right",right:"left",bottom:"top",top:"bottom"},zP={start:"end",end:"start"};function dm(e,t,r){return rr(e,Ms(t,r))}function Ln(e,t){return typeof e=="function"?e(t):e}function $n(e){return e.split("-")[0]}function di(e){return e.split("-")[1]}function tg(e){return e==="x"?"y":"x"}function rg(e){return e==="y"?"height":"width"}const BP=new Set(["top","bottom"]);function cn(e){return BP.has($n(e))?"y":"x"}function ng(e){return tg(cn(e))}function VP(e,t,r){r===void 0&&(r=!1);const n=di(e),s=ng(e),o=rg(s);let a=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Bu(a)),[a,Bu(a)]}function HP(e){const t=Bu(e);return[fm(e),t,fm(t)]}function fm(e){return e.replace(/start|end/g,t=>zP[t])}const Uv=["left","right"],zv=["right","left"],WP=["top","bottom"],qP=["bottom","top"];function KP(e,t,r){switch(e){case"top":case"bottom":return r?t?zv:Uv:t?Uv:zv;case"left":case"right":return t?WP:qP;default:return[]}}function GP(e,t,r,n){const s=di(e);let o=KP($n(e),r==="start",n);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(fm)))),o}function Bu(e){return e.replace(/left|right|bottom|top/g,t=>UP[t])}function YP(e){return{top:0,right:0,bottom:0,left:0,...e}}function w_(e){return typeof e!="number"?YP(e):{top:e,right:e,bottom:e,left:e}}function Vu(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function Bv(e,t,r){let{reference:n,floating:s}=e;const o=cn(t),a=ng(t),l=rg(a),c=$n(t),u=o==="y",d=n.x+n.width/2-s.width/2,f=n.y+n.height/2-s.height/2,m=n[l]/2-s[l]/2;let p;switch(c){case"top":p={x:d,y:n.y-s.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:f};break;case"left":p={x:n.x-s.width,y:f};break;default:p={x:n.x,y:n.y}}switch(di(t)){case"start":p[a]-=m*(r&&u?-1:1);break;case"end":p[a]+=m*(r&&u?-1:1);break}return p}const QP=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:a}=r,l=o.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:f}=Bv(u,n,c),m=n,p={},w=0;for(let g=0;g<l.length;g++){const{name:b,fn:v}=l[g],{x:y,y:x,data:_,reset:S}=await v({x:d,y:f,initialPlacement:n,placement:m,strategy:s,middlewareData:p,rects:u,platform:a,elements:{reference:e,floating:t}});d=y??d,f=x??f,p={...p,[b]:{...p[b],..._}},S&&w<=50&&(w++,typeof S=="object"&&(S.placement&&(m=S.placement),S.rects&&(u=S.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):S.rects),{x:d,y:f}=Bv(u,m,c)),g=-1)}return{x:d,y:f,placement:m,strategy:s,middlewareData:p}};async function kl(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:o,rects:a,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:m=!1,padding:p=0}=Ln(t,e),w=w_(p),b=l[m?f==="floating"?"reference":"floating":f],v=Vu(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(b)))==null||r?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),y=f==="floating"?{x:n,y:s,width:a.floating.width,height:a.floating.height}:a.reference,x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),_=await(o.isElement==null?void 0:o.isElement(x))?await(o.getScale==null?void 0:o.getScale(x))||{x:1,y:1}:{x:1,y:1},S=Vu(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:x,strategy:c}):y);return{top:(v.top-S.top+w.top)/_.y,bottom:(S.bottom-v.bottom+w.bottom)/_.y,left:(v.left-S.left+w.left)/_.x,right:(S.right-v.right+w.right)/_.x}}const JP=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:o,platform:a,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=Ln(e,t)||{};if(u==null)return{};const f=w_(d),m={x:r,y:n},p=ng(s),w=rg(p),g=await a.getDimensions(u),b=p==="y",v=b?"top":"left",y=b?"bottom":"right",x=b?"clientHeight":"clientWidth",_=o.reference[w]+o.reference[p]-m[p]-o.floating[w],S=m[p]-o.reference[p],k=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let N=k?k[x]:0;(!N||!await(a.isElement==null?void 0:a.isElement(k)))&&(N=l.floating[x]||o.floating[w]);const E=_/2-S/2,T=N/2-g[w]/2-1,R=Ms(f[v],T),L=Ms(f[y],T),O=R,A=N-g[w]-L,$=N/2-g[w]/2+E,z=dm(O,$,A),P=!c.arrow&&di(s)!=null&&$!==z&&o.reference[w]/2-($<O?R:L)-g[w]/2<0,M=P?$<O?$-O:$-A:0;return{[p]:m[p]+M,data:{[p]:z,centerOffset:$-z-M,...P&&{alignmentOffset:M}},reset:P}}}),ZP=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:o,rects:a,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:g=!0,...b}=Ln(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const v=$n(s),y=cn(l),x=$n(l)===l,_=await(c.isRTL==null?void 0:c.isRTL(u.floating)),S=m||(x||!g?[Bu(l)]:HP(l)),k=w!=="none";!m&&k&&S.push(...GP(l,g,w,_));const N=[l,...S],E=await kl(t,b),T=[];let R=((n=o.flip)==null?void 0:n.overflows)||[];if(d&&T.push(E[v]),f){const $=VP(s,a,_);T.push(E[$[0]],E[$[1]])}if(R=[...R,{placement:s,overflows:T}],!T.every($=>$<=0)){var L,O;const $=(((L=o.flip)==null?void 0:L.index)||0)+1,z=N[$];if(z&&(!(f==="alignment"?y!==cn(z):!1)||R.every(C=>C.overflows[0]>0&&cn(C.placement)===y)))return{data:{index:$,overflows:R},reset:{placement:z}};let P=(O=R.filter(M=>M.overflows[0]<=0).sort((M,C)=>M.overflows[1]-C.overflows[1])[0])==null?void 0:O.placement;if(!P)switch(p){case"bestFit":{var A;const M=(A=R.filter(C=>{if(k){const j=cn(C.placement);return j===y||j==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(j=>j>0).reduce((j,I)=>j+I,0)]).sort((C,j)=>C[1]-j[1])[0])==null?void 0:A[0];M&&(P=M);break}case"initialPlacement":P=l;break}if(s!==P)return{reset:{placement:P}}}return{}}}};function Vv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Hv(e){return FP.some(t=>e[t]>=0)}const XP=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...s}=Ln(e,t);switch(n){case"referenceHidden":{const o=await kl(t,{...s,elementContext:"reference"}),a=Vv(o,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Hv(a)}}}case"escaped":{const o=await kl(t,{...s,altBoundary:!0}),a=Vv(o,r.floating);return{data:{escapedOffsets:a,escaped:Hv(a)}}}default:return{}}}}},b_=new Set(["left","top"]);async function eR(e,t){const{placement:r,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),a=$n(r),l=di(r),c=cn(r)==="y",u=b_.has(a)?-1:1,d=o&&c?-1:1,f=Ln(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:w}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof w=="number"&&(p=l==="end"?w*-1:w),c?{x:p*d,y:m*u}:{x:m*u,y:p*d}}const tR=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:o,placement:a,middlewareData:l}=t,c=await eR(t,e);return a===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:o+c.y,data:{...c,placement:a}}}}},rR=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:b=>{let{x:v,y}=b;return{x:v,y}}},...c}=Ln(e,t),u={x:r,y:n},d=await kl(t,c),f=cn($n(s)),m=tg(f);let p=u[m],w=u[f];if(o){const b=m==="y"?"top":"left",v=m==="y"?"bottom":"right",y=p+d[b],x=p-d[v];p=dm(y,p,x)}if(a){const b=f==="y"?"top":"left",v=f==="y"?"bottom":"right",y=w+d[b],x=w-d[v];w=dm(y,w,x)}const g=l.fn({...t,[m]:p,[f]:w});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[m]:o,[f]:a}}}}}},nR=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:o,middlewareData:a}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=Ln(e,t),d={x:r,y:n},f=cn(s),m=tg(f);let p=d[m],w=d[f];const g=Ln(l,t),b=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const x=m==="y"?"height":"width",_=o.reference[m]-o.floating[x]+b.mainAxis,S=o.reference[m]+o.reference[x]-b.mainAxis;p<_?p=_:p>S&&(p=S)}if(u){var v,y;const x=m==="y"?"width":"height",_=b_.has($n(s)),S=o.reference[f]-o.floating[x]+(_&&((v=a.offset)==null?void 0:v[f])||0)+(_?0:b.crossAxis),k=o.reference[f]+o.reference[x]+(_?0:((y=a.offset)==null?void 0:y[f])||0)-(_?b.crossAxis:0);w<S?w=S:w>k&&(w=k)}return{[m]:p,[f]:w}}}},sR=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:s,rects:o,platform:a,elements:l}=t,{apply:c=()=>{},...u}=Ln(e,t),d=await kl(t,u),f=$n(s),m=di(s),p=cn(s)==="y",{width:w,height:g}=o.floating;let b,v;f==="top"||f==="bottom"?(b=f,v=m===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(v=f,b=m==="end"?"top":"bottom");const y=g-d.top-d.bottom,x=w-d.left-d.right,_=Ms(g-d[b],y),S=Ms(w-d[v],x),k=!t.middlewareData.shift;let N=_,E=S;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(N=y),k&&!m){const R=rr(d.left,0),L=rr(d.right,0),O=rr(d.top,0),A=rr(d.bottom,0);p?E=w-2*(R!==0||L!==0?R+L:rr(d.left,d.right)):N=g-2*(O!==0||A!==0?O+A:rr(d.top,d.bottom))}await c({...t,availableWidth:E,availableHeight:N});const T=await a.getDimensions(l.floating);
vendor: 4,956 bytes, line 42
42return w!==T.width||g!==T.height?{reset:{rects:!0}}:{}}}};function Ed(){return typeof window<"u"}function fi(e){return __(e)?(e.nodeName||"").toLowerCase():"#document"}function lr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vn(e){var t;return(t=(__(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function __(e){return Ed()?e instanceof Node||e instanceof lr(e).Node:!1}function Yr(e){return Ed()?e instanceof Element||e instanceof lr(e).Element:!1}function pn(e){return Ed()?e instanceof HTMLElement||e instanceof lr(e).HTMLElement:!1}function Wv(e){return!Ed()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof lr(e).ShadowRoot}const oR=new Set(["inline","contents"]);function tc(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=Qr(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!oR.has(s)}const aR=new Set(["table","td","th"]);function iR(e){return aR.has(fi(e))}const lR=[":popover-open",":modal"];function Td(e){return lR.some(t=>{try{return e.matches(t)}catch{return!1}})}const cR=["transform","translate","scale","rotate","perspective"],uR=["transform","translate","scale","rotate","perspective","filter"],dR=["paint","layout","strict","content"];function sg(e){const t=og(),r=Yr(e)?Qr(e):e;return cR.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||uR.some(n=>(r.willChange||"").includes(n))||dR.some(n=>(r.contain||"").includes(n))}function fR(e){let t=Ls(e);for(;pn(t)&&!Ja(t);){if(sg(t))return t;if(Td(t))return null;t=Ls(t)}return null}function og(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const hR=new Set(["html","body","#document"]);function Ja(e){return hR.has(fi(e))}function Qr(e){return lr(e).getComputedStyle(e)}function Pd(e){return Yr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ls(e){if(fi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Wv(e)&&e.host||vn(e);return Wv(t)?t.host:t}function S_(e){const t=Ls(e);return Ja(t)?e.ownerDocument?e.ownerDocument.body:e.body:pn(t)&&tc(t)?t:S_(t)}function jl(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=S_(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),a=lr(s);if(o){const l=hm(a);return t.concat(a,a.visualViewport||[],tc(s)?s:[],l&&r?jl(l):[])}return t.concat(s,jl(s,[],r))}function hm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function k_(e){const t=Qr(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=pn(e),o=s?e.offsetWidth:r,a=s?e.offsetHeight:n,l=zu(r)!==o||zu(n)!==a;return l&&(r=o,n=a),{width:r,height:n,$:l}}function ag(e){return Yr(e)?e:e.contextElement}function Ta(e){const t=ag(e);if(!pn(t))return fn(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:o}=k_(t);let a=(o?zu(r.width):r.width)/n,l=(o?zu(r.height):r.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const mR=fn(0);function j_(e){const t=lr(e);return!og()||!t.visualViewport?mR:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function pR(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==lr(e)?!1:t}function Po(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),o=ag(e);let a=fn(1);t&&(n?Yr(n)&&(a=Ta(n)):a=Ta(e));const l=pR(o,r,n)?j_(o):fn(0);let c=(s.left+l.x)/a.x,u=(s.top+l.y)/a.y,d=s.width/a.x,f=s.height/a.y;if(o){const m=lr(o),p=n&&Yr(n)?lr(n):n;let w=m,g=hm(w);for(;g&&n&&p!==w;){const b=Ta(g),v=g.getBoundingClientRect(),y=Qr(g),x=v.left+(g.clientLeft+parseFloat(y.paddingLeft))*b.x,_=v.top+(g.clientTop+parseFloat(y.paddingTop))*b.y;c*=b.x,u*=b.y,d*=b.x,f*=b.y,c+=x,u+=_,w=lr(g),g=hm(w)}}return Vu({width:d,height:f,x:c,y:u})}function ig(e,t){const r=Pd(e).scrollLeft;return t?t.left+r:Po(vn(e)).left+r}function N_(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-(r?0:ig(e,n)),o=n.top+t.scrollTop;return{x:s,y:o}}function gR(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const o=s==="fixed",a=vn(n),l=t?Td(t.floating):!1;if(n===a||l&&o)return r;let c={scrollLeft:0,scrollTop:0},u=fn(1);const d=fn(0),f=pn(n);if((f||!f&&!o)&&((fi(n)!=="body"||tc(a))&&(c=Pd(n)),pn(n))){const p=Po(n);u=Ta(n),d.x=p.x+n.clientLeft,d.y=p.y+n.clientTop}const m=a&&!f&&!o?N_(a,c,!0):fn(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+d.x+m.x,y:r.y*u.y-c.scrollTop*u.y+d.y+m.y}}function yR(e){return Array.from(e.getClientRects())}function vR(e){const t=vn(e),r=Pd(e),n=e.ownerDocument.body,s=rr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=rr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+ig(e);const l=-r.scrollTop;return Qr(n).direction==="rtl"&&(a+=rr(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:a,y:l}}
vendor: 4,850 bytes, line 42
42function xR(e,t){const r=lr(e),n=vn(e),s=r.visualViewport;let o=n.clientWidth,a=n.clientHeight,l=0,c=0;if(s){o=s.width,a=s.height;const u=og();(!u||u&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:o,height:a,x:l,y:c}}const wR=new Set(["absolute","fixed"]);function bR(e,t){const r=Po(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,o=pn(e)?Ta(e):fn(1),a=e.clientWidth*o.x,l=e.clientHeight*o.y,c=s*o.x,u=n*o.y;return{width:a,height:l,x:c,y:u}}function qv(e,t,r){let n;if(t==="viewport")n=xR(e,r);else if(t==="document")n=vR(vn(e));else if(Yr(t))n=bR(t,r);else{const s=j_(e);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Vu(n)}function C_(e,t){const r=Ls(e);return r===t||!Yr(r)||Ja(r)?!1:Qr(r).position==="fixed"||C_(r,t)}function _R(e,t){const r=t.get(e);if(r)return r;let n=jl(e,[],!1).filter(l=>Yr(l)&&fi(l)!=="body"),s=null;const o=Qr(e).position==="fixed";let a=o?Ls(e):e;for(;Yr(a)&&!Ja(a);){const l=Qr(a),c=sg(a);!c&&l.position==="fixed"&&(s=null),(o?!c&&!s:!c&&l.position==="static"&&!!s&&wR.has(s.position)||tc(a)&&!c&&C_(e,a))?n=n.filter(d=>d!==a):s=l,a=Ls(a)}return t.set(e,n),n}function SR(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const a=[...r==="clippingAncestors"?Td(t)?[]:_R(t,this._c):[].concat(r),n],l=a[0],c=a.reduce((u,d)=>{const f=qv(t,d,s);return u.top=rr(f.top,u.top),u.right=Ms(f.right,u.right),u.bottom=Ms(f.bottom,u.bottom),u.left=rr(f.left,u.left),u},qv(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function kR(e){const{width:t,height:r}=k_(e);return{width:t,height:r}}function jR(e,t,r){const n=pn(t),s=vn(t),o=r==="fixed",a=Po(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const c=fn(0);function u(){c.x=ig(s)}if(n||!n&&!o)if((fi(t)!=="body"||tc(s))&&(l=Pd(t)),n){const p=Po(t,!0,o,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else s&&u();o&&!n&&s&&u();const d=s&&!n&&!o?N_(s,l):fn(0),f=a.left+l.scrollLeft-c.x-d.x,m=a.top+l.scrollTop-c.y-d.y;return{x:f,y:m,width:a.width,height:a.height}}function Ff(e){return Qr(e).position==="static"}function Kv(e,t){if(!pn(e)||Qr(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return vn(e)===r&&(r=r.ownerDocument.body),r}function E_(e,t){const r=lr(e);if(Td(e))return r;if(!pn(e)){let s=Ls(e);for(;s&&!Ja(s);){if(Yr(s)&&!Ff(s))return s;s=Ls(s)}return r}let n=Kv(e,t);for(;n&&iR(n)&&Ff(n);)n=Kv(n,t);return n&&Ja(n)&&Ff(n)&&!sg(n)?r:n||fR(e)||r}const NR=async function(e){const t=this.getOffsetParent||E_,r=this.getDimensions,n=await r(e.floating);return{reference:jR(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function CR(e){return Qr(e).direction==="rtl"}const ER={convertOffsetParentRelativeRectToViewportRelativeRect:gR,getDocumentElement:vn,getClippingRect:SR,getOffsetParent:E_,getElementRects:NR,getClientRects:yR,getDimensions:kR,getScale:Ta,isElement:Yr,isRTL:CR};function T_(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function TR(e,t){let r=null,n;const s=vn(e);function o(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function a(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),o();const u=e.getBoundingClientRect(),{left:d,top:f,width:m,height:p}=u;if(l||t(),!m||!p)return;const w=Fc(f),g=Fc(s.clientWidth-(d+m)),b=Fc(s.clientHeight-(f+p)),v=Fc(d),x={rootMargin:-w+"px "+-g+"px "+-b+"px "+-v+"px",threshold:rr(0,Ms(1,c))||1};let _=!0;function S(k){const N=k[0].intersectionRatio;if(N!==c){if(!_)return a();N?a(!1,N):n=setTimeout(()=>{a(!1,1e-7)},1e3)}N===1&&!T_(u,e.getBoundingClientRect())&&a(),_=!1}try{r=new IntersectionObserver(S,{...x,root:s.ownerDocument})}catch{r=new IntersectionObserver(S,x)}r.observe(e)}return a(!0),o}function PR(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=ag(e),d=s||o?[...u?jl(u):[],...jl(t)]:[];d.forEach(v=>{s&&v.addEventListener("scroll",r,{passive:!0}),o&&v.addEventListener("resize",r)});const f=u&&l?TR(u,r):null;let m=-1,p=null;a&&(p=new ResizeObserver(v=>{let[y]=v;y&&y.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(t)})),r()}),u&&!c&&p.observe(u),p.observe(t));let w,g=c?Po(e):null;c&&b();function b(){const v=Po(e);g&&!T_(g,v)&&r(),g=v,w=requestAnimationFrame(b)}return r(),()=>{var v;d.forEach(y=>{s&&y.removeEventListener("scroll",r),o&&y.removeEventListener("resize",r)}),f==null||f(),(v=p)==null||v.disconnect(),p=null,c&&cancelAnimationFrame(w)}}const RR=tR,OR=rR,AR=ZP,IR=sR,DR=XP,Gv=JP,MR=nR,LR=(e,t,r)=>{const n=new Map,s={platform:ER,...r},o={...s.platform,_c:n};return QP(e,t,{...s,platform:o})};var $R=typeof document<"u",FR=function(){},uu=$R?h.useLayoutEffect:FR;function Hu(e,t){if(e===t)return!0;
vendor: 4,143 bytes, line 42
42if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Hu(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const o=s[n];if(!(o==="_owner"&&e.$$typeof)&&!Hu(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function P_(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Yv(e,t){const r=P_(e);return Math.round(t*r)/r}function Uf(e){const t=h.useRef(e);return uu(()=>{t.current=e}),t}function UR(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:o,floating:a}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=h.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=h.useState(n);Hu(m,n)||p(n);const[w,g]=h.useState(null),[b,v]=h.useState(null),y=h.useCallback(C=>{C!==k.current&&(k.current=C,g(C))},[]),x=h.useCallback(C=>{C!==N.current&&(N.current=C,v(C))},[]),_=o||w,S=a||b,k=h.useRef(null),N=h.useRef(null),E=h.useRef(d),T=c!=null,R=Uf(c),L=Uf(s),O=Uf(u),A=h.useCallback(()=>{if(!k.current||!N.current)return;const C={placement:t,strategy:r,middleware:m};L.current&&(C.platform=L.current),LR(k.current,N.current,C).then(j=>{const I={...j,isPositioned:O.current!==!1};$.current&&!Hu(E.current,I)&&(E.current=I,ui.flushSync(()=>{f(I)}))})},[m,t,r,L,O]);uu(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(C=>({...C,isPositioned:!1})))},[u]);const $=h.useRef(!1);uu(()=>($.current=!0,()=>{$.current=!1}),[]),uu(()=>{if(_&&(k.current=_),S&&(N.current=S),_&&S){if(R.current)return R.current(_,S,A);A()}},[_,S,A,R,T]);const z=h.useMemo(()=>({reference:k,floating:N,setReference:y,setFloating:x}),[y,x]),P=h.useMemo(()=>({reference:_,floating:S}),[_,S]),M=h.useMemo(()=>{const C={position:r,left:0,top:0};if(!P.floating)return C;const j=Yv(P.floating,d.x),I=Yv(P.floating,d.y);return l?{...C,transform:"translate("+j+"px, "+I+"px)",...P_(P.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:j,top:I}},[r,l,P.floating,d.x,d.y]);return h.useMemo(()=>({...d,update:A,refs:z,elements:P,floatingStyles:M}),[d,A,z,P,M])}const zR=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Gv({element:n.current,padding:s}).fn(r):{}:n?Gv({element:n,padding:s}).fn(r):{}}}},BR=(e,t)=>({...RR(e),options:[e,t]}),VR=(e,t)=>({...OR(e),options:[e,t]}),HR=(e,t)=>({...MR(e),options:[e,t]}),WR=(e,t)=>({...AR(e),options:[e,t]}),qR=(e,t)=>({...IR(e),options:[e,t]}),KR=(e,t)=>({...DR(e),options:[e,t]}),GR=(e,t)=>({...zR(e),options:[e,t]});var YR="Arrow",R_=h.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...o}=e;return i.jsx(ue.svg,{...o,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});R_.displayName=YR;var QR=R_;function lg(e){const[t,r]=h.useState(void 0);return yt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let a,l;if("borderBoxSize"in o){const c=o.borderBoxSize,u=Array.isArray(c)?c[0]:c;a=u.inlineSize,l=u.blockSize}else a=e.offsetWidth,l=e.offsetHeight;r({width:a,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var cg="Popper",[O_,hi]=Zt(cg),[JR,A_]=O_(cg),I_=e=>{const{__scopePopper:t,children:r}=e,[n,s]=h.useState(null);return i.jsx(JR,{scope:t,anchor:n,onAnchorChange:s,children:r})};I_.displayName=cg;var D_="PopperAnchor",M_=h.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,o=A_(D_,r),a=h.useRef(null),l=be(t,a);return h.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||a.current)}),n?null:i.jsx(ue.div,{...s,ref:l})});M_.displayName=D_;var ug="PopperContent",[ZR,XR]=O_(ug),L_=h.forwardRef((e,t)=>
vendor: 5,127 bytes, line 42
42{var V,le,ge,de,ne,q;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:o="center",alignOffset:a=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:w,...g}=e,b=A_(ug,r),[v,y]=h.useState(null),x=be(t,pe=>y(pe)),[_,S]=h.useState(null),k=lg(_),N=(k==null?void 0:k.width)??0,E=(k==null?void 0:k.height)??0,T=n+(o!=="center"?"-"+o:""),R=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},L=Array.isArray(u)?u:[u],O=L.length>0,A={padding:R,boundary:L.filter(t2),altBoundary:O},{refs:$,floatingStyles:z,placement:P,isPositioned:M,middlewareData:C}=UR({strategy:"fixed",placement:T,whileElementsMounted:(...pe)=>PR(...pe,{animationFrame:p==="always"}),elements:{reference:b.anchor},middleware:[BR({mainAxis:s+E,alignmentAxis:a}),c&&VR({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?HR():void 0,...A}),c&&WR({...A}),qR({...A,apply:({elements:pe,rects:Ce,availableWidth:Le,availableHeight:Ze})=>{const{width:K,height:xe}=Ce.reference,Ee=pe.floating.style;Ee.setProperty("--radix-popper-available-width",`${Le}px`),Ee.setProperty("--radix-popper-available-height",`${Ze}px`),Ee.setProperty("--radix-popper-anchor-width",`${K}px`),Ee.setProperty("--radix-popper-anchor-height",`${xe}px`)}}),_&&GR({element:_,padding:l}),r2({arrowWidth:N,arrowHeight:E}),m&&KR({strategy:"referenceHidden",...A})]}),[j,I]=U_(P),F=pt(w);yt(()=>{M&&(F==null||F())},[M,F]);const B=(V=C.arrow)==null?void 0:V.x,J=(le=C.arrow)==null?void 0:le.y,Z=((ge=C.arrow)==null?void 0:ge.centerOffset)!==0,[Se,je]=h.useState();return yt(()=>{v&&je(window.getComputedStyle(v).zIndex)},[v]),i.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:M?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Se,"--radix-popper-transform-origin":[(de=C.transformOrigin)==null?void 0:de.x,(ne=C.transformOrigin)==null?void 0:ne.y].join(" "),...((q=C.hide)==null?void 0:q.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(ZR,{scope:r,placedSide:j,onArrowChange:S,arrowX:B,arrowY:J,shouldHideArrow:Z,children:i.jsx(ue.div,{"data-side":j,"data-align":I,...g,ref:x,style:{...g.style,animation:M?void 0:"none"}})})})});L_.displayName=ug;var $_="PopperArrow",e2={top:"bottom",right:"left",bottom:"top",left:"right"},F_=h.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,o=XR($_,n),a=e2[o.placedSide];return i.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:i.jsx(QR,{...s,ref:r,style:{...s.style,display:"block"}})})});F_.displayName=$_;function t2(e){return e!==null}var r2=e=>({name:"transformOrigin",options:e,fn(t){var b,v,y;const{placement:r,rects:n,middlewareData:s}=t,a=((b=s.arrow)==null?void 0:b.centerOffset)!==0,l=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[u,d]=U_(r),f={start:"0%",center:"50%",end:"100%"}[d],m=(((v=s.arrow)==null?void 0:v.x)??0)+l/2,p=(((y=s.arrow)==null?void 0:y.y)??0)+c/2;let w="",g="";return u==="bottom"?(w=a?f:`${m}px`,g=`${-c}px`):u==="top"?(w=a?f:`${m}px`,g=`${n.floating.height+c}px`):u==="right"?(w=`${-c}px`,g=a?f:`${p}px`):u==="left"&&(w=`${n.floating.width+c}px`,g=a?f:`${p}px`),{data:{x:w,y:g}}}});function U_(e){const[t,r="center"]=e.split("-");return[t,r]}var Rd=I_,dg=M_,fg=L_,hg=F_,n2="Portal",Od=h.forwardRef((e,t)=>{var l;const{container:r,...n}=e,[s,o]=h.useState(!1);yt(()=>o(!0),[]);const a=r||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return a?h_.createPortal(i.jsx(ue.div,{...n,ref:t}),a):null});Od.displayName=n2;function s2(e,t){return h.useReducer((r,n)=>t[r][n]??r,e)}var It=e=>{const{present:t,children:r}=e,n=o2(t),s=typeof r=="function"?r({present:n.isPresent}):h.Children.only(r),o=be(n.ref,a2(s));return typeof r=="function"||n.isPresent?h.cloneElement(s,{ref:o}):null};It.displayName="Presence";function o2(e){const[t,r]=h.useState(),n=h.useRef(null),s=h.useRef(e),o=h.useRef("none"),a=e?"mounted":"unmounted",[l,c]=s2(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const u=Uc(n.current);o.current=l==="mounted"?u:"none"},[l]),yt(()=>{const u=n.current,d=s.current;if(d!==e){const m=o.current,p=Uc(u);e?c("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&m!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),yt(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=p=>{const g=Uc(n.current).includes(p.animationName);if(p.target===t&&g&&(c("ANIMATION_END"),!s.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},m=p=>
42{p.target===t&&(o.current=Uc(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),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(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function Uc(e){return(e==null?void 0:e.animationName)||"none"}function a2(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var i2=up[" useInsertionEffect ".trim().toString()]||yt;function gn({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,o,a]=l2({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:s;{const d=h.useRef(e!==void 0);h.useEffect(()=>{const f=d.current;f!==l&&console.warn(`${n} is changing from ${f?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=l},[l,n])}const u=h.useCallback(d=>{var f;if(l){const m=c2(d)?d(e):d;m!==e&&((f=a.current)==null||f.call(a,m))}else o(d)},[l,e,o,a]);return[c,u]}function l2({defaultProp:e,onChange:t}){const[r,n]=h.useState(e),s=h.useRef(r),o=h.useRef(t);return i2(()=>{o.current=t},[t]),h.useEffect(()=>{var a;s.current!==r&&((a=o.current)==null||a.call(o,r),s.current=r)},[r,s]),[r,n,o]}function c2(e){return typeof e=="function"}var z_=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),u2="VisuallyHidden",B_=h.forwardRef((e,t)=>i.jsx(ue.span,{...e,ref:t,style:{...z_,...e.style}}));B_.displayName=u2;var d2=B_,[Ad,X6]=Zt("Tooltip",[hi]),Id=hi(),V_="TooltipProvider",f2=700,mm="tooltip.open",[h2,mg]=Ad(V_),H_=e=>{const{__scopeTooltip:t,delayDuration:r=f2,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:o}=e,a=h.useRef(!0),l=h.useRef(!1),c=h.useRef(0);return h.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),i.jsx(h2,{scope:t,isOpenDelayedRef:a,delayDuration:r,onOpen:h.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:h.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:h.useCallback(u=>{l.current=u},[]),disableHoverableContent:s,children:o})};H_.displayName=V_;var Nl="Tooltip",[m2,Dd]=Ad(Nl),W_=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:s,onOpenChange:o,disableHoverableContent:a,delayDuration:l}=e,c=mg(Nl,e.__scopeTooltip),u=Id(t),[d,f]=h.useState(null),m=ir(),p=h.useRef(0),w=a??c.disableHoverableContent,g=l??c.delayDuration,b=h.useRef(!1),[v,y]=gn({prop:n,defaultProp:s??!1,onChange:N=>{N?(c.onOpen(),document.dispatchEvent(new CustomEvent(mm))):c.onClose(),o==null||o(N)},caller:Nl}),x=h.useMemo(()=>v?b.current?"delayed-open":"instant-open":"closed",[v]),_=h.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b.current=!1,y(!0)},[y]),S=h.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),k=h.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{b.current=!0,y(!0),p.current=0},g)},[g,y]);return h.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),i.jsx(Rd,{...u,children:i.jsx(m2,{scope:t,contentId:m,open:v,stateAttribute:x,trigger:d,onTriggerChange:f,onTriggerEnter:h.useCallback(()=>{c.isOpenDelayedRef.current?k():_()},[c.isOpenDelayedRef,k,_]),onTriggerLeave:h.useCallback(()=>{w?S():(window.clearTimeout(p.current),p.current=0)},[S,w]),onOpen:_,onClose:S,disableHoverableContent:w,children:r})})};W_.displayName=Nl;var pm="TooltipTrigger",q_=h.forwardRef((e,t)=>
vendor: 6,574 bytes, line 42
42{const{__scopeTooltip:r,...n}=e,s=Dd(pm,r),o=mg(pm,r),a=Id(r),l=h.useRef(null),c=be(t,l,s.onTriggerChange),u=h.useRef(!1),d=h.useRef(!1),f=h.useCallback(()=>u.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),i.jsx(dg,{asChild:!0,...a,children:i.jsx(ue.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:c,onPointerMove:Y(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:Y(e.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:Y(e.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Y(e.onFocus,()=>{u.current||s.onOpen()}),onBlur:Y(e.onBlur,s.onClose),onClick:Y(e.onClick,s.onClose)})})});q_.displayName=pm;var p2="TooltipPortal",[eB,g2]=Ad(p2,{forceMount:void 0}),Za="TooltipContent",K_=h.forwardRef((e,t)=>{const r=g2(Za,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,a=Dd(Za,e.__scopeTooltip);return i.jsx(It,{present:n||a.open,children:a.disableHoverableContent?i.jsx(G_,{side:s,...o,ref:t}):i.jsx(y2,{side:s,...o,ref:t})})}),y2=h.forwardRef((e,t)=>{const r=Dd(Za,e.__scopeTooltip),n=mg(Za,e.__scopeTooltip),s=h.useRef(null),o=be(t,s),[a,l]=h.useState(null),{trigger:c,onClose:u}=r,d=s.current,{onPointerInTransitChange:f}=n,m=h.useCallback(()=>{l(null),f(!1)},[f]),p=h.useCallback((w,g)=>{const b=w.currentTarget,v={x:w.clientX,y:w.clientY},y=_2(v,b.getBoundingClientRect()),x=S2(v,y),_=k2(g.getBoundingClientRect()),S=N2([...x,..._]);l(S),f(!0)},[f]);return h.useEffect(()=>()=>m(),[m]),h.useEffect(()=>{if(c&&d){const w=b=>p(b,d),g=b=>p(b,c);return c.addEventListener("pointerleave",w),d.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",w),d.removeEventListener("pointerleave",g)}}},[c,d,p,m]),h.useEffect(()=>{if(a){const w=g=>{const b=g.target,v={x:g.clientX,y:g.clientY},y=(c==null?void 0:c.contains(b))||(d==null?void 0:d.contains(b)),x=!j2(v,a);y?m():x&&(m(),u())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[c,d,a,u,m]),i.jsx(G_,{...e,ref:o})}),[v2,x2]=Ad(Nl,{isInside:!1}),w2=g_("TooltipContent"),G_=h.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:a,...l}=e,c=Dd(Za,r),u=Id(r),{onClose:d}=c;return h.useEffect(()=>(document.addEventListener(mm,d),()=>document.removeEventListener(mm,d)),[d]),h.useEffect(()=>{if(c.trigger){const f=m=>{const p=m.target;p!=null&&p.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),i.jsx(ec,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:i.jsxs(fg,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[i.jsx(w2,{children:n}),i.jsx(v2,{scope:r,isInside:!0,children:i.jsx(d2,{id:c.contentId,role:"tooltip",children:s||n})})]})})});K_.displayName=Za;var Y_="TooltipArrow",b2=h.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Id(r);return x2(Y_,r).isInside?null:i.jsx(hg,{...s,...n,ref:t})});b2.displayName=Y_;function _2(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,s,o)){case o:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function S2(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function k2(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function j2(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const l=t[o],c=t[a],u=l.x,d=l.y,f=c.x,m=c.y;d>n!=m>n&&r<(f-u)*(n-d)/(m-d)+u&&(s=!s)}return s}function N2(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),C2(t)}function C2(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const s=e[n];for(;t.length>=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(s.y-a.y)>=(o.y-a.y)*(s.x-a.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const o=r[r.length-1],a=r[r.length-2];if((o.x-a.x)*(s.y-a.y)>=(o.y-a.y)*(s.x-a.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var E2=H_,T2=W_,P2=q_,Q_=K_;function J_(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=J_(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Z_(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=J_(e))&&(n&&(n+=" "),n+=t);return n}const pg="-",R2=e=>{const t=A2(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{const l=a.split(pg);return l[0]===""&&l.length!==1&&l.shift(),X_(l,t)||O2(a)},getConflictingClassGroupIds:(a,l)=>{const c=r[a]||[];return l&&n[a]?[...c,...n[a]]:c}}},X_=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?X_(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(pg);return(a=t.validators.find(({validator:l})=>l(o)))==null?void 0:a.classGroupId},Qv=/^\[(.+)\]$/,O2=e=>{if(Qv.test(e)){const t=Qv.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},A2=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return D2(Object.entries(e.classGroups),r).forEach(([o,a])=>{gm(a,n,o,t)}),n},gm=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:Jv(t,s);o.classGroupId=r;return}if(typeof s=="function"){if(I2(s)){gm(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}
vendor: 4,829 bytes, line 42
42Object.entries(s).forEach(([o,a])=>{gm(a,Jv(t,o),r,n)})})},Jv=(e,t)=>{let r=e;return t.split(pg).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},I2=e=>e.isThemeGetter,D2=(e,t)=>t?e.map(([r,n])=>{const s=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,l])=>[t+a,l])):o);return[r,s]}):e,M2=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(o,a)=>{r.set(o,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(o){let a=r.get(o);if(a!==void 0)return a;if((a=n.get(o))!==void 0)return s(o,a),a},set(o,a){r.has(o)?r.set(o,a):s(o,a)}}},e1="!",L2=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],o=t.length,a=l=>{const c=[];let u=0,d=0,f;for(let b=0;b<l.length;b++){let v=l[b];if(u===0){if(v===s&&(n||l.slice(b,b+o)===t)){c.push(l.slice(d,b)),d=b+o;continue}if(v==="/"){f=b;continue}}v==="["?u++:v==="]"&&u--}const m=c.length===0?l:l.substring(d),p=m.startsWith(e1),w=p?m.substring(1):m,g=f&&f>d?f-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:w,maybePostfixModifierPosition:g}};return r?l=>r({className:l,parseClassName:a}):a},$2=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},F2=e=>({cache:M2(e.cacheSize),parseClassName:L2(e),...R2(e)}),U2=/\s+/,z2=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,o=[],a=e.trim().split(U2);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{modifiers:d,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:p}=r(u);let w=!!p,g=n(w?m.substring(0,p):m);if(!g){if(!w){l=u+(l.length>0?" "+l:l);continue}if(g=n(m),!g){l=u+(l.length>0?" "+l:l);continue}w=!1}const b=$2(d).join(":"),v=f?b+e1:b,y=v+g;if(o.includes(y))continue;o.push(y);const x=s(g,w);for(let _=0;_<x.length;++_){const S=x[_];o.push(v+S)}l=u+(l.length>0?" "+l:l)}return l};function B2(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=t1(t))&&(n&&(n+=" "),n+=r);return n}const t1=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=t1(e[n]))&&(r&&(r+=" "),r+=t);return r};function V2(e,...t){let r,n,s,o=a;function a(c){const u=t.reduce((d,f)=>f(d),e());return r=F2(u),n=r.cache.get,s=r.cache.set,o=l,l(c)}function l(c){const u=n(c);if(u)return u;const d=z2(c,r);return s(c,d),d}return function(){return o(B2.apply(null,arguments))}}const Be=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},r1=/^\[(?:([a-z-]+):)?(.+)\]$/i,H2=/^\d+\/\d+$/,W2=new Set(["px","full","screen"]),q2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,K2=/\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$/,G2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Y2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Q2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,_n=e=>Pa(e)||W2.has(e)||H2.test(e),Zn=e=>mi(e,"length",sO),Pa=e=>!!e&&!Number.isNaN(Number(e)),zf=e=>mi(e,"number",Pa),Pi=e=>!!e&&Number.isInteger(Number(e)),J2=e=>e.endsWith("%")&&Pa(e.slice(0,-1)),_e=e=>r1.test(e),Xn=e=>q2.test(e),Z2=new Set(["length","size","percentage"]),X2=e=>mi(e,Z2,n1),eO=e=>mi(e,"position",n1),tO=new Set(["image","url"]),rO=e=>mi(e,tO,aO),nO=e=>mi(e,"",oO),Ri=()=>!0,mi=(e,t,r)=>{const n=r1.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},sO=e=>K2.test(e)&&!G2.test(e),n1=()=>!1,oO=e=>Y2.test(e),aO=e=>Q2.test(e),iO=()=>{const e=Be("colors"),t=Be("spacing"),r=Be("blur"),n=Be("brightness"),s=Be("borderColor"),o=Be("borderRadius"),a=Be("borderSpacing"),l=Be("borderWidth"),c=Be("contrast"),u=Be("grayscale"),d=Be("hueRotate"),f=Be("invert"),m=Be("gap"),p=Be("gradientColorStops"),w=Be("gradientColorStopPositions"),g=Be("inset"),b=Be("margin"),v=Be("opacity"),y=Be("padding"),x=Be("saturate"),_=Be("scale"),S=Be("sepia"),k=Be("skew"),N=Be("space"),E=Be("translate"),T=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",_e,t],O=()=>[_e,t],A=()=>["",_n,Zn],$=()=>["auto",Pa,_e],z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],P=()=>["solid","dashed","dotted","double","none"],M=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],C=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",_e],I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[Pa,_e];return{cacheSize:500,separator:":",theme:{colors:[Ri],spacing:[_n,Zn],blur:["none","",Xn,_e],brightness:F(),borderColor:[e],borderRadius:["n
42one","","full",Xn,_e],borderSpacing:O(),borderWidth:A(),contrast:F(),grayscale:j(),hueRotate:F(),invert:j(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[J2,Zn],inset:L(),margin:L(),opacity:F(),padding:O(),saturate:F(),scale:F(),sepia:j(),skew:F(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",_e]}],container:["container"],columns:[{columns:[Xn]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"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:[...z(),_e]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Pi,_e]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",_e]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",Pi,_e]}],"grid-cols":[{"grid-cols":[Ri]}],"col-start-end":[{col:["auto",{span:["full",Pi,_e]},_e]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[Ri]}],"row-start-end":[{row:["auto",{span:[Pi,_e]},_e]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",_e]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",_e]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...C()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...C(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...C(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[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":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",_e,t]}],"min-w":[{"min-w":[_e,t,"min","max","fit"]}],"max-w":[{"max-w":[_e,t,"none","full","min","max","fit","prose",{screen:[Xn]},Xn]}],h:[{h:[_e,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[_e,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[_e,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[_e,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Xn,Zn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",zf]}],"font-family":[{font:[Ri]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",_e]}],"line-clamp":[{"line-clamp":["none",Pa,zf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",_n,_e]}],"list-image":[{"list-image":["none",_e]}],"list-style-type":[{list:["none","disc","decimal",_e]}],"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:[...P(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",_n,Zn]}],"underline-offset":[{"underline-offset":["auto",_n,_e]}],"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:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_e]}],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",_e]}],"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:[...z(),eO]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",X2]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},rO]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}
vendor: 4,885 bytes, line 42
42],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...P(),"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:P()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...P()]}],"outline-offset":[{"outline-offset":[_n,_e]}],"outline-w":[{outline:[_n,Zn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:A()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[_n,Zn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Xn,nO]}],"shadow-color":[{shadow:[Ri]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...M(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":M()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Xn,_e]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[x]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",_e]}],duration:[{duration:F()}],ease:[{ease:["linear","in","out","in-out",_e]}],delay:[{delay:F()}],animate:[{animate:["none","spin","ping","pulse","bounce",_e]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[Pi,_e]}],"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",_e]}],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",_e]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}
42],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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"]}],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",_e]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[_n,Zn,zf]}],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"]}}},lO=V2(iO);function D(...e){return lO(Z_(e))}const du="https://images.smackah.com",fu=/https?:\/\/[a-z0-9-]+\.supabase\.co\/storage\/v1\/object\/public\/email-images\//gi;function tB(e){return e?e.startsWith(du+"/")?e:fu.test(e)?(fu.lastIndex=0,e.replace(fu,`${du}/`)):/^https?:\/\//i.test(e)?e:`${du}/${e.replace(/^\/+/,"")}`:""}function rB(e){return e&&e.replace(fu,`${du}/`)}const cO=E2,nB=T2,sB=P2,uO=h.forwardRef(({className:e,sideOffset:t=4,...r},n)=>i.jsx(Q_,{ref:n,sideOffset:t,className:D("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),...r}));uO.displayName=Q_.displayName;var Md=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(){}},Ld=typeof window>"u"||"Deno"in globalThis;function Mr(){}function dO(e,t){return typeof e=="function"?e(t):e}function fO(e){return typeof e=="number"&&e>=0&&e!==1/0}function hO(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ym(e,t){return typeof e=="function"?e(t):e}function mO(e,t){return typeof e=="function"?e(t):e}function Zv(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:o,queryKey:a,stale:l}=e;if(a){if(n){if(t.queryHash!==gg(a,t.options))return!1}else if(!El(t.queryKey,a))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||o&&!o(t))}function Xv(e,t){const{exact:r,status:n,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(Cl(t.options.mutationKey)!==Cl(o))return!1}else if(!El(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function gg(e,t){return((t==null?void 0:t.queryKeyHashFn)||Cl)(e)}function Cl(e){return JSON.stringify(e,(t,r)=>vm(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function El(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>El(e[r],t[r])):!1}function s1(e,t){if(e===t)return e;const r=ex(e)&&ex(t);
vendor: 14,111 bytes, line 42
42if(r||vm(e)&&vm(t)){const n=r?e:Object.keys(e),s=n.length,o=r?t:Object.keys(t),a=o.length,l=r?[]:{},c=new Set(n);let u=0;for(let d=0;d<a;d++){const f=r?d:o[d];(!r&&c.has(f)||r)&&e[f]===void 0&&t[f]===void 0?(l[f]=void 0,u++):(l[f]=s1(e[f],t[f]),l[f]===e[f]&&e[f]!==void 0&&u++)}return s===a&&u===s?e:l}return t}function oB(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function ex(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function vm(e){if(!tx(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!tx(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function tx(e){return Object.prototype.toString.call(e)==="[object Object]"}function pO(e){return new Promise(t=>{setTimeout(t,e)})}function gO(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?s1(e,t):t}function yO(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function vO(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var yg=Symbol();function o1(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===yg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function aB(e,t){return typeof e=="function"?e(...t):!!e}var fo,ds,Ma,K0,xO=(K0=class extends Md{constructor(){super();Re(this,fo);Re(this,ds);Re(this,Ma);we(this,Ma,t=>{if(!Ld&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){U(this,ds)||this.setEventListener(U(this,Ma))}onUnsubscribe(){var t;this.hasListeners()||((t=U(this,ds))==null||t.call(this),we(this,ds,void 0))}setEventListener(t){var r;we(this,Ma,t),(r=U(this,ds))==null||r.call(this),we(this,ds,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){U(this,fo)!==t&&(we(this,fo,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof U(this,fo)=="boolean"?U(this,fo):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},fo=new WeakMap,ds=new WeakMap,Ma=new WeakMap,K0),a1=new xO,La,fs,$a,G0,wO=(G0=class extends Md{constructor(){super();Re(this,La,!0);Re(this,fs);Re(this,$a);we(this,$a,t=>{if(!Ld&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){U(this,fs)||this.setEventListener(U(this,$a))}onUnsubscribe(){var t;this.hasListeners()||((t=U(this,fs))==null||t.call(this),we(this,fs,void 0))}setEventListener(t){var r;we(this,$a,t),(r=U(this,fs))==null||r.call(this),we(this,fs,t(this.setOnline.bind(this)))}setOnline(t){U(this,La)!==t&&(we(this,La,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return U(this,La)}},La=new WeakMap,fs=new WeakMap,$a=new WeakMap,G0),Wu=new wO;function bO(){let e,t;const r=new Promise((s,o)=>{e=s,t=o});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}function _O(e){return Math.min(1e3*2**e,3e4)}function i1(e){return(e??"online")==="online"?Wu.isOnline():!0}var l1=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Bf(e){return e instanceof l1}function c1(e){let t=!1,r=0,n=!1,s;const o=bO(),a=g=>{var b;n||(m(new l1(g)),(b=e.abort)==null||b.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>a1.isFocused()&&(e.networkMode==="always"||Wu.isOnline())&&e.canRun(),d=()=>i1(e.networkMode)&&e.canRun(),f=g=>{var b;n||(n=!0,(b=e.onSuccess)==null||b.call(e,g),s==null||s(),o.resolve(g))},m=g=>{var b;n||(n=!0,(b=e.onError)==null||b.call(e,g),s==null||s(),o.reject(g))},p=()=>new Promise(g=>{var b;s=v=>{(n||u())&&g(v)},(b=e.onPause)==null||b.call(e)}).then(()=>{var g;s=void 0,n||(g=e.onContinue)==null||g.call(e)}),w=()=>{if(n)return;let g;const b=r===0?e.initialPromise:void 0;try{g=b??e.fn()}catch(v){g=Promise.reject(v)}Promise.resolve(g).then(f).catch(v=>{var k;if(n)return;const y=e.retry??(Ld?0:3),x=e.retryDelay??_O,_=typeof x=="function"?x(r,v):x,S=y===!0||typeof y=="number"&&r<y||typeof y=="function"&&y(r,v);if(t||!S){m(v);return}r++,(k=e.onFail)==null||k.call(e,r,v),pO(_).then(()=>u()?void 0:p()).then(()=>{t?m(v):w()})})};return{promise:o,cancel:a,continue:()=>(s==null||s(),o),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?w():p().then(w),o)}}var SO=e=>setTimeout(e,0);function kO(){let e=[],t=0,r=l=>{l()},n=l=>{l()},s=SO;const o=l=>{t?e.push(l):s(()=>{r(l)})},a=()=>{const l=e;e=[],l.length&&s(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||a()}return c},batchCalls:l=>(...c)=>{o(()=>{l(...c)})},schedule:o,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{s=l}}}var $t=kO(),ho,Y0,u1=(Y0=class{constructor(){Re(this,ho)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),fO(this.gcTime)&&we(this,ho,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ld?1/0:5*60*1e3))}clearGcTimeout(){U(this,ho)&&(clearTimeout(U(this,ho)),we(this,ho,void 0))}},ho=new WeakMap,Y0),Fa,mo,pr,po,Et,ql,go,$r,Sn,Q0,jO=(Q0=class extends u1{constructor(t){super();Re(this,$r);Re(this,Fa);Re(this,mo);Re(this,pr);Re(this,po);Re(this,Et);Re(this,ql);Re(this,go);we(this,go,!1),we(this,ql,t.defaultOptions),this.setOptions(t.options),this.observers=[],we(this,po,t.client),we(this,pr,U(this,po).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,we(this,Fa,CO(this.options)),this.state=t.state??U(this,Fa),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=U(this,Et))==null?void 0:t.promise}setOptions(t){this.options={...U(this,ql),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&U(this,pr).remove(this)}setData(t,r){const n=gO(this.state.data,t,this.options);return jt(this,$r,Sn).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){jt(this,$r,Sn).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,s;const r=(n=U(this,Et))==null?void 0:n.promise;return(s=U(this,Et))==null||s.cancel(t),r?r.then(Mr).catch(Mr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(U(this,Fa))}isActive(){return this.observers.some(t=>mO(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===yg||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>ym(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!hO(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=U(this,Et))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=U(this,Et))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),U(this,pr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(U(this,Et)&&(U(this,go)?U(this,Et).cancel({revert:!0}):U(this,Et).cancelRetry()),this.scheduleGc()),U(this,pr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||jt(this,$r,Sn).call(this,{type:"invalidate"})}fetch(t,r){var u,d,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(U(this,Et))return U(this,Et).continueRetry(),U(this,Et).promise}if(t&&this.setOptions(t),!this.options.queryFn){const m=this.observers.find(p=>p.options.queryFn);m&&this.setOptions(m.options)}const n=new AbortController,s=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(we(this,go,!0),n.signal)})},o=()=>{const m=o1(this.options,r),w=(()=>{const g={client:U(this,po),queryKey:this.queryKey,meta:this.meta};return s(g),g})();return we(this,go,!1),this.options.persister?this.options.persister(m,w,this):m(w)},l=(()=>{const m={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:U(this,po),state:this.state,fetchFn:o};return s(m),m})();(u=this.options.behavior)==null||u.onFetch(l,this),we(this,mo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&jt(this,$r,Sn).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta});const c=m=>{var p,w,g,b;Bf(m)&&m.silent||jt(this,$r,Sn).call(this,{type:"error",error:m}),Bf(m)||((w=(p=U(this,pr).config).onError)==null||w.call(p,m,this),(b=(g=U(this,pr).config).onSettled)==null||b.call(g,this.state.data,m,this)),this.scheduleGc()};return we(this,Et,c1({initialPromise:r==null?void 0:r.initialPromise,fn:l.fetchFn,abort:n.abort.bind(n),onSuccess:m=>{var p,w,g,b;if(m===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(m)}catch(v){c(v);return}(w=(p=U(this,pr).config).onSuccess)==null||w.call(p,m,this),(b=(g=U(this,pr).config).onSettled)==null||b.call(g,m,this.state.error,this),this.scheduleGc()},onError:c,onFail:(m,p)=>{jt(this,$r,Sn).call(this,{type:"failed",failureCount:m,error:p})},onPause:()=>{jt(this,$r,Sn).call(this,{type:"pause"})},onContinue:()=>{jt(this,$r,Sn).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),U(this,Et).start()}},Fa=new WeakMap,mo=new WeakMap,pr=new WeakMap,po=new WeakMap,Et=new WeakMap,ql=new WeakMap,go=new WeakMap,$r=new WeakSet,Sn=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...NO(n.data,this.options),fetchMeta:t.meta??null};case"success":return we(this,mo,void 0),{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return Bf(s)&&s.revert&&U(this,mo)?{...U(this,mo),fetchStatus:"idle"}:{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),$t.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),U(this,pr).notify({query:this,type:"updated",action:t})})},Q0);function NO(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:i1(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function CO(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var nn,J0,EO=(J0=class extends Md{constructor(t={}){super();Re(this,nn);this.config=t,we(this,nn,new Map)}build(t,r,n){const s=r.queryKey,o=r.queryHash??gg(s,r);let a=this.get(o);return a||(a=new jO({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(a)),a}add(t){U(this,nn).has(t.queryHash)||(U(this,nn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=U(this,nn).get(t.queryHash);r&&(t.destroy(),r===t&&U(this,nn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){$t.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return U(this,nn).get(t)}getAll(){return[...U(this,nn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Zv(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Zv(t,n)):r}notify(t){$t.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){$t.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){$t.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},nn=new WeakMap,J0),sn,Mt,yo,on,rs,Z0,TO=(Z0=class extends u1{constructor(t){super();Re(this,on);Re(this,sn);Re(this,Mt);Re(this,yo);this.mutationId=t.mutationId,we(this,Mt,t.mutationCache),we(this,sn,[]),this.state=t.state||PO(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){U(this,sn).includes(t)||(U(this,sn).push(t),this.clearGcTimeout(),U(this,Mt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){we(this,sn,U(this,sn).filter(r=>r!==t)),this.scheduleGc(),U(this,Mt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){U(this,sn).length||(this.state.status==="pending"?this.scheduleGc():U(this,Mt).remove(this))}continue(){var t;return((t=U(this,yo))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,a,l,c,u,d,f,m,p,w,g,b,v,y,x,_,S,k,N,E;const r=()=>
42{jt(this,on,rs).call(this,{type:"continue"})};we(this,yo,c1({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(T,R)=>{jt(this,on,rs).call(this,{type:"failed",failureCount:T,error:R})},onPause:()=>{jt(this,on,rs).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>U(this,Mt).canRun(this)}));const n=this.state.status==="pending",s=!U(this,yo).canStart();try{if(n)r();else{jt(this,on,rs).call(this,{type:"pending",variables:t,isPaused:s}),await((a=(o=U(this,Mt).config).onMutate)==null?void 0:a.call(o,t,this));const R=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));R!==this.state.context&&jt(this,on,rs).call(this,{type:"pending",context:R,variables:t,isPaused:s})}const T=await U(this,yo).start();return await((d=(u=U(this,Mt).config).onSuccess)==null?void 0:d.call(u,T,t,this.state.context,this)),await((m=(f=this.options).onSuccess)==null?void 0:m.call(f,T,t,this.state.context)),await((w=(p=U(this,Mt).config).onSettled)==null?void 0:w.call(p,T,null,this.state.variables,this.state.context,this)),await((b=(g=this.options).onSettled)==null?void 0:b.call(g,T,null,t,this.state.context)),jt(this,on,rs).c
42all(this,{type:"success",data:T}),T}catch(T){try{throw await((y=(v=U(this,Mt).config).onError)==null?void 0:y.call(v,T,t,this.state.context,this)),await((_=(x=this.options).onError)==null?void 0:_.call(x,T,t,this.state.context)),await((k=(S=U(this,Mt).config).onSettled)==null?void 0:k.call(S,void 0,T,this.state.variables,this.state.context,this)),await((E=(N=this.options).onSettled)==null?void 0:E.call(N,void 0,T,t,this.state.context)),T}finally{jt(this,on,rs).call(this,{type:"error",error:T})}}finally{U(this,Mt).runNext(this)}}},sn=new WeakMap,Mt=new WeakMap,yo=new WeakMap,on=new WeakSet,rs=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,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{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),$t.batch(()=>{U(this,sn).forEach(n=>{n.onMutationUpdate(t)}),U(this,Mt).notify({mutation:this,type:"updated",action:t})})},Z0);function PO(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Cn,Fr,Kl,X0,RO=(X0=class extends Md{constructor(t={}){super();Re(this,Cn);Re(this,Fr);Re(this,Kl);this.config=t,we(this,Cn,new Set),we(this,Fr,new Map),we(this,Kl,0)}build(t,r,n){const s=new TO({mutationCache:this,mutationId:++wc(this,Kl)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){U(this,Cn).add(t);const r=zc(t);if(typeof r=="string"){const n=U(this,Fr).get(r);n?n.push(t):U(this,Fr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(U(this,Cn).delete(t)){const r=zc(t);if(typeof r=="string"){const n=U(this,Fr).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&U(this,Fr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=zc(t);if(typeof r=="string"){const n=U(this,Fr).get(r),s=n==null?void 0:n.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=zc(t);if(typeof r=="string"){const s=(n=U(this,Fr).get(r))==null?void 0:n.find(o=>o!==t&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){$t.batch(()=>{U(this,Cn).forEach(t=>{this.notify({type:"removed",mutation:t})}),U(this,Cn).clear(),U(this,Fr).clear()})}getAll(){return Array.from(U(this,Cn))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Xv(r,n))}findAll(t={}){return this.getAll().filter(r=>Xv(t,r))}notify(t){$t.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>
vendor: 7,019 bytes, lines 42-51
42r.state.isPaused);return $t.batch(()=>Promise.all(t.map(r=>r.continue().catch(Mr))))}},Cn=new WeakMap,Fr=new WeakMap,Kl=new WeakMap,X0);function zc(e){var t;return(t=e.options.scope)==null?void 0:t.id}function rx(e){return{onFetch:(t,r)=>{var d,f,m,p,w;const n=t.options,s=(m=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:m.direction,o=((p=t.state.data)==null?void 0:p.pages)||[],a=((w=t.state.data)==null?void 0:w.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let g=!1;const b=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},v=o1(t.options,t.fetchOptions),y=async(x,_,S)=>{if(g)return Promise.reject();if(_==null&&x.pages.length)return Promise.resolve(x);const N=(()=>{const L={client:t.client,queryKey:t.queryKey,pageParam:_,direction:S?"backward":"forward",meta:t.options.meta};return b(L),L})(),E=await v(N),{maxPages:T}=t.options,R=S?vO:yO;return{pages:R(x.pages,E,T),pageParams:R(x.pageParams,_,T)}};if(s&&o.length){const x=s==="backward",_=x?OO:nx,S={pages:o,pageParams:a},k=_(n,S);l=await y(S,k,x)}else{const x=e??o.length;do{const _=c===0?a[0]??n.initialPageParam:nx(n,l);if(c>0&&_==null)break;l=await y(l,_),c++}while(c<x)}return l};t.options.persister?t.fetchFn=()=>{var g,b;return(b=(g=t.options).persister)==null?void 0:b.call(g,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function nx(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function OO(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Xe,hs,ms,Ua,za,ps,Ba,Va,ew,AO=(ew=class{constructor(e={}){Re(this,Xe);Re(this,hs);Re(this,ms);Re(this,Ua);Re(this,za);Re(this,ps);Re(this,Ba);Re(this,Va);we(this,Xe,e.queryCache||new EO),we(this,hs,e.mutationCache||new RO),we(this,ms,e.defaultOptions||{}),we(this,Ua,new Map),we(this,za,new Map),we(this,ps,0)}mount(){wc(this,ps)._++,U(this,ps)===1&&(we(this,Ba,a1.subscribe(async e=>{e&&(await this.resumePausedMutations(),U(this,Xe).onFocus())})),we(this,Va,Wu.subscribe(async e=>{e&&(await this.resumePausedMutations(),U(this,Xe).onOnline())})))}unmount(){var e,t;wc(this,ps)._--,U(this,ps)===0&&((e=U(this,Ba))==null||e.call(this),we(this,Ba,void 0),(t=U(this,Va))==null||t.call(this),we(this,Va,void 0))}isFetching(e){return U(this,Xe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return U(this,hs).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=U(this,Xe).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=U(this,Xe).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(ym(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return U(this,Xe).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=U(this,Xe).get(n.queryHash),o=s==null?void 0:s.state.data,a=dO(t,o);if(a!==void 0)return U(this,Xe).build(this,n).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return $t.batch(()=>U(this,Xe).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=U(this,Xe).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=U(this,Xe);$t.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=U(this,Xe);return $t.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=$t.batch(()=>U(this,Xe).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(Mr).catch(Mr)}invalidateQueries(e,t={}){return $t.batch(()=>(U(this,Xe).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=$t.batch(()=>U(this,Xe).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,r);return r.throwOnError||(o=o.catch(Mr)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(Mr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=U(this,Xe).build(this,t);return r.isStaleByTime(ym(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Mr).catch(Mr)}fetchInfiniteQuery(e){return e.behavior=rx(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Mr).catch(Mr)}ensureInfiniteQueryData(e){return e.behavior=rx(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Wu.isOnline()?U(this,hs).resumePausedMutations():Promise.resolve()}getQueryCache(){return U(this,Xe)}getMutationCache(){return U(this,hs)}getDefaultOptions(){return U(this,ms)}setDefaultOptions(e){we(this,ms,e)}setQueryDefaults(e,t){U(this,Ua).set(Cl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...U(this,Ua).values()],r={};return t.forEach(n=>{El(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){U(this,za).set(Cl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...U(this,za).values()],r={};return t.forEach(n=>{El(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...U(this,ms).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=gg(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===yg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...U(this,ms).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){U(this,Xe).clear(),U(this,hs).clear()}},Xe=new WeakMap,hs=new WeakMap,ms=new WeakMap,Ua=new WeakMap,za=new WeakMap,ps=new WeakMap,Ba=new WeakMap,Va=new WeakMap,ew),d1=h.createContext(void 0),iB=e=>{const t=h.useContext(d1);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},IO=({client:e,children:t})=>(h.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(d1.Provider,{value:e,children:t}));/** 43 * @remix-run/router v1.23.0 44 * 45 * Copyright (c) Remix Software Inc. 46 * 47 * This source code is licensed under the MIT license found in the 48 * LICENSE.md file in the root directory of this source tree. 49 * 50 * @license MIT 51 */function Tl(){return Tl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
vendor: 4,463 bytes, line 51
51for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tl.apply(this,arguments)}var vs;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(vs||(vs={}));const sx="popstate";function DO(e){e===void 0&&(e={});function t(n,s){let{pathname:o,search:a,hash:l}=n.location;return xm("",{pathname:o,search:a,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function r(n,s){return typeof s=="string"?s:qu(s)}return LO(t,r,null,e)}function st(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function f1(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function MO(){return Math.random().toString(36).substr(2,8)}function ox(e,t){return{usr:e.state,key:e.key,idx:t}}function xm(e,t,r,n){return r===void 0&&(r=null),Tl({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?pi(t):t,{state:r,key:t&&t.key||n||MO()})}function qu(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function pi(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function LO(e,t,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:o=!1}=n,a=s.history,l=vs.Pop,c=null,u=d();u==null&&(u=0,a.replaceState(Tl({},a.state,{idx:u}),""));function d(){return(a.state||{idx:null}).idx}function f(){l=vs.Pop;let b=d(),v=b==null?null:b-u;u=b,c&&c({action:l,location:g.location,delta:v})}function m(b,v){l=vs.Push;let y=xm(g.location,b,v);u=d()+1;let x=ox(y,u),_=g.createHref(y);try{a.pushState(x,"",_)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;s.location.assign(_)}o&&c&&c({action:l,location:g.location,delta:1})}function p(b,v){l=vs.Replace;let y=xm(g.location,b,v);u=d();let x=ox(y,u),_=g.createHref(y);a.replaceState(x,"",_),o&&c&&c({action:l,location:g.location,delta:0})}function w(b){let v=s.location.origin!=="null"?s.location.origin:s.location.href,y=typeof b=="string"?b:qu(b);return y=y.replace(/ $/,"%20"),st(v,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,v)}let g={get action(){return l},get location(){return e(s,a)},listen(b){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(sx,f),c=b,()=>{s.removeEventListener(sx,f),c=null}},createHref(b){return t(s,b)},createURL:w,encodeLocation(b){let v=w(b);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:m,replace:p,go(b){return a.go(b)}};return g}var ax;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(ax||(ax={}));function $O(e,t,r){return r===void 0&&(r="/"),FO(e,t,r,!1)}function FO(e,t,r,n){let s=typeof t=="string"?pi(t):t,o=vg(s.pathname||"/",r);if(o==null)return null;let a=h1(e);UO(a);let l=null;for(let c=0;l==null&&c<a.length;++c){let u=JO(o);l=YO(a[c],u,n)}return l}function h1(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let s=(o,a,l)=>{let c={relativePath:l===void 0?o.path||"":l,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};c.relativePath.startsWith("/")&&(st(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let u=Es([n,c.relativePath]),d=r.concat(c);o.children&&o.children.length>0&&(st(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),h1(o.children,t,d,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:KO(u,o.index),routesMeta:d})};return e.forEach((o,a)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))s(o,a);else for(let c of m1(o.path))s(o,a,c)}),t}function m1(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,s=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return s?[o,""]:[o];let a=m1(n.join("/")),l=[];return l.push(...a.map(c=>c===""?o:[o,c].join("/"))),s&&l.push(...a),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function UO(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:GO(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const zO=/^:[\w-]+$/,BO=3,VO=2,HO=1,WO=10,qO=-2,ix=e=>e==="*";function KO(e,t){let r=e.split("/"),n=r.length;
vendor: 10,060 bytes, lines 51-60
51return r.some(ix)&&(n+=qO),t&&(n+=VO),r.filter(s=>!ix(s)).reduce((s,o)=>s+(zO.test(o)?BO:o===""?HO:WO),n)}function GO(e,t){return e.length===t.length&&e.slice(0,-1).every((n,s)=>n===t[s])?e[e.length-1]-t[t.length-1]:0}function YO(e,t,r){let{routesMeta:n}=e,s={},o="/",a=[];for(let l=0;l<n.length;++l){let c=n[l],u=l===n.length-1,d=o==="/"?t:t.slice(o.length)||"/",f=lx({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),m=c.route;if(!f&&u&&r&&!n[n.length-1].route.index&&(f=lx({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!f)return null;Object.assign(s,f.params),a.push({params:s,pathname:Es([o,f.pathname]),pathnameBase:tA(Es([o,f.pathnameBase])),route:m}),f.pathnameBase!=="/"&&(o=Es([o,f.pathnameBase]))}return a}function lx(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=QO(e.path,e.caseSensitive,e.end),s=t.match(r);if(!s)return null;let o=s[0],a=o.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:n.reduce((u,d,f)=>{let{paramName:m,isOptional:p}=d;if(m==="*"){let g=l[f]||"";a=o.slice(0,o.length-g.length).replace(/(.)\/+$/,"$1")}const w=l[f];return p&&!w?u[m]=void 0:u[m]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:a,pattern:e}}function QO(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),f1(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 n=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),n]}function JO(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return f1(!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 vg(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function ZO(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:s=""}=typeof e=="string"?pi(e):e;return{pathname:r?r.startsWith("/")?r:XO(r,t):t,search:rA(n),hash:nA(s)}}function XO(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?r.length>1&&r.pop():s!=="."&&r.push(s)}),r.length>1?r.join("/"):"/"}function Vf(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function eA(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function xg(e,t){let r=eA(e);return t?r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function wg(e,t,r,n){n===void 0&&(n=!1);let s;typeof e=="string"?s=pi(e):(s=Tl({},e),st(!s.pathname||!s.pathname.includes("?"),Vf("?","pathname","search",s)),st(!s.pathname||!s.pathname.includes("#"),Vf("#","pathname","hash",s)),st(!s.search||!s.search.includes("#"),Vf("#","search","hash",s)));let o=e===""||s.pathname==="",a=o?"/":s.pathname,l;if(a==null)l=r;else{let f=t.length-1;if(!n&&a.startsWith("..")){let m=a.split("/");for(;m[0]==="..";)m.shift(),f-=1;s.pathname=m.join("/")}l=f>=0?t[f]:"/"}let c=ZO(s,l),u=a&&a!=="/"&&a.endsWith("/"),d=(o||a===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Es=e=>e.join("/").replace(/\/\/+/g,"/"),tA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),rA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,nA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function sA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const p1=["post","put","patch","delete"];new Set(p1);const oA=["get",...p1];new Set(oA);/** 52 * React Router v6.30.1 53 * 54 * Copyright (c) Remix Software Inc. 55 * 56 * This source code is licensed under the MIT license found in the 57 * LICENSE.md file in the root directory of this source tree. 58 * 59 * @license MIT 60 */function Pl(){return Pl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pl.apply(this,arguments)}const bg=h.createContext(null),aA=h.createContext(null),Vs=h.createContext(null),$d=h.createContext(null),zn=h.createContext({outlet:null,matches:[],isDataRoute:!1}),g1=h.createContext(null);function iA(e,t){let{relative:r}=t===void 0?{}:t;gi()||st(!1);let{basename:n,navigator:s}=h.useContext(Vs),{hash:o,pathname:a,search:l}=v1(e,{relative:r}),c=a;return n!=="/"&&(c=a==="/"?n:Es([n,a])),s.createHref({pathname:c,search:l,hash:o})}function gi(){return h.useContext($d)!=null}function Xr(){return gi()||st(!1),h.useContext($d).location}function y1(e){h.useContext(Vs).static||h.useLayoutEffect(e)}function Hs(){let{isDataRoute:e}=h.useContext(zn);return e?wA():lA()}function lA(){gi()||st(!1);let e=h.useContext(bg),{basename:t,future:r,navigator:n}=h.useContext(Vs),{matches:s}=h.useContext(zn),{pathname:o}=Xr(),a=JSON.stringify(xg(s,r.v7_relativeSplatPath)),l=h.useRef(!1);return y1(()=>{l.current=!0}),h.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){n.go(u);return}let f=wg(u,JSON.parse(a),o,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Es([t,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[t,n,a,o,e])}function lB(){let{matches:e}=h.useContext(zn),t=e[e.length-1];return t?t.params:{}}function v1(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=h.useContext(Vs),{matches:s}=h.useContext(zn),{pathname:o}=Xr(),a=JSON.stringify(xg(s,n.v7_relativeSplatPath));return h.useMemo(()=>wg(e,JSON.parse(a),o,r==="path"),[e,a,o,r])}function cA(e,t){return uA(e,t)}function uA(e,t,r,n){gi()||st(!1);let{navigator:s}=h.useContext(Vs),{matches:o}=h.useContext(zn),a=o[o.length-1],l=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let u=Xr(),d;if(t){var f;let b=typeof t=="string"?pi(t):t;c==="/"||(f=b.pathname)!=null&&f.startsWith(c)||st(!1),d=b}else d=u;let m=d.pathname||"/",p=m;if(c!=="/"){let b=c.replace(/^\//,"").split("/");p="/"+m.replace(/^\//,"").split("/").slice(b.length).join("/")}let w=$O(e,{pathname:p}),g=pA(w&&w.map(b=>Object.assign({},b,{params:Object.assign({},l,b.params),pathname:Es([c,s.encodeLocation?s.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?c:Es([c,s.encodeLocation?s.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),o,r,n);return t&&g?h.createElement($d.Provider,{value:{location:Pl({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:vs.Pop}},g):g}function dA(){let e=xA(),t=sA(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,s={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),r?h.createElement("pre",{style:s},r):null,null)}const fA=h.createElement(dA,null);class hA 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,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?h.createElement(zn.Provider,{value:this.props.routeContext},h.createElement(g1.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function mA(e){let{routeContext:t,match:r,children:n}=e,s=h.useContext(bg);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),h.createElement(zn.Provider,{value:t},n)}function pA(e,t,r,n){var s;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var o;if(!r)return null;if(r.errors)e=r.matches;else if((o=n)!=null&&o.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let a=e,l=(s=r)==null?void 0:s.errors;if(l!=null){let d=a.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||st(!1),a=a.slice(0,Math.min(a.length,d+1))}let c=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d<a.length;d++){let f=a[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:m,errors:p}=r,w=f.route.loader&&m[f.route.id]===void 0&&(!p||p[f.route.id]===void 0);if(f.route.lazy||w){c=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((d,f,m)=>{let p,w=!1,g=null,b=null;r&&(p=l&&f.route.id?l[f.route.id]:void 0,g=f.route.errorElement||fA,c&&(u<0&&m===0?(w=!0,b=null):u===m&&(w=!0,b=f.route.hydrateFallbackElement||null)));let v=t.concat(a.slice(0,m+1)),y=()=>{let x;return p?x=g:w?x=b:f.route.Component?x=h.createElement(f.route.Component,null):f.route.element?x=f.route.element:x=d,h.createElement(mA,{match:f,routeContext:{outlet:d,matches:v,isDataRoute:r!=null},children:x})};return r&&(f.route.ErrorBoundary||f.route.errorElement||m===0)?h.createElement(hA,{location:r.location,revalidation:r.revalidation,component:g,error:p,children:y(),routeC
60ontext:{outlet:null,matches:v,isDataRoute:!0}}):y()},null)}var x1=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(x1||{}),Ku=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}(Ku||{});function gA(e){let t=h.useContext(bg);return t||st(!1),t}function yA(e){let t=h.useContext(aA);return t||st(!1),t}function vA(e){let t=h.useContext(zn);return t||st(!1),t}function w1(e){let t=vA(),r=t.matches[t.matches.length-1];return r.route.id||st(!1),r.route.id}function xA(){var e;let t=h.useContext(g1),r=yA(Ku.UseRouteError),n=w1(Ku.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function wA(){let{router:e}=gA(x1.UseNavigateStable),t=w1(Ku.UseNavigateStable),r=h.useRef(!1);return y1(()=>{r.current=!0}),h.useCallback(function(s,o){o===void 0&&(o={}),r.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Pl({fromRouteId:t},o)))},[e,t])}function bA(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Oi(e){let{to:t,replace:r,state:n,relative:s}=e;gi()||st(!1);let{future:o,static:a}=h.useContext(Vs),{matches:l}=h.useContext(zn),{pathname:c}=Xr(),u=Hs(),d=wg(t,xg(l,o.v7_relativeSplatPath),c,s==="path"),f=JSON.stringify(d);return h.useEffect(()=>u(JSON.parse(f),{replace:r,state:n,relative:s}),[u,f,s,r,n]),null}function Oe(e){st(!1)}function _A(e){let{basename:t="/",children:r=null,location:n,navigationType:s=vs.Pop,navigator:o,static:a=!1,future:l}=e;gi()&&st(!1);let c=t.replace(/^\/*/,"/"),u=h.useMemo(()=>({basename:c,navigator:o,static:a,future:Pl({v7_relativeSplatPath:!1},l)}),[c,l,o,a]);typeof n=="string"&&(n=pi(n));let{pathname:d="/",search:f="",hash:m="",state:p=null,key:w="default"}=n,g=h.useMemo(()=>{let b=vg(d,c);return b==null?null:{location:{pathname:b,search:f,hash:m,state:p,key:w},navigationType:s}},[c,d,f,m,p,w,s]);return g==null?null:h.createElement(Vs.Provider,{value:u},h.createElement($d.Provider,{children:r,value:g}))}function SA(e){let{children:t,location:r}=e;return cA(wm(t),r)}new Promise(()=>{});function wm(e,t){t===void 0&&(t=[]);let r=[];return h.Children.forEach(e,(n,s)=>{if(!h.isValidElement(n))return;let o=[...t,s];if(n.type===h.Fragment){r.push.apply(r,wm(n.props.children,o));return}n.type!==Oe&&st(!1),!n.props.index||!n.props.children||st(!1);let a={id:n.props.id||o.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(a.children=wm(n.props.children,o)),r.push(a)}),r}/** 61 * React Router DOM v6.30.1 62 * 63 * Copyright (c) Remix Software Inc. 64 * 65 * This source code is licensed under the MIT license found in the 66 * LICENSE.md file in the root directory of this source tree. 67 * 68 * @license MIT 69 */function bm(){return bm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bm.apply(this,arguments)}function kA(e,t){if(e==null)return{};var r={},n=Object.keys(e),s,o;for(o=0;o<n.length;o++)s=n[o],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}function jA(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function NA(e,t){return e.button===0&&(!t||t==="_self")&&!jA(e)}function _m(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(s=>[r,s]):[[r,n]])},[]))}function CA(e,t){let r=_m(e);return t&&t.forEach((n,s)=>
69{r.has(s)||t.getAll(s).forEach(o=>{r.append(s,o)})}),r}const EA=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],TA="6";try{window.__reactRouterVersion=TA}catch{}const PA="startTransition",cx=up[PA];function RA(e){let{basename:t,children:r,future:n,window:s}=e,o=h.useRef();o.current==null&&(o.current=DO({window:s,v5Compat:!0}));let a=o.current,[l,c]=h.useState({action:a.action,location:a.location}),{v7_startTransition:u}=n||{},d=h.useCallback(f=>{u&&cx?cx(()=>c(f)):c(f)},[c,u]);return h.useLayoutEffect(()=>a.listen(d),[a,d]),h.useEffect(()=>bA(n),[n]),h.createElement(_A,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:a,future:n})}const OA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",AA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ee=h.forwardRef(function(t,r){let{onClick:n,relative:s,reloadDocument:o,replace:a,state:l,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,m=kA(t,EA),{basename:p}=h.useContext(Vs),w,g=!1;if(typeof u=="string"&&AA.test(u)&&(w=u,OA))try{let x=new URL(window.location.href),_=u.startsWith("//")?new URL(x.protocol+u):new URL(u),S=vg(_.pathname,p);_.origin===x.origin&&S!=null?u=S+_.search+_.hash:g=!0}catch{}let b=iA(u,{relative:s}),v=IA(u,{replace:a,state:l,target:c,preventScrollReset:d,relative:s,viewTransition:f});function y(x){n&&n(x),x.defaultPrevented||v(x)}return h.createElement("a",bm({},m,{href:w||b,onClick:g||o?n:y,ref:r,target:c}))});var ux;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ux||(ux={}));var dx;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(dx||(dx={}));function IA(e,t){let{target:r,replace:n,state:s,preventScrollReset:o,relative:a,viewTransition:l}=t===void 0?{}:t,c=Hs(),u=Xr(),d=v1(e,{relative:a});return h.useCallback(f=>{if(NA(f,r)){f.preventDefault();let m=n!==void 0?n:qu(u)===qu(d);c(e,{replace:m,state:s,preventScrollReset:o,relative:a,viewTransition:l})}},[u,c,d,n,s,r,e,o,a,l])}function DA(e){let t=h.useRef(_m(e)),r=h.useRef(!1),n=Xr(),s=h.useMemo(()=>CA(n.search,r.current?null:t.current),[n.search]),o=Hs(),a=h.useCallback((l,c)=>{const u=_m(typeof l=="function"?l(s):l);r.current=!0,o("?"+u,c)},[o,s]);return[s,a]}var MA=typeof Element<"u",LA=typeof Map=="function",$A=typeof Set=="function",FA=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function hu(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,s;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!hu(e[n],t[n]))return!1;return!0}var o;if(LA&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(n=o.next()).done;)if(!t.has(n.value[0]))return!1;for(o=e.entries();!(n=o.next()).done;)if(!hu(n.value[1],t.get(n.value[0])))return!1;return!0}if($A&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(n=o.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(FA&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[n]))return!1;if(MA&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((s[n]==="_owner"||s[n]==="__v"||s[n]==="__o")&&e.$$typeof)&&!hu(e[s[n]],t[s[n]]))return!1;return!0}return e!==e&&t!==t}var UA=function(t,r){try{return hu(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const zA=Gl(UA);var BA=function(e,t,r,n,s,o,a,l){if(!e){var c;if(t===void 0)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,n,s,o,a,l],d=0;c=new Error(t.replace(/%s/g,function(){return u[d++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}},VA=BA;const fx=Gl(VA);var HA=function(t,r,n,s){var o=n?n.call(s,t,r):void 0;if(o!==void 0)return!!o;if(t===r)return!0;
69if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var a=Object.keys(t),l=Object.keys(r);if(a.length!==l.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(r),u=0;u<a.length;u++){var d=a[u];if(!c(d))return!1;var f=t[d],m=r[d];if(o=n?n.call(s,f,m,d):void 0,o===!1||o===void 0&&f!==m)return!1}return!0};const WA=Gl(HA);var b1=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(b1||{}),Hf={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},hx=Object.values(b1),_g={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},qA=Object.entries(_g).reduce((e,[t,r])=>(e[r]=t,e),{}),Vr="data-rh",Ra={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},Oa=(e,t)=>{for(let r=e.length-1;r>=0;r-=1){const n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},KA=e=>{let t=Oa(e,"title");const r=Oa(e,Ra.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,()=>t);const n=Oa(e,Ra.DEFAULT_TITLE);return t||n||void 0},GA=e=>Oa(e,Ra.ON_CHANGE_CLIENT_STATE)||(()=>{}),Wf=(e,t)=>t.filter(r=>typeof r[e]<"u").map(r=>r[e]).reduce((r,n)=>({...r,...n}),{}),YA=(e,t)=>
69t.filter(r=>typeof r.base<"u").map(r=>r.base).reverse().reduce((r,n)=>{if(!r.length){const s=Object.keys(n);for(let o=0;o<s.length;o+=1){const l=s[o].toLowerCase();if(e.indexOf(l)!==-1&&n[l])return r.concat(n)}}return r},[]),QA=e=>console&&typeof console.warn=="function"&&console.warn(e),Ai=(e,t,r)=>{const n={};return r.filter(s=>Array.isArray(s[e])?!0:(typeof s[e]<"u"&&QA(`Helmet: ${e} should be of type "Array". Instead found type "${typeof s[e]}"`),!1)).map(s=>s[e]).reverse().reduce((s,o)=>{const a={};o.filter(c=>{let u;const d=Object.keys(c);for(let m=0;m<d.length;m+=1){const p=d[m],w=p.toLowerCase();t.indexOf(w)!==-1&&!(u==="rel"&&c[u].toLowerCase()==="canonical")&&!(w==="rel"&&c[w].toLowerCase()==="stylesheet")&&(u=w),t.indexOf(p)!==-1&&(p==="innerHTML"||p==="cssText"||p==="itemprop")&&(u=p)}if(!u||!c[u])return!1;const f=c[u].toLowerCase();return n[u]||(n[u]={}),a[u]||(a[u]={}),n[u][f]?!1:(a[u][f]=!0,!0)}).reverse().forEach(c=>s.push(c));const l=Object.keys(a);for(let c=0;c<l.length;c+=1){const u=l[c],d={...n[u],...a[u]};n[u]=d}return s},[]).reverse()},JA=(e,t)=>{if(Array.isArray(e)&&e.length){for(let r=0;r<e.length;r+=1)if(e[r][t])return!0}return!1},ZA=e=>({baseTag:YA(["href"],e),bodyAttributes:Wf("bodyAttributes",e),defer:Oa(e,Ra.DEFER),encode:Oa(e,Ra.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:Wf("htmlAttributes",e),linkTags:Ai("link",["rel","href"],e),metaTags:Ai("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:Ai("noscript",["innerHTML"],e),onChangeClientState:GA(e),scriptTags:Ai("script",["src","innerHTML"],e),styleTags:Ai("style",["cssText"],e),title:KA(e),titleAttributes:Wf("titleAttributes",e),prioritizeSeoTags:JA(e,Ra.PRIORITIZE_SEO_TAGS)}),_1=e=>Array.isArray(e)?e.join(""):e,XA=(e,t)=>{const r=Object.keys(e);for(let n=0;n<r.length;n+=1)if(t[r[n]]&&t[r[n]].includes(e[r[n]]))return!0;return!1},qf=(e,t)=>Array.isArray(e)?e.reduce((r,n)=>(XA(n,t)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:e,priority:[]},mx=(e,t)=>({...e,[t]:void 0}),eI=["noscript","script","style"],Sm=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),S1=e=>Object.keys(e).reduce((t,r)=>{const n=typeof e[r]<"u"?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),tI=(e,t,r,n)=>{const s=S1(r),o=_1(t);return s?`<${e} ${Vr}="true" ${s}>${Sm(o,n)}</${e}>`:`<${e} ${Vr}="true">${Sm(o,n)}</${e}>`},rI=(e,t,r=!0)=>t.reduce((n,s)=>{const o=s,a=Object.keys(o).filter(u=>!(u==="innerHTML"||u==="cssText")).reduce((u,d)=>{const f=typeof o[d]>"u"?d:`${d}="${Sm(o[d],r)}"`;return u?`${u} ${f}`:f},""),l=o.innerHTML||o.cssText||"",c=eI.indexOf(e)===-1;return`${n}<${e} ${Vr}="true" ${a}${c?"/>":`>${l}</${e}>`}`},""),k1=(e,t={})=>Object.keys(e).reduce((r,n)=>{const s=_g[n];return r[s||n]=e[n],r},t),nI=(e,t,r)=>{const n={key:t,[Vr]:!0},s=k1(r,n);return[W.createElement("title",s,t)]},mu=(e,t)=>t.map((r,n)=>{const s={key:n,[Vr]:!0};return Object.keys(r).forEach(o=>{const l=_g[o]||o;if(l==="innerHTML"||l==="cssText"){const c=r.innerHTML||r.cssText;s.dangerouslySetInnerHTML={__html:c}}else s[l]=r[o]}),W.createElement(e,s)}),mr=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>nI(e,t.title,t.titleAttributes),toString:()=>tI(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>k1(t),toString:()=>S1(t)};default:return{toComponent:()=>mu(e,t),toString:()=>rI(e,t,r)}}},sI=({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const s=qf(e,Hf.meta),o=qf(t,Hf.link),a=qf(r,Hf.script);return{priorityMethods:{toComponent:()=>[...mu("meta",s.priority),...mu("link",o.priority),...mu("script",a.priority)],toString:()=>`${mr("meta",s.priority,n)} ${mr("link",o.priority,n)} ${mr("script",a.priority,n)}`},metaTags:s.default,linkTags:o.default,scriptTags:a.default}},oI=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:s,noscriptTags:o,styleTags:a,title:l="",titleAttributes:c,prioritizeSeoTags:u}=e;let{linkTags:d,metaTags:f,scriptTags:m}=e,p={toComponent:()=>{},toString:()=>""};return u&&({priorityMethods:p,linkTags:d,metaTags:f,scriptTags:m}=sI(e)),{priority:p,base:mr("base",t,n),bodyAttributes:mr("bodyAttributes",r,n),htmlAttributes:mr("htmlAttributes",s,n),link:mr("link",d,n),meta:mr("meta",f,n),noscript:mr("noscript",o,n),script:mr("script",m,n),style:mr("style",a,n),title:mr("title",{title:l,titleAttributes:c},n)}},km=oI,Bc=[],j1=!!(typeof window<"u"&&window.document&&window.document.createElement),jm=class{constructor(e,t){bn(this,"instances",[]);bn(this,"canUseDOM",j1);bn(this,"context");bn(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?Bc:this.instances,add:e=>{(this.canUseDOM?Bc:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?Bc:this.instances).indexOf(e);(this.canUseDOM?Bc:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=km({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},aI={}
69,N1=W.createContext(aI),vo,C1=(vo=class extends h.Component{constructor(r){super(r);bn(this,"helmetData");this.helmetData=new jm(this.props.context||{},vo.canUseDOM)}render(){return W.createElement(N1.Provider,{value:this.helmetData.value},this.props.children)}},bn(vo,"canUseDOM",j1),vo),Ko=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${Vr}]`),s=[].slice.call(n),o=[];let a;return t&&t.length&&t.forEach(l=>{const c=document.createElement(e);for(const u in l)if(Object.prototype.hasOwnProperty.call(l,u))if(u==="innerHTML")c.innerHTML=l.innerHTML;else if(u==="cssText")c.styleSheet?c.styleSheet.cssText=l.cssText:c.appendChild(document.createTextNode(l.cssText));else{const d=u,f=typeof l[d]>"u"?"":l[d];c.setAttribute(u,f)}c.setAttribute(Vr,"true"),s.some((u,d)=>(a=d,c.isEqualNode(u)))?s.splice(a,1):o.push(c)}),s.forEach(l=>{var c;return(c=l.parentNode)==null?void 0:c.removeChild(l)}),o.forEach(l=>r.appendChild(l)),{oldTags:s,newTags:o}},Nm=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(Vr),s=n?n.split(","):[],o=[...s],a=Object.keys(t);for(const l of a){const c=t[l]||"";r.getAttribute(l)!==c&&r.setAttribute(l,c),s.indexOf(l)===-1&&s.push(l);const u=o.indexOf(l);u!==-1&&o.splice(u,1)}for(let l=o.length-1;l>=0;l-=1)r.removeAttribute(o[l]);s.length===o.length?r.removeAttribute(Vr):r.getAttribute(Vr)!==a.join(",")&&r.setAttribute(Vr,a.join(","))},iI=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=_1(e)),Nm("title",t)},px=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:s,linkTags:o,metaTags:a,noscriptTags:l,onChangeClientState:c,scriptTags:u,styleTags:d,title:f,titleAttributes:m}=e;Nm("body",n),Nm("html",s),iI(f,m);const p={baseTag:Ko("base",r),linkTags:Ko("link",o),metaTags:Ko("meta",a),noscriptTags:Ko("noscript",l),scriptTags:Ko("script",u),styleTags:Ko("style",d)},w={},g={};Object.keys(p).forEach(b=>{const{newTags:v,oldTags:y}=p[b];v.length&&(w[b]=v),y.length&&(g[b]=p[b].oldTags)}),t&&t(),c(e,w,g)},Ii=null,lI=e=>{Ii&&cancelAnimationFrame(Ii),e.defer?Ii=requestAnimationFrame(()=>{px(e,()=>{Ii=null})}):(px(e),Ii=null)},cI=lI,gx=class extends h.Component{constructor(){super(...arguments);bn(this,"rendered",!1)}shouldComponentUpdate(t){return!WA(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:r}=this.props.context;let n=null;const s=ZA(t.get().map(o=>{const a={...o.props};return delete a.context,a}));C1.canUseDOM?cI(s):km&&(n=km(s)),r(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},gh,Ro=(gh=class extends h.Component{shouldComponentUpdate(e){return!zA(mx(this.props,"helmetData"),mx(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,r,n){return{...t,[e.type]:[...t[e.type]||[],{...r,...this.mapNestedChildrenToProps(e,n)}]}}mapObjectTypeChildren(e,t,r,n){switch(e.type){case"title":return{...t,[e.type]:n,titleAttributes:{...r}};case"body":return{...t,bodyAttributes:{...r}};case"html":return{...t,htmlAttributes:{...r}};default:return{...t,[e.type]:{...r}}}}mapArrayTypeChildrenToProps(e,t){let r={...t};return Object.keys(e).forEach(n=>{r={...r,[n]:e[n]}}),r}warnOnInvalidChildren(e,t){return fx(hx.some(r=>e.type===r),typeof e.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${hx.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),fx(!t||typeof t=="string"||Array.isArray(t)&&!t.some(r=>typeof r!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`}</${e.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let r={};
69return W.Children.forEach(e,n=>{if(!n||!n.props)return;const{children:s,...o}=n.props,a=Object.keys(o).reduce((c,u)=>(c[qA[u]||u]=o[u],c),{});let{type:l}=n;switch(typeof l=="symbol"?l=l.toString():this.warnOnInvalidChildren(n,s),l){case"Symbol(react.fragment)":t=this.mapChildrenToProps(s,t);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(n,r,a,s);break;default:t=this.mapObjectTypeChildren(n,t,a,s);break}}),this.mapArrayTypeChildrenToProps(r,t)}render(){const{children:e,...t}=this.props;let r={...t},{helmetData:n}=t;if(e&&(r=this.mapChildrenToProps(e,r)),n&&!(n instanceof jm)){const s=n;n=new jm(s.context,!0),delete r.helmetData}return n?W.createElement(gx,{...r,context:n.value}):W.createElement(N1.Consumer,null,s=>W.createElement(gx,{...r,context:s}))}},bn(gh,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),gh),Cm=function(e,t){return Cm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])},Cm(e,t)};function cB(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Cm(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var ln=function(){return ln=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},ln.apply(this,arguments)};function yi(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function uI(e,t,r,n){function s(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function l(d){try{u(n.next(d))}catch(f){a(f)}}function c(d){try{u(n.throw(d))}catch(f){a(f)}}function u(d){d.done?o(d.value):s(d.value).then(l,c)}u((n=n.apply(e,t||[])).next())})}function dI(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,o;n<s;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}const fI=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class Sg extends Error{constructor(t,r="FunctionsError",n){super(t),this.name=r,this.context=n}}class hI extends Sg{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class yx extends Sg{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class vx extends Sg{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var Em;(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"})(Em||(Em={}));class mI{constructor(t,{headers:r={},customFetch:n,region:s=Em.Any}={}){this.url=t,this.headers=r,this.region=s,this.fetch=fI(n)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return uI(this,arguments,void 0,function*(r,n={}){var s;let o,a;try{const{headers:l,method:c,body:u,signal:d,timeout:f}=n;let m={},{region:p}=n;p||(p=this.region);const w=new URL(`${this.url}/${r}`);p&&p!=="any"&&(m["x-region"]=p,w.searchParams.set("forceFunctionRegion",p));let g;u&&(l&&!Object.prototype.hasOwnProperty.call(l,"Content-Type")||!l)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(m["Content-Type"]="application/octet-stream",g=u):typeof u=="string"?(m["Content-Type"]="text/plain",g=u):typeof FormData<"u"&&u instanceof FormData?g=u:(m["Content-Type"]="application/json",g=JSON.stringify(u)):g=u;let b=d;f&&(a=new AbortController,o=setTimeout(()=>a.abort(),f),d?(b=a.signal,d.addEventListener("abort",()=>a.abort())):b=a.signal);const v=yield this.fetch(w.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},m),this.headers),l),body:g,signal:b}).catch(S=>{throw new hI(S)}),y=v.headers.get("x-relay-error");
69if(y&&y==="true")throw new yx(v);if(!v.ok)throw new vx(v);let x=((s=v.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),_;return x==="application/json"?_=yield v.json():x==="application/octet-stream"||x==="application/pdf"?_=yield v.blob():x==="text/event-stream"?_=v:x==="multipart/form-data"?_=yield v.formData():_=yield v.text(),{data:_,error:null,response:v}}catch(l){return{data:null,error:l,response:l instanceof vx||l instanceof yx?l.context:void 0}}finally{o&&clearTimeout(o)}})}}var pI=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}},gI=class{constructor(e){var t,r;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(r=e.isMaybeSingle)!==null&&r!==void 0?r:!1,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}then(e,t){var r=this;this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const n=this.fetch;let s=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async o=>{let a=null,l=null,c=null,u=o.status,d=o.statusText;if(o.ok){var f,m;if(r.method!=="HEAD"){var p;const v=await o.text();v===""||(r.headers.get("Accept")==="text/csv"||r.headers.get("Accept")&&(!((p=r.headers.get("Accept"))===null||p===void 0)&&p.includes("application/vnd.pgrst.plan+text"))?l=v:l=JSON.parse(v))}const g=(f=r.headers.get("Prefer"))===null||f===void 0?void 0:f.match(/count=(exact|planned|estimated)/),b=(m=o.headers.get("content-range"))===null||m===void 0?void 0:m.split("/");g&&b&&b.length>1&&(c=parseInt(b[1])),r.isMaybeSingle&&r.method==="GET"&&Array.isArray(l)&&(l.length>1?(a={code:"PGRST116",details:`Results contain ${l.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},l=null,c=null,u=406,d="Not Acceptable"):l.length===1?l=l[0]:l=null)}else{var w;const g=await o.text();try{a=JSON.parse(g),Array.isArray(a)&&o.status===404&&(l=[],a=null,u=200,d="OK")}catch{o.status===404&&g===""?(u=204,d="No Content"):a={message:g}}if(a&&r.isMaybeSingle&&(!(a==null||(w=a.details)===null||w===void 0)&&w.includes("0 rows"))&&(a=null,u=200,d="OK"),a&&r.shouldThrowOnError)throw new pI(a)}return{error:a,data:l,count:c,status:u,statusText:d}});return this.shouldThrowOnError||(s=s.catch(o=>{var a;let l="";const c=o==null?void 0:o.cause;if(c){var u,d,f,m;const w=(u=c==null?void 0:c.message)!==null&&u!==void 0?u:"",g=(d=c==null?void 0:c.code)!==null&&d!==void 0?d:"";l=`${(f=o==null?void 0:o.name)!==null&&f!==void 0?f:"FetchError"}: ${o==null?void 0:o.message}`,l+=` 70 71Caused by: ${(m=c==null?void 0:c.name)!==null&&m!==void 0?m:"Error"}: ${w}`,g&&(l+=` (${g})`),c!=null&&c.stack&&(l+=` 72${c.stack}`)}else{var p;l=(p=o==null?void 0:o.stack)!==null&&p!==void 0?p:""}return{error:{message:`${(a=o==null?void 0:o.name)!==null&&a!==void 0?a:"FetchError"}: ${o==null?void 0:o.message}`,details:l,hint:"",code:""},data:null,count:null,status:0,statusText:""}})),s.then(e,t)}returns(){return this}overrideTypes(){return this}},yI=class extends gI{select(e){let t=!1;const r=(e??"*").split("").map(n=>/\s/.test(n)&&!t?"":(n==='"'&&(t=!t),n)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:n,referencedTable:s=n}={}){const o=s?`${s}.order`:"order",a=this.url.searchParams.get(o);return this.url.searchParams.set(o,`${a?`${a},`:""}${e}.${t?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:r=t}={}){const n=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${e}`),this}range(e,t,{foreignTable:r,referencedTable:n=r}={}){const s=typeof n>"u"?"offset":`${n}.offset`,o=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(o,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}
72explain({analyze:e=!1,verbose:t=!1,settings:r=!1,buffers:n=!1,wal:s=!1,format:o="text"}={}){var a;const l=[e?"analyze":null,t?"verbose":null,r?"settings":null,n?"buffers":null,s?"wal":null].filter(Boolean).join("|"),c=(a=this.headers.get("Accept"))!==null&&a!==void 0?a:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${o}; for="${c}"; options=${l};`),o==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const xx=new RegExp("[,()]");var sa=class extends yI{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const r=Array.from(new Set(t)).map(n=>typeof n=="string"&&xx.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}notIn(e,t){const r=Array.from(new Set(t)).map(n=>typeof n=="string"&&xx.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`not.in.(${r})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:r,type:n}={}){let s="";n==="plain"?s="pl":n==="phrase"?s="ph":n==="websearch"&&(s="w");const o=r===void 0?"":`(${r})`;return this.url.searchParams.append(e,`${s}fts${o}.${t}`),this}match(e){return Object.entries(e).forEach(([t,r])=>{this.url.searchParams.append(t,`eq.${r}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t,referencedTable:r=t}={}){const n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}},vI=class{constructor(e,{headers:t={},schema:r,fetch:n}){this.url=e,this.headers=new Headers(t),this.schema=r,this.fetch=n}select(e,t){const{head:r=!1,count:n}=t??{},s=r?"HEAD":"GET";let o=!1;const a=(e??"*").split("").map(l=>/\s/.test(l)&&!o?"":(l==='"'&&(o=!o),l)).join("");return this.url.searchParams.set("select",a),n&&this.headers.append("Prefer",`count=${n}`),new sa({method:s,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(e,{count:t,defaultToNull:r=!0}={}){var n;const s="POST";if(t&&this.headers.append("Prefer",`count=${t}`),r||this.headers.append("Prefer","missing=default"),Array.isArray(e)){const o=e.reduce((a,l)=>a.concat(Object.keys(l)),[]);if(o.length>
720){const a=[...new Set(o)].map(l=>`"${l}"`);this.url.searchParams.set("columns",a.join(","))}}return new sa({method:s,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:n,defaultToNull:s=!0}={}){var o;const a="POST";if(this.headers.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),t!==void 0&&this.url.searchParams.set("on_conflict",t),n&&this.headers.append("Prefer",`count=${n}`),s||this.headers.append("Prefer","missing=default"),Array.isArray(e)){const l=e.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(l.length>0){const c=[...new Set(l)].map(u=>`"${u}"`);this.url.searchParams.set("columns",c.join(","))}}return new sa({method:a,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}update(e,{count:t}={}){var r;const n="PATCH";return t&&this.headers.append("Prefer",`count=${t}`),new sa({method:n,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch})}delete({count:e}={}){var t;const r="DELETE";return e&&this.headers.append("Prefer",`count=${e}`),new sa({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch})}},xI=class E1{constructor(t,{headers:r={},schema:n,fetch:s}={}){this.url=t,this.headers=new Headers(r),this.schemaName=n,this.fetch=s}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new vI(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new E1(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,r={},{head:n=!1,get:s=!1,count:o}={}){var a;let l;const c=new URL(`${this.url}/rpc/${t}`);let u;n||s?(l=n?"HEAD":"GET",Object.entries(r).filter(([f,m])=>m!==void 0).map(([f,m])=>[f,Array.isArray(m)?`{${m.join(",")}}`:`${m}`]).forEach(([f,m])=>{c.searchParams.append(f,m)})):(l="POST",u=r);const d=new Headers(this.headers);return o&&d.set("Prefer",`count=${o}`),new sa({method:l,url:c,headers:d,schema:this.schemaName,body:u,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}};class wI{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};if(typeof process<"u"){const r=process.versions;if(r&&r.node){const n=r.node,s=parseInt(n.replace(/^v/,"").split(".")[0]);return s>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${s} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${s} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: 73import ws from "ws" 74new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.constructor)return t.constructor;let r=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(r+=` 75 76Suggested solution: ${t.workaround}`),new Error(r)}static createWebSocket(t,r){const n=this.getWebSocketConstructor();return new n(t,r)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const bI="2.89.0",_I=`realtime-js/${bI}`,T1="1.0.0",SI="2.0.0",wx=T1,Tm=1e4,kI=1e3,jI=100;var as;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(as||(as={}));var ut;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(ut||(ut={}));var zr;(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"})(zr||(zr={}));var Pm;(function(e){e.websocket="websocket"})(Pm||(Pm={}));var no;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(no||(no={}));class NI{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,r){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(t));let n=[t.join_ref,t.ref,t.topic,t.event,t.payload];return r(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(t){var r;return this._isArrayBuffer((r=t.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var r,n;const s=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(t){var r,n;const s=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:{},a=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,a)}_encodeUserBroadcastPush(t,r,n){var s,o;const a=t.topic,l=(s=t.ref)!==null&&s!==void 0?s:"",c=(o=t.join_ref)!==null&&o!==void 0?o:"",u=t.payload.event,d=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},f=Object.keys(d).length===0?"":JSON.stringify(d);if(c.length>255)throw new Error(`joinRef length ${c.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`ref length ${l.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`topic length ${a.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`metadata length ${f.length} exceeds maximum of 255`);const m=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+l.length+a.length+u.length+f.length,p=new ArrayBuffer(this.HEADER_LENGTH+m);let w=new DataView(p),g=0;w.setUint8(g++,this.KINDS.userBroadcastPush),w.setUint8(g++,c.length),w.setUint8(g++,l.length),w.setUint8(g++,a.length),w.setUint8(g++,u.length),w.setUint8(g++,f.length),w.setUint8(g++,r),Array.from(c,v=>w.setUint8(g++,v.charCodeAt(0))),Array.from(l,v=>w.setUint8(g++,v.charCodeAt(0))),Array.from(a,v=>w.setUint8(g++,v.charCodeAt(0))),Array.from(u,v=>w.setUint8(g++,v.charCodeAt(0))),Array.from(f,v=>w.setUint8(g++,v.charCodeAt(0)));var b=new Uint8Array(p.byteLength+n.byteLength);return b.set(new Uint8Array(p),0),b.set(new Uint8Array(n),p.byteLength),b.buffer}decode(t,r){if(this._isArrayBuffer(t)){let n=this._binaryDecode(t);return r(n)}if(typeof t=="string"){const n=JSON.parse(t),[s,o,a,l,c]=n;return r({join_ref:s,ref:o,topic:a,event:l,payload:c})}return r({})}_binaryDecode(t){const r=new DataView(t),n=r.getUint8(0),s=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,r,s)}}_decodeUserBroadcast(t,r,n){const s=r.getUint8(1),o=r.getUint8(2),a=r.getUint8(3),l=r.getUint8(4);let c=this.HEADER_LENGTH+4;const u=n.decode(t.slice(c,c+s));c=c+s;
76const d=n.decode(t.slice(c,c+o));c=c+o;const f=n.decode(t.slice(c,c+a));c=c+a;const m=t.slice(c,t.byteLength),p=l===this.JSON_ENCODING?JSON.parse(n.decode(m)):m,w={type:this.BROADCAST_EVENT,event:d,payload:p};return a>0&&(w.meta=JSON.parse(f)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:w}}_isArrayBuffer(t){var r;return t instanceof ArrayBuffer||((r=t==null?void 0:t.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(t,r){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([n])=>r.includes(n)))}}class P1{constructor(t,r){this.callback=t,this.timerCalc=r,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=r}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var Fe;(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"})(Fe||(Fe={}));const bx=(e,t,r={})=>{var n;const s=(n=r.skipTypes)!==null&&n!==void 0?n:[];return t?Object.keys(t).reduce((o,a)=>(o[a]=CI(a,e,t,s),o),{}):{}},CI=(e,t,r,n)=>{const s=t.find(l=>
76l.name===e),o=s==null?void 0:s.type,a=r[e];return o&&!n.includes(o)?R1(o,a):Rm(a)},R1=(e,t)=>{if(e.charAt(0)==="_"){const r=e.slice(1,e.length);return RI(t,r)}switch(e){case Fe.bool:return EI(t);case Fe.float4:case Fe.float8:case Fe.int2:case Fe.int4:case Fe.int8:case Fe.numeric:case Fe.oid:return TI(t);case Fe.json:case Fe.jsonb:return PI(t);case Fe.timestamp:return OI(t);case Fe.abstime:case Fe.date:case Fe.daterange:case Fe.int4range:case Fe.int8range:case Fe.money:case Fe.reltime:case Fe.text:case Fe.time:case Fe.timestamptz:case Fe.timetz:case Fe.tsrange:case Fe.tstzrange:return Rm(t);default:return Rm(t)}},Rm=e=>e,EI=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},TI=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},PI=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},RI=(e,t)=>{if(typeof e!="string")return e;const r=e.length-1,n=e[r];if(e[0]==="{"&&n==="}"){let o;const a=e.slice(1,r);try{o=JSON.parse("["+a+"]")}catch{o=a?a.split(","):[]}return o.map(l=>R1(t,l))}return e},OI=e=>typeof e=="string"?e.replace(" ","T"):e,O1=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};class Kf{constructor(t,r,n={},s=Tm){this.channel=t,this.event=r,this.payload=n,this.timeout=s,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,r){var n;return this._hasReceived(t)&&r((n=this.receivedResp)===null||n===void 0?void 0:n.response),this.recHooks.push({status:t,callback:r}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=r=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=r,this._matchReceive(r)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,r){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:r})}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:r}){this.recHooks.filter(n=>n.status===t).forEach(n=>n.callback(r))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var _x;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(_x||(_x={}));class sl{constructor(t,r){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const n=(r==null?void 0:r.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(n.state,{},s=>{const{onJoin:o,onLeave:a,onSync:l}=this.caller;this.joinRef=this.channel._joinRef(),this.state=sl.syncState(this.state,s,o,a),this.pendingDiffs.forEach(c=>{this.state=sl.syncDiff(this.state,c,o,a)}),this.pendingDiffs=[],l()}),this.channel._on(n.diff,{},s=>{const{onJoin:o,onLeave:a,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=sl.syncDiff(this.state,s,o,a),l())}),this.onJoin((s,o,a)=>{this.channel._trigger("presence",{event:"join",key:s,currentPresences:o,newPresences:a})}),this.onLeave((s,o,a)=>{this.channel._trigger("presence",{event:"leave",key:s,currentPresences:o,leftPresences:a})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,r,n,s){const o=this.cloneDeep(t),a=this.transformState(r),l={},c={};return this.map(o,(u,d)=>{a[u]||(c[u]=d)}),this.map(a,(u,d)=>{const f=o[u];if(f){const m=d.map(b=>b.presence_ref),p=f.map(b=>b.presence_ref),w=d.filter(b=>p.indexOf(b.presence_ref)<0),g=f.filter(b=>m.indexOf(b.presence_ref)<0);w.length>0&&(l[u]=w),g.length>0&&(c[u]=g)}else l[u]=d}),this.syncDiff(o,{joins:l,leaves:c},n,s)}static syncDiff(t,r,n,s){const{joins:o,leaves:a}={joins:this.transformState(r.joins),leaves:this.transformState(r.leaves)};return n||(n=()=>{}),s||(s=()=>{}),this.map(o,(l,c)=>{var u;
76const d=(u=t[l])!==null&&u!==void 0?u:[];if(t[l]=this.cloneDeep(c),d.length>0){const f=t[l].map(p=>p.presence_ref),m=d.filter(p=>f.indexOf(p.presence_ref)<0);t[l].unshift(...m)}n(l,d,c)}),this.map(a,(l,c)=>{let u=t[l];if(!u)return;const d=c.map(f=>f.presence_ref);u=u.filter(f=>d.indexOf(f.presence_ref)<0),t[l]=u,s(l,u,c),u.length===0&&delete t[l]}),t}static map(t,r){return Object.getOwnPropertyNames(t).map(n=>r(n,t[n]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((r,n)=>{const s=t[n];return"metas"in s?r[n]=s.metas.map(o=>(o.presence_ref=o.phx_ref,delete o.phx_ref,delete o.phx_ref_prev,o)):r[n]=s,r},{})}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 Sx;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(Sx||(Sx={}));var ol;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(ol||(ol={}));var jn;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(jn||(jn={}));class wa{constructor(t,r={config:{}},n){var s,o;if(this.topic=t,this.params=r,this.socket=n,this.bindings={},this.state=ut.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.timeout=this.socket.timeout,this.joinPush=new Kf(this,zr.join,this.params,this.timeout),this.rejoinTimer=new P1(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=ut.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=ut.closed,this.socket._remove(this)}),this._onError(a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=ut.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=ut.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=ut.errored,this.rejoinTimer.scheduleTimeout())}),this._on(zr.reply,{},(a,l)=>{this._trigger(this._replyEventName(l),a)}),this.presence=new sl(this),this.broadcastEndpointURL=O1(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((o=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||o===void 0)&&o.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,r=this.timeout){var n,s,o;if(this.socket.isConnected()||this.socket.connect(),this.state==ut.closed){const{config:{broadcast:a,presence:l,private:c}}=this.params,u=(s=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(p=>p.filter))!==null&&s!==void 0?s:[],d=!!this.bindings[ol.PRESENCE]&&this.bindings[ol.PRESENCE].length>0||((o=this.params.config.presence)===null||o===void 0?void 0:o.enabled)===!0,f={},m={broadcast:a,presence:Object.assign(Object.assign({},l),{enabled:d}),postgres_changes:u,private:c};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(p=>t==null?void 0:t(jn.CHANNEL_ERROR,p)),this._onClose(()=>t==null?void 0:t(jn.CLOSED)),this.updateJoinPayload(Object.assign({config:m},f)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:p})=>{var w;if(this.socket._isManualToken()||this.socket.setAuth(),p===void 0){t==null||t(jn.SUBSCRIBED);return}else{const g=this.bindings.postgres_changes,b=(w=g==null?void 0:g.length)!==null&&w!==void 0?w:0,v=[];for(let y=0;y<b;y++){const x=g[y],{filter:{event:_,schema:S,table:k,filter:N}}=x,E=p&&p[y];if(E&&E.event===_&&wa.isFilterValueEqual(E.schema,S)&&wa.isFilterValueEqual(E.table,k)&&wa.isFilterValueEqual(E.filter,N))v.push(Object.assign(Object.assign({},x),{id:E.id}));else{this.unsubscribe(),this.state=ut.errored,t==null||t(jn.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=v,t&&t(jn.SUBSCRIBED);return}}).receive("error",p=>{this.state=ut.errored,t==null||t(jn.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(p).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(jn.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,r={}){return await this.send({type:"presence",event:"track",payload:t},r.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,r,n){return this.state===ut.joined&&t===ol.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(async()=>await this.subscribe())),this._on(t,r,n)}async httpSend(t,r,n={}){var s;if(r==null)return Promise.reject("Payload is required for httpSend()");const o={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(o.Authorization=`Bearer ${this.socket.accessTokenValue}`);const a={method:"POST",headers:o,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:r,private:this.private}]})},l=await this._fetchWithTimeout(this.broadcastEndpointURL,a,(s=n.timeout)!==null&&s!==void 0?s:this.timeout);if(l.status===202)return{success:!0};let c=l.statusText;
76try{const u=await l.json();c=u.error||u.message||c}catch{}return Promise.reject(new Error(c))}async send(t,r={}){var n,s;if(!this._canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:o,payload:a}=t,l={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(l.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:l,body:JSON.stringify({messages:[{topic:this.subTopic,event:o,payload:a,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((s=u.body)===null||s===void 0?void 0:s.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(o=>{var a,l,c;const u=this._push(t.type,t,r.timeout||this.timeout);t.type==="broadcast"&&!(!((c=(l=(a=this.params)===null||a===void 0?void 0:a.config)===null||l===void 0?void 0:l.broadcast)===null||c===void 0)&&c.ack)&&o("ok"),u.receive("ok",()=>o("ok")),u.receive("error",()=>o("error")),u.receive("timeout",()=>o("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=ut.leaving;const r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(zr.close,"leave",this._joinRef())};this.joinPush.destroy();let n=null;return new Promise(s=>{n=new Kf(this,zr.leave,{},t),n.receive("ok",()=>{r(),s("ok")}).receive("timeout",()=>{r(),s("timed out")}).receive("error",()=>{s("error")}),n.send(),this._canPush()||n.trigger("ok",{})}).finally(()=>{n==null||n.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=ut.closed,this.bindings={}}async _fetchWithTimeout(t,r,n){const s=new AbortController,o=setTimeout(()=>s.abort(),n),a=await this.socket.fetch(t,Object.assign(Object.assign({},r),{signal:s.signal}));return clearTimeout(o),a}_push(t,r,n=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let s=new Kf(this,t,r,n);return this._canPush()?s.send():this._addToPushBuffer(s),s}_addToPushBuffer(t){if(t.startTimeout(),this.pushBuffer.push(t),this.pushBuffer.length>jI){const r=this.pushBuffer.shift();r&&(r.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${r.event}`,r.payload))}}_onMessage(t,r,n){return r}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,r,n){var s,o;const a=t.toLocaleLowerCase(),{close:l,error:c,leave:u,join:d}=zr;if(n&&[l,c,u,d].indexOf(a)>=0&&n!==this._joinRef())return;let m=this._onMessage(a,r,n);if(r&&!m)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(a)?(s=this.bindings.postgres_changes)===null||s===void 0||s.filter(p=>{var w,g,b;return((w=p.filter)===null||w===void 0?void 0:w.event)==="*"||((b=(g=p.filter)===null||g===void 0?void 0:g.event)===null||b===void 0?void 0:b.toLocaleLowerCase())===a}).map(p=>p.callback(m,n)):(o=this.bindings[a])===null||o===void 0||o.filter(p=>{var w,g,b,v,y,x;if(["broadcast","presence","postgres_changes"].includes(a))if("id"in p){const _=p.id,S=(w=p.filter)===null||w===void 0?void 0:w.event;return _&&((g=r.ids)===null||g===void 0?void 0:g.includes(_))&&(S==="*"||(S==null?void 0:S.toLocaleLowerCase())===((b=r.data)===null||b===void 0?void 0:b.type.toLocaleLowerCase()))}else{const _=(y=(v=p==null?void 0:p.filter)===null||v===void 0?void 0:v.event)===null||y===void 0?void 0:y.toLocaleLowerCase();return _==="*"||_===((x=r==null?void 0:r.event)===null||x===void 0?void 0:x.toLocaleLowerCase())}else return p.type.toLocaleLowerCase()===a}).map(p=>{if(typeof m=="object"&&"ids"in m){const w=m.data,{schema:g,table:b,commit_timestamp:v,type:y,errors:x}=w;m=Object.assign(Object.assign({},{schema:g,table:b,commit_timestamp:v,eventType:y,new:{},old:{},errors:x}),this._getPayloadRecords(w))}p.callback(m,n)})}_isClosed(){return this.state===ut.closed}_isJoined(){return this.state===ut.joined}_isJoining(){return this.state===ut.joining}_isLeaving(){return this.state===ut.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,r,n){const s=t.toLocaleLowerCase(),o={type:s,filter:r,callback:n};return this.bindings[s]?this.bindings[s].push(o):this.bindings[s]=[o],this}_off(t,r){const n=t.toLocaleLowerCase();return this.bindings[n]&&(this.bindings[n]=this.bindings[n].filter(s=>{var o;return!(((o=s.type)===null||o===void 0?void 0:o.toLocaleLowerCase())===n&&wa.isEqual(s.filter,r))})),this}static isEqual(t,r){if(Object.keys(t).length!==Object.keys(r).length)return!1;for(const n in t)if(t[n]!==r[n])return!1;return!0}static isFilterValueEqual(t,r){return(t??void 0)===(r??void 0)}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(zr.close,{},t)}_onError(t){this._on(zr.error,{},r=>t(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=ut.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=bx(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=bx(t.columns,t.old_record)),r}}const Gf=()=>{},Vc={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},AI=[1e3,2e3,5e3,1e4],II=1e4,DI=` 77 addEventListener("message", (e) => { 78 if (e.data.event === "start") { 79 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 80 } 81 });`;class MI{constructor(t,r){var n;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=Tm,this.transport=null,this.heartbeatIntervalMs=Vc.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=Gf,this.ref=0,this.reconnectTimer=null,this.vsn=wx,this.logger=Gf,this.conn=null,this.sendBuffer=[],this.serializer
81=new NI,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=s=>s?(...o)=>s(...o):(...o)=>fetch(...o),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey,this.endPoint=`${t}/${Pm.websocket}`,this.httpEndpoint=O1(t),this._initializeOptions(r),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=wI.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");const r=t.message;throw r.includes("Node.js")?new Error(`${r} 82 83To use Realtime in Node.js, you need to provide a WebSocket implementation: 84 85Option 1: Use Node.js 22+ which has native WebSocket support 86Option 2: Install and provide the "ws" package: 87 88 npm install ws 89 90 import ws from "ws" 91 const client = new RealtimeClient(url, { 92 ...options, 93 transport: ws 94 })`):new Error(`WebSocket not available: ${r}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(t,r){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const n=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(n),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(t?this.conn.close(t,r??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(t){const r=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const t=await Promise.all(this.channels.map(r=>r.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,r,n){this.logger(t,r,n)}connectionState(){switch(this.conn&&this.conn.readyState){case as.connecting:return no.Connecting;case as.open:return no.Open;case as.closing:return no.Closing;default:return no.Closed}}isConnected(){return this.connectionState()===no.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(t,r={config:{}}){const n=`realtime:${t}`,s=this.getChannels().find(o=>o.topic===n);if(s)return s;{const o=new wa(`realtime:${t}`,r,this);return this.channels.push(o),o}}push(t){const{topic:r,event:n,payload:s,ref:o}=t,a=()=>{this.encode(t,l=>{var c;(c=this.conn)===null||c===void 0||c.send(l)})};this.log("push",`${r} ${n} (${o})`,s),this.isConnected()?a():this.sendBuffer.push(a)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){var t;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(r){this.log("error","error in heartbeat callback",r)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(r){this.log("error","error in heartbeat callback",r)}this._wasManualDisconnect=!1,(t=this.conn)===null||t===void 0||t.close(kI,"heartbeat timeout"),setTimeout(()=>{var r;this.isConnected()||(r=this.reconnectTimer)===null||r===void 0||r.sc
94heduleTimeout()},Vc.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(r){this.log("error","error in heartbeat callback",r)}this._setAuthSafely("heartbeat")}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let r=this.channels.find(n=>n.topic===t&&(n._isJoined()||n._isJoining()));r&&(this.log("transport",`leaving duplicate topic "${t}"`),r.unsubscribe())}_remove(t){this.channels=this.channels.filter(r=>r.topic!==t.topic)}_onConnMessage(t){this.decode(t.data,r=>{if(r.topic==="phoenix"&&r.event==="phx_reply")try{this.heartbeatCallback(r.payload.status==="ok"?"ok":"error")}catch(u){this.log("error","error in heartbeat callback",u)}r.ref&&r.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:n,event:s,payload:o,ref:a}=r,l=a?`(${a})`:"",c=o.status||"";this.log("receive",`${c} ${n} ${s} ${l}`.trim(),o),this.channels.filter(u=>u._isMember(n)).forEach(u=>u._trigger(s,o,a)),this._triggerStateCallbacks("message",r)})}_clearTimer(t){var r;t==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):t==="reconnect"&&((r=this.reconnectTimer)===null||r===void 0||r.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t),this.conn.readyState===as.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===as.open||this.conn.readyState===as.connecting)try{this.conn.close()}catch(t){this.log("error","Error closing connection",t)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this._terminateWorker(),this.channels.forEach(t=>t.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(r=>{this.log("error","error waiting for auth on connect",r),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_onConnClose(t){var r;this._setConnectionState("disconnected"),this.log("transport","close",t),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(r=this.reconnectTimer)===null||r===void 0||r.sc
94heduleTimeout(),this._triggerStateCallbacks("close",t)}_onConnError(t){this._setConnectionState("disconnected"),this.log("transport",`${t}`),this._triggerChanError(),this._triggerStateCallbacks("error",t)}_triggerChanError(){this.channels.forEach(t=>t._trigger(zr.error))}_appendParams(t,r){if(Object.keys(r).length===0)return t;const n=t.match(/\?/)?"&":"?",s=new URLSearchParams(r);return`${t}${n}${s}`}_workerObjectUrl(t){let r;if(t)r=t;else{const n=new Blob([DI],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_setConnectionState(t,r=!1){this._connectionState=t,t==="connecting"?this._wasManualDisconnect=!1:t==="disconnecting"&&(this._wasManualDisconnect=r)}async _performAuth(t=null){let r,n=!1;if(t)r=t,n=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(s){this.log("error","Error fetching access token from callback",s),r=this.accessTokenValue}else r=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(s=>{const o={access_token:r,version:_I};r&&s.updateJoinPayload(o),s.joinedOnce&&s._isJoined()&&s._push(zr.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${t}`,r)})}_triggerStateCallbacks(t,r){try{this.stateChangeCallbacks[t].forEach(n=>{try{n(r)}catch(s){this.log("error",`error in ${t} callback`,s)}})}catch(n){this.log("error",`error triggering ${t} callbacks`,n)}}_setupReconnectionTimer(){this.reconnectTimer=new P1(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},Vc.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var r,n,s,o,a,l,c,u,d,f,m,p;switch(this.transport=(r=t==null?void 0:t.transport)!==null&&r!==void 0?r:null,this.timeout=(n=t==null?void 0:t.timeout)!==null&&n!==void 0?n:Tm,this.heartbeatIntervalMs=(s=t==null?void 0:t.heartbeatIntervalMs)!==null&&s!==void 0?s:Vc.HEARTBEAT_INTERVAL,this.worker=(o=t==null?void 0:t.worker)!==null&&o!==void 0?o:!1,this.accessToken=(a=t==null?void 0:t.accessToken)!==null&&a!==void 0?a:null,this.heartbeatCallback=(l=t==null?void 0:t.heartbeatCallback)!==null&&l!==void 0?l:Gf,this.vsn=(c=t==null?void 0:t.vsn)!==null&&c!==void 0?c:wx,t!=null&&t.params&&(this.params=t.params),t!=null&&t.logger&&(this.logger=t.logger),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(u=t==null?void 0:t.reconnectAfterMs)!==null&&u!==void 0?u:w=>AI[w-1]||II,this.vsn){case T1:this.encode=(d=t==null?void 0:t.encode)!==null&&d!==void 0?d:(w,g)=>g(JSON.stringify(w)),this.decode=(f=t==null?void 0:t.decode)!==null&&f!==void 0?f:(w,g)=>g(JSON.parse(w));break;case SI:this.encode=(m=t==null?void 0:t.encode)!==null&&m!==void 0?m:this.serializer.encode.bind(this.serializer),this.decode=(p=t==null?void 0:t.decode)!==null&&p!==void 0?p:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl}}}var Rl=class extends Error{constructor(e,t){var r;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((r=t.icebergType)==null?void 0:r.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function LI(e,t,r){const n=new URL(t,e);if(r)for(const[s,o]of Object.entries(r))o!==void 0&&n.searchParams.set(s,o);return n.toString()}async function $I(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function FI(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:s,body:o,headers:a}){const l=LI(e.baseUrl,n,s),c=await $I(e.auth),u=await t(l,{method:r,headers:{...o?{"Content-Type":"application/json"}:{},...c,...a},body:o?JSON.stringify(o):void 0}),d=await u.text(),f=(u.headers.get("content-type")||"").includes("application/json"),m=f&&d?JSON.parse(d):d;if(!u.ok){const p=f?m:void 0,w=p==null?void 0:p.error;throw new Rl((w==null?void 0:w.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:w==null?void 0:w.type,icebergCode:w==null?void 0:w.code,details:p})}return{status:u.status,headers:u.headers,data:m}}}}function Hc(e){return e.join("�")}var UI=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:Hc(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(e,t){const r={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Hc(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Hc(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Hc(e.namespace)}`}),!0}catch(t){if(t instanceof Rl&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(r){if(r instanceof Rl&&r.status===409)return;throw r}}};function Go(e){return e.join("�")}var zI=class{constructor(e,t="",r){this.client=e,this.prefix=t,this.accessDelegation=r}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Go(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Go(e.namespace)}/tables`,body:t,headers:r})).data.metadata}async updateTable(e,t){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Go(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Go(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Go(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Go(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(r){if(r instanceof Rl&&r.status===404)return!1;throw r}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof Rl&&r.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},BI=class{constructor(e){var n;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=FI({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(n=e.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new UI(this.client,t),this.tableOps=new zI(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}
94async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}},Fd=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};function qe(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var VI=class extends Fd{constructor(e,t,r){super(e),this.name="StorageApiError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},Om=class extends Fd{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}};const kg=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),HI=()=>Response,Am=e=>{if(Array.isArray(e))return e.map(r=>Am(r));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([r,n])=>{const s=r.replace(/([-_][a-z])/gi,o=>o.toUpperCase().replace(/[-_]/g,""));t[s]=Am(n)}),t},WI=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)},qI=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function Ol(e){"@babel/helpers - typeof";return Ol=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ol(e)}function KI(e,t){if(Ol(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ol(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function GI(e){var t=KI(e,"string");return Ol(t)=="symbol"?t:t+""}function YI(e,t,r){return(t=GI(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function he(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kx(Object(r),!0).forEach(function(n){YI(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kx(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}const Yf=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},QI=async(e,t,r)=>{e instanceof await HI()&&!(r!=null&&r.noResolveJson)?e.json().then(n=>{const s=e.status||500,o=(n==null?void 0:n.statusCode)||s+"";t(new VI(Yf(n),s,o))}).catch(n=>{t(new Om(Yf(n),n))}):t(new Om(Yf(e),e))},JI=(e,t,r,n)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||!n?s:(WI(n)?(s.headers=he({"Content-Type":"application/json"},t==null?void 0:t.headers),s.body=JSON.stringify(n)):s.body=n,t!=null&&t.duplex&&(s.duplex=t.duplex),he(he({},s),r))};async function rc(e,t,r,n,s,o){return new Promise((a,l)=>{e(r,JI(t,n,s,o)).then(c=>{if(!c.ok)throw c;return n!=null&&n.noResolveJson?c:c.json()}).then(c=>a(c)).catch(c=>QI(c,l,n))})}async function Al(e,t,r,n){return rc(e,"GET",t,r,n)}async function Lr(e,t,r,n,s){return rc(e,"POST",t,n,s,r)}async function Im(e,t,r,n,s){return rc(e,"PUT",t,n,s,r)}async function ZI(e,t,r,n){return rc(e,"HEAD",t,he(he({},r),{},{noResolveJson:!0}),n)}async function jg(e,t,r,n,s){return rc(e,"DELETE",t,n,s,r)}var XI=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(qe(t))return{data:null,error:t};throw t}}};let A1;A1=Symbol.toStringTag;var eD=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[A1]="BlobDownloadBuilder",this.promise=null}asStream(){return new XI(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(qe(t))return{data:null,error:t};throw t}}};const tD={limit:100,offset:0,sortBy:{column:"name",order:"asc"}}
94,jx={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var rD=class{constructor(e,t={},r,n){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.bucketId=r,this.fetch=kg(n)}throwOnError(){return this.shouldThrowOnError=!0,this}async uploadOrUpdate(e,t,r,n){var s=this;try{let o;const a=he(he({},jx),n);let l=he(he({},s.headers),e==="POST"&&{"x-upsert":String(a.upsert)});const c=a.metadata;typeof Blob<"u"&&r instanceof Blob?(o=new FormData,o.append("cacheControl",a.cacheControl),c&&o.append("metadata",s.encodeMetadata(c)),o.append("",r)):typeof FormData<"u"&&r instanceof FormData?(o=r,o.has("cacheControl")||o.append("cacheControl",a.cacheControl),c&&!o.has("metadata")&&o.append("metadata",s.encodeMetadata(c))):(o=r,l["cache-control"]=`max-age=${a.cacheControl}`,l["content-type"]=a.contentType,c&&(l["x-metadata"]=s.toBase64(s.encodeMetadata(c))),(typeof ReadableStream<"u"&&o instanceof ReadableStream||o&&typeof o=="object"&&"pipe"in o&&typeof o.pipe=="function")&&!a.duplex&&(a.duplex="half")),n!=null&&n.headers&&(l=he(he({},l),n.headers));const u=s._removeEmptyFolders(t),d=s._getFinalPath(u),f=await(e=="PUT"?Im:Lr)(s.fetch,`${s.url}/object/${d}`,o,he({headers:l},a!=null&&a.duplex?{duplex:a.duplex}:{}));return{data:{path:u,id:f.Id,fullPath:f.Key},error:null}}catch(o){if(s.shouldThrowOnError)throw o;if(qe(o))return{data:null,error:o};throw o}}async upload(e,t,r){return this.uploadOrUpdate("POST",e,t,r)}async uploadToSignedUrl(e,t,r,n){var s=this;const o=s._removeEmptyFolders(e),a=s._getFinalPath(o),l=new URL(s.url+`/object/upload/sign/${a}`);l.searchParams.set("token",t);try{let c;const u=he({upsert:jx.upsert},n),d=he(he({},s.headers),{"x-upsert":String(u.upsert)});return typeof Blob<"u"&&r instanceof Blob?(c=new FormData,c.append("cacheControl",u.cacheControl),c.append("",r)):typeof FormData<"u"&&r instanceof FormData?(c=r,c.append("cacheControl",u.cacheControl)):(c=r,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType),{data:{path:o,fullPath:(await Im(s.fetch,l.toString(),c,{headers:d})).Key},error:null}}catch(c){if(s.shouldThrowOnError)throw c;if(qe(c))return{data:null,error:c};throw c}}async createSignedUploadUrl(e,t){var r=this;try{let n=r._getFinalPath(e);const s=he({},r.headers);t!=null&&t.upsert&&(s["x-upsert"]="true");const o=await Lr(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:s}),a=new URL(r.url+o.url),l=a.searchParams.get("token");if(!l)throw new Fd("No token returned by API");return{data:{signedUrl:a.toString(),path:e,token:l},error:null}}catch(n){if(r.shouldThrowOnError)throw n;if(qe(n))return{data:null,error:n};throw n}}async update(e,t,r){return this.uploadOrUpdate("PUT",e,t,r)}async move(e,t,r){var n=this;try{return{data:await Lr(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,de
94stinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers}),error:null}}catch(s){if(n.shouldThrowOnError)throw s;if(qe(s))return{data:null,error:s};throw s}}async copy(e,t,r){var n=this;try{return{data:{path:(await Lr(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers})).Key},error:null}}catch(s){if(n.shouldThrowOnError)throw s;if(qe(s))return{data:null,error:s};throw s}}async createSignedUrl(e,t,r){var n=this;try{let s=n._getFinalPath(e),o=await Lr(n.fetch,`${n.url}/object/sign/${s}`,he({expiresIn:t},r!=null&&r.transform?{transform:r.transform}:{}),{headers:n.headers});const a=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return o={signedUrl:encodeURI(`${n.url}${o.signedURL}${a}`)},{data:o,error:null}}catch(s){if(n.shouldThrowOnError)throw s;if(qe(s))return{data:null,error:s};throw s}}async createSignedUrls(e,t,r){var n=this;try{const s=await Lr(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:t,paths:e},{headers:n.headers}),o=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return{data:s.map(a=>he(he({},a),{},{signedUrl:a.signedURL?encodeURI(`${n.url}${a.signedURL}${o}`):null})),error:null}}catch(s){if(n.shouldThrowOnError)throw s;if(qe(s))return{data:null,error:s};throw s}}download(e,t){const r=typeof(t==null?void 0:t.transform)<"u"?"render/image/authenticated":"object",n=this.transformOptsToQueryString((t==null?void 0:t.transform)||{}),s=n?`?${n}`:"",o=this._getFinalPath(e),a=()=>Al(this.fetch,`${this.url}/${r}/${o}${s}`,{headers:this.headers,noResolveJson:!0});return new eD(a,this.shouldThrowOnError)}async info(e){var t=this;const r=t._getFinalPath(e);try{return{data:Am(await Al(t.fetch,`${t.url}/object/info/${r}`,{headers:t.headers})),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(qe(n))return{data:null,error:n};throw n}}async exists(e){var t=this;const r=t._getFinalPath(e);try{return await ZI(t.fetch,`${t.url}/object/${r}`,{headers:t.headers}),{data:!0,error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(qe(n)&&n instanceof Om){const s=n.originalError;if([400,404].includes(s==null?void 0:s.status))return{data:!1,error:n}}throw n}}getPublicUrl(e,t){const r=this._getFinalPath(e),n=[],s=t!=null&&t.download?`download=${t.download===!0?"":t.download}`:"";s!==""&&n.push(s);const o=typeof(t==null?void 0:t.transform)<"u"?"render/image":"object",a=this.transformOptsToQueryString((t==null?void 0:t.transform)||{});a!==""&&n.push(a);let l=n.join("&");return l!==""&&(l=`?${l}`),{data:{publicUrl:encodeURI(`${this.url}/${o}/public/${r}${l}`)}}}async remove(e){var t=this;try{return{data:await jg(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(qe(r))return{data:null,error:r};throw r}}async list(e,t,r){var n=this;try{const s=he(he(he({},tD),t),{},{prefix:e||""});return{data:await Lr(n.fetch,`${n.url}/object/list/${n.bucketId}`,s,{headers:n.headers},r),error:null}}catch(s){if(n.shouldThrowOnError)throw s;if(qe(s))return{data:null,error:s};throw s}}async listV2(e,t){var r=this;try{const n=he({},e);return{data:await Lr(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},t),error:null}}catch(n){if(r.shouldThrowOnError)throw n;if(qe(n))return{data:null,error:n};throw n}}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}};const I1="2.89.0",D1={"X-Client-Info":`storage-js/${I1}`};var nD=class{constructor(e,t={},r,n){this.shouldThrowOnError=!1;const s=new URL(e);n!=null&&n.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase.")),this.url=s.href.replace(/\/$/,""),this.headers=he(he({},D1),t),this.fetch=kg(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async listBuckets(e){var t=this;try{const r=t.listBucketOptionsToQueryString(e);return{data:await Al(t.fetch,`${t.url}/bucket${r}`,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;
94if(qe(r))return{data:null,error:r};throw r}}async getBucket(e){var t=this;try{return{data:await Al(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(qe(r))return{data:null,error:r};throw r}}async createBucket(e,t={public:!1}){var r=this;try{return{data:await Lr(r.fetch,`${r.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}),error:null}}catch(n){if(r.shouldThrowOnError)throw n;if(qe(n))return{data:null,error:n};throw n}}async updateBucket(e,t){var r=this;try{return{data:await Im(r.fetch,`${r.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}),error:null}}catch(n){if(r.shouldThrowOnError)throw n;if(qe(n))return{data:null,error:n};throw n}}async emptyBucket(e){var t=this;try{return{data:await Lr(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(qe(r))return{data:null,error:r};throw r}}async deleteBucket(e){var t=this;try{return{data:await jg(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(qe(r))return{data:null,error:r};throw r}}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},sD=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=he(he({},D1),t),this.fetch=kg(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async createBucket(e){var t=this;try{return{data:await Lr(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(qe(r))return{data:null,error:r};throw r}}async listBuckets(e){var t=this;try{const r=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&r.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&r.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&r.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&r.set("sortOrder",e.sortOrder),e!=null&&e.search&&r.set("search",e.search);const n=r.toString(),s=n?`${t.url}/bucket?${n}`:`${t.url}/bucket`;return{data:await Al(t.fetch,s,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(qe(r))return{data:null,error:r};throw r}}async deleteBucket(e){var t=this;try{return{data:await jg(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(qe(r))return{data:null,error:r};throw r}}from(e){var t=this;if(!qI(e))throw new Fd("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const r=new BI({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(s,o){const a=s[o];return typeof a!="function"?a:async(...l)=>{try{return{data:await a.apply(s,l),error:null}}catch(c){if(n)throw c;return{data:null,error:c}}}}})}};const Ng={"X-Client-Info":`storage-js/${I1}`,"Content-Type":"application/json"};var M1=class extends Error{constructor(e){super(e),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}};function nr(e){return typeof e=="object"&&e!==null&&"__isStorageVectorsError"in e}var Qf=class extends M1{constructor(e,t,r){super(e),this.name="StorageVectorsApiError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},oD=class extends M1{constructor(e,t){super(e),this.name="StorageVectorsUnknownError",this.originalError=t}};const Cg=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),aD=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);
94return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Nx=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),iD=async(e,t,r)=>{if(e&&typeof e=="object"&&"status"in e&&"ok"in e&&typeof e.status=="number"&&!(r!=null&&r.noResolveJson)){const n=e.status||500,s=e;if(typeof s.json=="function")s.json().then(o=>{const a=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||n+"";t(new Qf(Nx(o),n,a))}).catch(()=>{const o=n+"";t(new Qf(s.statusText||`HTTP ${n} error`,n,o))});else{const o=n+"";t(new Qf(s.statusText||`HTTP ${n} error`,n,o))}}else t(new oD(Nx(e),e))},lD=(e,t,r,n)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return n?(aD(n)?(s.headers=he({"Content-Type":"application/json"},t==null?void 0:t.headers),s.body=JSON.stringify(n)):s.body=n,he(he({},s),r)):s};async function cD(e,t,r,n,s,o){return new Promise((a,l)=>{e(r,lD(t,n,s,o)).then(c=>{if(!c.ok)throw c;if(n!=null&&n.noResolveJson)return c;const u=c.headers.get("content-type");return!u||!u.includes("application/json")?{}:c.json()}).then(c=>a(c)).catch(c=>iD(c,l,n))})}async function sr(e,t,r,n,s){return cD(e,"POST",t,n,s,r)}var uD=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=he(he({},Ng),t),this.fetch=Cg(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async createIndex(e){var t=this;try{return{data:await sr(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(nr(r))return{data:null,error:r};throw r}}async getIndex(e,t){var r=this;try{return{data:await sr(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers}),error:null}}catch(n){if(r.shouldThrowOnError)throw n;if(nr(n))return{data:null,error:n};throw n}}async listIndexes(e){var t=this;try{return{data:await sr(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(nr(r))return{data:null,error:r};throw r}}async deleteIndex(e,t){var r=this;try{return{data:await sr(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers})||{},error:null}}catch(n){if(r.shouldThrowOnError)throw n;if(nr(n))return{data:null,error:n};throw n}}},dD=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=he(he({},Ng),t),this.fetch=Cg(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async putVectors(e){var t=this;try{if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return{data:await sr(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(nr(r))return{data:null,error:r};throw r}}async getVectors(e){var t=this;try{return{data:await sr(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(nr(r))return{data:null,error:r};throw r}}async listVectors(e){var t=this;try{if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return{data:await sr(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(nr(r))return{data:null,error:r};throw r}}async queryVectors(e){var t=this;try{return{data:await sr(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(nr(r))return{data:null,error:r};throw r}}async deleteVectors(e){var t=this;try{if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return{data:await sr(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(nr(r))return{data:null,error:r};throw r}}},fD=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=he(he({},Ng),t),this.fetch=Cg(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async createBucket(e){var t=this;try{return{data:await sr(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(nr(r))return{data:null,error:r};throw r}}async getBucket(e){var t=this;try{return{data:await sr(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(nr(r))return{data:null,error:r};throw r}}async listBuckets(e={}){var t=this;try{return{data:await sr(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(nr(r))return{data:null,error:r};throw r}}async deleteBucket(e){var t=this;try{return{data:await sr(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(nr(r))return{data:null,error:r};throw r}}},hD=class extends fD{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new mD(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,r=this;return t().call(r,e)}async getBucket(e){var t=()=>super.getBucket,r=this;return t().call(r,e)}async listBuckets(e={}){var t=()=>super.listBuckets,r=this;return t().call(r,e)}async deleteBucket(e){var t=()=>super.deleteBucket,r=this;return t().call(r,e)}},mD=class extends uD{constructor(e,t,r,n){super(e,t,n),this.vectorBucketName=r}async createIndex(e){var t=()=>super.createIndex,r=this;return t().call(r,he(he({},e),{},{vectorBucketName:r.vectorBucketName}))}
94async listIndexes(e={}){var t=()=>super.listIndexes,r=this;return t().call(r,he(he({},e),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,r=this;return t().call(r,r.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,r=this;return t().call(r,r.vectorBucketName,e)}index(e){return new pD(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},pD=class extends dD{constructor(e,t,r,n,s){super(e,t,s),this.vectorBucketName=r,this.indexName=n}async putVectors(e){var t=()=>super.putVectors,r=this;return t().call(r,he(he({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(e){var t=()=>super.getVectors,r=this;return t().call(r,he(he({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,r=this;return t().call(r,he(he({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,r=this;return t().call(r,he(he({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,r=this;return t().call(r,he(he({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},gD=class extends nD{constructor(e,t={},r,n){super(e,t,r,n)}from(e){return new rD(this.url,this.headers,e,this.fetch)}get vectors(){return new hD(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new sD(this.url+"/iceberg",this.headers,this.fetch)}};const L1="2.89.0",oa=30*1e3,Dm=3,Jf=Dm*oa,yD="http://localhost:9999",vD="supabase.auth.token",xD={"X-Client-Info":`gotrue-js/${L1}`},Mm="X-Supabase-Api-Version",$1={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},wD=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,bD=10*60*1e3;class Il extends Error{constructor(t,r,n){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}}function oe(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class _D extends Il{constructor(t,r,n){super(t,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function SD(e){return oe(e)&&e.name==="AuthApiError"}class so extends Il{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}}class Bn extends Il{constructor(t,r,n,s){super(t,n,s),this.name=r,this.status=n}}class er extends Bn{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function kD(e){return oe(e)&&e.name==="AuthSessionMissingError"}class Yo extends Bn{constructor(){super("Auth session or user missing","AuthInvalidToken
94ResponseError",500,void 0)}}class Wc extends Bn{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class qc extends Bn{constructor(t,r=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function jD(e){return oe(e)&&e.name==="AuthImplicitGrantRedirectError"}class Cx extends Bn{constructor(t,r=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class ND extends Bn{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class Lm extends Bn{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}}function Zf(e){return oe(e)&&e.name==="AuthRetryableFetchError"}class Ex extends Bn{constructor(t,r,n){super(t,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}}class $m extends Bn{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const Gu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Tx=` 95\r=`.split(""),CD=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<Tx.length;t+=1)e[Tx[t].charCodeAt(0)]=-2;for(let t=0;t<Gu.length;t+=1)e[Gu[t].charCodeAt(0)]=t;return e})();function Px(e,t,r){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(Gu[n]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(Gu[n]),t.queuedBits-=6}}function F1(e,t,r){const n=CD[e];if(n>-1)for(t.queue=t.queue<<6|n,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function Rx(e){const t=[],r=a=>{t.push(String.fromCodePoint(a))},n={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},o=a=>{PD(a,n,r)};for(let a=0;a<e.length;a+=1)F1(e.charCodeAt(a),s,o);return t.join("")}function ED(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 TD(e,t){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>55295&&n<=56319){const s=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|s)+65536,r+=1}ED(n,t)}}function PD(e,t,r){if(t.utf8seq===0){if(e<=127){r(e);return}for(let n=1;n<6;n+=1)if(!(e>>7-n&1)){t.utf8seq=n;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&&r(t.codepoint)}}function Aa(e){const t=[],r={queue:0,queuedBits:0},n=s=>{t.push(s)};for(let s=0;s<e.length;s+=1)F1(e.charCodeAt(s),r,n);return new Uint8Array(t)}function RD(e){const t=[];return TD(e,r=>t.push(r)),new Uint8Array(t)}function lo(e){const t=[],r={queue:0,queuedBits:0},n=s=>{t.push(s)};return e.forEach(s=>Px(s,r,n)),Px(null,r,n),t.join("")}function OD(e){return Math.round(Date.now()/1e3)+e}function AD(){return Symbol("auth-callback")}const wt=()=>typeof window<"u"&&typeof document<"u",Qs={tested:!1,writable:!1},U1=()=>{if(!wt())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Qs.tested)return Qs.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Qs.tested=!0,Qs.writable=!0}catch{Qs.tested=!0,Qs.writable=!1}return Qs.writable};function ID(e){const t={},r=new URL(e);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEac
95h((s,o)=>{t[o]=s})}catch{}return r.searchParams.forEach((n,s)=>{t[s]=n}),t}const z1=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),DD=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",aa=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},Js=async(e,t)=>{const r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return r}},xt=async(e,t)=>{await e.removeItem(t)};class Ud{constructor(){this.promise=new Ud.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}}Ud.promiseConstructor=Promise;function Xf(e){const t=e.split(".");if(t.length!==3)throw new $m("Invalid JWT structure");for(let n=0;n<t.length;n++)if(!wD.test(t[n]))throw new $m("JWT not in base64url format");return{header:JSON.parse(Rx(t[0])),payload:JSON.parse(Rx(t[1])),signature:Aa(t[2]),raw:{header:t[0],payload:t[1]}}}async function MD(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function LD(e,t){return new Promise((n,s)=>{(async()=>{for(let o=0;o<1/0;o++)try{const a=await e(o);if(!t(o,null,a)){n(a);return}}catch(a){if(!t(o,a)){s(a);return}}})()})}function $D(e){return("0"+e.toString(16)).substr(-2)}function FD(){const t=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let s="";for(let o=0;o<56;o++)s+=r.charAt(Math.floor(Math.random()*n));return s}return crypto.getRandomValues(t),Array.from(t,$D).join("")}async function UD(e){const r=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",r),s=new Uint8Array(n);return Array.from(s).map(o=>String.fromCharCode(o)).join("")}async function zD(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 r=await UD(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Qo(e,t,r=!1){const n=FD();let s=n;r&&(s+="/PASSWORD_RECOVERY"),await aa(e,`${t}-code-verifier`,s);const o=await zD(n);return[o,n===o?"plain":"s256"]}const BD=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function VD(e){const t=e.headers.get(Mm);if(!t||!t.match(BD))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function HD(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 WD(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 qD=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Jo(e){if(!qD.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function eh(){const e={};return new Proxy(e,{get:(t,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="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 "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function KD(e,t){return new Proxy(e,{get:(r,n,s)=>{if(n==="__isInsecureUserWarningProxy")return!0;if(typeof n=="symbol"){const o=n.toString();if(o==="Symbol(Symbol.toPrimitive)"||o==="Symbol(Symbol.toStringTag)"||o==="Symbol(util.inspect.custom)"||o==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,s)}return!t.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(r,n,s)}})}function Ox(e){return JSON.parse(JSON.stringify(e))}const to=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),GD=[502,503,504];async function Ax(e){var t;if(!DD(e))throw new Lm(to(e),0);if(GD.includes(e.status))throw new Lm(to(e),e.status);let r;try{r=await e.json()}catch(o){throw new so(to(o),o)}let n;const s=VD(e);if(s&&s.getTime()>=$1["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new Ex(to(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(n==="session_not_found")throw new er}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((o,a)=>
95o&&typeof a=="string",!0))throw new Ex(to(r),e.status,r.weak_password.reasons);throw new _D(to(r),e.status||500,n)}const YD=(e,t,r,n)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),s.body=JSON.stringify(n),Object.assign(Object.assign({},s),r))};async function fe(e,t,r,n){var s;const o=Object.assign({},n==null?void 0:n.headers);o[Mm]||(o[Mm]=$1["2024-01-01"].name),n!=null&&n.jwt&&(o.Authorization=`Bearer ${n.jwt}`);const a=(s=n==null?void 0:n.query)!==null&&s!==void 0?s:{};n!=null&&n.redirectTo&&(a.redirect_to=n.redirectTo);const l=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",c=await QD(e,t,r+l,{headers:o,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(c):{data:Object.assign({},c),error:null}}async function QD(e,t,r,n,s,o){const a=YD(t,n,s,o);let l;try{l=await e(r,Object.assign({},a))}catch(c){throw console.error(c),new Lm(to(c),0)}if(l.ok||await Ax(l),n!=null&&n.noResolveJson)return l;try{return await l.json()}catch(c){await Ax(c)}}function Ar(e){var t;let r=null;XD(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=OD(e.expires_in)));const n=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:r,user:n},error:null}}function Ix(e){const t=Ar(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((r,n)=>r&&typeof n=="string",!0)&&(t.data.weak_password=e.weak_password),t}function us(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function JD(e){return{data:e,error:null}}function ZD(e){const{action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:o}=e,a=yi(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:o},c=Object.assign({},a);return{data:{properties:l,user:c},error:null}}function Dx(e){return e}function XD(e){return e.access_token&&e.refresh_token&&e.expires_in}const th=["global","local","others"];class eM{constructor({url:t="",headers:r={},fetch:n}){this.url=t,this.headers=r,this.fetch=z1(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(t,r=th[0]){if(th.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${th.join(", ")}`);try{return await fe(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(n){if(oe(n))return{data:null,error:n};throw n}}async inviteUserByEmail(t,r={}){try{return await fe(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:us})}catch(n){if(oe(n))return{data:{user:null},error:n};throw n}}async generateLink(t){try{const{options:r}=t,n=yi(t,["options"]),s=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(s.new_email=n==null?void 0:n.newEmail,delete s.newEmail),await fe(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:ZD,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(oe(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(t){try{return await fe(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:us})}catch(r){if(oe(r))return{data:{user:null},error:r};throw r}}async listUsers(t){var r,n,s,o,a,l,c;try{const u={nextPage:null,lastPage:0,total:0},d=await fe(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(o=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&o!==void 0?o:""},xform:Dx});if(d.error)throw d.error;const f=await d.json(),m=(a=d.headers.get("x-total-count"))!==null&&a!==void 0?a:0,p=(c=(l=d.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return p.length>
950&&(p.forEach(w=>{const g=parseInt(w.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(w.split(";")[1].split("=")[1]);u[`${b}Page`]=g}),u.total=parseInt(m)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(oe(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){Jo(t);try{return await fe(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:us})}catch(r){if(oe(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){Jo(t);try{return await fe(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:us})}catch(n){if(oe(n))return{data:{user:null},error:n};throw n}}async deleteUser(t,r=!1){Jo(t);try{return await fe(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:us})}catch(n){if(oe(n))return{data:{user:null},error:n};throw n}}async _listFactors(t){Jo(t.userId);try{const{data:r,error:n}=await fe(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:r,error:n}}catch(r){if(oe(r))return{data:null,error:r};throw r}}async _deleteFactor(t){Jo(t.userId),Jo(t.id);try{return{data:await fe(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(r){if(oe(r))return{data:null,error:r};throw r}}async _listOAuthClients(t){var r,n,s,o,a,l,c;try{const u={nextPage:null,lastPage:0,total:0},d=await fe(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(o=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&o!==void 0?o:""},xform:Dx});if(d.error)throw d.error;const f=await d.json(),m=(a=d.headers.get("x-total-count"))!==null&&a!==void 0?a:0,p=(c=(l=d.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return p.length>0&&(p.forEach(w=>{const g=parseInt(w.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(w.split(";")[1].split("=")[1]);u[`${b}Page`]=g}),u.total=parseInt(m)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(oe(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await fe(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(oe(r))return{data:null,error:r};throw r}}async _getOAuthClient(t){try{return await fe(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(oe(r))return{data:null,error:r};throw r}}async _updateOAuthClient(t,r){try{return await fe(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(oe(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(t){try{return await fe(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(oe(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(t){try{return await fe(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(oe(r))return{data:null,error:r};throw r}}}function Mx(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}const Zo={debug:!!(globalThis&&U1()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class B1 extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class tM extends B1{}async function rM(e,t,r){Zo.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const n=new globalThis.AbortController;return t>0&&setTimeout(()=>{n.abort(),Zo.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:n.signal},async s=>{if(s){Zo.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,s.name);try{return await r()}finally{Zo.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,s.name)}}else{if(t===0)throw Zo.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new tM(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(Zo.debug)try{const o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null," "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}}))}function nM(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function V1(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}
95" is invalid.`);return e.toLowerCase()}function sM(e){return parseInt(e,16)}function oM(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,n=>n.toString(16).padStart(2,"0")).join("")}function aM(e){var t;const{chainId:r,domain:n,expirationTime:s,issuedAt:o=new Date,nonce:a,notBefore:l,requestId:c,resources:u,scheme:d,uri:f,version:m}=e;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(a&&a.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${a}`);if(!f)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(m!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${m}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(` 96`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const p=V1(e.address),w=d?`${d}://${n}`:n,g=e.statement?`${e.statement} 97`:"",b=`${w} wants you to sign in with your Ethereum account: 98${p} 99 100${g}`;let v=`URI: ${f} 101Version: ${m} 102Chain ID: ${r}${a?` 103Nonce: ${a}`:""} 104Issued At: ${o.toISOString()}`;if(s&&(v+=` 105Expiration Time: ${s.toISOString()}`),l&&(v+=` 106Not Before: ${l.toISOString()}`),c&&(v+=` 107Request ID: ${c}`),u){let y=` 108Resources:`;for(const x of u){if(!x||typeof x!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${x}`);y+=` 109- ${x}`}v+=y}return`${b} 110${v}`}class it extends Error{constructor({message:t,code:r,cause:n,name:s}){var o;super(t,{cause:n}),this.__isWebAuthnError=!0,this.name=(o=s??(n instanceof Error?n.name:void 0))!==null&&o!==void 0?o:"Unknown Error",this.code=r}}class Yu extends it{constructor(t,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:t}),this.name="WebAuthnUnknownError",this.originalError=r}}function iM({error:e,options:t}){var r,n,s;const{publicKey:o}=t;if(!o)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new it({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((r=o.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new it({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((n=o.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new it({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((s=o.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new it({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new it({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new it({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return o.pubKeyCredParams.filter(l=>l.type==="public-key").length===0?new it({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new it({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const a=window.location.hostname;if(H1(a)){if(o.rp.id!==a)return new it({message:`The RP ID "${o.rp.id}
110" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new it({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(o.user.id.byteLength<1||o.user.id.byteLength>64)return new it({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new it({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new it({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function lM({error:e,options:t}){const{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new it({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new it({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const n=window.location.hostname;if(H1(n)){if(r.rpId!==n)return new it({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new it({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new it({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new it({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class cM{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const uM=new cM;function dM(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:r,excludeCredentials:n}=e,s=yi(e,["challenge","user","excludeCredentials"]),o=Aa(t).buffer,a=Object.assign(Object.assign({},r),{id:Aa(r.id).buffer}),l=Object.assign(Object.assign({},s),{challenge:o,user:a});if(n&&n.length>0){l.excludeCredentials=new Array(n.length);for(let c=0;c<n.length;c++){const u=n[c];l.excludeCredentials[c]=Object.assign(Object.assign({},u),{id:Aa(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return l}function fM(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:r}=e,n=yi(e,["challenge","allowCredentials"]),s=Aa(t).buffer,o=Object.assign(Object.assign({},n),{challenge:s});if(r&&r.length>0){o.allowCredentials=new Array(r.length);for(let a=0;a<r.length;a++){const l=r[a];o.allowCredentials[a]=Object.assign(Object.assign({},l),{id:Aa(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return o}function hM(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e;return{id:e.id,rawId:e.id,response:{attestationObject:lo(new Uint8Array(e.response.attestationObject)),clientDataJSON:lo(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function mM(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e,n=e.getClientExtensionResults(),s=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:lo(new Uint8Array(s.authenticatorData)),clientDataJSON:lo(new Uint8Array(s.clientDataJSON)),signature:lo(new Uint8Array(s.signature)),userHandle:s.userHandle?lo(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function H1(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function Lx(){var e,t;return!!(wt()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function pM(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Yu("Browser returned unexpected credential type",t)}:{data:null,error:new Yu("Empty credential response",t)}}
110catch(t){return{data:null,error:iM({error:t,options:e})}}}async function gM(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Yu("Browser returned unexpected credential type",t)}:{data:null,error:new Yu("Empty credential response",t)}}catch(t){return{data:null,error:lM({error:t,options:e})}}}const yM={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},vM={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Qu(...e){const t=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),r=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),n={};for(const s of e)if(s)for(const o in s){const a=s[o];if(a!==void 0)if(Array.isArray(a))n[o]=a;else if(r(a))n[o]=a;else if(t(a)){const l=n[o];t(l)?n[o]=Qu(l,a):n[o]=Qu(a)}else n[o]=a}return n}function xM(e,t){return Qu(yM,e,t||{})}function wM(e,t){return Qu(vM,e,t||{})}class bM{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:r,friendlyName:n,signal:s},o){try{const{data:a,error:l}=await this.client.mfa.challenge({factorId:t,webauthn:r});if(!a)return{data:null,error:l};const c=s??uM.createNewAbortSignal();if(a.webauthn.type==="create"){const{user:u}=a.webauthn.credential_options.publicKey;u.name||(u.name=`${u.id}:${n}`),u.displayName||(u.displayName=u.name)}switch(a.webauthn.type){case"create":{const u=xM(a.webauthn.credential_options.publicKey,o==null?void 0:o.create),{data:d,error:f}=await pM({publicKey:u,signal:c});return d?{data:{factorId:t,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:d}},error:null}:{data:null,error:f}}case"request":{const u=wM(a.webauthn.credential_options.publicKey,o==null?void 0:o.request),{data:d,error:f}=await gM(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:u,signal:c}));return d?{data:{factorId:t,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:d}},error:null}:{data:null,error:f}}}}catch(a){return oe(a)?{data:null,error:a}:{data:null,error:new so("Unexpected error in challenge",a)}}}async _verify({challengeId:t,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:t,webauthn:n})}async _authenticate({factorId:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},o){if(!r)return{data:null,error:new Il("rpId is required for WebAuthn authentication")};try{if(!Lx())return{data:null,error:new so("Browser does not support WebAuthn",null)};const{data:a,error:l}=await this.challenge({factorId:t,webauthn:{rpId:r,rpOrigins:n},signal:s},{request:o});if(!a)return{data:null,error:l};const{webauthn:c}=a;return this._verify({factorId:t,challengeId:a.challengeId,webauthn:{type:c.type,rpId:r,rpOrigins:n,credential_response:c.credential_response}})}catch(a){return oe(a)?{data:null,error:a}:{data:null,error:new so("Unexpected error in authenticate",a)}}}async _register({friendlyName:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},o){if(!r)return{data:null,error:new Il("rpId is required for WebAuthn registration")};try{if(!Lx())return{data:null,error:new so("Browser does not support WebAuthn",null)};const{data:a,error:l}=await this._enroll({friendlyName:t});if(!a)return await this.client.mfa.listFactors().then(d=>{var f;return(f=d.data)===null||f===void 0?void 0:f.all.find(m=>m.factor_type==="webauthn"&&m.friendly_name===t&&m.status!=="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.id}):void 0),{data:null,error:l};const{data:c,error:u}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:s},{create:o});return c?this._verify({factorId:a.id,challengeId:c.challengeId,webauthn:{rpId:r,rpOrigins:n,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:u}}catch(a){return oe(a)?{data:null,error:a}:{data:null,error:new so("Unexpected error in register",a)}}}}nM();const _M={url:yD,storageKey:vD,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:xD,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1};async function $x(e,t,r){return await r()}const Xo={};class Dl{get jwks(){var t,r;return(r=(t=Xo[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(t){Xo[this.storageKey]=Object.assign(Object.assign({}
110,Xo[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,r;return(r=(t=Xo[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Xo[this.storageKey]=Object.assign(Object.assign({},Xo[this.storageKey]),{cachedAt:t})}constructor(t){var r,n,s;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;const o=Object.assign(Object.assign({},_M),t);if(this.storageKey=o.storageKey,this.instanceID=(r=Dl.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,Dl.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!o.debug,typeof o.debug=="function"&&(this.logger=o.debug),this.instanceID>0&&wt()){const a=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(a),this.logDebugMessages&&console.trace(a)}if(this.persistSession=o.persistSession,this.autoRefreshToken=o.autoRefreshToken,this.admin=new eM({url:o.url,headers:o.headers,fetch:o.fetch}),this.url=o.url,this.headers=o.headers,this.fetch=z1(o.fetch),this.lock=o.lock||$x,this.detectSessionInUrl=o.detectSessionInUrl,this.flowType=o.flowType,this.hasCustomAuthorizationHeader=o.hasCustomAuthorizationHeader,this.throwOnError=o.throwOnError,o.lock?this.lock=o.lock:this.persistSession&&wt()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=rM:this.lock=$x,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new bM(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(o.storage?this.storage=o.storage:U1()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Mx(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=Mx(this.memoryStorage)),wt()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(a){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",a)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async a=>{this._debug("received broadcast notification from other tab or client",a),await this._notifyAllSubscribers(a.data.event,a.data.session,!1)})}this.initialize()}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${L1}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let r={},n="none";if(wt()&&(r=ID(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),wt()&&this.detectSessionInUrl&&n!=="none"){const{data:s,error:o}=await this._getSessionFromURL(r,n);if(o){if(this._debug("#_initialize()","error detecting session from URL",o),jD(o)){const c=(t=o.details)===null||t===void 0?void 0:t.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:o}}return await this._removeSession(),{error:o}}const{session:a,redirectType:l}=s;return this._debug("#_initialize()","detected session in URL",a,"redirect type",l),await this._saveSession(a),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",a):await this._notifyAllSubscribers("SIGNED_IN",a)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return oe(r)?this._returnResult({error:r}):this._returnResult({error:new so("Unexpected error during initialization",r)}
110)}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var r,n,s;try{const o=await fe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(s=t==null?void 0:t.options)===null||s===void 0?void 0:s.captchaToken}},xform:Ar}),{data:a,error:l}=o;if(l||!a)return this._returnResult({data:{user:null,session:null},error:l});const c=a.session,u=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(o){if(oe(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signUp(t){var r,n,s;try{let o;if("email"in t){const{email:d,password:f,options:m}=t;let p=null,w=null;this.flowType==="pkce"&&([p,w]=await Qo(this.storage,this.storageKey)),o=await fe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:m==null?void 0:m.emailRedirectTo,body:{email:d,password:f,data:(r=m==null?void 0:m.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:m==null?void 0:m.captchaToken},code_challenge:p,code_challenge_method:w},xform:Ar})}else if("phone"in t){const{phone:d,password:f,options:m}=t;o=await fe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:f,data:(n=m==null?void 0:m.data)!==null&&n!==void 0?n:{},channel:(s=m==null?void 0:m.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:m==null?void 0:m.captchaToken}},xform:Ar})}else throw new Wc("You must provide either an email or phone number and a password");const{data:a,error:l}=o;if(l||!a)return await xt(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:l});const c=a.session,u=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(o){if(await xt(this.storage,`${this.storageKey}-code-verifier`),oe(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signInWithPassword(t){try{let r;if("email"in t){const{email:o,password:a,options:l}=t;r=await fe(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:o,password:a,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:Ix})}else if("phone"in t){const{phone:o,password:a,options:l}=t;r=await fe(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:o,password:a,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:Ix})}else throw new Wc("You must provide either an email or phone number and a password");const{data:n,error:s}=r;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!n||!n.session||!n.user){const o=new Yo;return this._returnResult({data:{user:null,session:null},error:o})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:s})}catch(r){if(oe(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(t){var r,n,s,o;return await this._handleProviderSignIn(t.provider,{redirectTo:(r=t.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=t.options)===null||n===void 0?void 0:n.scopes,queryParams:(s=t.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(o=t.options)===null||o===void 0?void 0:o.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:r}=t;switch(r){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(t){var r,n,s,o,a,l,c,u,d,f,m;let p,w;if("message"in t)p=t.message,w=t.signature;else{const{chain:g,wallet:b,statement:v,options:y}=t;let x;if(wt())if(typeof b=="object")x=b;else{const T=window;if("ethereum"in T&&typeof T.ethereum=="object"&&"request"in T.ethereum&&typeof T.ethereum.request=="function")x=T.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof b!="object"||!(y!=null&&y.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");x=b}const _=new URL((r=y==null?void 0:y.url)!==null&&r!==void 0?r:window.location.href),S=await x.request({method:"eth_requestAccounts"}).then(T=>T).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!S||S.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const k=V1(S[0]);let N=(n=y==null?void 0:y.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!N){const T=await x.request({method:"eth_chainId"});N=sM(T)}const E={domain:_.host,address:k,statement:v,uri:_.href,version:"1",chainId:N,nonce:(s=y==null?void 0:y.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(a=(o=y==null?void 0:y.signInWithEthereum)===null||o===void 0?void 0:o.issuedAt)!==null&&a!==void 0?a:new Date,expirationTime:(l=y==null?void 0:y.signInWithEthereum)===null||l===void 0?void 0:l.expirationTime,notBefore:(c=y==null?void 0:y.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(u=y==null?void 0:y.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(d=y==null?void 0:y.signInWithEthereum)===null||d===void 0?void 0:d.resources};p=aM(E),w=await x.request({method:"personal_sign",params:[oM(p),k]})}try{const{data:g,error:b}=await fe(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:w},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(m=t.options)===null||m===void 0?void 0:m.captchaToken}}:null),xform:Ar});if(b)throw b;if(!g||!g.session||!g.user){const v=new Yo;return this._returnResult({data:{user:null,session:null},error:v})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:b})}catch(g){if(oe(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(t){var r,n,s,o,a,l,c,u,d,f,m,p;let w,g;if("message"in t)w=t.message,g=t.signature;else{const{chain:b,wallet:v,statement:y,options:x}=t;let _;if(wt())if(typeof v=="object")_=v;
110else{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"))_=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"||!(x!=null&&x.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");_=v}const S=new URL((r=x==null?void 0:x.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in _&&_.signIn){const k=await _.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},x==null?void 0:x.signInWithSolana),{version:"1",domain:S.host,uri:S.href}),y?{statement:y}:null));let N;if(Array.isArray(k)&&k[0]&&typeof k[0]=="object")N=k[0];else if(k&&typeof k=="object"&&"signedMessage"in k&&"signature"in k)N=k;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in N&&"signature"in N&&(typeof N.signedMessage=="string"||N.signedMessage instanceof Uint8Array)&&N.signature instanceof Uint8Array)w=typeof N.signedMessage=="string"?N.signedMessage:new TextDecoder().decode(N.signedMessage),g=N.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in _)||typeof _.signMessage!="function"||!("publicKey"in _)||typeof _!="object"||!_.publicKey||!("toBase58"in _.publicKey)||typeof _.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");w=[`${S.host} wants you to sign in with your Solana account:`,_.publicKey.toBase58(),...y?["",y,""]:[""],"Version: 1",`URI: ${S.href}`,`Issued At: ${(s=(n=x==null?void 0:x.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((o=x==null?void 0:x.signInWithSolana)===null||o===void 0)&&o.notBefore?[`Not Before: ${x.signInWithSolana.notBefore}`]:[],...!((a=x==null?void 0:x.signInWithSolana)===null||a===void 0)&&a.expirationTime?[`Expiration Time: ${x.signInWithSolana.expirationTime}`]:[],...!((l=x==null?void 0:x.signInWithSolana)===null||l===void 0)&&l.chainId?[`Chain ID: ${x.signInWithSolana.chainId}`]:[],...!((c=x==null?void 0:x.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${x.signInWithSolana.nonce}`]:[],...!((u=x==null?void 0:x.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${x.signInWithSolana.requestId}`]:[],...!((f=(d=x==null?void 0:x.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||f===void 0)&&f.length?["Resources",...x.signInWithSolana.resources.map(N=>`- ${N}`)]:[]].join(` 111`);const k=await _.signMessage(new TextEncoder().encode(w),"utf8");if(!k||!(k instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=k}}try{const{data:b,error:v}=await fe(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:w,signature:lo(g)},!((m=t.options)===null||m===void 0)&&m.captchaToken?{gotrue_meta_security:{captcha_token:(p=t.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:Ar});if(v)throw v;if(!b||!b.session||!b.user){const y=new Yo;return this._returnResult({data:{user:null,session:null},error:y})}return b.session&&(await this._saveSession(b.session),await this._notifyAllSubscribers("SIGNED_IN",b.session)),this._returnResult({data:Object.assign({},b),error:v})}catch(b){if(oe(b))return this._returnResult({data:{user:null,session:null},error:b});throw b}}async _exchangeCodeForSession(t){const r=await Js(this.storage,`${this.storageKey}-code-verifier`),[n,s]=(r??"").split("/");try{if(!n&&this.flowType==="pkce")throw new ND;const{data:o,error:a}=await fe(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:n},xform:Ar});if(await xt(this.storage,`${this.storageKey}-code-verifier`),a)throw a;if(!o||!o.session||!o.user){const l=new Yo;return this._returnResult({data:{user:null,session:null,redirectType:null},error:l})}return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",o.session)),this._returnResult({data:Object.assign(Object.assign({},o),{redirectType:s??null}),error:a})}catch(o){if(await xt(this.storage,`${this.storageKey}-code-verifier`),oe(o))return this._returnResult({data:{user:null,session:null,redirectType:null},error:o});throw o}}async signInWithIdToken(t){try{const{options:r,provider:n,token:s,access_token:o,nonce:a}=t,l=await fe(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:s,access_token:o,nonce:a,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:Ar}),{data:c,error:u}=l;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!c||!c.session||!c.user){const d=new Yo;return this._returnResult({data:{user:null,session:null},error:d})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:u})}catch(r){if(oe(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(t){var r,n,s,o,a;try{if("email"in t){const{email:l,options:c}=t;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await Qo(this.storage,this.storageKey));const{error:f}=await fe(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:l,data:(r=c==null?void 0:c.data)!==null&&r!==void 0?r:{},create_user:(n=c==null?void 0:c.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:f})}if("phone"in t){const{phone:l,options:c}=t,{data:u,error:d}=await fe(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(s=c==null?void 0:c.data)!==null&&s!==void 0?s:{},create_user:(o=c==null?void 0:c.shouldCreateUser)!==null&&o!==void 0?o:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(a=c==null?void 0:c.channel)!==null&&a!==void 0?a:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d})}throw new Wc("You must provide either an email or phone number.")}catch(l){if(await xt(this.storage,`${this.storageKey}-code-verifier`),oe(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}}async verifyOtp(t){var r,n;try{let s,o;"options"in t&&(s=(r=t.options)===null||r===void 0?void 0:r.redirectTo,o=(n=t.options)===null||n===void 0?void 0:n.captchaToken);const{data:a,error:l}=await fe(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:o}}),redirectTo:s,xform:Ar});if(l)throw l;if(!a)throw new Error("An error occurred on token verification.");const c=a.session,u=a.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(s){if(oe(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(t){var r,n,s,o,a;try{let l=null,c=null;this.flowType==="pkce"&&([l,c]=await Qo(this.storage,this.storageKey));const u=await fe(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:(n=(r=t.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((s=t==null?void 0:t.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:l,code_challenge_method:c}),headers:this.headers,xform:JD});return!((o=u.data)===null||o===void 0)&&o.url&&wt()&&!(!((a=t.options)===null||a===void 0)&&a.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(l){if(await xt(this.storage,`${this.storageKey}-code-verifier`),oe(l))return this._returnResult({data:null,error:l});throw l}}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:r},error:n}=t;if(n)throw n;if(!r)throw new er;const{error:s}=await fe(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(t){if(oe(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const r=`${this.url}/resend`;if("email"in t){const{email:n,type:s,options:o}=t,{error:a}=await fe(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},redirectTo:o==null?void 0:o.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}else if("phone"in t){const{phone:n,type:s,options:o}=t,{data:a,error:l}=await fe(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:a==null?void 0:a.message_id},error:l})}throw new Wc("You must provide either an email or phone number and a type")}catch(r){if(oe(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async r=>r))}async _acquireLock(t,r){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await n}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 r=await this.__loadSession();return await t(r)}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 r=await Js(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not val
111id"),await this._removeSession())),!t)return{data:{session:null},error:null};const n=t.expires_at?t.expires_at*1e3-Date.now()<Jf:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",t.expires_at),!n){if(this.userStorage){const a=await Js(this.userStorage,this.storageKey+"-user");a!=null&&a.user?t.user=a.user:t.user=eh()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const a={value:this.suppressGetSessionWarning};t.user=KD(t.user,a),a.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:s,error:o}=await this._callRefreshToken(t.refresh_token);return o?this._returnResult({data:{session:null},error:o}):this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const r=await this._acquireLock(-1,async()=>await this._getUser());return r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(t){try{return t?await fe(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:us}):await this._useSession(async r=>{var n,s,o;const{data:a,error:l}=r;if(l)throw l;return!(!((n=a.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new er}:await fe(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(o=(s=a.session)===null||s===void 0?void 0:s.access_token)!==null&&o!==void 0?o:void 0,xform:us})})}catch(r){if(oe(r))return kD(r)&&(await this._removeSession(),await xt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(t,r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(t,r))}async _updateUser(t,r={}){try{return await this._useSession(async n=>{const{data:s,error:o}=n;if(o)throw o;if(!s.session)throw new er;const a=s.session;let l=null,c=null;this.flowType==="pkce"&&t.email!=null&&([l,c]=await Qo(this.storage,this.storageKey));const{data:u,error:d}=await fe(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:l,code_challenge_method:c}),jwt:a.access_token,xform:us});if(d)throw d;return a.user=u.user,await this._saveSession(a),await this._notifyAllSubscribers("USER_UPDATED",a),this._returnResult({data:{user:a.user},error:null})})}catch(n){if(await xt(this.storage,`${this.storageKey}-code-verifier`),oe(n))return this._returnResult({data:{user:null},error:n});throw n}}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 er;const r=Date.now()/1e3;let n=r,s=!0,o=null;const{payload:a}=Xf(t.access_token);if(a.exp&&(n=a.exp,s=n<=r),s){const{data:l,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l)return{data:{user:null,session:null},error:null};o=l}else{const{data:l,error:c}=await this._getUser(t.access_token);if(c)throw c;o={access_token:t.access_token,refresh_token:t.refresh_token,user:l.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)}return this._returnResult({data:{user:o.user,session:o},error:null})}catch(r){if(oe(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}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 r=>{var n;if(!t){const{data:a,error:l}=r;if(l)throw l;t=(n=a.session)!==null&&n!==void 0?n:void 0}if(!(t!=null&&t.refresh_token))throw new er;const{data:s,error:o}=await this._callRefreshToken(t.refresh_token);return o?this._returnResult({data:{user:null,session:null},error:o}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(oe(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(t,r){try{if(!wt())throw new qc("No browser detected.");
111if(t.error||t.error_description||t.error_code)throw new qc(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new Cx("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new qc("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new Cx("No code detected.");const{data:y,error:x}=await this._exchangeCodeForSession(t.code);if(x)throw x;const _=new URL(window.location.href);return _.searchParams.delete("code"),window.history.replaceState(window.history.state,"",_.toString()),{data:{session:y.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:s,access_token:o,refresh_token:a,expires_in:l,expires_at:c,token_type:u}=t;if(!o||!l||!a||!u)throw new qc("No session defined in URL");const d=Math.round(Date.now()/1e3),f=parseInt(l);let m=d+f;c&&(m=parseInt(c));const p=m-d;p*1e3<=oa&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${f}s`);const w=m-f;d-w>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",w,m,d):d-w<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",w,m,d);const{data:g,error:b}=await this._getUser(o);if(b)throw b;const v={provider_token:n,provider_refresh_token:s,access_token:o,expires_in:f,expires_at:m,refresh_token:a,token_type:u,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:v,redirectType:t.type},error:null})}catch(n){if(oe(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const r=await Js(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&r)}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 r=>{var n;const{data:s,error:o}=r;if(o)return this._returnResult({error:o});const a=(n=s.session)===null||n===void 0?void 0:n.access_token;if(a){const{error:l}=await this.admin.signOut(a,t);if(l&&!(SD(l)&&(l.status===404||l.status===401||l.status===403)))return this._returnResult({error:l})}return t!=="others"&&(await this._removeSession(),await xt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const r=AD(),n={id:r,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(t){return await this._useSession(async r=>{var n,s;try{const{data:{session:o},error:a}=r;if(a)throw a;await((n=this.stateChangeEmitters.get(t))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",o)),this._debug("INITIAL_SESSION","callback id",t,"session",o)}catch(o){await((s=this.stateChangeEmitters.get(t))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",o),console.error(o)}})}async resetPasswordForEmail(t,r={}){let n=null,s=null;this.flowType==="pkce"&&([n,s]=await Qo(this.storage,this.storageKey,!0));try{return await fe(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:n,code_challenge_method:s,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(o){if(await xt(this.storage,`${this.storageKey}-code-verifier`),oe(o))return this._returnResult({data:null,error:o});throw o}}async getUserIdentities(){var t;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(t=r.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(r){if(oe(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var r;try{const{data:n,error:s}=await this._useSession(async o=>{var a,l,c,u,d;const{data:f,error:m}=o;if(m)throw m;const p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(a=t.options)===null||a===void 0?void 0:a.redirectTo,scopes:(l=t.options)===null||l===void 0?void 0:l.scopes,queryParams:(c=t.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await fe(this.fetch,"GET",p,{headers:this.headers,jwt:(d=(u=f.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(s)throw s;return wt()&&!(!((r=t.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:t.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(oe(n))return this._returnResult({data:{provider:t.provider,url:null},error:n});throw n}}async linkIdentityIdToken(t){return await this._useSession(async r=>{var n;try{const{error:s,data:{session:o}}=r;if(s)throw s;const{options:a,provider:l,token:c,access_token:u,nonce:d}=t,f=await fe(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=o==null?void 0:o.access_token)!==null&&n!==void 0?n:void 0,body:{provider:l,id_token:c,access_token:u,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:Ar}),{data:m,error:p}=f;return p?this._returnResult({data:{user:null,session:null},error:p}):!m||!m.session||!m.user?this._returnResult({data:{user:null,session:null},error:new Yo}):(m.session&&(await this._saveSession(m.session),await this._notifyAllSubscribers("USER_UPDATED",m.session)),this._returnResult({data:m,error:p}))}catch(s){if(await xt(this.storage,`${this.storageKey}-code-verifier`),oe(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(t){try{return await this._useSession(async r=>{var n,s;const{data:o,error:a}=r;if(a)throw a;
111return await fe(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(s=(n=o.session)===null||n===void 0?void 0:n.access_token)!==null&&s!==void 0?s:void 0})})}catch(r){if(oe(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(t){const r=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(r,"begin");try{const n=Date.now();return await LD(async s=>(s>0&&await MD(200*Math.pow(2,s-1)),this._debug(r,"refreshing attempt",s),await fe(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Ar})),(s,o)=>{const a=200*Math.pow(2,s);return o&&Zf(o)&&Date.now()+a-n<oa})}catch(n){if(this._debug(r,"error",n),oe(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(r,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,r){const n=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",r,"url",n),wt()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:t,url:n},error:null}}async _recoverAndRefresh(){var t,r;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const s=await Js(this.storage,this.storageKey);if(s&&this.userStorage){let a=await Js(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!a&&(a={user:s.user},await aa(this.userStorage,this.storageKey+"-user",a)),s.user=(t=a==null?void 0:a.user)!==null&&t!==void 0?t:eh()}else if(s&&!s.user&&!s.user){const a=await Js(this.storage,this.storageKey+"-user");a&&(a!=null&&a.user)?(s.user=a.user,await xt(this.storage,this.storageKey+"-user"),await aa(this.storage,this.storageKey,s)):s.user=eh()}if(this._debug(n,"session from storage",s),!this._isValidSession(s)){this._debug(n,"session is not valid"),s!==null&&await this._removeSession();return}const o=((r=s.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<Jf;if(this._debug(n,`session has${o?"":" not"} expired with margin of ${Jf}s`),o){if(this.autoRefreshToken&&s.refresh_token){const{error:a}=await this._callRefreshToken(s.refresh_token);a&&(console.error(a),Zf(a)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",a),await this._removeSession()))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:a,error:l}=await this._getUser(s.access_token);!l&&(a!=null&&a.user)?(s.user=a.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(a){console.error("Error getting user data:",a),this._debug(n,"error getting user data, skipping SIGNED_IN notification",a)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(n,"error",s),console.error(s);return}finally{this._debug(n,"end")}}async _callRefreshToken(t){var r,n;if(!t)throw new er;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new Ud;const{data:o,error:a}=await this._refreshAccessToken(t);if(a)throw a;if(!o.session)throw new er;await this._saveSession(o.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",o.session);const l={data:o.session,error:null};return this.refreshingDeferred.resolve(l),l}catch(o){if(this._debug(s,"error",o),oe(o)){const a={data:null,error:o};return Zf(o)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(a),a}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(o),o}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(t,r,n=!0){const s=`#_notifyAllSubscribers(${t})`;this._debug(s,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:t,session:r});const o=[],a=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(t,r)}catch(c){o.push(c)}});if(await Promise.all(a),o.length>0){for(let l=0;l<o.length;l+=1)console.error(o[l]);throw o[0]}}finally{this._debug(s,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await xt(this.storage,`${this.storageKey}-code-verifier`);const r=Object.assign({},t),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await aa(this.userStorage,this.storageKey+"-user",{user:r.user});const s=Object.assign({},r);delete s.user;const o=Ox(s);await aa(this.storage,this.storageKey,o)}else{const s=Ox(r);await aa(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await xt(this.storage,this.storageKey),await xt(this.storage,this.storageKey+"-code-verifier"),await xt(this.storage,this.storageKey+"-user"),this.userStorage&&await xt(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;
111try{t&&wt()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),oa);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 r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((n.expires_at*1e3-t)/oa);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${oa}ms, refresh threshold is ${Dm} ticks`),s<=Dm&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof B1)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!wt()||!(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 r=`#_onVisibilityChanged(${t})`;this._debug(r,"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(r,"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,r,n){const s=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&s.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&s.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[o,a]=await Qo(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(o)}`,code_challenge_method:`${encodeURIComponent(a)}`});s.push(l.toString())}if(n!=null&&n.queryParams){const o=new URLSearchParams(n.queryParams);s.push(o.toString())}return n!=null&&n.skipBrowserRedirect&&s.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${t}?${s.join("&")}`}async _unenroll(t){try{return await this._useSession(async r=>{var n;const{data:s,error:o}=r;return o?this._returnResult({data:null,error:o}):await fe(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(oe(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(t){try{return await this._useSession(async r=>{var n,s;const{data:o,error:a}=r;if(a)return this._returnResult({data:null,error:a});const l=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:c,error:u}=await fe(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(n=o==null?void 0:o.session)===null||n===void 0?void 0:n.access_token});return u?this._returnResult({data:null,error:u}):(t.factorType==="totp"&&c.type==="totp"&&(!((s=c==null?void 0:c.totp)===null||s===void 0)&&s.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(r){if(oe(r))return this._returnResult({data:null,error:r});throw r}}async _verify(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:o}=r;if(o)return this._returnResult({data:null,error:o});const a=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?hM(t.webauthn.credential_response):mM(t.webauthn.credential_response)})}:{code:t.code}),{data:l,error:c}=await fe(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:a,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});return c?this._returnResult({data:null,error:c}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+l.expires_in},l)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",l),this._returnResult({data:l,error:c}))})}catch(r){if(oe(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:o}=r;if(o)return this._returnResult({data:null,error:o});const a=await fe(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});if(a.error)return a;const{data:l}=a;if(l.type!=="webauthn")return{data:l,error:null};switch(l.webauthn.type){case"create":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:dM(l.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:fM(l.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(oe(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(t){const{data:r,error:n}=await this._challenge({factorId:t.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:t.factorId,challengeId:r.id,code:t.code})}async _listFactors(){var t;const{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};const s={all:[],phone:[],totp:[],webauthn:[]};for(const o of(t=r==null?void 0:r.factors)!==null&&t!==void 0?t:[])s.all.push(o),o.status==="verified"&&s[o.factor_type].push(o);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(){var t,r;const{data:{session:n},error:s}
111=await this.getSession();if(s)return this._returnResult({data:null,error:s});if(!n)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:o}=Xf(n.access_token);let a=null;o.aal&&(a=o.aal);let l=a;((r=(t=n.user.factors)===null||t===void 0?void 0:t.filter(d=>d.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(l="aal2");const u=o.amr||[];return{data:{currentLevel:a,nextLevel:l,currentAuthenticationMethods:u},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?await fe(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:n.access_token,xform:o=>({data:o,error:null})}):this._returnResult({data:null,error:new er})})}catch(r){if(oe(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:s},error:o}=n;if(o)return this._returnResult({data:null,error:o});if(!s)return this._returnResult({data:null,error:new er});const a=await fe(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:l=>({data:l,error:null})});return a.data&&a.data.redirect_url&&wt()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(n){if(oe(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:s},error:o}=n;if(o)return this._returnResult({data:null,error:o});if(!s)return this._returnResult({data:null,error:new er});const a=await fe(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:l=>({data:l,error:null})});return a.data&&a.data.redirect_url&&wt()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(n){if(oe(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?await fe(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new er})})}catch(t){if(oe(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?(await fe(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new er})})}catch(r){if(oe(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(t,r={keys:[]}){let n=r.keys.find(l=>l.kid===t);if(n)return n;const s=Date.now();if(n=this.jwks.keys.find(l=>l.kid===t),n&&this.jwks_cached_at+bD>s)return n;const{data:o,error:a}=await fe(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(a)throw a;return!o.keys||o.keys.length===0||(this.jwks=o,this.jwks_cached_at=s,n=o.keys.find(l=>l.kid===t),!n)?null:n}async getClaims(t,r={}){try{let n=t;if(!n){const{data:p,error:w}
111=await this.getSession();if(w||!p.session)return this._returnResult({data:null,error:w});n=p.session.access_token}const{header:s,payload:o,signature:a,raw:{header:l,payload:c}}=Xf(n);r!=null&&r.allowExpired||HD(o.exp);const u=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!u){const{error:p}=await this.getUser(n);if(p)throw p;return{data:{claims:o,header:s,signature:a},error:null}}const d=WD(s.alg),f=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,f,a,RD(`${l}.${c}`)))throw new $m("Invalid JWT signature");return{data:{claims:o,header:s,signature:a},error:null}}catch(n){if(oe(n))return this._returnResult({data:null,error:n});throw n}}}Dl.nextInstanceID={};const SM=Dl,kM="2.89.0";let Bi="";typeof Deno<"u"?Bi="deno":typeof document<"u"?Bi="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Bi="react-native":Bi="node";const jM={"X-Client-Info":`supabase-js-${Bi}/${kM}`},NM={headers:jM},CM={schema:"public"},EM={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},TM={};function Ml(e){"@babel/helpers - typeof";return Ml=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ml(e)}function PM(e,t){if(Ml(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ml(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function RM(e){var t=PM(e,"string");return Ml(t)=="symbol"?t:t+""}function OM(e,t,r){return(t=RM(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function et(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Fx(Object(r),!0).forEach(function(n){OM(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fx(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}const AM=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),IM=()=>Headers,DM=(e,t,r)=>{const n=AM(r),s=IM();return async(o,a)=>{var l;const c=(l=await t())!==null&&l!==void 0?l:e;let u=new s(a==null?void 0:a.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${c}`),n(o,et(et({},a),{},{headers:u}))}};function MM(e){return e.endsWith("/")?e:e+"/"}function LM(e,t){var r,n;const{db:s,auth:o,realtime:a,global:l}=e,{db:c,auth:u,realtime:d,global:f}=t,m={db:et(et({},c),s),auth:et(et({},u),o),realtime:et(et({},d),a),storage:{},global:et(et(et({},f),l),{},{headers:et(et({},(r=f==null?void 0:f.headers)!==null&&r!==void 0?r:{}),(n=l==null?void 0:l.headers)!==null&&n!==void 0?n:{})}),accessToken:async()=>""};return e.accessToken?m.accessToken=e.accessToken:delete m.accessToken,m}function $M(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(MM(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var FM=class extends SM{constructor(e){super(e)}},UM=class{constructor(e,t,r){var n,s;this.supabaseUrl=e,this.supabaseKey=t;const o=$M(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",o),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",o),this.storageUrl=new URL("storage/v1",o),this.functionsUrl=new URL("functions/v1",o);const a=`sb-${o.hostname.split(".")[0]}-auth-token`,l={db:CM,realtime:TM,auth:et(et({},EM),{},{storageKey:a}),global:NM},c=LM(r??{},l);if(this.storageKey=(n=c.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(s=c.global.headers)!==null&&s!==void 0?s:{},c.accessToken)this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(d,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=c.auth)!==null&&u!==void 0?u:{},this.headers,c.global.fetch)}this.fetch=DM(t,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(et({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.accessToken&&this.accessToken().then(d=>this.realtime.setAuth(d)).catch(d=>console.warn("Failed to set initial Realtime auth token:",d)),this.rest=new xI(new URL("rest/v1",o).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch}),this.storage=new gD(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new mI(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,r)}
111channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,r;if(e.accessToken)return await e.accessToken();const{data:n}=await e.auth.getSession();return(t=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:s,storageKey:o,flowType:a,lock:l,debug:c,throwOnError:u},d,f){const m={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new FM({url:this.authUrl.href,headers:et(et({},m),d),storageKey:o,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:s,flowType:a,lock:l,debug:c,throwOnError:u,fetch:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(p=>p.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new MI(this.realtimeUrl.href,et(et({},e),{},{params:et(et({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const zM=(e,t,r)=>new UM(e,t,r);function BM(){if(typeof window<"u"||typeof process>"u")return!1;const e=process.version;if(e==null)return!1;const t=e.match(/^v(\d+)\./);return t?parseInt(t[1],10)<=18:!1}BM()&&console.warn("â ï¸ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const VM="https://kbkcpntdputtzqliqaxd.supabase.co",HM="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imtia2NwbnRkcHV0dHpxbGlxYXhkIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjY3NzUwMDIsImV4cCI6MjA4MjM1MTAwMn0.r2iTHMs4fQ_9CESUTpyR5BqwGvyqp6JPRI70QZ2VDHU",ie=zM(VM,HM,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}}),WM=5,qM="I understand that there are certain risks involved with participating in any recreational activity. I expressly understand that the Happy Smackah planning committee, nor any of its officers, agents, volunteers, or assistants shall be held responsible or made subject to any claims, including any claim for negligence, seeking to assess damages or liability for or arising from personal injury or property damage to myself or other person in whose behalf this form is submitted as a result of actual or proposed participation in the event. I am over 18 years of age OR the parent/legal guardian of a minor under 18 years of age OR the legal guardian of an incapacitated and/or mentally challenged person with legal standing to accept the terms of this liability waiver agreement. I, on behalf of myself and/or my child, hereby agree to HOLD THE HAPPY SMACKAH VOLUNTEERS, OFFICERS, AGENTS, AND ASSISTANTS HARMLESS ON ACCOUNT OF ANY SUCH CLAIM.",uB="https://smackah.com",KM="https://smackah.com",W1=h.createContext(void 0);function GM({children:e}){const[t,r]=h.useState(null),[n,s]=h.useState(null),[o,a]=h.useState(!0),[l,c]=h.useState([]),[u,d]=h.useState(null),f=async C=>{try{const{data:j,error:I}=await ie.from("user_roles").select("role").eq("user_id",C);return I?(console.error("Error fetching user roles:",I),[]):(j||[]).map(F=>F.role)}catch(j){return console.error("Error fetching user roles:",j),[]}};h.useEffect(()=>{const{data:{subscription:C}}=ie.auth.onAuthStateChange(async(j,I)=>{s(I),r((I==null?void 0:I.user)??null),j==="SIGNED_OUT"&&d(null),j==="USER_UPDATED"&&(I!=null&&I.user)&&setTimeout(async()=>{const F=I.user.email;if(F){console.log("User updated, syncing email to profile:",F);const{error:B}=await ie.from("profiles").update({email:F}).eq("user_id",I.user.id);B&&console.error("Error syncing email to profile:",B);const{error:J}=await ie.from("marketing_contacts").update({email:F,updated_at:new Date().toISOString()}).eq("user_id",I.user.id);J&&console.error("Error syncing email to marketing_contacts:",J)}},0),I!=null&&I.user?setTimeout(async()=>{const F=await f(I.user.id);c(F);const{data:B}=await ie.from("profiles").select("status").eq("user_id",I.user.id).single();(B==null?void 0:B.status)==="archived"?(console.log("Archived user attempted to access account, signing out"),await ie.auth.signOut(),c([])):(B==null?void 0:B.status)==="invited"&&(console.log("Invited user logged in, updating status to active"),await ie.from("profiles").update({status:"active",last_login_at:new Date().toISOString()}).eq("user_id",I.user.id)),a(!1)},0):(c([]),a(!1))});return ie.auth.getSession().then(async({data:{session:j}})=>{if(s(j),r((j==null?void 0:j.user)??null),j!=null&&j.user){const I=await f(j.user.id);c(I);const{data:F}=await ie.from("profiles").select("status").eq("user_id",j.user.id).single();(F==null?void 0:F.status)==="archived"&&(console.log("Archived user session found, signing out"),await ie.auth.signOut(),c([])),a(!1)}else a(!1)}),()=>C.unsubscribe()},[]);const m=async(C,j,I,F)=>{const B=`${window.location.origin}/`,{data:J,error:Z}=await ie.auth.signUp({email:C,password:j,options:{emailRedirectTo:B,data:{first_name:I||"",last_name:F||""}}});if(!Z&&J.user)try{await ie.functions.invoke("send-welcome-email",{body:{email:C,firstName:I||"",lastName:F||""}})}catch(Se){console.error("Failed to send welcome email:",Se)}return{error:Z}},p=async(C,j)=>{const{error:I}=await ie.auth.signInWithPassword({email:C,password:j});return{error:I}},w=async()=>{d(null),await ie.auth.signOut(),c([])},g=async C=>{const j=`${KM}/auth?mode=reset-confirm`;try{const{data:I,error:F}=await ie.functions.invoke("request-password-reset",{body:{email:C,redirectUrl:j}});return F?{error:new Error(F.message)}:{error:null}}catch(I){return{error:new Error(I.message||"Failed to send password reset email")}}},b=async C=>
111{if(!l.includes("admin")){console.error("Only admins can impersonate users");return}try{const{data:j,error:I}=await ie.from("profiles").select("email, first_name, last_name").eq("user_id",C).single();if(I||!j){console.error("Error fetching user profile for impersonation:",I);return}const F=await f(C);d({id:C,email:j.email,firstName:j.first_name||void 0,lastName:j.last_name||void 0,roles:F})}catch(j){console.error("Error starting impersonation:",j)}},v=()=>{d(null)},y=l.includes("admin"),x=l.includes("admin")||l.includes("editor"),_=l.includes("admin")||l.includes("editor")||l.includes("event_staff"),S=_||l.includes("check_in_staff"),k=l.includes("admin")||l.includes("editor")||l.includes("reviewer"),N=l.includes("partner"),E=u!==null,T=(u==null?void 0:u.id)??(t==null?void 0:t.id)??null,R=(u==null?void 0:u.roles)??l,L=R.includes("admin"),O=R.includes("admin")||R.includes("editor"),A=R.includes("admin")||R.includes("editor")||R.includes("event_staff"),$=A||R.includes("check_in_staff"),z=R.includes("admin")||R.includes("editor")||R.includes("reviewer"),P=R.includes("partner"),M={user:t,session:n,loading:o,roles:l,isAdmin:y,isEditor:x,isStaff:_,isCheckInStaff:S,isReviewer:k,isPartner:N,impersonatedUser:u,isImpersonating:E,startImpersonation:b,stopImpersonation:v,effectiveUserId:T,effectiveRoles:R,effectiveIsAdmin:L,effectiveIsEditor:O,effectiveIsStaff:A,effectiveIsCheckInStaff:$,effectiveIsReviewer:z,effectiveIsPartner:P,signUp:m,signIn:p,signOut:w,resetPassword:g};return i.jsx(W1.Provider,{value:M,children:e})}function Vn(){const e=h.useContext(W1);if(e===void 0)throw new Error("useAuth must be used within an AuthProvider");return e}const Fm={modern:{key:"modern",name:"Modern Minimal",description:"Clean lines, generous whitespace, soft shadows",borderRadius:"rounded",shadowIntensity:"subtle",spacing:"comfortable",fontPairing:"modern",animationSpeed:"quick"},corporate:{key:"corporate",name:"Corporate Professional",description:"Structured, efficient, high-density",borderRadius:"subtle",shadowIntensity:"flat",spacing:"compact",fontPairing:"classic",animationSpeed:"instant"},friendly:{key:"friendly",name:"Soft & Friendly",description:"Rounded, warm, approachable feel",borderRadius:"pill",shadowIntensity:"elevated",spacing:"spacious",fontPairing:"friendly",animationSpeed:"smooth"}},YM=[{name:"Lake McIntosh",city:"Longmont, CO",directionsUrl:"https://goo.gl/maps/2H92j8CLas5DJqCw5",description:"The home course! A beautiful paved loop around the lake with stunning mountain views. Perfect for runners of all levels.",icon:"water",highlight:!0,mapId:"53340"},{name:"Rabbit Mountain",city:"Longmont, CO",directionsUrl:"https://goo.gl/maps/HuVQFTcGacBd18i96",description:"A scenic trail offering panoramic views of the Front Range. Moderate terrain with some elevation gain.",icon:"mountain",mapId:"53337"},{name:"Lagerman Reservoir",city:"Longmont, CO",directionsUrl:"https://goo.gl/maps/pnmZsi3g2cDTTsrp8",description:"A peaceful reservoir loop featuring wildlife viewing opportunities and serene water views.",icon:"water",mapId:"53334"},{name:"Pella Crossing",city:"Hygiene, CO",directionsUrl:"https://goo.gl/maps/VW9x4CoHUaKhAvAV9",description:"A nature preserve with multiple ponds and excellent bird watching. Flat, easy terrain ideal for beginners.",icon:"water",mapId:"53336"},{name:"Teller Farms & White Rocks",city:"Boulder, CO",directionsUrl:"https://goo.gl/maps/WdjpHD6Rcn7SKf16A",description:"Historic farmland meets natural beauty with views of unique white rock formations along the trail.",icon:"trees",mapId:"53339"},{name:"Bobolink Trail",city:"Boulder, CO",directionsUrl:"https://goo.gl/maps/9RRVZh7gxrpB61gz8",description:"A peaceful grassland trail connecting to Boulder's extensive trail system. Great for spotting meadow birds.",icon:"trees",mapId:"53338"}],QM={course:{imageUrl:"/heroes/course-hero.jpg",overlayOpacity:60},virtualCourses:{imageUrl:"",overlayOpacity:60},about:{imageUrl:"",overlayOpacity:60},donate:{imageUrl:"",overlayOpacity:60},register:{imageUrl:"",overlayOpacity:60},gallery:{imageUrl:"",overlayOpacity:60},history:{imageUrl:"",overlayOpacity:60},sponsors:{imageUrl:"",overlayOpacity:60}},Ux={foundationLogoUrl:"https://happysmackah.com/media/2011_generic/HS_logo_white_est2011_web_2400.png",primaryColor:"#22a55b",secondaryColor:"#f97316",accentColor:"#eab308",heroVideoUrl:"",heroFallbackImageUrl:"/gallery/2024/morning.jpg",siteTitle:"",siteTagline:"",useTextBranding:!1,emailLogoUrl:"https://happysmackah.com/media/2011_generic/HS_logo_white_est2011_web_2400.png",countdownSize:"standard",courseLayoutImageUrl:"",courseMaps:{mainCourseMapId:"43295",virtualCourses:YM},pageHeroImages:QM,activeThemeProfile:"modern",themeProfiles:Fm,themeOverrides:void 0,sections:{actions:{visible:!0,title:"How You Can Help"},pastBeneficiaries:{visible:!0,title:"Your Impact"},about:{visible:!0,title:"About Our Mission"},sponsors:{visible:!0,title:"Our Amazing Sponsors"},cta:{visible:!0,title:"Ready to Make a Difference?"},eventProgress:{visible:!0,title:"Event Progress",variant:"cards",showPercentage:!0}}},q1=h.createContext(void 0);function JM({children:e}){const[t,r]=h.useState(Ux),[n,s]=h.useState(null),[o,a]=h.useState(!0),l=h.useCallback(async()=>{try{const{data:f,error:m}=await ie.from("site_settings").select("value").eq("key","branding").single();if(m)throw m;if(f!=null&&f.value){const p=f.value;r({...Ux,...p})}}catch(f){console.error("Error fetching branding:",f)}finally{a(!1)}},[]),c=h.useCallback(async f=>{try{const{error:m}=await ie.from("site_settings").update({value:JSON.parse(JSON.stringify(f))}).eq("key","branding");if(m)throw m;return r(f),s(null),!0}catch(m){return console.error("Error saving branding:",m),!1}},[]),u=h.useCallback(async()=>{a(!0),await l()},[l]);h.useEffect(()=>{l()},[l]);const d=h.useMemo(()=>({branding:t,previewBranding:n,isLoading:o,setPreviewBranding:s,saveBranding:c,refreshBranding:u}),[t,n,o,c,u]);return i.jsx(q1.Provider,{value:d,children:e})}function Bo(){const e=h.useContext(q1);if(e===void 0)throw new Error("useBranding must be used within a BrandingProvider");return e}const K1=h.createContext(void 0);function ZM({children:e}){const[t,r]=h.useState(null),[n,s]=h.useState([]),[o,a]=h.useState([]),[l,c]=h.useState([]),[u,d]=h.useState([]),[f,m]=h.useState(!0),[p,w]=h.useState(null),g=h.useCallback((x,_)=>{const S=u.find(k=>k.shirt_option_id===x&&k.size===_);return S?Math.max(0,S.quantity-S.sold_count):-1},[u]),b=h.useCallback(async()=>{try{m(!0),w(null);const{data:x,error:_}=await ie.from("events").select("*").eq("status","published").order("event_date",{ascending:!1}).limit(1).maybeSingle();if(_)throw _;if(x){r(x);const S=x.id,[k,N,E,T]=await Promise.all([ie.from("registration_skus").select("*").eq("event_id",S).eq("is_active",!0).order("sort_order",{ascending:!0}),ie.from("beneficiaries").select("*").eq("event_id",S).order("sort_order",{ascending:!0}),ie.from("shirt_options").select("*").eq("event_id",S).eq("is_available",!0).order("sort_order",{ascending:!0}),ie.from("shirt_inventory").select("*").eq("event_id",S)]);if(k.error)throw k.error;if(N.error)throw N.error;if(E.error)throw E.error;if(T.error)throw T.error;const R=k.data||[];let L=[];if(R.length>0){const{data:O,error:A}=await ie.from("age_pricing_tiers").select("*").in("sku_id",R.map(z=>z.id)).order("sort_order",{ascending:!0});if(A)throw A;const $=(O||[]).reduce((z,P)=>(z[P.sku_id]||(z[P.sku_id]=[]),z[P.sku_id].push(P),z),{});for(const z of R)L.push({...z,age_tiers:$[z.id]||[]})}s(L),a(N.data||[]),c(E.data||[]),d(T.data||[])}else r(null),s([]),a([]),c([]),d([])}catch(x){console.error("Error fetching active event:",x),w(x instanceof Error?x.message:"Failed to load event")}finally{m(!1)}},[]),v=h.useCallback(async()=>
111{if(!(t!=null&&t.id))return;const{data:x,error:_}=await ie.from("shirt_inventory").select("*").eq("event_id",t.id);if(_){console.warn("refreshInventory failed:",_.message);return}d(x||[])},[t==null?void 0:t.id]);h.useEffect(()=>{b()},[b]),h.useEffect(()=>{if(!(t!=null&&t.id))return;const x=ie.channel(`shirt_inventory:${t.id}`).on("postgres_changes",{event:"*",schema:"public",table:"shirt_inventory",filter:`event_id=eq.${t.id}`},()=>{v()}).subscribe();return()=>{ie.removeChannel(x)}},[t==null?void 0:t.id,v]);const y=h.useMemo(()=>({activeEvent:t,registrationSkus:n,beneficiaries:o,shirtOptions:l,shirtInventory:u,isLoading:f,error:p,refreshEvent:b,refreshInventory:v,getInventoryCount:g}),[t,n,o,l,u,f,p,b,v,g]);return i.jsx(K1.Provider,{value:y,children:e})}function ht(){const e=h.useContext(K1);if(e===void 0)throw new Error("useEvent must be used within an EventProvider");return e}function Eg(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})}function Tg(e){const[t]=e.split("-").map(Number);return t}function XM(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}const G1=h.createContext(void 0),Y1="lovable-cart",e4=e=>{try{localStorage.setItem(Y1,JSON.stringify(e))}catch(t){console.error("Failed to save cart to localStorage:",t)}},t4=()=>{try{const e=localStorage.getItem(Y1);if(e)return JSON.parse(e)}catch(e){console.error("Failed to load cart from localStorage:",e)}return{items:[],promo:null,eventId:null}},r4=({children:e})=>{const[t]=h.useState(t4),[r,n]=h.useState(t.items),[s,o]=h.useState(t.promo),[a,l]=h.useState(t.eventId);h.useEffect(()=>{e4({items:r,promo:s,eventId:a})},[r,s,a]);const c=h.useCallback(P=>{const M=`cart-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;n(C=>[...C,{...P,id:M}])},[]),u=h.useCallback(P=>{n(M=>M.filter(C=>C.id!==P))},[]),d=h.useCallback((P,M)=>{n(C=>C.map(j=>j.id===P?{...j,...M}:j))},[]),f=h.useCallback(()=>{n([]),o(null)},[]),m=h.useCallback((P,M)=>{var j,I,F,B,J,Z;if(!((j=M.appliesToTypes)!=null&&j.length)&&!((I=M.includedSkuIds)!=null&&I.length)&&!((F=M.excludedSkuIds)!=null&&F.length))return!0;const C=P.type==="registration"||P.type==="merchandise"||P.type==="donation"?P.skuId:void 0;return(B=M.excludedSkuIds)!=null&&B.length&&C&&M.excludedSkuIds.includes(C)?!1:(J=M.includedSkuIds)!=null&&J.length?C?M.includedSkuIds.includes(C):!1:(Z=M.appliesToTypes)!=null&&Z.length?M.appliesToTypes.includes(P.type):!0},[]),p=h.useMemo(()=>r.reduce((P,M)=>M.type==="registration"?P+M.basePrice+M.shirtPrice:M.type==="sponsorship"?P+M.price:M.type==="donation"?P+M.amount:M.type==="merchandise"?P+M.price*M.quantity:P,0),[r]),w=h.useMemo(()=>s?r.reduce((P,M)=>m(M,s)?M.type==="registration"?P+M.basePrice+M.shirtPrice:M.type==="sponsorship"?P+M.price:M.type==="donation"?P+M.amount:M.type==="merchandise"?P+M.price*M.quantity:P:P,0):p,[r,s,p,m]),g=h.useMemo(()=>s?r.filter(P=>m(P,s)).length:r.length,[r,s,m]),b=h.useMemo(()=>{if(!s)return 0;if(s.percentOff)return Math.round(w*(s.percentOff/100));if(s.amountOff)if(s.discountMode==="per_item"){const P=s.maxItemsPerOrder??1/0,M=Math.min(g,P),C=s.amountOff*M;return Math.min(C,w)}else return Math.min(s.amountOff,w);return 0},[s,w,g]),v=h.useMemo(()=>Math.max(0,p-b),[p,b]),y=h.useCallback(()=>p,[p]),x=h.useCallback(()=>w,[w]),_=h.useCallback(()=>b,[b]),S=h.useCallback(()=>v,[v]),k=h.useCallback(()=>r.length,[r.length]),N=h.useCallback(()=>g,[g]),E=h.useCallback(()=>r.filter(P=>P.type==="registration"),[r]),T=h.useCallback(()=>r.filter(P=>P.type==="sponsorship"),[r]),R=h.useCallback(()=>r.filter(P=>P.type==="donation"),[r]),L=h.useCallback(()=>r.filter(P=>P.type==="merchandise"),[r]),O=h.useCallback((P,M)=>{if(!P||!M)return 0;let C=0;for(const j of r)j.type==="registration"?j.participant.shirtOptionId===P&&j.participant.shirtSize===M&&(C+=1):j.type==="merchandise"&&j.shirtOptionId===P&&j.shirtSize===M&&(C+=j.quantity||1);return C},[r]),A=h.useCallback(P=>s?m(P,s):!0,[s,m]),$=h.useCallback(P=>{if(!s||!m(P,s))return 0;
111const M=P.type==="registration"?P.basePrice+P.shirtPrice:P.type==="sponsorship"?P.price:P.type==="donation"?P.amount:P.type==="merchandise"?P.price*P.quantity:0;if(s.percentOff)return Math.round(M*(s.percentOff/100));if(s.amountOff)if(s.discountMode==="per_item"){const j=r.filter(F=>m(F,s)).findIndex(F=>F.id===P.id),I=s.maxItemsPerOrder??1/0;return j<I?Math.min(s.amountOff,M):0}else{if(w===0)return 0;const C=M/w;return Math.round(Math.min(s.amountOff,w)*C)}return 0},[s,r,m,w]),z=h.useMemo(()=>({items:r,promo:s,eventId:a,addItem:c,removeItem:u,updateItem:d,clearCart:f,setEventId:l,setPromo:o,getSubtotal:y,getEligibleSubtotal:x,getDiscount:_,getTotal:S,getItemCount:k,getEligibleItemCount:N,getRegistrations:E,getSponsorships:T,getDonations:R,getMerchandise:L,isItemEligible:A,getItemDiscount:$,getCartShirtCount:O}),[r,s,a,c,u,d,f,y,x,_,S,k,N,E,T,R,L,A,$,O]);return i.jsx(G1.Provider,{value:z,children:e})},Vt=()=>{const e=h.useContext(G1);if(!e)throw new Error("useCart must be used within a CartProvider");return e};function rh(e){e=e.replace(/^#/,"");const t=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(!t)return"142 76% 36%";let r=parseInt(t[1],16)/255,n=parseInt(t[2],16)/255,s=parseInt(t[3],16)/255;const o=Math.max(r,n,s),a=Math.min(r,n,s);let l=0,c=0;const u=(o+a)/2;if(o!==a){const d=o-a;switch(c=u>.5?d/(2-o-a):d/(o+a),o){case r:l=((n-s)/d+(n<s?6:0))*60;break;case n:l=((s-r)/d+2)*60;break;case s:l=((r-n)/d+4)*60;break}}return`${Math.round(l)} ${Math.round(c*100)}% ${Math.round(u*100)}%`}const zx={sharp:"0px",subtle:"0.25rem",rounded:"0.75rem",pill:"9999px"},Bx={flat:"0 0 0 0 transparent",subtle:"0 1px 3px 0 rgb(0 0 0 / 0.05), 0 1px 2px -1px rgb(0 0 0 / 0.05)",elevated:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)"},n4={compact:"0.85",comfortable:"1",spacious:"1.15"},Vx={instant:"0ms",quick:"150ms",smooth:"300ms"},Hx={modern:{heading:"'Outfit', system-ui, sans-serif",body:"'Inter', system-ui, sans-serif"},classic:{heading:"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",body:"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"},friendly:{heading:"'Outfit', 'Nunito', system-ui, sans-serif",body:"'Inter', 'Nunito Sans', system-ui, sans-serif"}};function s4(){const{branding:e,previewBranding:t}=Bo();return h.useEffect(()=>{var g,b,v,y;const r=t||e,n=r.activeThemeProfile||"modern",s=((g=r.themeProfiles)==null?void 0:g[n])||Fm[n]||Fm.modern,o=r.themeOverrides,a=((b=s.colorPreset)==null?void 0:b.primary)||r.primaryColor,l=((v=s.colorPreset)==null?void 0:v.secondary)||r.secondaryColor,c=((y=s.colorPreset)==null?void 0:y.accent)||r.accentColor;document.documentElement.style.setProperty("--primary",rh(a)),document.documentElement.style.setProperty("--secondary",rh(l)),document.documentElement.style.setProperty("--accent",rh(c));const u=(o==null?void 0:o.borderRadiusValue)!==void 0?`${o.borderRadiusValue}px`:zx[s.borderRadius]||zx.rounded;document.documentElement.style.setProperty("--radius",u);const d=Bx[s.shadowIntensity]||Bx.subtle,f=(o==null?void 0:o.shadowMultiplier)??1;document.documentElement.style.setProperty("--shadow-card",d),document.documentElement.style.setProperty("--shadow-multiplier",String(f));const m=(o==null?void 0:o.spacingScale)??parseFloat(n4[s.spacing]||"1");document.documentElement.style.setProperty("--spacing-scale",String(m));const p=Vx[s.animationSpeed]||Vx.quick;document.documentElement.style.setProperty("--transition-speed",p);const w=Hx[s.fontPairing]||Hx.modern;return document.documentElement.style.setProperty("--font-heading",w.heading),document.documentElement.style.setProperty("--font-body",w.body),()=>{document.documentElement.style.removeProperty("--primary"),document.documentElement.style.removeProperty("--secondary"),document.documentElement.style.removeProperty("--accent"),document.documentElement.style.removeProperty("--radius"),document.documentElement.style.removeProperty("--shadow-card"),document.documentElement.style.removeProperty("--shadow-multiplier"),document.documentElement.style.removeProperty("--spacing-scale"),document.documentElement.style.removeProperty("--transition-speed"),document.documentElement.style.removeProperty("--font-heading"),document.documentElement.style.removeProperty("--font-body")}},[e,t]),null}function Zs({children:e,requireAdmin:t=!1,requireStaff:r=!1,requireReviewer:n=!1,requireCheckInStaff:s=!1}){const{user:o,loading:a,isAdmin:l,isStaff:c,isReviewer:u,isCheckInStaff:d}=Vn(),f=Xr();return a?i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"w-8 h-8 border-4 border-primary border-t-transparent roun
111ded-full animate-spin mx-auto mb-4"}),i.jsx("p",{className:"text-muted-foreground",children:"Loading..."})]})}):o?t&&!l?i.jsx(Oi,{to:"/",replace:!0}):r&&!c&&!u?i.jsx(Oi,{to:"/",replace:!0}):s&&!d?i.jsx(Oi,{to:"/",replace:!0}):n&&!u?i.jsx(Oi,{to:"/",replace:!0}):i.jsx(i.Fragment,{children:e}):i.jsx(Oi,{to:"/auth",state:{from:f},replace:!0})}const nh="analytics_session_id",o4=30*60*1e3;function a4(){return crypto.randomUUID()}function i4(){const e=sessionStorage.getItem(nh);if(e)try{const{id:r,timestamp:n}=JSON.parse(e);if(Date.now()-n<o4)return sessionStorage.setItem(nh,JSON.stringify({id:r,timestamp:Date.now()})),r}catch{}const t=a4();return sessionStorage.setItem(nh,JSON.stringify({id:t,timestamp:Date.now()})),t}function l4(){const e=new URLSearchParams(window.location.search);return{utm_source:e.get("utm_source"),utm_medium:e.get("utm_medium"),utm_campaign:e.get("utm_campaign"),utm_content:e.get("utm_content"),utm_term:e.get("utm_term")}}function c4(e){if(!e)return null;try{const t=new URL(e);return t.hostname===window.location.hostname?null:t.hostname}catch{return null}}function u4(){const e=navigator.userAgent;return/tablet|ipad|playbook|silk/i.test(e)?"tablet":/mobile|iphone|ipod|android|blackberry|opera mini|iemobile/i.test(e)?"mobile":"desktop"}function d4(){const e=navigator.userAgent;return e.includes("Firefox")?"Firefox":e.includes("Edg")?"Edge":e.includes("Chrome")?"Chrome":e.includes("Safari")?"Safari":e.includes("Opera")||e.includes("OPR")?"Opera":"Other"}function f4(){const e=navigator.userAgent;return e.includes("Windows")?"Windows":e.includes("Mac OS")?"macOS":e.includes("Linux")?"Linux":e.includes("Android")?"Android":e.includes("iOS")||e.includes("iPhone")||e.includes("iPad")?"iOS":"Other"}function h4(){const e=navigator.userAgent.toLowerCase();return["bot","crawler","spider","scraper","fetch","googlebot","bingbot","slurp","duckduckbot","baiduspider","yandexbot","facebookexternalhit","twitterbot","linkedinbot","embedly","quora","outbrain","pinterest","developers.google.com","headless","phantom","puppeteer","lighthouse"].some(r=>e.includes(r))}function m4(){const e=Xr(),{user:t}=Vn(),r=h.useRef(""),n=h.useRef(""),s=h.useRef(!0),o=h.useCallback(async a=>{if(a===r.current&&!s.current||(r.current=a,s.current=!1,h4()))return;n.current||(n.current=i4());const l=n.current,c=l4(),u=document.referrer,d=c4(u),f=u4(),m=d4(),p=f4();try{const w=await fetch("https://kbkcpntdputtzqliqaxd.supabase.co/functions/v1/track-pageview",{method:"POST",headers:{"Content-Type":"application/json",apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imtia2NwbnRkcHV0dHpxbGlxYXhkIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjY3NzUwMDIsImV4cCI6MjA4MjM1MTAwMn0.r2iTHMs4fQ_9CESUTpyR5BqwGvyqp6JPRI70QZ2VDHU"},body:JSON.stringify({session_id:l,page_path:a,page_title:document.title,referrer:u||null,referrer_domain:d,...c,device_type:f,browser:m,os:p,user_id:(t==null?void 0:t.id)||null})});w.ok||console.error("Failed to track page view:",await w.text())}catch(w){console.error("Analytics tracking error:",w)}},[t==null?void 0:t.id]);return h.useEffect(()=>{const a=e.pathname+e.search;o(a)},[e.pathname,e.search,o]),{trackPageView:o}}function p4({children:e}){return m4(),i.jsx(i.Fragment,{children:e})}const Wx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,qx=Z_,nc=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return qx(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:o}=t,a=Object.keys(s).map(u=>{const d=r==null?void 0:r[u],f=o==null?void 0:o[u];if(d===null)return null;const m=Wx(d)||Wx(f);return s[u][m]}),l=r&&Object.entries(r).reduce((u,d)=>{let[f,m]=d;return m===void 0||(u[f]=m),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:f,className:m,...p}=d;return Object.entries(p).every(w=>{let[g,b]=w;return Array.isArray(b)?b.includes({...o,...l}[g]):{...o,...l}[g]===b})?[...u,f,m]:u},[]);return qx(e,a,c,r==null?void 0:r.class,r==null?void 0:r.className)},Pg=nc("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-semibold transition-all duration-300 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 font-body",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-md hover:shadow-lg hover:scale-[1.02] active:scale-[0.98]",destructive:"bg-destructive text-destructive-foreground shadow-md hover:bg-destructive/90 hover:shadow-lg",outline:"border-2 border-primary text-primary bg-transparent hover:bg-primary hover:text-primary-foreground",secondary:"bg-secondary text-secondary-foreground shadow-md hover:shadow-lg hover:scale-[1.02] active:scale-[0.98]",ghost:"text-foreground hover:bg-muted hover:text-foreground",link:"text-primary underline-offset-4 hover:underline",hero:"bg-primary text-primary-foreground shadow-lg hover:shadow-xl hover:scale-[1.03] active:scale-[0.98] hover:bg-primary/90",heroOutline:"border-2 border-background/50 text-foreground bg-background/90 backdrop-blur-md shadow-lg hover:bg-background hover:shadow-xl hover:scale-[1.02] active:scale-[0.98]",heroGlass:"bg-background/95 backdrop-blur-sm text-foreground hover:bg-background shadow-lg border border-border/50",nature:"bg-secondary text-secondary-foreground shadow-lg hover:shadow-xl hover:scale-[1.03] active:scale-[0.98]",glass:"backdrop-blur-md border border-border/50 text-foreground bg-card/80 hover:bg-card/90"},size:{default:"h-11 px-5 py-2.5",sm:"h-9 rounded-md px-4 text-xs",lg:"h-12 rounded-lg px-8 text-base",xl:"h-14 roun
111ded-xl px-10 text-lg",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ce=h.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},o)=>{const a=n?SP:"button";return i.jsx(a,{className:D(Pg({variant:t,size:r,className:e})),ref:o,...s})});ce.displayName="Button";/** 112 * @license lucide-react v0.462.0 - ISC 113 * 114 * This source code is licensed under the ISC license. 115 * See the LICENSE file in the root directory of this source tree. 116 */const g4=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Q1=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/** 117 * @license lucide-react v0.462.0 - ISC 118 * 119 * This source code is licensed under the ISC license. 120 * See the LICENSE file in the root directory of this source tree. 121 */var y4={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"};/** 122 * @license lucide-react v0.462.0 - ISC 123 * 124 * This source code is licensed under the ISC license. 125 * See the LICENSE file in the root directory of this source tree. 126 */const v4=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:o,iconNode:a,...l},c)=>h.createElement("svg",{ref:c,...y4,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Q1("lucide",s),...l},[...a.map(([u,d])=>h.createElement(u,d)),...Array.isArray(o)?o:[o]]));/** 127 * @license lucide-react v0.462.0 - ISC 128 * 129 * This source code is licensed under the ISC license. 130 * See the LICENSE file in the root directory of this source tree. 131 */const ae=(e,t)=>{const r=h.forwardRef(({className:n,...s},o)=>h.createElement(v4,{ref:o,iconNode:t,className:Q1(`lucide-${g4(e)}`,n),...s}));return r.displayName=`${e}`,r};/** 132 * @license lucide-react v0.462.0 - ISC 133 * 134 * This source code is licensed under the ISC license. 135 * See the LICENSE file in the root directory of this source tree. 136 */const Um=ae("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** 137 * @license lucide-react v0.462.0 - ISC 138 * 139 * This source code is licensed under the ISC license. 140 * See the LICENSE file in the root directory of this source tree. 141 */const _t=ae("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 142 * @license lucide-react v0.462.0 - ISC 143 * 144 * This source code is licensed under the ISC license. 145 * See the LICENSE file in the root directory of this source tree. 146 */const x4=ae("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"}]]);/** 147 * @license lucide-react v0.462.0 - ISC 148 * 149 * This source code is licensed under the ISC license. 150 * See the LICENSE file in the root directory of this source tree. 151 */const yn=ae("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** 152 * @license lucide-react v0.462.0 - ISC 153 * 154 * This source code is licensed under the ISC license. 155 * See the LICENSE file in the root directory of this source tree. 156 */const w4=ae("CalendarDays",[["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"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/** 157 * @license lucide-react v0.462.0 - ISC 158 * 159 * This source code is licensed under the ISC license. 160 * See the LICENSE file in the root directory of this source tree. 161 */const Rg=ae("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"}]]);/** 162 * @license lucide-react v0.462.0 - ISC 163 * 164 * This source code is licensed under the ISC license. 165 * See the LICENSE file in the root directory of this source tree. 166 */const Oo=ae("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 167 * @license lucide-react v0.462.0 - ISC 168 * 169 * This source code is licensed under the ISC license. 170 * See the LICENSE file in the root directory of this source tree. 171 */const hn=ae("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 172 * @license lucide-react v0.462.0 - ISC 173 * 174 * This source code is licensed under the ISC license. 175 * See the LICENSE file in the root directory of this source tree. 176 */const Vi=ae("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 177 * @license lucide-react v0.462.0 - ISC 178 * 179 * This source code is licensed under the ISC license. 180 * See the LICENSE file in the root directory of this source tree. 181 */const J1=ae("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 182 * @license lucide-react v0.462.0 - ISC 183 * 184 * This source code is licensed under the ISC license. 185 * See the LICENSE file in the root directory of this source tree. 186 */const Xa=ae("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** 187 * @license lucide-react v0.462.0 - ISC 188 * 189 * This source code is licensed under the ISC license. 190 * See the LICENSE file in the root directory of this source tree. 191 */const Z1=ae("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 192 * @license lucide-react v0.462.0 - ISC 193 * 194 * This source code is licensed under the ISC license. 195 * See the LICENSE file in the root directory of this source tree. 196 */const b4=ae("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 197 * @license lucide-react v0.462.0 - ISC 198 * 199 * This source code is licensed under the ISC license. 200 * See the LICENSE file in the root directory of this source tree. 201 */const X1=ae("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** 202 * @license lucide-react v0.462.0 - ISC 203 * 204 * This source code is licensed under the ISC license. 205 * See the LICENSE file in the root directory of this source tree.
206 */const eS=ae("ClipboardCheck",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]);/** 207 * @license lucide-react v0.462.0 - ISC 208 * 209 * This source code is licensed under the ISC license. 210 * See the LICENSE file in the root directory of this source tree. 211 */const _4=ae("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** 212 * @license lucide-react v0.462.0 - ISC 213 * 214 * This source code is licensed under the ISC license. 215 * See the LICENSE file in the root directory of this source tree. 216 */const S4=ae("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/** 217 * @license lucide-react v0.462.0 - ISC 218 * 219 * This source code is licensed under the ISC license. 220 * See the LICENSE file in the root directory of this source tree. 221 */const k4=ae("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/** 222 * @license lucide-react v0.462.0 - ISC 223 * 224 * This source code is licensed under the ISC license. 225 * See the LICENSE file in the root directory of this source tree. 226 */const j4=ae("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"}]]);/** 227 * @license lucide-react v0.462.0 - ISC 228 * 229 * This source code is licensed under the ISC license. 230 * See the LICENSE file in the root directory of this source tree. 231 */const N4=ae("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"}]]);/** 232 * @license lucide-react v0.462.0 - ISC 233 * 234 * This source code is licensed under the ISC license. 235 * See the LICENSE file in the root directory of this source tree. 236 */const C4=ae("Facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]]);/** 237 * @license lucide-react v0.462.0 - ISC 238 * 239 * This source code is licensed under the ISC license. 240 * See the LICENSE file in the root directory of this source tree. 241 */const E4=ae("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"}]]);/** 242 * @license lucide-react v0.462.0 - ISC 243 * 244 * This source code is licensed under the ISC license. 245 * See the LICENSE file in the root directory of this source tree. 246 */const T4=ae("HeartHandshake",[["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"}],["path",{d:"M12 5 9.04 7.96a2.17 2.17 0 0 0 0 3.08c.82.82 2.13.85 3 .07l2.07-1.9a2.82 2.82 0 0 1 3.79 0l2.96 2.66",key:"4oyue0"}],["path",{d:"m18 15-2-2",key:"60u0ii"}],["path",{d:"m15 18-2-2",key:"6p76be"}]]);/** 247 * @license lucide-react v0.462.0 - ISC 248 * 249 * This source code is licensed under the ISC license. 250 * See the LICENSE file in the root directory of this source tree. 251 */const vt=ae("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"}]]);/** 252 * @license lucide-react v0.462.0 - ISC 253 * 254 * This source code is licensed under the ISC license. 255 * See the LICENSE file in the root directory of this source tree.
256 */const P4=ae("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** 257 * @license lucide-react v0.462.0 - ISC 258 * 259 * This source code is licensed under the ISC license. 260 * See the LICENSE file in the root directory of this source tree. 261 */const R4=ae("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"}]]);/** 262 * @license lucide-react v0.462.0 - ISC 263 * 264 * This source code is licensed under the ISC license. 265 * See the LICENSE file in the root directory of this source tree. 266 */const Jr=ae("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 267 * @license lucide-react v0.462.0 - ISC 268 * 269 * This source code is licensed under the ISC license. 270 * See the LICENSE file in the root directory of this source tree. 271 */const O4=ae("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** 272 * @license lucide-react v0.462.0 - ISC 273 * 274 * This source code is licensed under the ISC license. 275 * See the LICENSE file in the root directory of this source tree. 276 */const Kx=ae("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"}]]);/** 277 * @license lucide-react v0.462.0 - ISC 278 * 279 * This source code is licensed under the ISC license. 280 * See the LICENSE file in the root directory of this source tree. 281 */const tS=ae("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"}]]);/** 282 * @license lucide-react v0.462.0 - ISC 283 * 284 * This source code is licensed under the ISC license. 285 * See the LICENSE file in the root directory of this source tree. 286 */const Og=ae("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"}]]);/** 287 * @license lucide-react v0.462.0 - ISC 288 * 289 * This source code is licensed under the ISC license. 290 * See the LICENSE file in the root directory of this source tree. 291 */const A4=ae("Medal",[["path",{d:"M7.21 15 2.66 7.14a2 2 0 0 1 .13-2.2L4.4 2.8A2 2 0 0 1 6 2h12a2 2 0 0 1 1.6.8l1.6 2.14a2 2 0 0 1 .14 2.2L16.79 15",key:"143lza"}],["path",{d:"M11 12 5.12 2.2",key:"qhuxz6"}],["path",{d:"m13 12 5.88-9.8",key:"hbye0f"}],["path",{d:"M8 7h8",key:"i86dvs"}],["circle",{cx:"12",cy:"17",r:"5",key:"qbz8iq"}],["path",{d:"M12 18v-2h-.5",key:"fawc4q"}]]);/** 292 * @license lucide-react v0.462.0 - ISC 293 * 294 * This source code is licensed under the ISC license. 295 * See the LICENSE file in the root directory of this source tree. 296 */const I4=ae("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** 297 * @license lucide-react v0.462.0 - ISC 298 * 299 * This source code is licensed under the ISC license. 300 * See the LICENSE file in the root directory of this source tree. 301 */const zd=ae("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/** 302 * @license lucide-react v0.462.0 - ISC 303 * 304 * This source code is licensed under the ISC license. 305 * See the LICENSE file in the root directory of this source tree. 306 */const D4=ae("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"}]]);/** 307 * @license lucide-react v0.462.0 - ISC 308 * 309 * This source code is licensed under the ISC license. 310 * See the LICENSE file in the root directory of this source tree. 311 */const M4=ae("Percent",[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]]);/** 312 * @license lucide-react v0.462.0 - ISC 313 * 314 * This source code is licensed under the ISC license. 315 * See the LICENSE file in the root directory of this source tree. 316 */const Ao=ae("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** 317 * @license lucide-react v0.462.0 - ISC 318 * 319 * This source code is licensed under the ISC license. 320 * See the LICENSE file in the root directory of this source tree. 321 */const L4=ae("Printer",[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]);/** 322 * @license lucide-react v0.462.0 - ISC 323 * 324 * This source code is licensed under the ISC license. 325 * See the LICENSE file in the root directory of this source tree. 326 */const $4=ae("Receipt",[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]]);/** 327 * @license lucide-react v0.462.0 - ISC 328 * 329 * This source code is licensed under the ISC license. 330 * See the LICENSE file in the root directory of this source tree. 331 */const F4=ae("ShieldCheck",[["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",ke
331y:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 332 * @license lucide-react v0.462.0 - ISC 333 * 334 * This source code is licensed under the ISC license. 335 * See the LICENSE file in the root directory of this source tree. 336 */const Gx=ae("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"}]]);/** 337 * @license lucide-react v0.462.0 - ISC 338 * 339 * This source code is licensed under the ISC license. 340 * See the LICENSE file in the root directory of this source tree. 341 */const ei=ae("Shirt",[["path",{d:"M20.38 3.46 16 2a4 4 0 0 1-8 0L3.62 3.46a2 2 0 0 0-1.34 2.23l.58 3.47a1 1 0 0 0 .99.84H6v10c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2V10h2.15a1 1 0 0 0 .99-.84l.58-3.47a2 2 0 0 0-1.34-2.23z",key:"1wgbhj"}]]);/** 342 * @license lucide-react v0.462.0 - ISC 343 * 344 * This source code is licensed under the ISC license. 345 * See the LICENSE file in the root directory of this source tree. 346 */const bo=ae("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);/** 347 * @license lucide-react v0.462.0 - ISC 348 * 349 * This source code is licensed under the ISC license. 350 * See the LICENSE file in the root directory of this source tree. 351 */const U4=ae("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** 352 * @license lucide-react v0.462.0 - ISC 353 * 354 * This source code is licensed under the ISC license. 355 * See the LICENSE file in the root directory of this source tree. 356 */const z4=ae("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"}]]);/** 357 * @license lucide-react v0.462.0 - ISC 358 * 359 * This source code is licensed under the ISC license. 360 * See the LICENSE file in the root directory of this source tree. 361 */const co=ae("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"}]]);/** 362 * @license lucide-react v0.462.0 - ISC 363 * 364 * This source code is licensed under the ISC license. 365 * See the LICENSE file in the root directory of this source tree. 366 */const rS=ae("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/** 367 * @license lucide-react v0.462.0 - ISC 368 * 369 * This source code is licensed under the ISC license. 370 * See the LICENSE file in the root directory of this source tree. 371 */const B4=ae("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"}]]);/** 372 * @license lucide-react v0.462.0 - ISC 373 * 374 * This source code is licensed under the ISC license. 375 * See the LICENSE file in the root directory of this source tree. 376 */const V4=ae("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"}]]);/** 377 * @license lucide-react v0.462.0 - ISC 378 * 379 * This source code is licensed under the ISC license. 380 * See the LICENSE file in the root directory of this source tree. 381 */const Ag=ae("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"}]]);/** 382 * @license lucide-react v0.462.0 - ISC 383 * 384 * This source code is licensed under the ISC license. 385 * See the LICENSE file in the root directory of this source tree. 386 */const H4=ae("UserCheck",[["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"}
386],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/** 387 * @license lucide-react v0.462.0 - ISC 388 * 389 * This source code is licensed under the ISC license. 390 * See the LICENSE file in the root directory of this source tree. 391 */const W4=ae("UserPlus",[["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"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/** 392 * @license lucide-react v0.462.0 - ISC 393 * 394 * This source code is licensed under the ISC license. 395 * See the LICENSE file in the root directory of this source tree. 396 */const q4=ae("UserX",[["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"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]);/** 397 * @license lucide-react v0.462.0 - ISC 398 * 399 * This source code is licensed under the ISC license. 400 * See the LICENSE file in the root directory of this source tree. 401 */const Hr=ae("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** 402 * @license lucide-react v0.462.0 - ISC 403 * 404 * This source code is licensed under the ISC license. 405 * See the LICENSE file in the root directory of this source tree. 406 */const Fn=ae("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"}]]);/** 407 * @license lucide-react v0.462.0 - ISC 408 * 409 * This source code is licensed under the ISC license. 410 * See the LICENSE file in the root directory of this source tree. 411 */const sc=ae("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** 412 * @license lucide-react v0.462.0 - ISC 413 * 414 * This source code is licensed under the ISC license. 415 * See the LICENSE file in the root directory of this source tree. 416 */const K4=ae("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"}]]),G4={sm:"h-8",md:"h-12",lg:"h-16",xl:"h-24"},Yx={sm:{title:"text-lg",tagline:"text-[10px]"},md:{title:"text-xl",tagline:"text-xs"},lg:{title:"text-2xl",tagline:"text-sm"},xl:{title:"text-3xl",tagline:"text-base"}};function Ig({variant:e="event",className:t,size:r="md"}){const{branding:n,previewBranding:s}=Bo(),{activeEvent:o}=ht(),a=s||n;if(e==="nav"&&a.useTextBranding&&a.siteTitle)return i.jsxs("div",{className:D("flex flex-col justify-center",t),children:[i.jsx("span",{className:D("font-bold leading-tight tracking-tight",Yx[r].title),children:a.siteTitle}),a.siteTagline&&i.jsx("span",{className:D("text-muted-foreground leading-tight",Yx[r].tagline),children:a.siteTagline})]});let l;e==="nav"?l=a.foundationLogoUrl:e==="event"?l=o==null?void 0:o.event_logo_url:l=a.foundationLogoUrl;const c=o?Tg(o.event_date):new Date().getFullYear(),u=e==="event"?`Happy Smackah ${c} Logo`:"Happy Smackah Foundation Logo";return l?i.jsx("img",{src:l,alt:u,className:D(G4[r],"w-auto object-contain",t)}):null}function Dg(e){const t=e+"CollectionProvider",[r,n]=Zt(t),[s,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),a=g=>{const{scope:b,children:v}=g,y=W.useRef(null),x=W.useRef(new Map).current;return i.jsx(s,{scope:b,itemMap:x,collectionRef:y,children:v})};a.displayName=t;const l=e+"CollectionSlot",c=To(l),u=W.forwardRef((g,b)=>{const{scope:v,children:y}=g,x=o(l,v),_=be(b,x.collectionRef);return i.jsx(c,{ref:_,children:y})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",m=To(d),p=W.forwardRef((g,b)=>{const{scope:v,children:y,...x}=g,_=W.useRef(null),S=be(b,_),k=o(d,v);return W.useEffect(()=>(k.itemMap.set(_,{ref:_,...x}),()=>void k.itemMap.delete(_))),i.jsx(m,{[f]:"",ref:S,children:y})});p.displayName=d;function w(g){const b=o(e+"CollectionConsumer",g);return W.useCallback(()=>{const y=b.collectionRef.current;if(!y)return[];const x=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((k,N)=>x.indexOf(k.ref.current)-x.indexOf(N.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:u,ItemSlot:p},w,n]}var Y4=h.createContext(void 0);function oc(e){const t=h.useContext(Y4);return e||t||"ltr"}var sh=0;function Mg(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Qx()),document.body.insertAdjacentElement("beforeend",e[1]??Qx()),sh++,()=>{sh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),sh--}},[])}function Qx(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.
vendor: 4,724 bytes, line 416
416style.position="fixed",e.style.pointerEvents="none",e}var oh="focusScope.autoFocusOnMount",ah="focusScope.autoFocusOnUnmount",Jx={bubbles:!1,cancelable:!0},Q4="FocusScope",Bd=h.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=e,[l,c]=h.useState(null),u=pt(s),d=pt(o),f=h.useRef(null),m=be(t,g=>c(g)),p=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(n){let g=function(x){if(p.paused||!l)return;const _=x.target;l.contains(_)?f.current=_:ns(f.current,{select:!0})},b=function(x){if(p.paused||!l)return;const _=x.relatedTarget;_!==null&&(l.contains(_)||ns(f.current,{select:!0}))},v=function(x){if(document.activeElement===document.body)for(const S of x)S.removedNodes.length>0&&ns(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",b);const y=new MutationObserver(v);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",b),y.disconnect()}}},[n,l,p.paused]),h.useEffect(()=>{if(l){Xx.add(p);const g=document.activeElement;if(!l.contains(g)){const v=new CustomEvent(oh,Jx);l.addEventListener(oh,u),l.dispatchEvent(v),v.defaultPrevented||(J4(rL(nS(l)),{select:!0}),document.activeElement===g&&ns(l))}return()=>{l.removeEventListener(oh,u),setTimeout(()=>{const v=new CustomEvent(ah,Jx);l.addEventListener(ah,d),l.dispatchEvent(v),v.defaultPrevented||ns(g??document.body,{select:!0}),l.removeEventListener(ah,d),Xx.remove(p)},0)}}},[l,u,d,p]);const w=h.useCallback(g=>{if(!r&&!n||p.paused)return;const b=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(b&&v){const y=g.currentTarget,[x,_]=Z4(y);x&&_?!g.shiftKey&&v===_?(g.preventDefault(),r&&ns(x,{select:!0})):g.shiftKey&&v===x&&(g.preventDefault(),r&&ns(_,{select:!0})):v===y&&g.preventDefault()}},[r,n,p.paused]);return i.jsx(ue.div,{tabIndex:-1,...a,ref:m,onKeyDown:w})});Bd.displayName=Q4;function J4(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(ns(n,{select:t}),document.activeElement!==r)return}function Z4(e){const t=nS(e),r=Zx(t,e),n=Zx(t.reverse(),e);return[r,n]}function nS(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Zx(e,t){for(const r of e)if(!X4(r,{upTo:t}))return r}function X4(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 eL(e){return e instanceof HTMLInputElement&&"select"in e}function ns(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&eL(e)&&t&&e.select()}}var Xx=tL();function tL(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=e0(e,t),e.unshift(t)},remove(t){var r;e=e0(e,t),(r=e[0])==null||r.resume()}}}function e0(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function rL(e){return e.filter(t=>t.tagName!=="A")}var ih="rovingFocusGroup.onEntryFocus",nL={bubbles:!1,cancelable:!0},ac="RovingFocusGroup",[zm,sS,sL]=Dg(ac),[oL,Vd]=Zt(ac,[sL]),[aL,iL]=oL(ac),oS=h.forwardRef((e,t)=>i.jsx(zm.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(zm.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(lL,{...e,ref:t})})}));oS.displayName=ac;var lL=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,m=h.useRef(null),p=be(t,m),w=oc(o),[g,b]=gn({prop:a,defaultProp:l??null,onChange:c,caller:ac}),[v,y]=h.useState(!1),x=pt(u),_=sS(r),S=h.useRef(!1),[k,N]=h.useState(0);return h.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(ih,x),()=>E.removeEventListener(ih,x)},[x]),i.jsx(aL,{scope:r,orientation:n,dir:w,loop:s,currentTabStopId:g,onItemFocus:h.useCallback(E=>b(E),[b]),onItemShiftTab:h.useCallback(()=>y(!0),[]),onFocusableItemAdd:h.useCallback(()=>N(E=>E+1),[]),onFocusableItemRemove:h.useCallback(()=>N(E=>E-1),[]),children:i.jsx(ue.div,{tabIndex:v||k===0?-1:0,"data-orientation":n,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:Y(e.onMouseDown,()=>{S.current=!0}),onFocus:Y(e.onFocus,E=>{const T=!S.current;if(E.target===E.currentTarget&&T&&!v){const R=new CustomEvent(ih,nL);if(E.currentTarget.dispatchEvent(R),!R.defaultPrevented){const L=_().filter(P=>P.focusable),O=L.find(P=>P.active),A=L.find(P=>
vendor: 4,132 bytes, line 416
416P.id===g),z=[O,A,...L].filter(Boolean).map(P=>P.ref.current);lS(z,d)}}S.current=!1}),onBlur:Y(e.onBlur,()=>y(!1))})})}),aS="RovingFocusGroupItem",iS=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:o,children:a,...l}=e,c=ir(),u=o||c,d=iL(aS,r),f=d.currentTabStopId===u,m=sS(r),{onFocusableItemAdd:p,onFocusableItemRemove:w,currentTabStopId:g}=d;return h.useEffect(()=>{if(n)return p(),()=>w()},[n,p,w]),i.jsx(zm.ItemSlot,{scope:r,id:u,focusable:n,active:s,children:i.jsx(ue.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...l,ref:t,onMouseDown:Y(e.onMouseDown,b=>{n?d.onItemFocus(u):b.preventDefault()}),onFocus:Y(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:Y(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){d.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const v=dL(b,d.orientation,d.dir);if(v!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let x=m().filter(_=>_.focusable).map(_=>_.ref.current);if(v==="last")x.reverse();else if(v==="prev"||v==="next"){v==="prev"&&x.reverse();const _=x.indexOf(b.currentTarget);x=d.loop?fL(x,_+1):x.slice(_+1)}setTimeout(()=>lS(x))}}),children:typeof a=="function"?a({isCurrentTabStop:f,hasTabStop:g!=null}):a})})});iS.displayName=aS;var cL={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function uL(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function dL(e,t,r){const n=uL(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return cL[n]}function lS(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function fL(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var cS=oS,uS=iS,hL=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ea=new WeakMap,Kc=new WeakMap,Gc={},lh=0,dS=function(e){return e&&(e.host||dS(e.parentNode))},mL=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=dS(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},pL=function(e,t,r,n){var s=mL(t,Array.isArray(e)?e:[e]);Gc[r]||(Gc[r]=new WeakMap);var o=Gc[r],a=[],l=new Set,c=new Set(s),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};s.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(m){if(l.has(m))d(m);else try{var p=m.getAttribute(n),w=p!==null&&p!=="false",g=(ea.get(m)||0)+1,b=(o.get(m)||0)+1;ea.set(m,g),o.set(m,b),a.push(m),g===1&&w&&Kc.set(m,!0),b===1&&m.setAttribute(r,"true"),w||m.setAttribute(n,"true")}catch(v){console.error("aria-hidden: cannot operate on ",m,v)}})};return d(t),l.clear(),lh++,function(){a.forEach(function(f){var m=ea.get(f)-1,p=o.get(f)-1;ea.set(f,m),o.set(f,p),m||(Kc.has(f)||f.removeAttribute(n),Kc.delete(f)),p||f.removeAttribute(r)}),lh--,lh||(ea=new WeakMap,ea=new WeakMap,Kc=new WeakMap,Gc={})}},Lg=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=hL(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),pL(n,s,r,"aria-hidden")):function(){return null}},pu="right-scroll-bar-position",gu="width-before-scroll-bar",gL="with-scroll-bars-hidden",yL="--removed-body-scroll-bar-size";function ch(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function vL(e,t){var r=h.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=t,r.facade}var xL=typeof window<"u"?h.useLayoutEffect:h.useEffect,t0=new WeakMap;function wL(e,t){var r=vL(null,function(n){return e.forEach(function(s){return ch(s,n)})});return xL(function(){var n=t0.get(r);if(n){var s=new Set(n),o=new Set(e),a=r.current;s.forEach(function(l){o.has(l)||ch(l,null)}),o.forEach(function(l){s.has(l)||ch(l,a)})}t0.set(r,e)},[e]),r}function bL(e){return e}
vendor: 10,873 bytes, lines 416-456
416function _L(e,t){t===void 0&&(t=bL);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(o){var a=t(o,n);return r.push(a),function(){r=r.filter(function(l){return l!==a})}},assignSyncMedium:function(o){for(n=!0;r.length;){var a=r;r=[],a.forEach(o)}r={push:function(l){return o(l)},filter:function(){return r}}},assignMedium:function(o){n=!0;var a=[];if(r.length){var l=r;r=[],l.forEach(o),a=r}var c=function(){var d=a;a=[],d.forEach(o)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),r}}}};return s}function SL(e){e===void 0&&(e={});var t=_L(null);return t.options=ln({async:!0,ssr:!1},e),t}var fS=function(e){var t=e.sideCar,r=yi(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return h.createElement(n,ln({},r))};fS.isSideCarExport=!0;function kL(e,t){return e.useMedium(t),fS}var hS=SL(),uh=function(){},Hd=h.forwardRef(function(e,t){var r=h.useRef(null),n=h.useState({onScrollCapture:uh,onWheelCapture:uh,onTouchMoveCapture:uh}),s=n[0],o=n[1],a=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,m=e.sideCar,p=e.noRelative,w=e.noIsolation,g=e.inert,b=e.allowPinchZoom,v=e.as,y=v===void 0?"div":v,x=e.gapMode,_=yi(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,k=wL([r,t]),N=ln(ln({},_),s);return h.createElement(h.Fragment,null,d&&h.createElement(S,{sideCar:hS,removeScrollBar:u,shards:f,noRelative:p,noIsolation:w,inert:g,setCallbacks:o,allowPinchZoom:!!b,lockRef:r,gapMode:x}),a?h.cloneElement(h.Children.only(l),ln(ln({},N),{ref:k})):h.createElement(y,ln({},N,{className:c,ref:k}),l))});Hd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Hd.classNames={fullWidth:gu,zeroRight:pu};var jL=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function NL(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=jL();return t&&e.setAttribute("nonce",t),e}function CL(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function EL(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var TL=function(){var e=0,t=null;return{add:function(r){e==0&&(t=NL())&&(CL(t,r),EL(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},PL=function(){var e=TL();return function(t,r){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},mS=function(){var e=PL(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},RL={left:0,top:0,right:0,gap:0},dh=function(e){return parseInt(e||"",10)||0},OL=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[dh(r),dh(n),dh(s)]},AL=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return RL;var t=OL(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},IL=mS(),Ia="data-scroll-locked",DL=function(e,t,r,n){var s=e.left,o=e.top,a=e.right,l=e.gap;return r===void 0&&(r="margin"),` 417 .`.concat(gL,` { 418 overflow: hidden `).concat(n,`; 419 padding-right: `).concat(l,"px ").concat(n,`; 420 } 421 body[`).concat(Ia,`] { 422 overflow: hidden `).concat(n,`; 423 overscroll-behavior: contain; 424 `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&` 425 padding-left: `.concat(s,`px; 426 padding-top: `).concat(o,`px; 427 padding-right: `).concat(a,`px; 428 margin-left:0; 429 margin-top:0; 430 margin-right: `).concat(l,"px ").concat(n,`; 431 `),r==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";")].filter(Boolean).join(""),` 432 } 433 434 .`).concat(pu,` { 435 right: `).concat(l,"px ").concat(n,`; 436 } 437 438 .`).concat(gu,` { 439 margin-right: `).concat(l,"px ").concat(n,`; 440 } 441 442 .`).concat(pu," .").concat(pu,` { 443 right: 0 `).concat(n,`; 444 } 445 446 .`).concat(gu," .").concat(gu,` { 447 margin-right: 0 `).concat(n,`; 448 } 449 450 body[`).concat(Ia,`] { 451 `).concat(yL,": ").concat(l,`px; 452 } 453`)},r0=function(){var e=parseInt(document.body.getAttribute(Ia)||"0",10);return isFinite(e)?e:0},ML=function(){h.useEffect(function(){return document.body.setAttribute(Ia,(r0()+1).toString()),function(){var e=r0()-1;e<=0?document.body.removeAttribute(Ia):document.body.setAttribute(Ia,e.toString())}},[])},LL=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;ML();var o=h.useMemo(function(){return AL(s)},[s]);return h.createElement(IL,{styles:DL(o,!t,s,r?"":"!important")})},Bm=!1;if(typeof window<"u")try{var Yc=Object.defineProperty({},"passive",{get:function(){return Bm=!0,!0}});window.addEventListener("test",Yc,Yc),window.removeEventListener("test",Yc,Yc)}catch{Bm=!1}var ta=Bm?{passive:!1}:!1,$L=function(e){return e.tagName==="TEXTAREA"},pS=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!$L(e)&&r[t]==="visible")},FL=function(e){return pS(e,"overflowY")},UL=function(e){return pS(e,"overflowX")},n0=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=gS(e,n);if(s){var o=yS(e,n),a=o[1],l=o[2];if(a>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},zL=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},BL=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},gS=function(e,t){return e==="v"?FL(t):UL(t)},yS=function(e,t){return e==="v"?zL(t):BL(t)},VL=function(e,t){return e==="h"&&t==="rtl"?-1:1},HL=function(e,t,r,n,s){var o=VL(e,window.getComputedStyle(t).direction),a=o*n,l=r.target,c=t.contains(l),u=!1,d=a>0,f=0,m=0;do{if(!l)break;var p=yS(e,l),w=p[0],g=p[1],b=p[2],v=g-b-o*w;(w||v)&&gS(e,l)&&(f+=v,m+=w);var y=l.parentNode;l=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(f)<1||!s)||!d&&(Math.abs(m)<1||!s))&&(u=!0),u},Qc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},s0=function(e){return[e.deltaX,e.deltaY]},o0=function(e){return e&&"current"in e?e.current:e},WL=function(e,t){return e[0]===t[0]&&e[1]===t[1]},qL=function(e){return` 454 .block-interactivity-`.concat(e,` {pointer-events: none;} 455 .allow-interactivity-`).concat(e,` {pointer-events: all;} 456`)},KL=0,ra=[];function GL(e){var t=h.useRef([]),r=h.useRef([0,0]),n=h.useRef(),s=h.useState(KL++)[0],o=h.useState(mS)[0],a=h.useRef(e);h.useEffect(function(){a.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var g=dI([e.lockRef.current],(e.shards||[]).map(o0),!0).filter(Boolean);return g.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),g.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=h.useCallback(function(g,b){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!a.current.allowPinchZoom;var v=Qc(g),y=r.current,x="deltaX"in g?g.deltaX:y[0]-v[0],_="deltaY"in g?g.deltaY:y[1]-v[1],S,k=g.target,N=Math.abs(x)>Math.abs(_)?"h":"v";if("touches"in g&&N==="h"&&k.type==="range")return!1;var E=n0(N,k);if(!E)return!0;if(E?S=N:(S=N==="v"?"h":"v",E=n0(N,k)),!E)return!1;if(!n.current&&"changedTouches"in g&&(x||_)&&(n.current=S),!S)return!0;var T=n.current||S;return HL(T,b,g,T==="h"?x:_,!0)},[]),c=h.useCallback(function(g){var b=g;if(!(!ra.length||ra[ra.length-1]!==o)){var v="deltaY"in b?s0(b):Qc(b),y=t.current.filter(function(S){return S.name===b.type&&(S.target===b.target||b.target===S.shadowParent)&&WL(S.delta,v)})[0];if(y&&y.should){b.cancelable&&b.preventDefault();return}if(!y){var x=(a.current.shards||[]).map(o0).filter(Boolean).filter(function(S){return S.contains(b.target)}),_=x.length>0?l(b,x[0]):!a.current.noIsolation;_&&b.cancelable&&b.preventDefault()}}},[]),u=h.useCallback(function(g,b,v,y){var x={name:g,delta:b,target:v,should:y,shadowParent:YL(v)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(_){return _!==x})},1)},[]),d=h.useCallback(function(g){r.current=Qc(g),n.current=void 0},[]),f=h.useCallback(function(g){u(g.type,s0(g),g.target,l(g,e.lockRef.current))},[]),m=h.useCallback(function(g){u(g.type,Qc(g),g.target,l(g,e.lockRef.current))},[]);h.useEffect(function(){return ra.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",c,ta),document.addEventListener("touchmove",c,ta),document.addEventListener("touchstart",d,ta),function(){ra=ra.filter(function(g){return g!==o}),document.removeEventListener("wheel",c,ta),document.removeEventListener("touchmove",c,ta),document.removeEventListener("touchstart",d,ta)}},[]);var p=e.removeScrollBar,w=e.inert;return h.createElement(h.Fragment,null,w?h.createElement(o,{styles:qL(s)}):null,p?h.createElement(LL,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function YL(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const QL=kL(hS,GL);var Wd=h.forwardRef(function(e,t){return h.createElement(Hd,ln({},e,{ref:t,sideCar:QL}))});Wd.classNames=Hd.classNames;var Vm=["Enter"," "],JL=["ArrowDown","PageUp","Home"],vS=["ArrowUp","PageDown","End"],ZL=[...JL,...vS],XL={ltr:[...Vm,"ArrowRight"],rtl:[...Vm,"ArrowLeft"]},e$={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ic="Menu",[Ll,t$,r$]=Dg(ic),[Vo,xS]=Zt(ic,[r$,hi,Vd]),lc=hi(),wS=Vd(),[bS,Ws]=Vo(ic),[n$,cc]=Vo(ic),_S=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:s,onOpenChange:o,modal:a=!0}=e,l=lc(t),[c,u]=h.useState(null),d=h.useRef(!1),f=pt(o),m=oc(s);return h.useEffect(()=>{const p=()=>{d.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>d.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),i.jsx(Rd,{...l,children:i.jsx(bS,{scope:t,open:r,onOpenChange:f,content:c,onContentChange:u,children:i.jsx(n$,{scope:t,onClose:h.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:m,modal:a,children:n})})})};_S.displayName=ic;
vendor: 13,340 bytes, line 456
456var s$="MenuAnchor",$g=h.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=lc(r);return i.jsx(dg,{...s,...n,ref:t})});$g.displayName=s$;var Fg="MenuPortal",[o$,SS]=Vo(Fg,{forceMount:void 0}),kS=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:s}=e,o=Ws(Fg,t);return i.jsx(o$,{scope:t,forceMount:r,children:i.jsx(It,{present:r||o.open,children:i.jsx(Od,{asChild:!0,container:s,children:n})})})};kS.displayName=Fg;var wr="MenuContent",[a$,Ug]=Vo(wr),jS=h.forwardRef((e,t)=>{const r=SS(wr,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=Ws(wr,e.__scopeMenu),a=cc(wr,e.__scopeMenu);return i.jsx(Ll.Provider,{scope:e.__scopeMenu,children:i.jsx(It,{present:n||o.open,children:i.jsx(Ll.Slot,{scope:e.__scopeMenu,children:a.modal?i.jsx(i$,{...s,ref:t}):i.jsx(l$,{...s,ref:t})})})})}),i$=h.forwardRef((e,t)=>{const r=Ws(wr,e.__scopeMenu),n=h.useRef(null),s=be(t,n);return h.useEffect(()=>{const o=n.current;if(o)return Lg(o)},[]),i.jsx(zg,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Y(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),l$=h.forwardRef((e,t)=>{const r=Ws(wr,e.__scopeMenu);return i.jsx(zg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),c$=To("MenuContent.ScrollLock"),zg=h.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:m,onDismiss:p,disableOutsideScroll:w,...g}=e,b=Ws(wr,r),v=cc(wr,r),y=lc(r),x=wS(r),_=t$(r),[S,k]=h.useState(null),N=h.useRef(null),E=be(t,N,b.onContentChange),T=h.useRef(0),R=h.useRef(""),L=h.useRef(0),O=h.useRef(null),A=h.useRef("right"),$=h.useRef(0),z=w?Wd:h.Fragment,P=w?{as:c$,allowPinchZoom:!0}:void 0,M=j=>{var V,le;const I=R.current+j,F=_().filter(ge=>!ge.disabled),B=document.activeElement,J=(V=F.find(ge=>ge.ref.current===B))==null?void 0:V.textValue,Z=F.map(ge=>ge.textValue),Se=b$(Z,I,J),je=(le=F.find(ge=>ge.textValue===Se))==null?void 0:le.ref.current;(function ge(de){R.current=de,window.clearTimeout(T.current),de!==""&&(T.current=window.setTimeout(()=>ge(""),1e3))})(I),je&&setTimeout(()=>je.focus())};h.useEffect(()=>()=>window.clearTimeout(T.current),[]),Mg();const C=h.useCallback(j=>{var F,B;return A.current===((F=O.current)==null?void 0:F.side)&&S$(j,(B=O.current)==null?void 0:B.area)},[]);return i.jsx(a$,{scope:r,searchRef:R,onItemEnter:h.useCallback(j=>{C(j)&&j.preventDefault()},[C]),onItemLeave:h.useCallback(j=>{var I;C(j)||((I=N.current)==null||I.focus(),k(null))},[C]),onTriggerLeave:h.useCallback(j=>{C(j)&&j.preventDefault()},[C]),pointerGraceTimerRef:L,onPointerGraceIntentChange:h.useCallback(j=>{O.current=j},[]),children:i.jsx(z,{...P,children:i.jsx(Bd,{asChild:!0,trapped:s,onMountAutoFocus:Y(o,j=>{var I;j.preventDefault(),(I=N.current)==null||I.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:i.jsx(ec,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:m,onDismiss:p,children:i.jsx(cS,{asChild:!0,...x,dir:v.dir,orientation:"vertical",loop:n,currentTabStopId:S,onCurrentTabStopIdChange:k,onEntryFocus:Y(c,j=>{v.isUsingKeyboardRef.current||j.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(fg,{role:"menu","aria-orientation":"vertical","data-state":BS(b.open),"data-radix-menu-content":"",dir:v.dir,...y,...g,ref:E,style:{outline:"none",...g.style},onKeyDown:Y(g.onKeyDown,j=>{const F=j.target.closest("[data-radix-menu-content]")===j.currentTarget,B=j.ctrlKey||j.altKey||j.metaKey,J=j.key.length===1;F&&(j.key==="Tab"&&j.preventDefault(),!B&&J&&M(j.key));const Z=N.current;if(j.target!==Z||!ZL.includes(j.key))return;j.preventDefault();const je=_().filter(V=>!V.disabled).map(V=>V.ref.current);vS.includes(j.key)&&je.reverse(),x$(je)}),onBlur:Y(e.onBlur,j=>{j.currentTarget.contains(j.target)||(window.clearTimeout(T.current),R.current="")}),onPointerMove:Y(e.onPointerMove,$l(j=>{const I=j.target,F=$.current!==j.clientX;if(j.currentTarget.contains(I)&&F){const B=j.clientX>$.current?"right":"left";A.current=B,$.current=j.clientX}}))})})})})})})});jS.displayName=wr;var u$="MenuGroup",Bg=h.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return i.jsx(ue.div,{role:"group",...n,ref:t})});Bg.displayName=u$;var d$="MenuLabel",NS=h.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return i.jsx(ue.div,{...n,ref:t})});NS.displayName=d$;var Ju="MenuItem",a0="menu.itemSelect",qd=h.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...s}=e,o=h.useRef(null),a=cc(Ju,e.__scopeMenu),l=Ug(Ju,e.__scopeMenu),c=be(t,o),u=h.useRef(!1),d=()=>{const f=o.current;if(!r&&f){const m=new CustomEvent(a0,{bubbles:!0,cancelable:!0});f.addEventListener(a0,p=>n==null?void 0:n(p),{once:!0}),y_(f,m),m.defaultPrevented?u.current=!1:a.onClose()}};return i.jsx(CS,{...s,ref:c,disabled:r,onClick:Y(e.onClick,d),onPointerDown:f=>{var m;(m=e.onPointerDown)==null||m.call(e,f),u.current=!0},onPointerUp:Y(e.onPointerUp,f=>{var m;u.current||(m=f.currentTarget)==null||m.click()}),onKeyDown:Y(e.onKeyDown,f=>{const m=l.searchRef.current!=="";r||m&&f.key===" "||Vm.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});qd.displayName=Ju;var CS=h.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:s,...o}=e,a=Ug(Ju,r),l=wS(r),c=h.useRef(null),u=be(t,c),[d,f]=h.useState(!1),[m,p]=h.useState("");return h.useEffect(()=>{const w=c.current;w&&p((w.textContent??"").trim())},[o.children]),i.jsx(Ll.ItemSlot,{scope:r,disabled:n,textValue:s??m,children:i.jsx(uS,{asChild:!0,...l,focusable:!n,children:i.jsx(ue.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...o,ref:u,onPointerMove:Y(e.onPointerMove,$l(w=>{n?a.onItemLeave(w):(a.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Y(e.onPointerLeave,$l(w=>a.onItemLeave(w))),onFocus:Y(e.onFocus,()=>f(!0)),onBlur:Y(e.onBlur,()=>f(!1))})})})}),f$="MenuCheckboxItem",ES=h.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...s}=e;return i.jsx(AS,{scope:e.__scopeMenu,checked:r,children:i.jsx(qd,{role:"menuitemcheckbox","aria-checked":Zu(r)?"mixed":r,...s,ref:t,"data-state":Wg(r),onSelect:Y(s.onSelect,()=>n==null?void 0:n(Zu(r)?!0:!r),{checkForDefaultPrevented:!1})})})});ES.displayName=f$;var TS="MenuRadioGroup",[h$,m$]=Vo(TS,{value:void 0,onValueChange:()=>{}}),PS=h.forwardRef((e,t)=>{const{value:r,onValueChange:n,...s}=e,o=pt(n);return i.jsx(h$,{scope:e.__scopeMenu,value:r,onValueChange:o,children:i.jsx(Bg,{...s,ref:t})})});PS.displayName=TS;var RS="MenuRadioItem",OS=h.forwardRef((e,t)=>{const{value:r,...n}=e,s=m$(RS,e.__scopeMenu),o=r===s.value;return i.jsx(AS,{scope:e.__scopeMenu,checked:o,children:i.jsx(qd,{role:"menuitemradio","aria-checked":o,...n,ref:t,"data-state":Wg(o),onSelect:Y(n.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,r)},{checkForDefaultPrevented:!1})})})});OS.displayName=RS;var Vg="MenuItemIndicator",[AS,p$]=Vo(Vg,{checked:!1}),IS=h.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...s}=e,o=p$(Vg,r);return i.jsx(It,{present:n||Zu(o.checked)||o.checked===!0,children:i.jsx(ue.span,{...s,ref:t,"data-state":Wg(o.checked)})})});IS.displayName=Vg;var g$="MenuSeparator",DS=h.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return i.jsx(ue.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});DS.displayName=g$;var y$="MenuArrow",MS=h.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=lc(r);return i.jsx(hg,{...s,...n,ref:t})});MS.displayName=y$;var Hg="MenuSub",[v$,LS]=Vo(Hg),$S=e=>{const{__scopeMenu:t,children:r,open:n=!1,onOpenChange:s}=e,o=Ws(Hg,t),a=lc(t),[l,c]=h.useState(null),[u,d]=h.useState(null),f=pt(s);return h.useEffect(()=>(o.open===!1&&f(!1),()=>f(!1)),[o.open,f]),i.jsx(Rd,{...a,children:i.jsx(bS,{scope:t,open:n,onOpenChange:f,content:u,onContentChange:d,children:i.jsx(v$,{scope:t,contentId:ir(),triggerId:ir(),trigger:l,onTriggerChange:c,children:r})})})};$S.displayName=Hg;var Hi="MenuSubTrigger",FS=h.forwardRef((e,t)=>{const r=Ws(Hi,e.__scopeMenu),n=cc(Hi,e.__scopeMenu),s=LS(Hi,e.__scopeMenu),o=Ug(Hi,e.__scopeMenu),a=h.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=o,u={__scopeMenu:e.__scopeMenu},d=h.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return h.useEffect(()=>d,[d]),h.useEffect(()=>{const f=l.current;return()=>{window.clearTimeout(f),c(null)}},[l,c]),i.jsx($g,{asChild:!0,...u,children:i.jsx(CS,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":BS(r.open),...e,ref:Cd(t,s.onTriggerChange),onClick:f=>{var m;(m=e.onClick)==null||m.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Y(e.onPointerMove,$l(f=>{o.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!r.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{r.onOpenChange(!0),d()},100))})),onPointerLeave:Y(e.onPointerLeave,$l(f=>{var p,w;d();const m=(p=r.content)==null?void 0:p.getBoundingClientRect();if(m){const g=(w=r.content)==null?void 0:w.dataset.side,b=g==="right",v=b?-5:5,y=m[b?"left":"right"],x=m[b?"right":"left"];o.onPointerGraceIntentChange({area:[{x:f.clientX+v,y:f.clientY},{x:y,y:m.top},{x,y:m.top},{x,y:m.bottom},{x:y,y:m.bottom}],side:g}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(f),f.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Y(e.onKeyDown,f=>{var p;const m=o.searchRef.current!=="";e.disabled||m&&f.key===" "||XL[n.dir].includes(f.key)&&(r.onOpenChange(!0),(p=r.content)==null||p.focus(),f.preventDefault())})})})});FS.displayName=Hi;var US="MenuSubContent",zS=h.forwardRef((e,t)=>{const r=SS(wr,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=Ws(wr,e.__scopeMenu),a=cc(wr,e.__scopeMenu),l=LS(US,e.__scopeMenu),c=h.useRef(null),u=be(t,c);return i.jsx(Ll.Provider,{scope:e.__scopeMenu,children:i.jsx(It,{present:n||o.open,children:i.jsx(Ll.Slot,{scope:e.__scopeMenu,children:i.jsx(zg,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:u,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;a.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:Y(e.onFocusOutside,d=>{d.target!==l.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Y(e.onEscapeKeyDown,d=>{a.onClose(),d.preventDefault()}),onKeyDown:Y(e.onKeyDown,d=>{var p;const f=d.currentTarget.contains(d.target),m=e$[a.dir].includes(d.key);f&&m&&(o.onOpenChange(!1),(p=l.trigger)==null||p.focus(),d.preventDefault())})})})})})});zS.displayName=US;function BS(e){return e?"open":"closed"}function Zu(e){return e==="indeterminate"}function Wg(e){return Zu(e)?"indeterminate":e?"checked":"unchecked"}function x$(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function w$(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function b$(e,t,r){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=w$(e,Math.max(o,0));s.length===1&&(a=a.filter(u=>u!==r));const c=a.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return c!==r?c:void 0}function _$(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const l=t[o],c=t[a],u=l.x,d=l.y,f=c.x,m=c.y;d>n!=m>n&&r<(f-u)*(n-d)/(m-d)+u&&(s=!s)}return s}function S$(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return _$(r,t)}function $l(e){return t=>t.pointerType==="mouse"?e(t):void 0}var k$=_S,j$=$g,N$=kS,C$=jS,E$=Bg,T$=NS,P$=qd,R$=ES,O$=PS,A$=OS,I$=IS,D$=DS,M$=MS,L$=$S,$$=FS,F$=zS,Kd="DropdownMenu",[U$,dB]=Zt(Kd,[xS]),Dt=xS(),[z$,VS]=U$(Kd),HS=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:s,defaultOpen:o,onOpenChange:a,modal:l=!0}=e,c=Dt(t),u=h.useRef(null),[d,f]=gn({prop:s,defaultProp:o??!1,onChange:a,caller:Kd});return i.jsx(z$,{scope:t,triggerId:ir(),triggerRef:u,contentId:ir(),open:d,onOpenChange:f,onOpenToggle:h.useCallback(()=>f(m=>!m),[f]),modal:l,children:i.jsx(k$,{...c,open:d,onOpenChange:f,dir:n,modal:l,children:r})})};HS.displayName=Kd;var WS="DropdownMenuTrigger",qS=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...s}=e,o=VS(WS,r),a=Dt(r);return i.jsx(j$,{asChild:!0,...a,children:i.jsx(ue.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...s,ref:Cd(t,o.triggerRef),onPointerDown:Y(e.onPointerDown,l=>{!n&&l.button===0&&l.ctrlKey===!1&&(o.onOpenToggle(),o.open||l.preventDefault())}),onKeyDown:Y(e.onKeyDown,l=>{n||(["Enter"," "].includes(l.key)&&o.onOpenToggle(),l.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});qS.displayName=WS;var B$="DropdownMenuPortal",KS=e=>{const{__scopeDropdownMenu:t,...r}=e,n=Dt(t);return i.jsx(N$,{...n,...r})};KS.displayName=B$;var GS="DropdownMenuContent",YS=h.forwardRef((e,t)=>
456{const{__scopeDropdownMenu:r,...n}=e,s=VS(GS,r),o=Dt(r),a=h.useRef(!1);return i.jsx(C$,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...n,ref:t,onCloseAutoFocus:Y(e.onCloseAutoFocus,l=>{var c;a.current||(c=s.triggerRef.current)==null||c.focus(),a.current=!1,l.preventDefault()}),onInteractOutside:Y(e.onInteractOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!s.modal||d)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});YS.displayName=GS;var V$="DropdownMenuGroup",H$=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Dt(r);return i.jsx(E$,{...s,...n,ref:t})});H$.displayName=V$;var W$="DropdownMenuLabel",QS=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Dt(r);return i.jsx(T$,{...s,...n,ref:t})});QS.displayName=W$;var q$="DropdownMenuItem",JS=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Dt(r);return i.jsx(P$,{...s,...n,ref:t})});JS.displayName=q$;var K$="DropdownMenuCheckboxItem",ZS=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Dt(r);return i.jsx(R$,{...s,...n,ref:t})});ZS.displayName=K$;var G$="DropdownMenuRadioGroup",Y$=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Dt(r);return i.jsx(O$,{...s,...n,ref:t})});Y$.displayName=G$;var Q$="DropdownMenuRadioItem",XS=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Dt(r);return i.jsx(A$,{...s,...n,ref:t})});XS.displayName=Q$;var J$="DropdownMenuItemIndicator",ek=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Dt(r);return i.jsx(I$,{...s,...n,ref:t})});ek.displayName=J$;var Z$="DropdownMenuSeparator",tk=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Dt(r);return i.jsx(D$,{...s,...n,ref:t})});tk.displayName=Z$;var X$="DropdownMenuArrow",e5=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Dt(r);return i.jsx(M$,{...s,...n,ref:t})});e5.displayName=X$;var t5=e=>{const{__scopeDropdownMenu:t,children:r,open:n,onOpenChange:s,defaultOpen:o}=e,a=Dt(t),[l,c]=gn({prop:n,defaultProp:o??!1,onChange:s,caller:"DropdownMenuSub"});return i.jsx(L$,{...a,open:l,onOpenChange:c,children:r})},r5="DropdownMenuSubTrigger",rk=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Dt(r);return i.jsx($$,{...s,...n,ref:t})});rk.displayName=r5;var n5="DropdownMenuSubContent",nk=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Dt(r);return i.jsx(F$,{...s,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});nk.displayName=n5;var s5=HS,o5=qS,sk=KS,ok=YS,ak=QS,ik=JS,lk=ZS,ck=XS,uk=ek,dk=tk,a5=t5,fk=rk,hk=nk;const ba=s5,_a=o5,i0=sk,l0=a5,Hm=h.forwardRef(({className:e,inset:t,children:r,...n},s)=>i.jsxs(fk,{ref:s,className:D("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",t&&"pl-8",e),...n,children:[r,i.jsx(Vi,{className:"ml-auto h-4 w-4"})]}));Hm.displayName=fk.displayName;const Wm=h.forwardRef(({className:e,...t},r)=>i.jsx(hk,{ref:r,className:D("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
456de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Wm.displayName=hk.displayName;const uo=h.forwardRef(({className:e,sideOffset:t=4,...r},n)=>i.jsx(sk,{children:i.jsx(ok,{ref:n,sideOffset:t,className:D("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));uo.displayName=ok.displayName;const Tt=h.forwardRef(({className:e,inset:t,...r},n)=>i.jsx(ik,{ref:n,className:D("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t&&"pl-8",e),...r}));Tt.displayName=ik.displayName;const i5=h.forwardRef(({className:e,children:t,checked:r,...n},s)=>i.jsxs(lk,{ref:s,className:D("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:r,...n,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(uk,{children:i.jsx(Oo,{className:"h-4 w-4"})})}),t]}));i5.displayName=lk.displayName;const l5=h.forwardRef(({className:e,children:t,...r},n)=>i.jsxs(ck,{ref:n,className:D("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...r,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(uk,{children:i.jsx(X1,{className:"h-2 w-2 fill-current"})})}),t]}));l5.displayName=ck.displayName;const c5=h.forwardRef(({className:e,inset:t,...r},n)=>i.jsx(ak,{ref:n,className:D("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));c5.displayName=ak.displayName;const Xu=h.forwardRef(({className:e,...t},r)=>i.jsx(dk,{ref:r,className:D("-mx-1 my-1 h-px bg-muted",e),...t}));Xu.displayName=dk.displayName;function c0({isScrolled:e,hasDarkHero:t=!1,isMobile:r=!1,onItemClick:n}){const[s,o]=h.useState([]),a=Xr();h.useEffect(()=>{(async()=>{const{data:u,error:d}=await ie.from("events").select(` 457 id, 458 name, 459 slug, 460 event_date, 461 event_sponsors (id) 462 `).in("status",["published","archived"]).order("event_date",{ascending:!1});if(!d&&u){const f=u.filter(m=>m.event_sponsors&&m.event_sponsors.length>0).map(({event_sponsors:m,...p})=>p);o(f)}})()},[]);const l=a.pathname==="/sponsors"||a.pathname.startsWith("/sponsors/");return r?i.jsxs("div",{className:"space-y-1",children:[i.jsx(ee,{to:"/sponsors",onClick:n,className:D("block py-3 px-4 rounded-lg font-medium transition-colors",a.pathname==="/sponsors"?"bg-primary text-primary-foreground":"text-foreground hover:bg-muted"),children:"Sponsor Program"}),s.map(c=>i.jsxs(ee,{to:`/sponsors/${c.slug}`,onClick:n,className:D("block py-3 px-4 pl-8 rounded-lg font-medium transition-colors text-sm",a.pathname===`/sponsors/${c.slug}`?"bg-primary text-primary-foreground":"text-foreground hover:bg-muted"),children:[c.name," Sponsors"]},c.id))]}):i.jsxs(ba,{children:[i.jsx(_a,{asChild:!0,children:i.jsxs("button",{className:D("flex items-center gap-1 font-medium transition-colors hover:text-primary relative py-2",l?"text-primary":e?"text-foreground":t?"text-primary-foreground":"text-foreground","after:absolute after:bottom-0 after:left-0 after:w-full after:h-0.5 after:bg-primary after:scale-x-0 after:transition-transform hover:after:scale-x-100",l&&"after:scale-x-100"),children:["Sponsors",i.jsx(hn,{className:"w-4 h-4"})]})}),i.jsxs(uo,{align:"start",className:"w-56",children:[i.jsx(Tt,{asChild:!0,children:i.jsxs(ee,{to:"/sponsors",className:"cursor-pointer",children:[i.jsx(yn,{className:"w-4 h-4 mr-2"}),"Sponsor Program"]})}),s.length>0&&i.jsxs(i.Fragment,{children:[i.jsx(Xu,{}),s.map(c=>i.jsx(Tt,{asChild:!0,children:i.jsx(ee,{to:`/sponsors/${c.slug}`,className:"cursor-pointer",children:c.name})},c.id))]})]})]})}const u5=nc("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"}},defaultVariants:{variant:"default"}});function Pt({className:e,variant:t,...r}){return i.jsx("div",{className:D(u5({variant:t}),e),...r})}const d5=["/"];function f5(){const[e,t]=h.useState(!1),[r,n]=h.useState(!1),[s,o]=h.useState([]),[a,l]=h.useState([]),c=Xr(),u=d5.includes(c.pathname)&&!c.pathname.startsWith("/sponsors/"),{user:d,isAdmin:f,isStaff:m,isReviewer:p,signOut:w}=Vn(),{getItemCount:g}=Vt(),b=g(),{activeEvent:v}=ht(),y=(v==null?void 0:v.accepting_nominations)===!0;h.useEffect(()=>{(async()=>{const{data:k}=await ie.from("beneficiaries").select(` 463 id, 464 full_name, 465 story_post_id, 466 events!inner(event_date), 467 posts!beneficiaries_story_post_id_fkey(slug) 468 `).not("story_post_id","is",null).order("event_date",{referencedTable:"events",ascending:!1});if(k){const N=k.filter(E=>{var T;return(T=E.posts)==null?void 0:T.slug}).map(E=>({id:E.id,full_name:E.full_name,event_year:new Date(E.events.event_date).getFullYear(),story_slug:E.posts.slug})).sort((E,T)=>T.event_year-E.event_year);o(N)}})()},[]),h.useEffect(()=>{const S=new Date().toISOString().split("T")[0];(async()=>{const{data:N}=await ie.from("partners").select(` 469 id, 470 name, 471 slug, 472 events!inner ( 473 status, 474 event_date 475 ) 476 `).eq("is_active",!0).eq("events.status","published").gte("events.event_date",S).order("name");if(N){const E=N.map(({events:T,...R})=>R);l(E)}})()},[]),h.useEffect(()=>{let S=!1;const k=()=>{S||(requestAnimationFrame(()=>{n(window.scrollY>20),S=!1}),S=!0)};return window.addEventListener("scroll",k,{passive:!0}),()=>window.removeEventListener("scroll",k)},[]);const x=async()=>{await w(),re.success("You have been successfully signed out.")},_=S=>D("font-medium transition-colors hover:text-primary relative py-2",S?"text-primary":r?"text-foreground":u?"text-primary-foreground":"text-foreground","after:absolute after:bottom-0 after:left-0 after:w-full after:h-0.5 after:bg-primary after:scale-x-0 after:transition-transform hover:after:scale-x-100",S&&"after:scale-x-100");return i.jsx("header",{className:D("fixed top-0 left-0 right-0 z-50 transition-all duration-300",r?"bg-background/95 backdrop-blur-md shadow-md py-2":"bg-transparent py-4"),children:i.jsxs("div",{className:"container mx-auto px-4",children:[i.jsxs("nav",{className:"flex items-center justify-between",children:[i.jsx(ee,{to:"/",className:"flex items-center gap-2 group transition-transform hover:scale-[1.02]",children:i.jsx(Ig,{variant:"nav",size:"md",className:D("transition-all",r?"brightness-100":"brightness-100 drop-shadow-lg")})}),i.jsxs("div",{className:"hidden lg:flex items-center gap-6",children:[y&&i.jsxs(ee,{to:"/nominate",className:D(_(c.pathname==="/nominate"),"flex items-center gap-1.5"),children:[i.jsx(vt,{className:"w-4 h-4 text-primary"}),"Nominate"]}),i.jsxs(ba,{children:[i.jsx(_a,{asChild:!0,children:i.jsxs("button",{className:D(_(c.pathname==="/register"||c.pathname.startsWith("/partner/")),"flex items-center gap-1 cursor-pointer"),children:["Register",i.jsx(hn,{className:"w-4 h-4"})]})}),i.jsxs(uo,{align:"center",className:"w-56",children:[i.jsx(Tt,{asChild:!0,children:i.jsx(ee,{to:"/register",className:"cursor-pointer w-full",children:"5K Event"})}),a.length>0&&i.jsxs(l0,{children:[i.jsx(Hm,{className:"cursor-pointer",children:"Partner Registration"}),i.jsx(i0,{children:i.jsx(Wm,{className:"max-h-[400px] overflow-y-auto w-56",children:a.map(S=>i.jsx(Tt,{asChild:!0,children:i.jsx(ee,{to:`/partner/${S.slug}`,className:"cursor-pointer w-full",children:S.name})},S.id))})})]})]})]}),i.jsxs(ba,{children:[i.jsx(_a,{asChild:!0,children:i.jsxs("button",{className:D(_(["/course","/virtual-courses"].includes(c.pathname)),"flex items-center gap-1 cursor-pointer"),children:["Course",i.jsx(hn,{className:"w-4 h-4"})]})}),i.jsxs(uo,{align:"center",className:"w-48",children:[i.jsx(Tt,{asChild:!0,children:i.jsx(ee,{to:"/course",className:"cursor-pointer w-full",children:"5K Course"})}),i.jsx(Tt,{asChild:!0,children:i.jsx(ee,{to:"/virtual-courses",className:"cursor-pointer w-full",children:"Virtual Courses"})})]})]}),i.jsx(ee,{to:"/donate",className:_(c.pathname==="/donate"),children:"Donate"}),i.jsx(c0,{isScrolled:r,hasDarkHero:u}),i.jsx(ee,{to:"/news",className:_(c.pathname==="/news"||c.pathname.startsWith("/stories")),children:"News"}),i.jsx(ee,{to:"/gallery",className:_(c.pathname==="/gallery"),children:"Gallery"}),i.jsxs(ba,{children:[i.jsx(_a,{asChild:!0,children:i.jsxs("button",{className:D(_(["/about","/history","/support"].includes(c.pathname)),"flex items-center gap-1 cursor-pointer"),children:["About",i.jsx(hn,{className:"w-4 h-4"})]})}),i.jsxs(uo,{align:"center",className:"w-48",children:[i.jsx(Tt,{asChild:!0,children:i.jsx(ee,{to:"/about",className:"cursor-pointer w-full",children:"About Us"})}),i.jsx(Tt,{asChild:!0,children:i.jsx(ee,{to:"/history",className:"cursor-pointer w-full",children:"History"})}),s.length>0&&i.jsxs(l0,{children:[i.jsx(Hm,{className:"cursor-pointer",children:"Past Happy Smackahs"}),i.jsx(i0,{children:i.jsx(Wm,{className:"max-h-[400px] overflow-y-auto w-56",children:s.map(S=>i.jsx(Tt,{asChild:!0,children:i.jsxs(ee,{to:`/stories/${S.story_slug}`,state:{from:"history"},className:"cursor-pointer w-full",children:[S.full_name," â ",S.event_year]})},S.id))})})]}),i.jsx(Tt,{asChild:!0,children:i.jsx(ee,{to:"/support",className:"cursor-pointer w-full",children:"Support"})})]})]})]}),i.jsxs("div",{className:"hidden lg:flex items-center gap-3",children:[i.jsx(ee,{to:"/checkout",className:"relative",children:i.jsxs(ce,{variant:"ghost",size:"icon",className:D(r?"text-foreground hover:bg-muted":u?"text-primary-foreground hover:bg-primary-foreground
476/10":"text-foreground hover:bg-muted"),children:[i.jsx(bo,{className:"w-5 h-5"}),b>0&&i.jsx(Pt,{className:"absolute -top-1 -right-1 h-5 w-5 flex items-center justify-center p-0 text-xs",variant:"destructive",children:b>9?"9+":b})]})}),d?i.jsxs(ba,{children:[i.jsx(_a,{asChild:!0,children:i.jsx(ce,{variant:"ghost",size:"icon",className:D(r?"text-foreground hover:bg-muted":u?"text-primary-foreground hover:bg-primary-foreground/10":"text-foreground hover:bg-muted"),children:i.jsx(Hr,{className:"w-5 h-5"})})}),i.jsxs(uo,{align:"end",className:"w-48",children:[i.jsx("div",{className:"px-2 py-1.5 text-sm font-medium text-foreground truncate",children:d.email}),i.jsx(Xu,{}),i.jsx(Tt,{asChild:!0,children:i.jsxs(ee,{to:"/profile",className:"cursor-pointer",children:[i.jsx(Hr,{className:"w-4 h-4 mr-2"}),"My Profile"]})}),(m||p)&&i.jsx(Tt,{asChild:!0,children:i.jsxs(ee,{to:"/admin",className:"cursor-pointer",children:[i.jsx(Gx,{className:"w-4 h-4 mr-2"}),f?"Admin Dashboard":m?"Staff Dashboard":"Reviewer Dashboard"]})}),i.jsx(Xu,{}),i.jsxs(Tt,{onClick:x,className:"cursor-pointer text-destructive",children:[i.jsx(Kx,{className:"w-4 h-4 mr-2"}),"Sign Out"]})]})]}):i.jsx(ee,{to:"/auth",children:i.jsx(ce,{variant:"ghost",size:"sm",className:D(r?"text-foreground hover:bg-muted":u?"text-primary-foreground hover:bg-primary-foreground/10":"text-foreground hover:bg-muted"),children:"Sign In"})})]}),i.jsx("button",{onClick:()=>t(!e),className:"lg:hidden p-2 rounded-lg hover:bg-muted/20 transition-colors","aria-label":"Toggle menu",children:e?i.jsx(sc,{className:D("w-6 h-6",r?"text-foreground":u?"text-primary-foreground":"text-foreground")}):i.jsx(I4,{className:D("w-6 h-6",r?"text-foreground":u?"text-primary-foreground":"text-foreground")})})]}),i.jsx("div",{className:D("lg:hidden overflow-y-auto transition-all duration-300",e?"max-h-[calc(100vh-120px)] opacity-100 mt-4":"max-h-0 opacity-0"),children:i.jsxs("div",{className:"bg-card rounded-xl shadow-lg p-4 space-y-2",children:[y&&i.jsxs(ee,{to:"/nominate",onClick:()=>t(!1),className:D("flex items-center gap-2 py-3 px-4 rounded-lg font-medium transition-colors",c.pathname==="/nominate"?"bg-primary text-primary-foreground":"text-foreground hover:bg-muted"),children:[i.jsx(vt,{className:"w-4 h-4"}),"Nominate"]}),i.jsxs("details",{className:"group",children:[i.jsxs("summary",{className:D("block py-3 px-4 rounded-lg font-medium transition-colors cursor-pointer list-none flex items-center justify-between",c.pathname==="/register"||c.pathname.startsWith("/partner/")?"bg-primary text-primary-foreground":"text-foreground hover:bg-muted"),children:["Register",i.jsx(Vi,{className:"w-4 h-4 transition-transform group-open:rotate-90"})]}),i.jsxs("div",{className:"pl-4 space-y-1",children:[i.jsx(ee,{to:"/register",onClick:()=>t(!1),className:D("block py-2 px-4 rounded-lg text-sm transition-colors pl-8",c.pathname==="/register"?"bg-primary/80 text-primary-foreground":"text-muted-foreground hover:bg-muted"),children:"5K Event"}),a.length>0&&i.jsxs("details",{className:"group/partners",children:[i.jsxs("summary",{className:"block py-2 px-4 rounded-lg text-sm transition-colors pl-8 text-muted-foreground hover:bg-muted cursor-pointer list-none flex items-center justify-between",children:["Partner Registration",i.jsx(Vi,{className:"w-4 h-4 transition-transform group-open/partners:rotate-90"})]}),i.jsx("div",{className:"pl-4 space-y-1",children:a.map(S=>i.jsx(ee,{to:`/partner/${S.slug}`,onClick:()=>t(!1),className:D("block py-2 px-4 rounded-lg text-sm transition-colors pl-12",c.pathname===`/partner/${S.slug}`?"bg-primary/80 text-primary-foreground":"text-muted-foreground hover:bg-muted"),children:S.name},S.id))})]})]})]}),i.jsxs("details",{className:"group",children:[i.jsxs("summary",{className:D("block py-3 px-4 rounded-lg font-medium transition-colors cursor-pointer list-none flex items-center justify-between",["/course","/virtual-courses"].includes(c.pathname)?"bg-primary text-primary-foreground":"text-foreground hover:bg-muted"),children:["Course",i.jsx(Vi,{className:"w-4 h-4 transition-transform group-open:rotate-90"})]}),i.jsxs("div",{className:"pl-4 space-y-1",children:[i.jsx(ee,{to:"/course",onClick:()=>
476t(!1),className:D("block py-2 px-4 rounded-lg text-sm transition-colors pl-8",c.pathname==="/course"?"bg-primary/80 text-primary-foreground":"text-muted-foreground hover:bg-muted"),children:"5K Course"}),i.jsx(ee,{to:"/virtual-courses",onClick:()=>t(!1),className:D("block py-2 px-4 rounded-lg text-sm transition-colors pl-8",c.pathname==="/virtual-courses"?"bg-primary/80 text-primary-foreground":"text-muted-foreground hover:bg-muted"),children:"Virtual Courses"})]})]}),i.jsx(ee,{to:"/donate",onClick:()=>t(!1),className:D("block py-3 px-4 rounded-lg font-medium transition-colors",c.pathname==="/donate"?"bg-primary text-primary-foreground":"text-foreground hover:bg-muted"),children:"Donate"}),i.jsx(c0,{isScrolled:r,isMobile:!0,onItemClick:()=>t(!1)}),i.jsx(ee,{to:"/news",onClick:()=>t(!1),className:D("block py-3 px-4 rounded-lg font-medium transition-colors",c.pathname==="/news"||c.pathname.startsWith("/stories")?"bg-primary text-primary-foreground":"text-foreground hover:bg-muted"),children:"News"}),i.jsx(ee,{to:"/gallery",onClick:()=>t(!1),className:D("block py-3 px-4 rounded-lg font-medium transition-colors",c.pathname==="/gallery"?"bg-primary text-primary-foreground":"text-foreground hover:bg-muted"),children:"Gallery"}),i.jsx(ee,{to:"/about",onClick:()=>t(!1),className:D("block py-3 px-4 rounded-lg font-medium transition-colors",c.pathname==="/about"?"bg-primary text-primary-foreground":"text-foreground hover:bg-muted"),children:"About"}),i.jsx(ee,{to:"/history",onClick:()=>t(!1),className:D("block py-3 px-4 rounded-lg font-medium transition-colors pl-8",c.pathname==="/history"?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted"),children:"History"}),s.length>0&&i.jsxs("details",{className:"group",children:[i.jsxs("summary",{className:"block py-3 px-4 rounded-lg font-medium transition-colors pl-8 text-muted-foreground hover:bg-muted cursor-pointer list-none flex items-center justify-between",children:["Past Happy Smackahs",i.jsx(Vi,{className:"w-4 h-4 transition-transform group-open:rotate-90"})]}),i.jsx("div",{className:"pl-4 space-y-1",children:s.map(S=>i.jsxs(ee,{to:`/stories/${S.story_slug}`,state:{from:"history"},onClick:()=>t(!1),className:"block py-2 px-4 rounded-lg text-sm transition-colors pl-12 text-muted-foreground hover:bg-muted",children:[S.full_name," â ",S.event_year]},S.id))})]}),i.jsx(ee,{to:"/support",onClick:()=>t(!1),className:D("block py-3 px-4 rounded-lg font-medium transition-colors pl-8",c.pathname==="/support"?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted"),children:"Support"}),i.jsxs("div",{className:"pt-4 border-t border-border space-y-2",children:[d?i.jsxs(i.Fragment,{children:[i.jsx(ee,{to:"/profile",onClick:()=>t(!1),children:i.jsxs(ce,{variant:"ghost",className:"w-full justify-start",children:[i.jsx(Hr,{className:"w-4 h-4"}),"My Profile"]})}),(m||p)&&i.jsx(ee,{to:"/admin",onClick:()=>t(!1),children:i.jsxs(ce,{variant:"ghost",className:"w-full justify-start",children:[i.jsx(Gx,{className:"w-4 h-4"}),f?"Admin Dashboard":m?"Staff Dashboard":"Reviewer Dashboard"]})}),i.jsxs(ce,{variant:"ghost",className:"w-full justify-start text-destructive",onClick:()=>{x(),t(!1)},children:[i.jsx(Kx,{className:"w-4 h-4"}),"Sign Out"]})]}):i.jsx(ee,{to:"/auth",onClick:()=>t(!1),children:i.jsxs(ce,{variant:"ghost",className:"w-full justify-start",children:[i.jsx(Hr,{className:"w-4 h-4"}),"Sign In"]})}),i.jsx(ee,{to:"/checkout",onClick:()=>t(!1),children:i.jsxs(ce,{variant:"outline",className:"w-full justify-center relative",children:[i.jsx(bo,{className:"w-4 h-4"}),"Cart",b>0&&i.jsx(Pt,{className:"ml-2",variant:"destructive",children:b})]})})]})]})})]})})}function u0(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function h5(){const[e,t]=h.useState(""),[r,n]=h.useState(!1),s=h.useMemo(()=>{const a=e.trim();return a.length>0&&u0(a)&&!r},[e,r]),o=async a=>{a.preventDefault();const l=e.trim();if(!u0(l)){re.error("Please enter a valid email address");return}n(!0);try{const{error:c}=await ie.functions.invoke("subscribe-newsletter",{body:{email:l}});if(c)throw c;t(""),re.success("You're subscribed â thanks!")}
476catch(c){const u=typeof(c==null?void 0:c.message)=="string"&&c.message.length>0?c.message:"Failed to subscribe. Please try again.";re.error(u)}finally{n(!1)}};return i.jsxs("footer",{className:"bg-foreground text-background",children:[i.jsx("div",{className:"container mx-auto px-4 py-16",children:i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-8 sm:gap-10 lg:gap-12",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx(ee,{to:"/",className:"inline-block",children:i.jsx(Ig,{variant:"foundation",size:"lg",className:"max-h-16"})}),i.jsx("p",{className:"text-background/70 text-sm leading-relaxed",children:"A 501(c)(3) nonprofit hosting an annual 5K Fun Run/Walk to benefit local individuals facing medical hardship. Making a difference since 2011."}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("a",{href:"https://facebook.com",target:"_blank",rel:"noopener noreferrer",className:"w-10 h-10 rounded-full bg-background/10 flex items-center justify-center hover:bg-primary transition-colors",children:i.jsx(C4,{className:"w-5 h-5"})}),i.jsx("a",{href:"https://www.instagram.com/happysmackah/",target:"_blank",rel:"noopener noreferrer",className:"w-10 h-10 rounded-full bg-background/10 flex items-center justify-center hover:bg-primary transition-colors",children:i.jsx(R4,{className:"w-5 h-5"})}),i.jsx("a",{href:"https://youtube.com",target:"_blank",rel:"noopener noreferrer",className:"w-10 h-10 rounded-full bg-background/10 flex items-center justify-center hover:bg-primary transition-colors",children:i.jsx(K4,{className:"w-5 h-5"})})]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-heading font-bold text-lg mb-4",children:"Quick Links"}),i.jsx("ul",{className:"space-y-3",children:[{href:"/about",label:"About Us"},{href:"/events",label:"Upcoming Events"},{href:"/register",label:"Register"},{href:"/donate",label:"Donate"},{href:"/sponsors",label:"Become a Sponsor"},{href:"/gallery",label:"Photo Gallery"},{href:"/support",label:"Support & FAQ"}].map(a=>i.jsx("li",{children:i.jsx(ee,{to:a.href,className:"text-background/70 hover:text-primary transition-colors text-sm",children:a.label})},a.href))})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-heading font-bold text-lg mb-4",children:"Contact Us"}),i.jsxs("ul",{className:"space-y-4",children:[i.jsxs("li",{className:"flex items-start gap-3",children:[i.jsx(Og,{className:"w-5 h-5 text-primary mt-0.5 shrink-0"}),i.jsxs("span",{className:"text-background/70 text-sm",children:["240 NCR 27E",i.jsx("br",{}),"Berthoud, CO 80513"]})]}),i.jsxs("li",{className:"flex items-center gap-3",children:[i.jsx(tS,{className:"w-5 h-5 text-primary shrink-0"}),i.jsx("a",{href:"mailto:[email protected]",className:"text-background/70 hover:text-primary transition-colors text-sm",children:"[email protected]"})]})]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-heading font-bold text-lg mb-4",children:"Stay Updated"}),i.jsx("p",{className:"text-background/70 text-sm mb-4",children:"Subscribe to our newsletter for event updates and community news."}),i.jsxs("form",{className:"space-y-3",onSubmit:o,children:[i.jsx("input",{type:"email",inputMode:"email",autoComplete:"email",value:e,onChange:a=>t(a.target.value),placeholder:"Enter your email",className:"w-full px-4 py-3 rounded-lg bg-background/10 border border-background/20 text-background placeholder:text-background/50 focus:outline-none focus:border-primary transition-colors text-sm"}),i.jsx("button",{type:"submit",disabled:!s,className:"w-full px-4 py-3 rounded-lg bg-primary text-primary-foreground font-semibold hover:bg-primary/90 transition-colors text-sm disabled:opacity-60 disabled:cursor-not-allowed",children:r?i.jsxs("span",{className:"inline-flex items-center justify-center gap-2",children:[i.jsx(Jr,{className:"h-4 w-4 animate-spin"}),"Subscribingâ¦"]}):"Subscribe"})]})]})]})}),i.jsx("div",{className:"border-t border-background/10",children:i.jsx("div",{className:"container mx-auto px-4 py-6",children:i.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between gap-4",children:[i.jsxs("p",{className:"text-background/50 text-sm",children:["© ",new Date().getFullYear()," Happy Smackah Foundation. All rights reserved."]}),i.jsxs("div",{className:"flex items-center gap-6",children:[i.jsx(ee,{to:"/privacy",className:"text-background/50 hover:text-primary transition-colors text-sm",children:"Privacy Policy"}),i.jsx(ee,{to:"/terms",className:"text-background/50 hover:text-primary transition-colors text-sm",children:"Terms of Service"})]})]})})})]})}function m5(){const{impersonatedUser:e,stopImpersonation:t}=Vn();return e?i.jsxs("div",{className:"bg-amber-500 text-amber-950 px-4 py-2 flex items-center justify-center gap-3 text-sm font-medium sticky top-0 z-[60] pointer-events-auto relative",children:[i.jsx(Ag,{className:"h-4 w-4"}),i.jsxs("span",{children:["Impersonating: ",i.jsx("strong",{children:e.email}),e.firstName&&` (${e.firstName} ${e.lastName||""})`]}),i.jsxs(ce,{variant:"outline",size:"sm",onClick:t,className:"ml-2 h-7 bg-amber-600 border-amber-700 text-white hover:bg-amber-700 hover:text-white",children:[i.jsx(q4,{className:"h-3 w-3 mr-1"}),"Exit Impersonation"]})]}):null}function Ts({children:e}){return i.jsxs("div",{className:"min-h-screen flex flex-col",children:[i.jsx(m5,{}),i.jsx(f5,{}),i.jsx("main",{className:"flex-1",children:e}),i.jsx(h5,{})]})}function p5({beneficiaries:e}){if(!e||e.length===0)return null;const t=e.map(r=>r.full_name).join(" & ");return i.jsxs("div",{className:"inline-flex items-center gap-4 px-6 py-4 sm:px-8 sm:py-5 rounded-2xl bg-background/20 backdrop-blur-md border border-background/30",children:[i.jsx("div",{className:"flex -sp
476ace-x-3",children:e.slice(0,3).map(r=>r.photo_url?i.jsx("img",{src:r.photo_url,alt:r.full_name,className:"w-14 h-14 sm:w-16 sm:h-16 rounded-full object-cover border-[3px] border-primary/50 relative"},r.id):i.jsx("div",{className:"w-14 h-14 sm:w-16 sm:h-16 rounded-full bg-primary/20 flex items-center justify-center border-[3px] border-primary/50 relative",children:i.jsx(Hr,{className:"w-7 h-7 text-primary"})},r.id))}),i.jsxs("div",{className:"text-left",children:[i.jsxs("div",{className:"flex items-center gap-1.5 text-primary-foreground/80 text-xs uppercase tracking-widest mb-1",children:[i.jsx(vt,{className:"w-4 h-4 text-primary fill-primary"}),i.jsx("span",{children:"Supporting"})]}),i.jsx("div",{className:"text-xl sm:text-2xl font-bold text-primary-foreground leading-tight",children:t})]})]})}const g5="/assets/hero-run-CPLAs2gR.jpg";function y5(e){if(!e)return null;const t=e.match(/(?:youtube\.com\/(?:watch\?v=|embed\/)|youtu\.be\/)([a-zA-Z0-9_-]{11})/);if(t)return{type:"youtube",embedUrl:`https://www.youtube.com/embed/${t[1]}?autoplay=1&mute=1&loop=1&playlist=${t[1]}&controls=0&showinfo=0&rel=0&modestbranding=1&playsinline=1`};const r=e.match(/(?:vimeo\.com\/)(\d+)/);return r?{type:"vimeo",embedUrl:`https://player.vimeo.com/video/${r[1]}?autoplay=1&muted=1&loop=1&background=1&controls=0`}:{type:"direct",embedUrl:e}}function v5(){const{branding:e,previewBranding:t}=Bo(),{activeEvent:r,beneficiaries:n,isLoading:s}=ht(),o=t||e,a=(r==null?void 0:r.hero_video_url)||o.heroVideoUrl,l=y5(a),c=o.heroFallbackImageUrl||g5;return r?Tg(r.event_date):new Date().getFullYear(),i.jsxs("section",{className:"relative min-h-[85vh] flex items-center justify-center overflow-hidden",children:[i.jsxs("div",{className:"absolute inset-0",children:[l?l.type==="direct"?i.jsx("video",{src:l.embedUrl,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"w-full h-full object-cover",poster:c}):i.jsxs(i.Fragment,{children:[i.jsx("img",{src:c,alt:"Happy Smackah 5K Fun Run",className:"absolute inset-0 w-full h-full object-cover"}),i.jsx("iframe",{src:l.embedUrl,className:"absolute w-[300%] h-[300%] top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-none",allow:"autoplay; fullscreen",style:{border:"none"},title:"Hero background video"})]}):i.jsx("img",{src:c,alt:"Happy Smackah 5K Fun Run with community runners crossing the finish line",className:"w-full h-full object-cover",fetchPriority:"high"}),i.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-foreground
476/70 via-foreground/50 to-foreground/80"})]}),i.jsx("div",{className:"absolute inset-0 overflow-hidden pointer-events-none hidden sm:block motion-reduce:hidden",children:[...Array(8)].map((u,d)=>i.jsx("div",{className:"absolute w-2 h-2 bg-primary/30 rounded-full animate-float",style:{left:`${Math.random()*100}%`,top:`${Math.random()*100}%`,animationDelay:`${Math.random()*5}s`,animationDuration:`${4+Math.random()*4}s`}},d))}),i.jsx("div",{className:"relative z-10 container mx-auto px-4 text-center",children:i.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[i.jsx("div",{className:"animate-fade-in flex justify-center",children:i.jsx(Ig,{variant:"event",size:"xl",className:"drop-shadow-2xl max-h-24 sm:max-h-32"})}),r?i.jsxs(i.Fragment,{children:[n.length>0&&i.jsx("div",{className:"animate-fade-in",style:{animationDelay:"0.1s"},children:i.jsx(p5,{beneficiaries:n})}),i.jsxs("h1",{className:"text-4xl sm:text-5xl md:text-6xl lg:text-7xl font-heading font-bold text-primary-foreground leading-tight animate-slide-up",children:["Run for a Cause.",i.jsx("br",{}),i.jsx("span",{className:"text-primary",children:"Change Lives."})]}),i.jsx("p",{className:"text-lg sm:text-xl text-primary-foreground/80 max-w-2xl mx-auto animate-slide-up",style:{animationDelay:"0.2s"},children:"Join your fellow community members at our annual 5K Fun Run/Walk supporting local families facing medical hardship."}),i.jsxs("div",{className:"inline-flex flex-col sm:flex-row items-center gap-4 sm:gap-8 px-6 py-4 rounded-2xl bg-background/10 backdrop-blur-md border border-background/20 animate-slide-up",style:{animationDelay:"0.3s"},children:[i.jsxs("div",{className:"flex items-center gap-2 text-primary-foreground",children:[i.jsx(Rg,{className:"w-5 h-5 text-primary"}),i.jsx("span",{className:"font-semibold",children:Eg(r.event_date)})]}),r.location_name&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"hidden sm:block w-px h-6 bg-background/30"}),i.jsxs("div",{className:"flex items-center gap-2 text-primary-foreground",children:[i.jsx(Og,{className:"w-5 h-5 text-primary"}),i.jsx("span",{children:r.location_name})]})]})]}),r.accepting_nominations&&i.jsx("div",{className:"animate-slide-up",style:{animationDelay:"0.35s"},children:i.jsx(ee,{to:"/nominate",children:i.jsxs("div",{className:"inline-flex items-center gap-3 px-5 py-3 rounded-xl bg-secondary/20 backdrop-blur-sm border border-secondary/30 hover:bg-secondary/30 transition-colors cursor-pointer group",children:[i.jsx(vt,{className:"w-5 h-5 text-secondary animate-pulse"}),i.jsxs("span",{className:"text-primary-foreground font-medium",children:["Know a family in need? ",i.jsx("span",{className:"text-secondary underline underline-offset-2 group-hover:no-underline",children:"Nominate them today"})]})]})})}),i.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4 animate-slide-up",style:{animationDelay:"0.4s"},children:[i.jsx(ee,{to:"/register",children:i.jsxs(ce,{variant:"hero",size:"xl",className:"group shadow-xl",children:["Register Now",i.jsx(_t,{className:"w-5 h-5 transition-transform group-hover:translate-x-1"})]})}),i.jsx(ee,{to:"/donate",children:i.jsxs(ce,{variant:"heroGlass",size:"xl",className:"group",children:["Make a Donation",i.jsx(_t,{className:"w-5 h-5 transition-transform group-hover:translate-x-1 opacity-70"})]})})]}),i.jsx("div",{className:"animate-fade-in",style:{animationDelay:"0.5s"},children:i.jsx(ee,{to:"/events",className:"text-primary-foreground/70 hover:text-primary-foreground underline underline-offset-4 text-sm transition-colors",children:"View event details, schedule & pricing â"})})]}):i.jsxs(i.Fragment,{children:[i.jsxs("h1",{className:"text-4xl sm:text-5xl md:text-6xl lg:text-7xl font-heading font-bold text-primary-foreground leading-tight animate-slide-up",children:["Run for a Cause.",i.jsx("br",{}),i.jsx("span",{className:"text-primary",children:"Change Lives."})]}),i.jsx("p",{className:"text-lg sm:text-xl text-primary-foreground/80 max-w-2xl mx-auto animate-slide-up",style:{animationDelay:"0.2s"},children:"Our annual 5K Fun Run/Walk supports local families facing medical hardship. Stay tuned for our next event!"}),i.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4 animate-slide-up",style:{animationDelay:"0.4s"},children:[i.jsx(ee,{to:"/donate",children:i.jsxs(ce,{variant:"hero",size:"xl",className:"group shadow-xl",children:["Support Our Mission",i.jsx(_t,{className:"w-5 h-5 transition-transform group-hover:translate-x-1"})]})}),i.jsx(ee,{to:"/history",children:i.jsxs(ce,{variant:"heroGlass",size:"xl",className:"group",children:["View Past Events",i.jsx(_t,{className:"w-5 h-5 transition-transform group-hover:translate-x-1 opacity-70"})]})})]})]}),i.jsx("div",{className:"pt-4 animate-bounce-subtle",children:i.jsx("div",{className:"w-6 h-10 rounded-full border-2 border-primary-foreground
476/50 mx-auto flex justify-center pt-2",children:i.jsx("div",{className:"w-1.5 h-3 bg-primary-foreground/50 rounded-full animate-pulse"})})})]})})]})}function x5({beneficiaries:e,eventName:t}){const[r,n]=h.useState({});if(h.useEffect(()=>{const o=e.map(a=>a.story_post_id).filter(a=>!!a);o.length!==0&&ie.from("posts").select("id, slug").in("id",o).eq("status","published").then(({data:a})=>{if(a){const l={};a.forEach(c=>{l[c.id]=c.slug}),n(l)}})},[e]),!e||e.length===0)return null;const s=[...e];return i.jsx("section",{className:"py-20 bg-gradient-subtle",children:i.jsx("div",{className:"container mx-auto px-4",children:i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsxs("div",{className:"text-center mb-12",children:[i.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-primary/10 text-primary text-sm font-medium mb-4",children:[i.jsx(vt,{className:"w-4 h-4"}),"Meet ",e.length>1?"Our Beneficiaries":"Our Beneficiary"]}),i.jsx("h2",{className:"text-3xl sm:text-4xl font-heading font-bold text-foreground mb-4",children:"Who We're Running For"}),i.jsxs("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:["Your participation directly supports ",e.length>1?"these individuals and their families":"this individual and their family"," facing medical hardship."]})]}),i.jsx("div",{className:`grid gap-8 ${e.length===1?"max-w-lg mx-auto":"md:grid-cols-2"}`,children:s.map(o=>{const a=o.story_post_id?r[o.story_post_id]:null;return i.jsx("div",{className:"bg-card rounded-2xl p-6 border border-border shadow-lg hover:shadow-xl transition-shadow",children:i.jsxs("div",{className:"flex flex-col items-center text-center",children:[o.photo_url?i.jsx("img",{src:o.photo_url,alt:o.full_name,className:"w-32 h-32 rounded-full object-cover border-4 border-primary/20 mb-4",loading:"lazy"}):i.jsx("div",{className:"w-32 h-32 rounded-full bg-primary/10 flex items-center justify-center mb-4",children:i.jsx(Hr,{className:"w-16 h-16 text-primary/50"})}),i.jsx("h3",{className:"text-xl font-heading font-bold text-foreground mb-2",children:o.full_name}),o.bio&&i.jsx("p",{className:"text-muted-foreground leading-relaxed mb-4",children:o.bio}),a&&i.jsxs(ee,{to:`/stories/${a}`,className:"inline-flex items-center gap-1.5 text-primary font-medium hover:underline mt-auto",children:["Read Their Story",i.jsx(_t,{className:"w-4 h-4"})]})]})},o.id)})})]})})})}function w5({eventName:e}){return i.jsx("section",{className:"py-20 bg-gradient-subtle",children:i.jsx("div",{className:"container mx-auto px-4",children:i.jsxs("div",{className:"max-w-2xl mx-auto text-center",children:[i.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 mb-6",children:i.jsx(vt,{className:"w-8 h-8 text-primary animate-pulse"})}),i.jsx("h2",{className:"text-3xl sm:text-4xl font-heading font-bold text-foreground mb-4",children:"Help Us Find Our Next Beneficiary"}),i.jsxs("p",{className:"text-lg text-muted-foreground mb-8 max-w-xl mx-auto",children:["Know a local family facing medical hardship? Your nomination could change their lives.",e&&` We're currently accepting nominations for ${e}.`]}),i.jsx(ce,{asChild:!0,size:"lg",className:"group",children:i.jsxs(ee,{to:"/nominate",children:["Nominate a Family",i.jsx(_t,{className:"ml-2 w-4 h-4 transition-transform group-hover:translate-x-1"})]})}),i.jsx("p",{className:"mt-6 text-sm text-muted-foreground",children:"All nominations are kept confidential"})]})})})}const b5=nc("rounded-xl border bg-card text-card-foreground transition-all duration-300",{variants:{variant:{default:"shadow-sm hover:shadow-md",elevated:"shadow-lg hover:shadow-xl",glass:"backdrop-blur-md bg-card/80 border-border/50",feature:"shadow-lg hover:shadow-xl hover:scale-[1.02] border-2 border-transparent hover:border-primary/20",sponsor:"shadow-md hover:shadow-lg overflow-hidden"}},defaultVariants:{variant:"default"}}),ot=h.forwardRef(({className:e,variant:t,...r},n)=>i.jsx("div",{ref:n,className:D(b5({variant:t}),e),...r}));ot.displayName="Card";const ur=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:D("flex flex-col space-y-1.5 p-6",e),...t}));
476ur.displayName="CardHeader";const Sr=h.forwardRef(({className:e,...t},r)=>i.jsx("h3",{ref:r,className:D("text-2xl font-bold leading-none tracking-tight font-heading",e),...t}));Sr.displayName="CardTitle";const qs=h.forwardRef(({className:e,...t},r)=>i.jsx("p",{ref:r,className:D("text-sm text-muted-foreground",e),...t}));qs.displayName="CardDescription";const at=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:D("p-6 pt-0",e),...t}));at.displayName="CardContent";const _5=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:D("flex items-center p-6 pt-0",e),...t}));_5.displayName="CardFooter";function Ut(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 Io(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const mk=6048e5,S5=864e5,k5=6e4,j5=36e5,fB=525600,hB=43200,mB=1440;let N5={};function Gd(){return N5}function Fl(e,t){var l,c,u,d;const r=Gd(),n=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,s=Ut(e),o=s.getDay(),a=(o<n?7:0)+o-n;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function ed(e){return Fl(e,{weekStartsOn:1})}function pk(e){const t=Ut(e),r=t.getFullYear(),n=Io(e,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const s=ed(n),o=Io(e,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=ed(o);return t.getTime()>=s.getTime()?r+1:t.getTime()>=a.getTime()?r:r-1}function d0(e){const t=Ut(e);return t.setHours(0,0,0,0),t}function f0(e){const t=Ut(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function gk(e,t){const r=d0(e),n=d0(t),s=+r-f0(r),o=+n-f0(n);return Math.round((s-o)/S5)}function C5(e){const t=pk(e),r=Io(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),ed(r)}function E5(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function T5(e){if(!E5(e)&&typeof e!="number")return!1;const t=Ut(e);return!isNaN(Number(t))}function P5(e,t){const r=Ut(e),n=Ut(t),s=h0(r,n),o=Math.abs(gk(r,n));r.setDate(r.getDate()-s*o);const a=+(h0(r,n)===-s),l=s*(o-a);return l===0?0:l}function h0(e,t){const r=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return r<0?-1:r>0?1:r}function qg(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function Kg(e,t){return+Ut(e)-+Ut(t)}function R5(e,t,r){const n=Kg(e,t)/j5;return qg(r==null?void 0:r.roundingMethod)(n)}function O5(e,t,r){const n=Kg(e,t)/k5;return qg(r==null?void 0:r.roundingMethod)(n)}function A5(e,t,r){const n=Kg(e,t)/1e3;return qg(r==null?void 0:r.roundingMethod)(n)}function I5(e){const t=Ut(e),r=Io(e,0);return r.setFullYear(t.getFullYear(),0,1),r.setHours(0,0,0,0),r}const D5={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"}},M5=(e,t,r)=>{let n;const s=D5[e];return typeof s=="string"?n=s:t===1?n=s.one:n=s.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function fh(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const L5={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},$5={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},F5={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},U5={date:fh({formats:L5,defaultWidth:"full"}),time:fh({formats:$5,defaultWidth:"full"}),dateTime:fh({formats:F5,defaultWidth:"full"})},z5={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},B5=(e,t,r,n)=>z5[e];function Di(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let s;if(n==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,l=r!=null&&r.width?String(r.width):a;s=e.formattingValues[l]||e.formattingValues[a]}else{const a=e.defaultWidth,l=r!=null&&r.width?String(r.width):e.defaultWidth;s=e.values[l]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const V5={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},H5={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},W5={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"]},q5={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
476ay","Saturday"]},K5={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"}},G5={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"}},Y5=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Q5={ordinalNumber:Y5,era:Di({values:V5,defaultWidth:"wide"}),quarter:Di({values:H5,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Di({values:W5,defaultWidth:"wide"}),day:Di({values:q5,defaultWidth:"wide"}),dayPeriod:Di({values:K5,defaultWidth:"wide",formattingValues:G5,defaultFormattingWidth:"wide"})};function Mi(e){return(t,r={})=>{const n=r.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const a=o[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?Z5(l,f=>f.test(a)):J5(l,f=>f.test(a));let u;u=e.valueCallback?e.valueCallback(c):c,u=r.valueCallback?r.valueCallback(u):u;const d=t.slice(a.length);return{value:u,rest:d}}}function J5(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function Z5(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function X5(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const s=n[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=r.valueCallback?r.valueCallback(a):a;const l=t.slice(s.length);return{value:a,rest:l}}}const e3=/^(\d+)(th|st|nd|rd)?/i,t3=/\d+/i,r3={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},n3={any:[/^b/i,/^(a|c)/i]},s3={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},o3={any:[/1/i,/2/i,/3/i,/4/i]},a3={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},i3={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]},l3={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},c3={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]},u3={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},d3={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}},f3={ordinalNumber:X5({matchPattern:e3,parsePattern:t3,valueCallback:e=>parseInt(e,10)}),era:Mi({matchPatterns:r3,defaultMatchWidth:"wide",parsePatterns:n3,defaultParseWidth:"any"}),quarter:Mi({matchPatterns:s3,defaultMatchWidth:"wide",parsePatterns:o3,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Mi({matchPatterns:a3,defaultMatchWidth:"wide",parsePatterns:i3,defaultParseWidth:"any"}),day:Mi({matchPatterns:l3,defaultMatchWidth:"wide",parsePatterns:c3,defaultParseWidth:"any"}),dayPeriod:Mi({matchPatterns:u3,defaultMatchWidth:"any",parsePatterns:d3,defaultParseWidth:"any"})},h3={code:"en-US",formatDistance:M5,formatLong:U5,formatRelative:B5,localize:Q5,match:f3,options:{weekStartsOn:0,firstWeekContainsDate:1}};function m3(e){const t=Ut(e);return gk(t,I5(t))+1}function p3(e){const t=Ut(e),r=+ed(t)-+C5(t);return Math.round(r/mk)+1}function yk(e,t){var d,f,m,p;const r=Ut(e),n=r.getFullYear(),s=Gd(),o=(t==null?void 0:t.firstWeekContainsDate)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??s.firstWeekContainsDate??((p=(m=s.locale)==null?void 0:m.options)==null?void 0:p.firstWeekContainsDate)??1,a=Io(e,0);a.setFullYear(n+1,0,o),a.setHours(0,0,0,0);const l=Fl(a,t),c=Io(e,0);c.setFullYear(n,0,o),c.setHours(0,0,0,0);const u=Fl(c,t);return r.getTime()>=l.getTime()?n+1:r.getTime()>=u.getTime()?n:n-1}function g3(e,t){var l,c,u,d;const r=Gd(),n=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,s=yk(e,t),o=Io(e,0);return o.setFullYear(s,0,n),o.setHours(0,0,0,0),Fl(o,t)}function y3(e,t){const r=Ut(e),n=+Fl(r,t)-+g3(r,t);return Math.round(n/mk)+1}function De(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const es={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return De(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):De(r+1,2)},d(e,t){return De(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return De(e.getHours()%12||12,t.length)},H(e,t){return De(e.getHours(),t.length)},m(e,t){return De(e.getMinutes(),t.length)},s(e,t){return De(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),s=Math.trunc(n*Math.pow(10,r-3));return De(s,t.length)}},na={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},m0={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),s=n>0?n:1-n;return r.ordinalNumber(s,{unit:"year"})}return es.y(e,t)},Y:function(e,t,r,n){const s=yk(e,n),o=s>0?s:1-s;if(t==="YY"){const a=o%100;return De(a,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):De(o,t.length)},R:function(e,t){const r=pk(e);return De(r,t.length)},u:function(e,t){const r=e.getFullYear();return De(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return De(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return De(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return es.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return De(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const s=y3(e,n);return t==="wo"?r.ordinalNumber(s,{unit:"week"}):De(s,t.length)},I:function(e,t,r){const n=p3(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):De(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):es.d(e,t)},D:function(e,t,r){const n=m3(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):De(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const s=e.getDay(),o=(s-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return De(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(s,{width:"short",context:"formatting"});case"eeee":default:return r.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const s=e.getDay(),o=(s-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return De(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(s,{width:"narrow",context:"standalone"});case"cccccc":return r.day(s,{width:"short",context:"standalone"});case"cccc":default:return r.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),s=n===0?7:n;switch(t){case"i":return String(s);case"ii":return De(s,t.length);case"io":return r.ordinalNumber(s,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let s;switch(n===12?s=na.noon:n===0?s=na.midnight:s=n/12>
vendor: 4,693 bytes, line 476
476=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let s;switch(n>=17?s=na.evening:n>=12?s=na.afternoon:n>=4?s=na.morning:s=na.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return es.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):es.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):De(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):De(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):es.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):es.s(e,t)},S:function(e,t){return es.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return g0(n);case"XXXX":case"XX":return ro(n);case"XXXXX":case"XXX":default:return ro(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return g0(n);case"xxxx":case"xx":return ro(n);case"xxxxx":case"xxx":default:return ro(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+p0(n,":");case"OOOO":default:return"GMT"+ro(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+p0(n,":");case"zzzz":default:return"GMT"+ro(n,":")}},t:function(e,t,r){const n=Math.trunc(e.getTime()/1e3);return De(n,t.length)},T:function(e,t,r){const n=e.getTime();return De(n,t.length)}};function p0(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=Math.trunc(n/60),o=n%60;return o===0?r+String(s):r+String(s)+t+De(o,2)}function g0(e,t){return e%60===0?(e>0?"-":"+")+De(Math.abs(e)/60,2):ro(e,t)}function ro(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=De(Math.trunc(n/60),2),o=De(n%60,2);return r+s+t+o}const y0=(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"})}},vk=(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"})}},v3=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],s=r[2];if(!s)return y0(e,t);let o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",y0(n,t)).replace("{{time}}",vk(s,t))},x3={p:vk,P:v3},w3=/^D+$/,b3=/^Y+$/,_3=["D","DD","YY","YYYY"];function S3(e){return w3.test(e)}function k3(e){return b3.test(e)}function j3(e,t,r){const n=N3(e,t,r);if(console.warn(n),_3.includes(e))throw new RangeError(n)}function N3(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const C3=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,E3=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,T3=/^'([^]*?)'?$/,P3=/''/g,R3=/[a-zA-Z]/;function O3(e,t,r){var d,f,m,p,w,g,b,v;const n=Gd(),s=(r==null?void 0:r.locale)??n.locale??h3,o=(r==null?void 0:r.firstWeekContainsDate)??((f=(d=r==null?void 0:r.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??n.firstWeekContainsDate??((p=(m=n.locale)==null?void 0:m.options)==null?void 0:p.firstWeekContainsDate)??1,a=(r==null?void 0:r.weekStartsOn)??((g=(w=r==null?void 0:r.locale)==null?void 0:w.options)==null?void 0:g.weekStartsOn)??n.weekStartsOn??((v=(b=n.locale)==null?void 0:b.options)==null?void 0:v.weekStartsOn)??0,l=Ut(e);if(!T5(l))throw new RangeError("Invalid time value");let c=t.match(E3).map(y=>{const x=y[0];if(x==="p"||x==="P"){const _=x3[x];return _(y,s.formatLong)}return y}).join("").match(C3).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const x=y[0];if(x==="'")return{isToken:!1,value:A3(y)};if(m0[x])return{isToken:!0,value:y};
476if(x.match(R3))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:y}});s.localize.preprocessor&&(c=s.localize.preprocessor(l,c));const u={firstWeekContainsDate:o,weekStartsOn:a,locale:s};return c.map(y=>{if(!y.isToken)return y.value;const x=y.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&k3(x)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&S3(x))&&j3(x,t,String(e));const _=m0[x[0]];return _(l,x,s.localize,u)}).join("")}function A3(e){const t=e.match(T3);return t?t[1].replace(P3,"'"):e}const I3={compact:{container:"p-4 sm:p-5 max-w-2xl",iconWrapper:"w-10 h-10",icon:"w-5 h-5",label:"text-xs",date:"text-sm font-medium",unitBox:"px-2 sm:px-3 py-2 min-w-[48px] sm:min-w-[56px]",unitValue:"text-lg sm:text-xl",unitLabel:"text-[10px] sm:text-xs",separator:"text-lg sm:text-xl"},standard:{container:"p-6 sm:p-8 max-w-4xl",iconWrapper:"w-14 h-14",icon:"w-7 h-7",label:"text-sm",date:"text-lg font-semibold",unitBox:"px-3 sm:px-5 py-3 min-w-[60px] sm:min-w-[80px]",unitValue:"text-2xl sm:text-4xl",unitLabel:"text-xs sm:text-sm",separator:"text-2xl sm:text-3xl"},large:{container:"p-8 sm:p-10 max-w-5xl",iconWrapper:"w-16 h-16",icon:"w-8 h-8",label:"text-base",date:"text-xl font-bold",unitBox:"px-4 sm:px-6 py-4 min-w-[72px] sm:min-w-[100px]",unitValue:"text-3xl sm:text-5xl",unitLabel:"text-sm",separator:"text-3xl sm:text-4xl"}};function D3(){const{activeEvent:e}=ht(),{branding:t}=Bo(),[r,n]=h.useState(null),s=t.countdownSize||"standard",o=I3[s];if(h.useEffect(()=>{if(!(e!=null&&e.event_date))return;const l=()=>{const u=XM(e.event_date),d=new Date,f=A5(u,d);if(f<=0){n(null);return}const m=P5(u,d),p=R5(u,d)%24,w=O5(u,d)%60,g=f%60;n({days:m,hours:p,minutes:w,seconds:g})};l();const c=setInterval(l,1e3);return()=>clearInterval(c)},[e==null?void 0:e.event_date]),!(e!=null&&e.event_date)||!r)return null;const a=[{value:r.days,label:"days"},{value:r.hours,label:"hours"},{value:r.minutes,label:"mins"},{value:r.seconds,label:"secs"}];return i.jsx("div",{className:D("bg-gradient-to-r from-primary to-primary/80 rounded-2xl text-primary-foreground mb-12 mx-auto",o.container),children:i.jsxs("div",{className:"flex flex-col lg:flex-row items-center justify-between gap-6",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("div",{className:D("rounded-full bg-background/10 flex items-center justify-center",o.iconWrapper),children:i.jsx(_4,{className:o.icon})}),i.jsxs("div",{children:[i.jsx("p",{className:D("font-medium text-primary-foreground/80",o.label),children:"Event Countdown"}),i.jsx("p",{className:o.date,children:Eg(e.event_date)})]})]}),i.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[a.map((l,c)=>i.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[i.jsxs("div",{className:D("text-center bg-background/10 rounded-xl",o.unitBox),children:[i.jsx("span",{className:D("block font-bold tabular-nums",o.unitValue),children:String(l.value).padStart(2,"0")}),i.jsx("span",{className:D("font-medium text-primary-foreground/80",o.unitLabel),children:l.label})]}),c<a.length-1&&i.jsx("span",{className:D("font-bold text-primary-foreground/60",o.separator),children:":"})]},l.label)),i.jsx(Rg,{className:D("text-primary-foreground/60 hidden lg:block ml-2",o.icon)})]})]})})}const M3={icon:eS,title:"Register",description:"Join us for the 5K Fun Run/Walk! Sign up today and be part of something meaningful.",href:"/register",buttonText:"Register Now",gradient:"from-primary/10 to-primary/5",iconBg:"bg-primary/10",iconColor:"text-primary"},L3={icon:w4,title:"Event Details",description:"See the full schedule, course map, pricing tiers, and what's included with your registration.",href:"/events",buttonText:"View Details",gradient:"from-muted/10 to-muted/5",iconBg:"bg-muted",iconColor:"text-muted-foreground"},v0=[{icon:E4,title:"Donate",description:"Can't join us for the event? Your donation directly helps families facing medical hardship.",href:"/donate",buttonText:"Make a Donation",gradient:"from-secondary/10 to-secondary/5",iconBg:"bg-secondary/10",iconColor:"text-secondary"},{icon:yn,title:"Sponsor",description:"Local business looking to make an impact? Partner with us as an event sponsor.",href:"/sponsors",buttonText:"Become a Sponsor",gradient:"from-
476accent/10 to-accent/5",iconBg:"bg-accent/10",iconColor:"text-accent"}];function $3({title:e}){const t=e||"How You Can Help",{activeEvent:r}=ht();let n=!1;if((r==null?void 0:r.status)==="published"&&r.event_date){const[a,l,c]=r.event_date.split("-").map(Number),u=new Date(a,l-1,c),d=new Date;d.setHours(0,0,0,0),n=u>=d}const s=n?[M3,L3,...v0]:v0,o=s.length>=4?"lg:grid-cols-4":`lg:grid-cols-${s.length}`;return i.jsx("section",{className:"py-20",children:i.jsxs("div",{className:"container mx-auto px-4",children:[i.jsxs("div",{className:"text-center mb-12",children:[i.jsx("h2",{className:"text-3xl sm:text-4xl font-heading font-bold text-foreground mb-4",children:t}),i.jsx("p",{className:"text-muted-foreground max-w-2xl mx-auto",children:"Every contribution makes a difference. Choose how you'd like to support our mission and help local families in need."})]}),i.jsx(D3,{}),i.jsx("div",{className:`grid sm:grid-cols-2 ${o} gap-6`,children:s.map((a,l)=>{const c=a.icon;return i.jsxs(ot,{variant:"feature",className:"group relative overflow-hidden animate-slide-up",style:{animationDelay:`${l*.1}s`},children:[i.jsx("div",{className:`absolute inset-0 bg-gradient-to-br ${a.gradient} opacity-0 group-hover:opacity-100 transition-opacity duration-300`}),i.jsxs(ur,{className:"relative",children:[i.jsx("div",{className:`w-16 h-16 rounded-2xl ${a.iconBg} flex items-center justify-center mb-4 transition-transform group-hover:scale-110`,children:i.jsx(c,{className:`w-8 h-8 ${a.iconColor}`})}),i.jsx(Sr,{className:"text-xl",children:a.title}),i.jsx(qs,{className:"text-base",children:a.description})]}),i.jsx(at,{className:"relative",children:i.jsx(ee,{to:a.href,children:i.jsxs(ce,{variant:"outline",className:"group/btn",children:[a.buttonText,i.jsx(_t,{className:"w-4 h-4 transition-transform group-hover/btn:translate-x-1"})]})})})]},a.title)})})]})})}const hh={participants:{label:"Participants",icon:Fn,color:"hsl(var(--chart-1))"},registrations:{label:"Registrations",icon:rS,color:"hsl(var(--chart-2))"},donations:{label:"Donations",icon:vt,color:"hsl(var(--chart-3))"},sponsorships:{label:"Sponsors",icon:yn,color:"hsl(var(--chart-4))"}};function F3({title:e}){var b;const{activeEvent:t}=ht(),{branding:r}=Bo(),[n,s]=h.useState([]),[o,a]=h.useState({participants:0,registrations:0,donations:0,sponsorships:0}),[l,c]=h.useState(!0),u=(b=r.sections)==null?void 0:b.eventProgress,d=e||(u==null?void 0:u.title)||"Event Progress",f=(u==null?void 0:u.variant)||"cards",m=(u==null?void 0:u.showPercentage)!==!1;h.useEffect(()=>{if(!(t!=null&&t.id)){c(!1);return}(async()=>{var y,x,_,S;c(!0);try{const{data:k,error:N}=await ie.rpc("get_public_event_progress",{p_event_id:t.id});if(N)throw N;const E=k??{};s(E.goals??[]),a({participants:((y=E.progress)==null?void 0:y.participants)??0,registrations:((x=E.progress)==null?void 0:x.registrations)??0,donations:((_=E.progress)==null?void 0:_.donations)??0,sponsorships:((S=E.progress)==null?void 0:S.sponsorships)??0})}catch(k){console.error("Error fetching progress:",k)}finally{c(!1)}})()},[t==null?void 0:t.id]);const p=n.filter(v=>v.target_value>0);if(l||p.length===0)return null;const w=v=>{const y=p.find(S=>S.goal_type===v);if(!y)return null;const x=o[v]||0,_=Math.min(x/y.target_value*100,100);return{current:x,target:y.target_value,percent:_}},g=v=>v>=100?"bg-green-500":v>=75?"bg-primary":v>=50?"bg-yellow-500":"bg-secondary";return f==="cards"?i.jsx("section",{className:"py-12 bg-muted/30",children:i.jsxs("div",{className:"container mx-auto px-4",children:[i.jsxs("div",{className:"text-center mb-8",children:[i.jsx("h2",{className:"text-3xl font-heading font-bold text-foreground",children:d}),i.jsxs("p",{className:"text-muted-foreground mt-2",children:["Help us reach our goals for ",t==null?void 0:t.name]})]}),i.jsx("div",{className:"flex flex-wrap justify-center gap-4 max-w-4xl mx-auto",children:Object.entries(hh).map(([v,y])=>{const x=w(v);if(!x)return null;const _=y.icon;return i.jsx(ot,{className:"relative overflow-hidden",children:i.jsx(at,{className:"pt-6 pb-4",children:i.jsxs("div",{className:"flex flex-col items-center text-center",children:[i.jsx("div",{className:"w-12 h-12 rounded-full flex items-center justify-center mb-3",style:{backgroundColor:`${y.color}20`},children:i.jsx(_,{className:"w-6 h-6",style:{color:y.color}})}),i.jsx("p",{className:"text-3xl font-bold text-foreground",children:x.current.toLocaleStr
476ing()}),i.jsxs("p",{className:"text-xs text-muted-foreground mb-3",children:["of ",x.target.toLocaleString()," ",y.label]}),i.jsxs("div",{className:"w-full",children:[i.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-secondary",children:i.jsx("div",{className:D("h-full transition-all duration-500",g(x.percent)),style:{width:`${x.percent}%`}})}),m&&i.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[x.percent.toFixed(0),"%"]})]})]})})},v)})})]})}):f==="bars"?i.jsx("section",{className:"py-12 bg-muted/30",children:i.jsxs("div",{className:"container mx-auto px-4",children:[i.jsx("div",{className:"text-center mb-8",children:i.jsx("h2",{className:"text-3xl font-heading font-bold text-foreground",children:d})}),i.jsx("div",{className:"max-w-2xl mx-auto space-y-6",children:Object.entries(hh).map(([v,y])=>{const x=w(v);if(!x)return null;const _=y.icon;return i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(_,{className:"w-5 h-5 text-muted-foreground"}),i.jsx("span",{className:"font-medium",children:y.label})]}),i.jsxs("span",{className:"text-sm text-muted-foreground",children:[x.current.toLocaleString()," / ",x.target.toLocaleString(),m&&i.jsxs("span",{className:"ml-2 font-medium",children:["(",x.percent.toFixed(0),"%)"]})]})]}),i.jsx("div",{className:"h-4 w-full overflow-hidden rounded-full bg-secondary",children:i.jsx("div",{className:D("h-full transition-all duration-500",g(x.percent)),style:{width:`${x.percent}%`}})})]},v)})})]})}):i.jsx("section",{className:"py-8 bg-gradient-to-r from-primary/10 via-primary/5 to-primary/10",children:i.jsx("div",{className:"container mx-auto px-4",children:i.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-center gap-6 md:gap-12",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(V4,{className:"w-5 h-5 text-primary"}),i.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:[d,":"]})]}),i.jsx("div",{className:"flex flex-wrap items-center justify-center gap-6 md:gap-8",children:Object.entries(hh).map(([v,y])=>{const x=w(v);if(!x)return null;const _=y.icon;return i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(_,{className:"w-4 h-4 text-muted-foreground"}),i.jsx("span",{className:"text-lg font-bold text-foreground",children:x.current}),i.jsxs("span",{className:"text-sm text-muted-foreground",children:["/ ",x.target," ",y.label]}),m&&i.jsxs("span",{className:D("text-xs font-medium px-2 py-0.5 rounded-full",x.percent>=100?"bg-green-500/20 text-green-600":x.percent>=75?"bg-primary/20 text-primary":"bg-secondary text-muted-foreground"),children:[x.percent.toFixed(0),"%"]})]},v)})})]})})})}function U3({title:e}){const{activeEvent:t}=ht(),[r,n]=h.useState([]),[s,o]=h.useState(!0);if(h.useEffect(()=>{(async()=>{const{data:c,error:u}=await ie.from("beneficiaries").select(` 477 id, 478 full_name, 479 photo_url, 480 event_id, 481 story_post_id, 482 events!inner ( 483 id, 484 name, 485 event_date, 486 status 487 ), 488 posts:story_post_id ( 489 slug 490 ) 491 `).in("events.status",["published","archived"]).order("events(event_date)",{ascending:!1});if(!u&&c){const f=[...c.filter(m=>{var p;return m.event_id!==(t==null?void 0:t.id)&&((p=m.posts)==null?void 0:p.slug)}).map(m=>{var p;return{id:m.id,full_name:m.full_name,photo_url:m.photo_url,event_id:m.event_id,event_name:m.events.name,event_year:new Date(m.events.event_date).getFullYear(),story_post_id:m.story_post_id,story_slug:((p=m.posts)==null?void 0:p.slug)||null}})].sort(()=>Math.random()-.5);n(f.slice(0,3))}o(!1)})()},[t==null?void 0:t.id]),s)return i.jsx("section",{className:"py-20 bg-gradient-subtle",children:i.jsx("div",{className:"container mx-auto px-4 flex justify-center",children:i.jsx(Jr,{className:"w-8 h-8 animate-spin text-primary"})})});if(r.length===0)return null;const a=r;return i.jsxs("section",{className:"py-20 bg-gradient-subtle relative overflow-hidden",children:[i.jsxs("div",{className:"absolute inset-0 pointer-events-none",children:[i.jsx("div",{className:"absolute top-0 left-1/4 w-96 h-96 bg-primary/5 rounded-full blur-3xl"}),i.jsx("div",{className:"absolute bottom-0 right-1/4 w-96 h-96 bg-secondary/5 rounded-full blur-3xl"})]}),i.jsxs("div",{className:"container mx-auto px-4 relative",children:[i.jsxs("div",{className:"text-center mb-12",children:[i.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-primary/10 text-primary text-sm font-medium mb-4",children:[i.jsx(vt,{className:"w-4 h-4"}),e||"Your Impact"]}),i.jsx("h2",{className:"text-3xl sm:text-4xl font-heading font-bold text-foreground mb-4",children:"Families You've Helped"}),i.jsx("p",{className:"text-muted-foreground max-w-2xl mx-auto",children:"Over the years, your support has helped these amazing families during their time of need."})]}),i.jsx("div",{className:"flex flex-row flex-wrap gap-5 justify-center",children:a.map(l
vendor: 6,769 bytes, line 491
491=>i.jsx(ee,{to:`/stories/${l.story_slug}`,children:i.jsxs("div",{className:"group relative w-44 h-56 sm:w-48 sm:h-60 rounded-2xl overflow-hidden bg-card border border-border shadow-lg hover:shadow-xl transition-all duration-300 hover:scale-[1.03] hover:-translate-y-1 flex-shrink-0",children:[i.jsx("div",{className:"absolute inset-0",children:l.photo_url?i.jsx("img",{src:l.photo_url,alt:l.full_name,className:"w-full h-full object-cover",loading:"lazy"}):i.jsx("div",{className:"w-full h-full bg-gradient-to-br from-primary/30 via-primary/10 to-accent/20 flex items-center justify-center",children:i.jsx(T4,{className:"w-16 h-16 text-primary/30"})})}),i.jsx("div",{className:"absolute top-3 left-3",children:i.jsx("span",{className:"bg-primary text-primary-foreground text-xs font-bold px-2.5 py-1 rounded-full shadow-md",children:l.event_year})}),i.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/90 via-black/20 to-transparent"}),i.jsxs("div",{className:"absolute inset-x-0 bottom-0 p-4 flex flex-col",children:[i.jsx("h3",{className:"text-white font-bold text-base leading-tight mb-1",children:l.full_name}),i.jsxs("span",{className:"text-white/70 text-xs flex items-center gap-1 group-hover:text-white transition-colors",children:["Read story ",i.jsx(_t,{className:"w-3 h-3 group-hover:translate-x-0.5 transition-transform"})]})]}),i.jsx("div",{className:"absolute inset-0 rounded-2xl ring-2 ring-transparent group-hover:ring-primary/50 transition-all pointer-events-none"})]})},l.id))}),i.jsx("div",{className:"text-center mt-12",children:i.jsx(ee,{to:"/history",children:i.jsxs(ce,{variant:"outline",size:"lg",className:"group",children:["View All Past Beneficiaries",i.jsx(_t,{className:"w-4 h-4 transition-transform group-hover:translate-x-1"})]})})})]})]})}function z3(e){return Object.prototype.toString.call(e)==="[object Object]"}function x0(e){return z3(e)||Array.isArray(e)}function B3(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Gg(e,t){const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;const s=JSON.stringify(Object.keys(e.breakpoints||{})),o=JSON.stringify(Object.keys(t.breakpoints||{}));return s!==o?!1:r.every(a=>{const l=e[a],c=t[a];return typeof l=="function"?`${l}`==`${c}`:!x0(l)||!x0(c)?l===c:Gg(l,c)})}function w0(e){return e.concat().sort((t,r)=>t.name>r.name?1:-1).map(t=>t.options)}function V3(e,t){if(e.length!==t.length)return!1;const r=w0(e),n=w0(t);return r.every((s,o)=>{const a=n[o];return Gg(s,a)})}function Yg(e){return typeof e=="number"}function qm(e){return typeof e=="string"}function Yd(e){return typeof e=="boolean"}function b0(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ge(e){return Math.abs(e)}function Qg(e){return Math.sign(e)}function al(e,t){return Ge(e-t)}function H3(e,t){if(e===0||t===0||Ge(e)<=Ge(t))return 0;const r=al(Ge(e),Ge(t));return Ge(r/e)}function W3(e){return Math.round(e*100)/100}function Ul(e){return zl(e).map(Number)}function Kr(e){return e[uc(e)]}function uc(e){return Math.max(0,e.length-1)}function Jg(e,t){return t===uc(e)}function _0(e,t=0){return Array.from(Array(e),(r,n)=>t+n)}function zl(e){return Object.keys(e)}function xk(e,t){return[e,t].reduce((r,n)=>(zl(n).forEach(s=>{const o=r[s],a=n[s],l=b0(o)&&b0(a);r[s]=l?xk(o,a):a}),r),{})}function Km(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function q3(e,t){const r={start:n,center:s,end:o};function n(){return 0}function s(c){return o(c)/2}function o(c){return t-c}function a(c,u){return qm(e)?r[e](c):e(t,c,u)}return{measure:a}}function Bl(){let e=[];function t(s,o,a,l={passive:!0}){let c;if("addEventListener"in s)s.addEventListener(o,a,l),c=()=>s.removeEventListener(o,a,l);else{const u=s;u.addListener(a),c=()=>u.removeListener(a)}return e.push(c),n}function r(){e=e.filter(s=>s())}const n={add:t,clear:r};return n}function K3(e,t,r,n){const s=Bl(),o=1e3/60;let a=null,l=0,c=0;function u(){s.add(e,"visibilitychange",()=>{e.hidden&&w()})}function d(){p(),s.clear()}function f(b){if(!c)return;a||(a=b,r(),r());const v=b-a;for(a=b,l+=v;l>=o;)r(),l-=o;const y=l/o;n(y),c&&(c=t.requestAnimationFrame(f))}function m(){c||(c=t.requestAnimationFrame(f))}function p(){t.cancelAnimationFrame(c),a=null,l=0,c=0}function w(){a=null,l=0}return{init:u,destroy:d,start:m,stop:p,update:r,render:n}}function G3(e,t){const r=t==="rtl",n=e==="y",s=n?"y":"x",o=n?"x":"y",a=!n&&r?-1:1,l=d(),c=f();function u(w){const{height:g,width:b}=w;return n?g:b}function d(){return n?"top":r?"right":"left"}function f(){return n?"bottom":r?"left":"right"}function m(w){return w*a}return{scroll:s,cross:o,startEdge:l,endEdge:c,measureSize:u,direction:m}}function Do(e=0,t=0){const r=Ge(e-t);function n(u){return u<e}function s(u){return u>t}function o(u){return n(u)||s(u)}function a(u){return o(u)?n(u)?e:t:u}function l(u){return r?u-r*Math.ceil((u-t)/r):u}return{length:r,max:t,min:e,constrain:a,reachedAny:o,reachedMax:s,reachedMin:n,removeOffset:l}}function wk(e,t,r){const{constrain:n}=Do(0,e),s=e+1;let o=a(t);function a(m){return r?Ge((s+m)%s):n(m)}function l(){return o}function c(m){return o=a(m),f}function u(m){return d().set(l()+m)}function d(){return wk(e,l(),r)}const f={get:l,set:c,add:u,clone:d};return f}function Y3(e,t,r,n,s,o,a,l,c,u,d,f,m,p,w,g,b,v,y){const{cross:x,direction:_}=e,S=["INPUT","SELECT","TEXTAREA"],k={passive:!1},N=Bl(),E=Bl(),T=Do(50,225).constrain(p.measure(20)),R={mouse:300,touch:400},L={mouse:500,touch:600},O=w?43:25;let A=!1,$=0,z=0,P=!1,M=!1,C=!1,j=!1;function I(q){if(!y)return;function pe(Le){(Yd(y)||y(q,Le))&&je(Le)}const Ce=t;N.add(Ce,"dragstart",Le=>Le.preventDefault(),k).add(Ce,"touchmove",()=>{},k).add(Ce,"touchend",()=>{}).add(Ce,"touchstart",pe).add(Ce,"mousedown",pe).add(Ce,"touchcancel",le).add(Ce,"contextmenu",le).add(Ce,"click",ge,!0)}function F(){N.clear(),E.clear()}function B(){const q=j?r:t;E.add(q,"touchmove",V,k).add(q,"touchend",le).add(q,"mousemove",V,k).add(q,"mouseup",le)}function J(q){const pe=q.nodeName||"";return S.includes(pe)}function Z(){return(w?L:R)[j?"mouse":"touch"]}function Se(q,pe){const Ce=f.add(Qg(q)*-1),Le=d.byDistance(q,!w).distance;return w||Ge(q)<T?Le:b&&pe?Le*.5:d.byIndex(Ce.get(),0).distance}function je(q){const pe=Km(q,n);j=pe,C=w&&pe&&!q.buttons&&A,A=al(s.get(),a.get())>=2,!(pe&&q.button!==0)&&(J(q.target)||(P=!0,o.pointerDown(q),u.useFriction(0).useDuration(0),s.set(a),B(),$=o.readPoint(q),z=o.readPoint(q,x),m.emit("pointerDown")))}function V(q){if(!Km(q,n)&&q.touches.length>=2)return le(q);const Ce=o.readPoint(q),Le=o.readPoint(q,x),Ze=al(Ce,$),K=al(Le,z);if(!M&&!j&&(!q.cancelable||(M=Ze>K,!M)))return le(q);const xe=o.pointerMove(q);Ze>g&&(C=!0),u.useFriction(.3).useDuration(.75),l.start(),s.add(_(xe)),q.preventDefault()}
vendor: 14,325 bytes, line 491
491function le(q){const Ce=d.byDistance(0,!1).index!==f.get(),Le=o.pointerUp(q)*Z(),Ze=Se(_(Le),Ce),K=H3(Le,Ze),xe=O-10*K,Ee=v+K/50;M=!1,P=!1,E.clear(),u.useDuration(xe).useFriction(Ee),c.distance(Ze,!w),j=!1,m.emit("pointerUp")}function ge(q){C&&(q.stopPropagation(),q.preventDefault(),C=!1)}function de(){return P}return{init:I,destroy:F,pointerDown:de}}function Q3(e,t){let n,s;function o(f){return f.timeStamp}function a(f,m){const w=`client${(m||e.scroll)==="x"?"X":"Y"}`;return(Km(f,t)?f:f.touches[0])[w]}function l(f){return n=f,s=f,a(f)}function c(f){const m=a(f)-a(s),p=o(f)-o(n)>170;return s=f,p&&(n=f),m}function u(f){if(!n||!s)return 0;const m=a(s)-a(n),p=o(f)-o(n),w=o(f)-o(s)>170,g=m/p;return p&&!w&&Ge(g)>.1?g:0}return{pointerDown:l,pointerMove:c,pointerUp:u,readPoint:a}}function J3(){function e(r){const{offsetTop:n,offsetLeft:s,offsetWidth:o,offsetHeight:a}=r;return{top:n,right:s+o,bottom:n+a,left:s,width:o,height:a}}return{measure:e}}function Z3(e){function t(n){return e*(n/100)}return{measure:t}}function X3(e,t,r,n,s,o,a){const l=[e].concat(n);let c,u,d=[],f=!1;function m(b){return s.measureSize(a.measure(b))}function p(b){if(!o)return;u=m(e),d=n.map(m);function v(y){for(const x of y){if(f)return;const _=x.target===e,S=n.indexOf(x.target),k=_?u:d[S],N=m(_?e:n[S]);if(Ge(N-k)>=.5){b.reInit(),t.emit("resize");break}}}c=new ResizeObserver(y=>{(Yd(o)||o(b,y))&&v(y)}),r.requestAnimationFrame(()=>{l.forEach(y=>c.observe(y))})}function w(){f=!0,c&&c.disconnect()}return{init:p,destroy:w}}function eF(e,t,r,n,s,o){let a=0,l=0,c=s,u=o,d=e.get(),f=0;function m(){const k=n.get()-e.get(),N=!c;let E=0;return N?(a=0,r.set(n),e.set(n),E=k):(r.set(e),a+=k/c,a*=u,d+=a,e.add(a),E=d-f),l=Qg(E),f=d,S}function p(){const k=n.get()-t.get();return Ge(k)<.001}function w(){return c}function g(){return l}function b(){return a}function v(){return x(s)}function y(){return _(o)}function x(k){return c=k,S}function _(k){return u=k,S}const S={direction:g,duration:w,velocity:b,seek:m,settled:p,useBaseFriction:y,useBaseDuration:v,useFriction:_,useDuration:x};return S}function tF(e,t,r,n,s){const o=s.measure(10),a=s.measure(50),l=Do(.1,.99);let c=!1;function u(){return!(c||!e.reachedAny(r.get())||!e.reachedAny(t.get()))}function d(p){if(!u())return;const w=e.reachedMin(t.get())?"min":"max",g=Ge(e[w]-t.get()),b=r.get()-t.get(),v=l.constrain(g/a);r.subtract(b*v),!p&&Ge(b)<o&&(r.set(e.constrain(r.get())),n.useDuration(25).useBaseFriction())}function f(p){c=!p}return{shouldConstrain:u,constrain:d,toggleActive:f}}function rF(e,t,r,n,s){const o=Do(-t+e,0),a=f(),l=d(),c=m();function u(w,g){return al(w,g)<=1}function d(){const w=a[0],g=Kr(a),b=a.lastIndexOf(w),v=a.indexOf(g)+1;return Do(b,v)}function f(){return r.map((w,g)=>{const{min:b,max:v}=o,y=o.constrain(w),x=!g,_=Jg(r,g);return x?v:_||u(b,y)?b:u(v,y)?v:y}).map(w=>parseFloat(w.toFixed(3)))}function m(){if(t<=e+s)return[o.max];if(n==="keepSnaps")return a;const{min:w,max:g}=l;return a.slice(w,g)}return{snapsContained:c,scrollContainLimit:l}}function nF(e,t,r){const n=t[0],s=r?n-e:Kr(t);return{limit:Do(s,n)}}function sF(e,t,r,n){const o=t.min+.1,a=t.max+.1,{reachedMin:l,reachedMax:c}=Do(o,a);function u(m){return m===1?c(r.get()):m===-1?l(r.get()):!1}function d(m){if(!u(m))return;const p=e*(m*-1);n.forEach(w=>w.add(p))}return{loop:d}}function oF(e){const{max:t,length:r}=e;function n(o){const a=o-t;return r?a/-r:0}return{get:n}}function aF(e,t,r,n,s){const{startEdge:o,endEdge:a}=e,{groupSlides:l}=s,c=f().map(t.measure),u=m(),d=p();function f(){return l(n).map(g=>Kr(g)[a]-g[0][o]).map(Ge)}function m(){return n.map(g=>r[o]-g[o]).map(g=>-Ge(g))}function p(){return l(u).map(g=>g[0]).map((g,b)=>g+c[b])}return{snaps:u,snapsAligned:d}}function iF(e,t,r,n,s,o){const{groupSlides:a}=s,{min:l,max:c}=n,u=d();function d(){const m=a(o),p=!e||t==="keepSnaps";return r.length===1?[o]:p?m:m.slice(l,c).map((w,g,b)=>{const v=!g,y=Jg(b,g);if(v){const x=Kr(b[0])+1;return _0(x)}if(y){const x=uc(o)-Kr(b)[0]+1;return _0(x,Kr(b)[0])}return w})}return{slideRegistry:u}}function lF(e,t,r,n,s){const{reachedAny:o,removeOffset:a,constrain:l}=n;function c(w){return w.concat().sort((g,b)=>Ge(g)-Ge(b))[0]}function u(w){const g=e?a(w):l(w),b=t.map((y,x)=>({diff:d(y-g,0),index:x})).sort((y,x)=>Ge(y.diff)-Ge(x.diff)),{index:v}=b[0];return{index:v,distance:g}}function d(w,g){const b=[w,w+r,w-r];if(!e)return w;if(!g)return c(b);const v=b.filter(y=>Qg(y)===g);return v.length?c(v):Kr(b)-r}function f(w,g){const b=t[w]-s.get(),v=d(b,g);return{index:w,distance:v}}function m(w,g){const b=s.get()+w,{index:v,distance:y}=u(b),x=!e&&o(b);if(!g||x)return{index:v,distance:w};const _=t[v]-y,S=w+d(_,0);return{index:v,distance:S}}return{byDistance:m,byIndex:f,shortcut:d}}function cF(e,t,r,n,s,o,a){function l(f){const m=f.distance,p=f.index!==t.get();o.add(m),m&&(n.duration()?e.start():(e.update(),e.render(1),e.update())),p&&(r.set(t.get()),t.set(f.index),a.emit("select"))}function c(f,m){const p=s.byDistance(f,m);l(p)}function u(f,m){const p=t.clone().set(f),w=s.byIndex(p.get(),m);l(w)}return{distance:c,index:u}}function uF(e,t,r,n,s,o,a,l){const c={passive:!0,capture:!0};let u=0;function d(p){if(!l)return;function w(g){if(new Date().getTime()-u>10)return;a.emit("slideFocusStart"),e.scrollLeft=0;const y=r.findIndex(x=>x.includes(g));Yg(y)&&(s.useDuration(0),n.index(y,0),a.emit("slideFocus"))}o.add(document,"keydown",f,!1),t.forEach((g,b)=>{o.add(g,"focus",v=>{(Yd(l)||l(p,v))&&w(b)},c)})}function f(p){p.code==="Tab"&&(u=new Date().getTime())}return{init:d}}function Wi(e){let t=e;function r(){return t}function n(c){t=a(c)}function s(c){t+=a(c)}function o(c){t-=a(c)}function a(c){return Yg(c)?c:c.get()}return{get:r,set:n,add:s,subtract:o}}function bk(e,t){const r=e.scroll==="x"?a:l,n=t.style;let s=null,o=!1;function a(m){return`translate3d(${m}px,0px,0px)`}function l(m){return`translate3d(0px,${m}px,0px)`}function c(m){if(o)return;const p=W3(e.direction(m));p!==s&&(n.transform=r(p),s=p)}function u(m){o=!m}function d(){o||(n.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:d,to:c,toggleActive:u}}function dF(e,t,r,n,s,o,a,l,c){const d=Ul(s),f=Ul(s).reverse(),m=v().concat(y());function p(N,E){return N.reduce((T,R)=>T-s[R],E)}function w(N,E){return N.reduce((T,R)=>p(T,E)>0?T.concat([R]):T,[])}function g(N){return o.map((E,T)=>({start:E-n[T]+.5+N,end:E+t-.5+N}))}function b(N,E,T){const R=g(E);return N.map(L=>{const O=T?0:-r,A=T?r:0,$=T?"end":"start",z=R[L][$];return{index:L,loopPoint:z,slideLocation:Wi(-1),translate:bk(e,c[L]),target:()=>l.get()>z?O:A}})}function v(){const N=a[0],E=w(f,N);return b(E,r,!1)}function y(){const N=t-a[0]-1,E=w(d,N);return b(E,-r,!0)}function x(){return m.every(({index:N})=>{const E=d.filter(T=>T!==N);return p(E,t)<=.1})}function _(){m.forEach(N=>{const{target:E,translate:T,slideLocation:R}=N,L=E();L!==R.get()&&(T.to(L),R.set(L))})}function S(){m.forEach(N=>N.translate.clear())}return{canLoop:x,clear:S,loop:_,loopPoints:m}}function fF(e,t,r){let n,s=!1;function o(c){if(!r)return;function u(d){for(const f of d)if(f.type==="childList"){c.reInit(),t.emit("slidesChanged");break}}n=new MutationObserver(d=>{s||(Yd(r)||r(c,d))&&u(d)}),n.observe(e,{childList:!0})}function a(){n&&n.disconnect(),s=!0}return{init:o,destroy:a}}function hF(e,t,r,n){const s={};let o=null,a=null,l,c=!1;function u(){l=new IntersectionObserver(w=>{c||(w.forEach(g=>{const b=t.indexOf(g.target);s[b]=g}),o=null,a=null,r.emit("slidesInView"))},{root:e.parentElement,threshold:n}),t.forEach(w=>l.observe(w))}function d(){l&&l.disconnect(),c=!0}function f(w){return zl(s).reduce((g,b)=>{const v=parseInt(b),{isIntersecting:y}=s[v];return(w&&y||!w&&!y)&&g.push(v),g},[])}function m(w=!0){if(w&&o)return o;if(!w&&a)return a;const g=f(w);return w&&(o=g),w||(a=g),g}return{init:u,destroy:d,get:m}}function mF(e,t,r,n,s,o){const{measureSize:a,startEdge:l,endEdge:c}=e,u=r[0]&&s,d=w(),f=g(),m=r.map(a),p=b();function w(){if(!u)return 0;const y=r[0];return Ge(t[l]-y[l])}function g(){if(!u)return 0;const y=o.getComputedStyle(Kr(n));return parseFloat(y.getPropertyValue(`margin-${c}`))}function b(){return r.map((y,x,_)=>{const S=!x,k=Jg(_,x);return S?m[x]+d:k?m[x]+f:_[x+1][l]-y[l]}).map(Ge)}return{slideSizes:m,slideSizesWithGaps:p,startGap:d,endGap:f}}function pF(e,t,r,n,s,o,a,l,c){const{startEdge:u,endEdge:d,direction:f}=e,m=Yg(r);function p(v,y){return Ul(v).filter(x=>x%y===0).map(x=>v.slice(x,x+y))}function w(v){return v.length?Ul(v).reduce((y,x,_)=>{const S=Kr(y)||0,k=S===0,N=x===uc(v),E=s[u]-o[S][u],T=s[u]-o[x][d],R=!n&&k?f(a):0,L=!n&&N?f(l):0,O=Ge(T-L-(E+R));return _&&O>t+c&&y.push(x),N&&y.push(v.length),y},[]).map((y,x,_)=>{const S=Math.max(_[x-1]||0);return v.slice(S,y)}):[]}function g(v){return m?p(v,r):w(v)}return{groupSlides:g}}function gF(e,t,r,n,s,o,a){const{align:l,axis:c,direction:u,startIndex:d,loop:f,duration:m,dragFree:p,dragThreshold:w,inViewThreshold:g,slidesToScroll:b,skipSnaps:v,containScroll:y,watchResize:x,watchSlides:_,watchDrag:S,watchFocus:k}=o,N=2,E=J3(),T=E.measure(t),R=r.map(E.measure),L=G3(c,u),O=L.measureSize(T),A=Z3(O),$=q3(l,O),z=!f&&!!y,P=f||!!y,{slideSizes:M,slideSizesWithGaps:C,startGap:j,endGap:I}=mF(L,T,R,r,P,s),F=pF(L,O,b,f,T,R,j,I,N),{snaps:B,snapsAligned:J}=aF(L,$,T,R,F),Z=-Kr(B)+Kr(C),{snapsContained:Se,scrollContainLimit:je}=rF(O,Z,J,y,N),V=z?Se:J,{limit:le}=nF(Z,V,f),ge=wk(uc(V),d,f),de=ge.clone(),ne=Ul(r),q=({dragHandler:Nr,scrollBody:wi,scrollBounds:Ho,options:{loop:qn}})=>{qn||Ho.constrain(Nr.pointerDown()),wi.seek()},pe=({scrollBody:Nr,translate:wi,location:Ho,offsetLocation:qn,previousLocation:Kn,scrollLooper:yc,slideLooper:Gn,dragHandler:cf,animation:uf,eventHandler:bi,scrollBounds:vc,options:{loop:xc}},Wo)=>{const Cr=Nr.settled(),df=!vc.shouldConstrain(),me=xc?Cr:Cr&&df,Ie=me&&!cf.pointerDown();Ie&&uf.stop();const $e=Ho.get()*Wo+Kn.get()*(1-Wo);qn.set($e),xc&&(yc.loop(Nr.direction()),Gn.loop()),wi.to(qn.get()),Ie&&bi.emit("settle"),me||bi.emit("scroll")},Ce=K3(n,s,()=>q(xi),Nr=>pe(xi,Nr)),Le=.68,Ze=V[ge.get()],K=Wi(Ze),xe=Wi(Ze),Ee=Wi(Ze),ct=Wi(Ze),Ht=eF(K,Ee,xe,ct,m,Le),Wn=lF(f,V,Z,le,ct),Xt=cF(Ce,ge,de,Ht,Wn,ct,a),pc=oF(le),gc=Bl(),Wt=hF(t,r,a,g),{slideRegistry:wn}=iF(z,y,V,je,F,ne),lf=uF(e,r,wn,Xt,Ht,gc,a,k),xi={ownerDocument:n,ownerWindow:s,eventHandler:a,containerRect:T,slideRects:R,animation:Ce,axis:L,dragHandler:Y3(L,e,n,s,ct,Q3(L,s),K,Ce,Xt,Ht,Wn,ge,a,A,p,w,v,Le,S),eventStore:gc,percentOfView:A,index:ge,indexPrevious:de,limit:le,location:K,offsetLocation:Ee,previousLocation:xe,options:o,resizeHandler:X3(t,a,s,r,L,x,E),scrollBody:Ht,scrollBounds:tF(le,Ee,ct,Ht,A),scrollLooper:sF(Z,le,Ee,[K,Ee,xe,ct]),scrollProgress:pc,scrollSnapList:V.map(pc.get),scrollSnaps:V,scrollTarget:Wn,scrollTo:Xt,slideLooper:dF(L,O,Z,M,C,B,V,Ee,r),slideFocus:lf,slidesHandler:fF(t,a,_),slidesInView:Wt,slideIndexes:ne,slideRegistry:wn,slidesToScroll:F,target:ct,translate:bk(L,t)};return xi}function yF(){let e={},t;function r(u){t=u}function n(u){return e[u]||[]}function s(u){return n(u).forEach(d=>d(t,u)),c}function o(u,d){return e[u]=n(u).concat([d]),c}function a(u,d){return e[u]=n(u).filter(f=>f!==d),c}function l(){e={}}const c={init:r,emit:s,off:a,on:o,clear:l};return c}const vF={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 xF(e){function t(o,a){return xk(o,a||{})}function r(o){const a=o.breakpoints||{},l=zl(a).filter(c=>e.matchMedia(c).matches).map(c=>a[c]).reduce((c,u)=>t(c,u),{});return t(o,l)}function n(o){return o.map(a=>zl(a.breakpoints||{})).reduce((a,l)=>a.concat(l),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:r,optionsMediaQueries:n}}function wF(e){let t=[];function r(o,a){return t=a.filter(({options:l})=>e.optionsAtMedia(l).active!==!1),t.forEach(l=>l.init(o,e)),a.reduce((l,c)=>Object.assign(l,{[c.name]:c}),{})}function n(){t=t.filter(o=>o.destroy())}return{init:r,destroy:n}}function td(e,t,r){const n=e.ownerDocument,s=n.defaultView,o=xF(s),a=wF(o),l=Bl(),c=yF(),{mergeOptions:u,optionsAtMedia:d,optionsMediaQueries:f}=o,{on:m,off:p,emit:w}=c,g=L;let b=!1,v,y=u(vF,td.globalOptions),x=u(y),_=[],S,k,N;function E(){const{container:ne,slides:q}=x;k=(qm(ne)?e.querySelector(ne):ne)||e.children[0];const Ce=qm(q)?k.querySelectorAll(q):q;N=[].slice.call(Ce||k.children)}function T(ne){const q=gF(e,k,N,n,s,ne,c);if(ne.loop&&!q.slideLooper.canLoop()){const pe=Object.assign({},ne,{loop:!1});return T(pe)}return q}function R(ne,q){b||(y=u(y,ne),x=d(y),_=q||_,E(),v=T(x),f([y,..._.map(({options:pe})=>pe)]).forEach(pe=>l.add(pe,"change",L)),x.active&&(v.translate.to(v.location.get()),v.animation.init(),v.slidesInView.init(),v.slideFocus.init(de),v.eventHandler.init(de),v.resizeHandler.init(de),v.slidesHandler.init(de),v.options.loop&&v.slideLooper.loop(),k.offsetParent&&N.length&&v.dragHandler.init(de),S=a.init(de,_)))}function L(ne,q){const pe=F();O(),R(u({startIndex:pe},ne),q),c.emit("reInit")}function O(){v.dragHandler.destroy(),v.eventStore.clear(),v.translate.clear(),v.slideLooper.clear(),v.resizeHandler.destroy(),v.slidesHandler.destroy(),v.slidesInView.destroy(),v.animation.destroy(),a.destroy(),l.clear()}function A(){b||(b=!0,l.clear(),O(),c.emit("destroy"),c.clear())}function $(ne,q,pe){!x.active||b||(v.scrollBody.useBaseFriction().useDuration(q===!0?0:x.duration),v.scrollTo.index(ne,pe||0))}function z(ne){const q=v.index.add(1).get();$(q,ne,-1)}function P(ne){const q=v.index.add(-1).get();$(q,ne,1)}function M(){return v.index.add(1).get()!==F()}function C(){return v.index.add(-1).get()!==F()}function j(){return v.scrollSnapList}function I(){return v.scrollProgress.get(v.offsetLocation.get())}function F(){return v.index.get()}function B(){return v.indexPrevious.get()}function J(){return v.slidesInView.get()}function Z(){return v.slidesInView.get(!1)}function Se(){return S}function je(){return v}function V(){return e}function le(){return k}function ge(){return N}const de={canScrollNext:M,canScrollPrev:C,containerNode:le,internalEngine:je,destroy:A,off:p,on:m,emit:w,plugins:Se,previousScrollSnap:B,reInit:g,rootNode:V,scrollNext:z,scrollPrev:P,scrollProgress:I,scrollSnapList:j,scrollTo:$,selectedScrollSnap:F,slideNo
491des:ge,slidesInView:J,slidesNotInView:Z};return R(t,r),setTimeout(()=>c.emit("init"),0),de}td.globalOptions=void 0;function Zg(e={},t=[]){const r=h.useRef(e),n=h.useRef(t),[s,o]=h.useState(),[a,l]=h.useState(),c=h.useCallback(()=>{s&&s.reInit(r.current,n.current)},[s]);return h.useEffect(()=>{Gg(r.current,e)||(r.current=e,c())},[e,c]),h.useEffect(()=>{V3(n.current,t)||(n.current=t,c())},[t,c]),h.useEffect(()=>{if(B3()&&a){td.globalOptions=Zg.globalOptions;const u=td(a,r.current,n.current);return o(u),()=>u.destroy()}else o(void 0)},[a,o]),[l,s]}Zg.globalOptions=void 0;const _k=h.createContext(null);function Qd(){const e=h.useContext(_k);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}const Sk=h.forwardRef(({orientation:e="horizontal",opts:t,setApi:r,plugins:n,className:s,children:o,...a},l)=>{const[c,u]=Zg({...t,axis:e==="horizontal"?"x":"y"},n),[d,f]=h.useState(!1),[m,p]=h.useState(!1),w=h.useCallback(y=>{y&&(f(y.canScrollPrev()),p(y.canScrollNext()))},[]),g=h.useCallback(()=>{u==null||u.scrollPrev()},[u]),b=h.useCallback(()=>{u==null||u.scrollNext()},[u]),v=h.useCallback(y=>{y.key==="ArrowLeft"?(y.preventDefault(),g()):y.key==="ArrowRight"&&(y.preventDefault(),b())},[g,b]);return h.useEffect(()=>{!u||!r||r(u)},[u,r]),h.useEffect(()=>{if(u)return w(u),u.on("reInit",w),u.on("select",w),()=>{u==null||u.off("select",w)}},[u,w]),i.jsx(_k.Provider,{value:{carouselRef:c,api:u,opts:t,orientation:e||((t==null?void 0:t.axis)==="y"?"vertical":"horizontal"),scrollPrev:g,scrollNext:b,canScrollPrev:d,canScrollNext:m},children:i.jsx("div",{ref:l,onKeyDownCapture:v,className:D("relative",s),role:"region","aria-roledescription":"carousel",...a,children:o})})});Sk.displayName="Carousel";const kk=h.forwardRef(({className:e,...t},r)=>{const{carouselRef:n,orientation:s}=Qd();return i.jsx("div",{ref:n,className:"overflow-hidden",children:i.jsx("div",{ref:r,className:D("flex",s==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})});kk.displayName="CarouselContent";const jk=h.forwardRef(({className:e,...t},r)=>{const{orientation:n}=Qd();return i.jsx("div",{ref:r,role:"group","aria-roledescription":"slide",className:D("min-w-0 shrink-0 grow-0 basis-full",n==="horizontal"?"pl-4":"pt-4",e),...t})});jk.displayName="CarouselItem";const Nk=h.forwardRef(({className:e,variant:t="outline",size:r="icon",...n},s)=>{const{orientation:o,scrollPrev:a,canScrollPrev:l}=Qd();return i.jsxs(ce,{ref:s,variant:t,size:r,className:D("absolute h-8 w-8 rounded-full",o==="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:a,...n,children:[i.jsx(Um,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Previous slide"})]})});Nk.displayName="CarouselPrevious";const Ck=h.forwardRef(({className:e,variant:t="outline",size:r="icon",...n},s)=>{const{orientation:o,scrollNext:a,canScrollNext:l}=Qd();return i.jsxs(ce,{ref:s,variant:t,size:r,className:D("absolute h-8 w-8 rounded-full",o==="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:a,...n,children:[i.jsx(_t,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Next slide"})]})});Ck.displayName="CarouselNext";const bF={active:!0,breakpoints:{},delay:4e3,jump:!1,playOnInit:!0,stopOnFocusIn:!0,stopOnInteraction:!0,stopOnMouseEnter:!1,stopOnLastSnap:!1,rootNode:null};function _F(e,t){const r=e.scrollSnapList();return typeof t=="number"?r.map(()=>t):t(r,e)}function SF(e,t){const r=e.rootNode();return t&&t(r)||r}function Xg(e={}){let t,r,n,s,o=null,a=0,l=!1,c=!1,u=!1,d=!1;function f($,z){r=$;const{mergeOptions:P,optionsAtMedia:M}=z,C=P(bF,Xg.globalOptions),j=P(C,e);if(t=M(j),r.scrollSnapList().length<=1)return;d=t.jump,n=!1,s=_F(r,t.delay);const{eventStore:I,ownerDocument:F}=r.internalEngine(),B=!!r.internalEngine().options.watchDrag,J=SF(r,t.rootNode);I.add(F,"visibilitychange",v),B&&r.on("pointerDown",x),B&&!t.stopOnInteraction&&r.on("pointerUp",_),t.stopOnMouseEnter&&I.add(J,"mouseenter",S),t.stopOnMouseEnter&&!t.stopOnInteraction&&I.add(J,"mouseleave",k),t.stopOnFocusIn&&r.on("slideFocusStart",b),t.stopOnFocusIn&&!t.stopOn
491Interaction&&I.add(r.containerNode(),"focusout",g),t.playOnInit&&g()}function m(){r.off("pointerDown",x).off("pointerUp",_).off("slideFocusStart",b),b(),n=!0,l=!1}function p(){const{ownerWindow:$}=r.internalEngine();$.clearTimeout(a),a=$.setTimeout(L,s[r.selectedScrollSnap()]),o=new Date().getTime(),r.emit("autoplay:timerset")}function w(){const{ownerWindow:$}=r.internalEngine();$.clearTimeout(a),a=0,o=null,r.emit("autoplay:timerstopped")}function g(){if(!n){if(y()){u=!0;return}l||r.emit("autoplay:play"),p(),l=!0}}function b(){n||(l&&r.emit("autoplay:stop"),w(),l=!1)}function v(){if(y())return u=l,b();u&&g()}function y(){const{ownerDocument:$}=r.internalEngine();return $.visibilityState==="hidden"}function x(){c||b()}function _(){c||g()}function S(){c=!0,b()}function k(){c=!1,g()}function N($){typeof $<"u"&&(d=$),g()}function E(){l&&b()}function T(){l&&g()}function R(){return l}function L(){const{index:$}=r.internalEngine(),z=$.clone().add(1).get(),P=r.scrollSnapList().length-1,M=t.stopOnLastSnap&&z===P;if(r.canScrollNext()?r.scrollNext(d):r.scrollTo(0,d),r.emit("autoplay:select"),M)return b();g()}function O(){if(!o)return null;const $=s[r.selectedScrollSnap()],z=new Date().getTime()-o;return $-z}return{name:"autoplay",options:e,init:f,destroy:m,play:N,stop:E,reset:T,isPlaying:R,timeUntilNext:O}}Xg.globalOptions=void 0;const kF=[{src:"/gallery/2024/runners.jpg",alt:"Runners at Happy Smackah 2024"},{src:"/gallery/2024/finish-line.jpg",alt:"Finish line celebration 2024"},{src:"/gallery/2023/group-photo.jpg",alt:"Happy Smackah 2023 group photo"},{src:"/gallery/2023/race-day.jpg",alt:"Race day action 2023"},{src:"/gallery/2022/race-day-action.jpg",alt:"Race day action 2022"},{src:"/gallery/2019/families.jpg",alt:"Happy Smackah Families 2019"},{src:"/press/happy-smackah-volunteers-2025.jpg",alt:"Happy Smackah volunteers"},{src:"/press/cooper-rusaw-2025.jpg",alt:"Happy Smackah community event"}];function jF({title:e}){const t=e||"About Our Mission";return i.jsx("section",{className:"py-20 bg-muted/30",children:i.jsx("div",{className:"container mx-auto px-4",children:i.jsxs("div",{className:"grid lg:grid-cols-2 gap-12 items-center",children:[i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-primary/10 text-primary text-sm font-medium",children:[i.jsx(vt,{className:"w-4 h-4"}),t]}),i.jsx("h2",{className:"text-3xl sm:text-4xl font-heading font-bold text-foreground",children:"Bringing Our Community Together for Those in Need"}),i.jsx("p",{className:"text-muted-foreground text-lg leading-relaxed",children:"Happy Smackah is a 501(c)(3) nonprofit organization that hosts an annual 5K Fun Run/Walk to benefit local individuals and families facing medical hardship in the St. Vrain Valley community."}),i.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"For 15 years, we've united runners, walkers, volunteers, and sponsors to raise funds and awareness. We are 100% volunteer operated and all proceeds go directly to helping families with medical expenses, making a real difference when they need it most."}),i.jsxs("div",{className:"grid sm:grid-cols-2 gap-6 pt-4",children:[i.jsxs("div",{className:"flex items-start gap-4",children:[i.jsx("div",{className:"w-12 h-12 rounded-xl bg-secondary/10 flex items-center justify-center shrink-0",children:i.jsx(rS,{className:"w-6 h-6 text-secondary"})}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-heading font-semibold text-foreground mb-1",children:"Our Mission"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Support families facing medical hardship through community fundraising events."})]})]}),i.jsxs("div",{className:"flex items-start gap-4",children:[i.jsx("div",{className:"w-12 h-12 rounded-xl bg-accent/10 flex items-center justify-center shrink-0",children:i.jsx(Fn,{className:"w-6 h-6 text-accent"})}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-heading font-semibold text-foreground mb-1",children:"Community First"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"100% of donations stay local, helping our neighbors when they need it most."})]})]})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx(ee,{to:"/gallery",className:"block group",children:i.jsxs(Sk,{opts:{align:"start",loop:!0}
491,plugins:[Xg({delay:4e3,stopOnInteraction:!0})],className:"w-full",children:[i.jsx(kk,{children:kF.map((r,n)=>i.jsx(jk,{children:i.jsx("div",{className:"aspect-[4/3] rounded-2xl overflow-hidden bg-muted",children:i.jsx("img",{src:r.src,alt:r.alt,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500",loading:"lazy"})})},n))}),i.jsx(Nk,{className:"left-4 bg-background/80 backdrop-blur-sm hover:bg-background"}),i.jsx(Ck,{className:"right-4 bg-background/80 backdrop-blur-sm hover:bg-background"})]})}),i.jsxs(ee,{to:"/gallery",className:"inline-flex items-center gap-2 text-primary font-medium hover:gap-3 transition-all",children:["View Full Gallery",i.jsx(_t,{className:"w-4 h-4"})]})]})]})})})}const S0=["event","merchandise","platinum","gold","silver","community"],k0=["event","merchandise"];function NF({title:e}){const{activeEvent:t}=ht(),[r,n]=h.useState([]),[s,o]=h.useState(!0),a=h.useRef(null);h.useEffect(()=>{(async()=>{if(!(t!=null&&t.id)){o(!1);return}const{data:d,error:f}=await ie.from("event_sponsors").select(` 492 id, 493 tier, 494 sort_order, 495 sponsor:sponsors ( 496 id, 497 name, 498 logo_url, 499 website_url 500 ) 501 `).eq("event_id",t.id).order("sort_order",{ascending:!0});if(!f&&d){const m=d.sort((p,w)=>{const g=S0.indexOf(p.tier),b=S0.indexOf(w.tier);return g!==b?g-b:(p.sort_order||0)-(w.sort_order||0)});n(m)}o(!1)})()},[t==null?void 0:t.id]);const l=r.filter(u=>k0.includes(u.tier)),c=r.filter(u=>!k0.includes(u.tier));return s?i.jsx("section",{className:"py-20 bg-muted/30",children:i.jsx("div",{className:"container mx-auto px-4 flex justify-center",children:i.jsx(Jr,{className:"w-8 h-8 animate-spin text-primary"})})}):r.length===0?null:i.jsx("section",{className:"py-20 bg-muted/30",children:i.jsxs("div",{className:"container mx-auto px-4",children:[i.jsxs("div",{className:"text-center mb-12",children:[i.jsx("h2",{className:"text-3xl sm:text-4xl font-heading font-bold text-foreground mb-4",children:e||"Our Amazing Sponsors"}),i.jsx("p",{className:"text-muted-foreground max-w-2xl mx-auto",children:"Thank you to our generous sponsors who make Happy Smackah possible."})]}),l.length>0&&i.jsxs("div",{className:"mb-12",children:[i.jsx("h3",{className:"text-center text-sm font-semibold uppercase tracking-wider text-primary mb-6",children:"Event Sponsors"}),i.jsx("div",{className:"flex flex-wrap justify-center gap-8",children:l.map(u=>i.jsx("a",{href:u.sponsor.website_url||void 0,target:"_blank",rel:"noopener noreferrer",className:`group transition-transform hover:scale-105 ${u.sponsor.website_url?"cursor-pointer":"cursor-default"}`,children:i.jsx(ot,{variant:"sponsor",className:"p-6 hover:border-primary/30 transition-colors",children:i.jsx(at,{className:"p-0",children:u.sponsor.logo_url?i.jsx("img",{src:u.sponsor.logo_url,alt:u.sponsor.name,className:"h-24 w-auto object-contain",loading:"lazy"}):i.jsx("div",{className:"h-24 w-40 bg-muted rounded flex items-center justify-center",children:i.jsx(yn,{className:"w-10 h-10 text-muted-foreground"})})})})},u.id))})]}),c.length>0&&i.jsxs("div",{className:"relative overflow-hidden",children:[i.jsx("div",{ref:a,className:"flex animate-scroll gap-8 py-4",style:{width:"max-content"},children:[...c,...c].map((u,d)=>i.jsx("a",{href:u.sponsor.website_url||void 0,target:"_blank",rel:"noopener noreferrer",className:D("flex-shrink-0 transition-all hover:scale-105",u.sponsor.website_url?"cursor-pointer":"cursor-default"),children:i.jsx(ot,{variant:"sponsor",className:"p-3 hover:border-primary/30 transition-colors",children:i.jsx(at,{className:"p-0",children:u.sponsor.logo_url?i.jsx("img",{src:u.sponsor.logo_url,alt:u.sponsor.name,className:"h-12 w-auto object-contain grayscale hover:grayscale-0 transition-all duration-300",loading:"lazy"}):i.jsx("div",{className:"h-12 w-24 bg-muted rounded flex items-center justify-center",children:i.jsx(yn,{className:"w-6 h-6 text-muted-foreground"})})})})},`${u.id}-${d}`))}),i.jsx("div",{className:"absolute inset-y-0 left-0 w-20 bg-gradient-to-r from-muted/30 to-transparent pointer-events-none"}),i.jsx("div",{className:"absolute inset-y-0 right-0 w-20 bg-gradient-to-l from-muted/30 to-transparent pointer-events-none"})]}),i.jsx("div",{className:"text-center mt-12",children:i.jsx(ee,{to:"/sponsors",children:i.jsxs(ce,{variant:"secondary",size:"lg",className:"group",children:["Become a Sponsor",i.jsx(_t,{className:"w-4 h-4 transition-transform group-hover:translate-x-1"})]})})})]})})}function CF({title:e}){const{activeEvent:t}=ht();let r=!1,n=new Date().getFullYear();if(t!=null&&t.event_date){const[o,a,l]=t.event_date.split("-").map(Number);n=o;const c=new Date(o,a-1,l),u=new Date;u.setHours(0,0,0,0),r=t.status==="published"&&c>=u}const s=e||"Ready to Make a Difference?";return i.jsxs("section",{className:"py-24 relative overflow-hidden",children:[i.jsx("div",{className:"absolute inset-0 bg-primary"}),i.jsx("div",{className:"absolute inset-0 bg-hero-pattern opacity-50"}),i.jsx("div",{className:"absolute top-0 left-0 w-64 h-64 bg-background/5 rounded-full -translate-x-1/2 -translate-y-1/2"}),i.jsx("div",{className:"absolute bottom-0 right-0 w-96 h-96 bg-background/5 rounded-full translate-x-1/2 translate-y-1/2"}),i.jsx("div",{className:"container mx-auto px-4 relative",children:i.jsxs("div",{className:"max-w-3xl mx-auto text-center space-y-8",children:[i.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-background/10 mb-4",children:i.jsx(vt,{className:"w-8 h-8 text-primary-foreground"})}),i.jsx("h2",{className:"text-3xl sm:text-4xl lg:text-5xl font-heading font-bold text-primary-foreground",children:s}
501),i.jsx("p",{className:"text-lg text-primary-foreground/80 max-w-xl mx-auto",children:"Whether you run, walk, donate, or sponsor â every action helps local families facing medical hardship. Join our community today."}),i.jsx("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4",children:r?i.jsxs(i.Fragment,{children:[i.jsx(ee,{to:"/register",children:i.jsxs(ce,{size:"xl",className:"group bg-background text-primary hover:bg-background/90",children:["Register for ",n,i.jsx(_t,{className:"w-5 h-5 transition-transform group-hover:translate-x-1"})]})}),i.jsx(ee,{to:"/donate",children:i.jsx(ce,{variant:"heroOutline",size:"xl",children:"Make a Donation"})})]}):i.jsxs(i.Fragment,{children:[i.jsx(ee,{to:"/donate",children:i.jsxs(ce,{size:"xl",className:"group bg-background text-primary hover:bg-background/90",children:["Make a Donation",i.jsx(_t,{className:"w-5 h-5 transition-transform group-hover:translate-x-1"})]})}),i.jsx(ee,{to:"/sponsors",children:i.jsx(ce,{variant:"heroOutline",size:"xl",children:"Become a Sponsor"})})]})})]})})]})}const EF=()=>{var s,o,a,l,c,u,d,f,m,p,w,g;const{activeEvent:e,beneficiaries:t}=ht(),{branding:r}=Bo(),n=r.sections;return i.jsxs(i.Fragment,{children:[i.jsxs(Ro,{children:[i.jsx("title",{children:"Happy Smackah | 5K Fun Run/Walk for Medical Hardship Relief"}),i.jsx("meta",{name:"description",content:"Join Happy Smackah's annual 5K Fun Run/Walk in St. Vrain Valley, CO. Support local families facing medical hardship. Register, donate, or sponsor today!"}),i.jsx("meta",{name:"keywords",content:"5K, fun run, charity, nonprofit, medical hardship, St. Vrain, Colorado, community event"})]}),i.jsxs(Ts,{children:[i.jsx(v5,{}),t.length>0?i.jsx(x5,{beneficiaries:t,eventName:e==null?void 0:e.name}):e!=null&&e.accepting_nominations?i.jsx(w5,{eventName:e==null?void 0:e.name}):null,((s=n==null?void 0:n.actions)==null?void 0:s.visible)!==!1&&i.jsx($3,{title:(o=n==null?void 0:n.actions)==null?void 0:o.title}),((a=n==null?void 0:n.eventProgress)==null?void 0:a.visible)!==!1&&i.jsx(F3,{title:(l=n==null?void 0:n.eventProgress)==null?void 0:l.title}),((c=n==null?void 0:n.pastBeneficiaries)==null?void 0:c.visible)!==!1&&i.jsx(U3,{title:(u=n==null?void 0:n.pastBeneficiaries)==null?void 0:u.title}),((d=n==null?void 0:n.about)==null?void 0:d.visible)!==!1&&i.jsx(jF,{title:(f=n==null?void 0:n.about)==null?void 0:f.title}),((m=n==null?void 0:n.sponsors)==null?void 0:m.visible)!==!1&&i.jsx(NF,{title:(p=n==null?void 0:n.sponsors)==null?void 0:p.title}),((w=n==null?void 0:n.cta)==null?void 0:w.visible)!==!1&&i.jsx(CF,{title:(g=n==null?void 0:n.cta)==null?void 0:g.title})]})]})};var Ae;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{const o={};for(const a of s)o[a]=a;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(l=>typeof s[s[l]]!="number"),a={};for(const l of o)a[l]=s[l];return e.objectValues(a)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&o.push(a);return o},e.find=(s,o)=>{for(const a of s)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(Ae||(Ae={}));var j0;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(j0||(j0={}));const te=Ae.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),is=e=>{switch(typeof e){case"undefined":return te.undefined;case"string":return te.string;case"number":return Number.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}}
vendor: 5,706 bytes, line 501
501,G=Ae.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"]);class Zr extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(o){return o.message},n={_errors:[]},s=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let l=n,c=0;for(;c<a.path.length;){const u=a.path[c];c===a.path.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(r(a))):l[u]=l[u]||{_errors:[]},l=l[u],c++}}};return s(this),n}static assert(t){if(!(t instanceof Zr))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ae.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},n=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];r[o]=r[o]||[],r[o].push(t(s))}else n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Zr.create=e=>new Zr(e);const Gm=(e,t)=>{let r;switch(e.code){case G.invalid_type:e.received===te.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case G.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ae.jsonStringifyReplacer)}`;break;case G.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ae.joinValues(e.keys,", ")}`;break;case G.invalid_union:r="Invalid input";break;case G.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ae.joinValues(e.options)}`;break;case G.invalid_enum_value:r=`Invalid enum value. Expected ${Ae.joinValues(e.options)}, received '${e.received}'`;break;case G.invalid_arguments:r="Invalid function arguments";break;case G.invalid_return_type:r="Invalid function return type";break;case G.invalid_date:r="Invalid date";break;case G.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Ae.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case G.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case G.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case G.custom:r="Invalid input";break;case G.invalid_intersection_types:r="Intersection results could not be merged";break;case G.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case G.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ae.assertNever(e)}return{message:r}};let TF=Gm;function PF(){return TF}const RF=e=>{const{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],a={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let l="";const c=n.filter(u=>!!u).slice().reverse();for(const u of c)l=u(a,{data:t,defaultError:l}).message;return{...s,path:o,message:l}};function Q(e,t){const r=PF(),n=RF({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Gm?void 0:Gm].filter(s=>!!s)});e.common.issues.push(n)}class dr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const s of r){if(s.status==="aborted")return ye;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const s of r){const o=await s.key,a=await s.value;n.push({key:o,value:a})}return dr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const s of r){const{key:o,value:a}=s;
vendor: 6,188 bytes, line 501
501if(o.status==="aborted"||a.status==="aborted")return ye;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(n[o.value]=a.value)}return{status:t.value,value:n}}}const ye=Object.freeze({status:"aborted"}),qi=e=>({status:"dirty",value:e}),kr=e=>({status:"valid",value:e}),N0=e=>e.status==="aborted",C0=e=>e.status==="dirty",ti=e=>e.status==="valid",rd=e=>typeof Promise<"u"&&e instanceof Promise;var se;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(se||(se={}));class $s{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const E0=(e,t)=>{if(ti(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 r=new Zr(e.common.issues);return this._error=r,this._error}}};function ke(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(a,l)=>{const{message:c}=e;return a.code==="invalid_enum_value"?{message:c??l.defaultError}:typeof l.data>"u"?{message:c??n??l.defaultError}:a.code!=="invalid_type"?{message:l.defaultError}:{message:c??r??l.defaultError}},description:s}}class Pe{get description(){return this._def.description}_getType(t){return is(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:is(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new dr,ctx:{common:t.parent.common,data:t.data,parsedType:is(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(rd(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:is(t)},s=this._parseSync({data:t,path:n.path,parent:n});return E0(n,s)}"~validate"(t){var n,s;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:is(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:r});return ti(o)?{value:o.value}:{issues:r.common.issues}}catch(o){(s=(n=o==null?void 0:o.message)==null?void 0:n.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(o=>ti(o)?{value:o.value}:{issues:r.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:is(t)},s=this._parse({data:t,path:n.path,parent:n}),o=await(rd(s)?s:Promise.resolve(s));return E0(n,o)}refine(t,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,o)=>{const a=t(s),l=()=>o.addIssue({code:G.custom,...n(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(l(),!1)):a?!0:(l(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new ni({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}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),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Ps.create(this,this._def)}nullable(){return si.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return mn.create(this)}promise(){return ad.create(this,this._def)}or(t){return sd.create([this,t],this._def)}and(t){return od.create(this,t,this._def)}transform(t){return new ni({...ke(this._def),schema:this,typeName:ve.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new Qm({...ke(this._def),innerType:this,defaultValue:r,typeName:ve.ZodDefault})}brand(){return new eU({typeName:ve.ZodBranded,type:this,...ke(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new Jm({...ke(this._def),innerType:this,catchValue:r,typeName:ve.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return ey.create(this,t)}readonly(){return Zm.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const OF=/^c[^\s-]{8,}
vendor: 4,606 bytes, line 501
501$/i,AF=/^[0-9a-z]+$/,IF=/^[0-9A-HJKMNP-TV-Z]{26}$/i,DF=/^[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,MF=/^[a-z0-9_-]{21}$/i,LF=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$F=/^[-+]?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)?)??$/,FF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,UF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let mh;const zF=/^(?:(?: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])$/,BF=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,VF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,HF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,WF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,qF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ek="((\\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])))",KF=new RegExp(`^${Ek}$`);function Tk(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function GF(e){return new RegExp(`^${Tk(e)}$`)}function YF(e){let t=`${Ek}T${Tk(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function QF(e,t){return!!((t==="v4"||!t)&&zF.test(e)||(t==="v6"||!t)&&VF.test(e))}function JF(e,t){if(!LF.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function ZF(e,t){return!!((t==="v4"||!t)&&BF.test(e)||(t==="v6"||!t)&&HF.test(e))}class xs extends Pe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==te.string){const o=this._getOrReturnCtx(t);return Q(o,{code:G.invalid_type,expected:te.string,received:o.parsedType}),ye}const n=new dr;let s;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(s=this._getOrReturnCtx(t,s),Q(s,{code:G.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")t.data.length>o.value&&(s=this._getOrReturnCtx(t,s),Q(s,{code:G.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,l=t.data.length<o.value;(a||l)&&(s=this._getOrReturnCtx(t,s),a?Q(s,{code:G.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):l&&Q(s,{code:G.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")FF.test(t.data)||(s=this._getOrReturnCtx(t,s),Q(s,{validation:"email",code:G.invali
vendor: 5,987 bytes, line 501
501d_string,message:o.message}),n.dirty());else if(o.kind==="emoji")mh||(mh=new RegExp(UF,"u")),mh.test(t.data)||(s=this._getOrReturnCtx(t,s),Q(s,{validation:"emoji",code:G.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")DF.test(t.data)||(s=this._getOrReturnCtx(t,s),Q(s,{validation:"uuid",code:G.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")MF.test(t.data)||(s=this._getOrReturnCtx(t,s),Q(s,{validation:"nanoid",code:G.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")OF.test(t.data)||(s=this._getOrReturnCtx(t,s),Q(s,{validation:"cuid",code:G.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")AF.test(t.data)||(s=this._getOrReturnCtx(t,s),Q(s,{validation:"cuid2",code:G.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")IF.test(t.data)||(s=this._getOrReturnCtx(t,s),Q(s,{validation:"ulid",code:G.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),Q(s,{validation:"url",code:G.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),Q(s,{validation:"regex",code:G.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(t,s),Q(s,{code:G.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(s=this._getOrReturnCtx(t,s),Q(s,{code:G.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(s=this._getOrReturnCtx(t,s),Q(s,{code:G.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?YF(o).test(t.data)||(s=this._getOrReturnCtx(t,s),Q(s,{code:G.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?KF.test(t.data)||(s=this._getOrReturnCtx(t,s),Q(s,{code:G.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?GF(o).test(t.data)||(s=this._getOrReturnCtx(t,s),Q(s,{code:G.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?$F.test(t.data)||(s=this._getOrReturnCtx(t,s),Q(s,{validation:"duration",code:G.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?QF(t.data,o.version)||(s=this._getOrReturnCtx(t,s),Q(s,{validation:"ip",code:G.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?JF(t.data,o.alg)||(s=this._getOrReturnCtx(t,s),Q(s,{validation:"jwt",code:G.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?ZF(t.data,o.version)||(s=this._getOrReturnCtx(t,s),Q(s,{validation:"cidr",code:G.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?WF.test(t.data)||(s=this._getOrReturnCtx(t,s),Q(s,{validation:"base64",code:G.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?qF.test(t.data)||(s=this._getOrReturnCtx(t,s),Q(s,{validation:"base64url",code:G.invalid_string,message:o.message}),n.dirty()):Ae.assertNever(o);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(s=>t.test(s),{validation:r,code:G.invalid_string,...se.errToObj(n)})}_addCheck(t){return new xs({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...se.errToObj(t)})}url(t){return this._addCheck({kind:"url",...se.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...se.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...se.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...se.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...se.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...se.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...se.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...se.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...se.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...se.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...se.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...se.errToObj(t)})}datetime(t){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:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...se.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,...se.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...se.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...se.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...se.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...se.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...se.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...se.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...se.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...se.errToObj(r)})}nonempty(t){return this.min(1,se.errToObj(t))}trim(){return new xs({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new xs({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new xs({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}
vendor: 4,658 bytes, line 501
501get 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 isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}xs.create=e=>new xs({checks:[],typeName:ve.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...ke(e)});function XF(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=Number.parseInt(e.toFixed(s).replace(".","")),a=Number.parseInt(t.toFixed(s).replace(".",""));return o%a/10**s}class Vl extends Pe{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 o=this._getOrReturnCtx(t);return Q(o,{code:G.invalid_type,expected:te.number,received:o.parsedType}),ye}let n;const s=new dr;for(const o of this._def.checks)o.kind==="int"?Ae.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),Q(n,{code:G.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),Q(n,{code:G.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),Q(n,{code:G.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?XF(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),Q(n,{code:G.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),Q(n,{code:G.not_finite,message:o.message}),s.dirty()):Ae.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,se.toString(r))}gt(t,r){return this.setLimit("min",t,!1,se.toString(r))}lte(t,r){return this.setLimit("max",t,!0,se.toString(r))}lt(t,r){return this.setLimit("max",t,!1,se.toString(r))}setLimit(t,r,n,s){return new Vl({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:se.toString(s)}]})}_addCheck(t){return new Vl({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:se.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:se.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:se.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:se.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:se.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:se.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:se.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:se.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:se.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ae.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}
vendor: 7,027 bytes, line 501
501}Vl.create=e=>new Vl({checks:[],typeName:ve.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...ke(e)});class Hl extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==te.bigint)return this._getInvalidInput(t);let n;const s=new dr;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),Q(n,{code:G.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),Q(n,{code:G.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),Q(n,{code:G.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):Ae.assertNever(o);return{status:s.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return Q(r,{code:G.invalid_type,expected:te.bigint,received:r.parsedType}),ye}gte(t,r){return this.setLimit("min",t,!0,se.toString(r))}gt(t,r){return this.setLimit("min",t,!1,se.toString(r))}lte(t,r){return this.setLimit("max",t,!0,se.toString(r))}lt(t,r){return this.setLimit("max",t,!1,se.toString(r))}setLimit(t,r,n,s){return new Hl({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:se.toString(s)}]})}_addCheck(t){return new Hl({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:se.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:se.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:se.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:se.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:se.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Hl.create=e=>new Hl({checks:[],typeName:ve.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...ke(e)});class T0 extends Pe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==te.boolean){const n=this._getOrReturnCtx(t);return Q(n,{code:G.invalid_type,expected:te.boolean,received:n.parsedType}),ye}return kr(t.data)}}T0.create=e=>new T0({typeName:ve.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...ke(e)});class nd extends Pe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==te.date){const o=this._getOrReturnCtx(t);return Q(o,{code:G.invalid_type,expected:te.date,received:o.parsedType}),ye}if(Number.isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return Q(o,{code:G.invalid_date}),ye}const n=new dr;let s;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(s=this._getOrReturnCtx(t,s),Q(s,{code:G.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(s=this._getOrReturnCtx(t,s),Q(s,{code:G.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Ae.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new nd({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:se.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:se.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}}nd.create=e=>new nd({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ve.ZodDate,...ke(e)});class P0 extends Pe{_parse(t){if(this._getType(t)!==te.symbol){const n=this._getOrReturnCtx(t);return Q(n,{code:G.invalid_type,expected:te.symbol,received:n.parsedType}),ye}return kr(t.data)}}P0.create=e=>new P0({typeName:ve.ZodSymbol,...ke(e)});class R0 extends Pe{_parse(t){if(this._getType(t)!==te.undefined){const n=this._getOrReturnCtx(t);return Q(n,{code:G.invalid_type,expected:te.undefined,received:n.parsedType}),ye}return kr(t.data)}}R0.create=e=>new R0({typeName:ve.ZodUndefined,...ke(e)});class O0 extends Pe{_parse(t){if(this._getType(t)!==te.null){const n=this._getOrReturnCtx(t);return Q(n,{code:G.invalid_type,expected:te.null,received:n.parsedType}),ye}return kr(t.data)}}O0.create=e=>new O0({typeName:ve.ZodNull,...ke(e)});class A0 extends Pe{constructor(){super(...arguments),this._any=!0}_parse(t){return kr(t.data)}}A0.create=e=>new A0({typeName:ve.ZodAny,...ke(e)});class I0 extends Pe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return kr(t.data)}}I0.create=e=>new I0({typeName:ve.ZodUnknown,...ke(e)});class Fs extends Pe{_parse(t){const r=this._getOrReturnCtx(t);return Q(r,{code:G.invalid_type,expected:te.never,received:r.parsedType}),ye}}Fs.create=e=>new Fs({typeName:ve.ZodNever,...ke(e)});class D0 extends Pe{_parse(t){if(this._getType(t)!==te.undefined){const n=this._getOrReturnCtx(t);return Q(n,{code:G.invalid_type,expected:te.void,received:n.parsedType}),ye}return kr(t.data)}}D0.create=e=>new D0({typeName:ve.ZodVoid,...ke(e)});class mn extends Pe{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==te.array)return Q(r,{code:G.invalid_type,expected:te.array,received:r.parsedType}),ye;if(s.exactLength!==null){const a=r.data.length>s.exactLength.value,l=r.data.length<s.exactLength.value;(a||l)&&(Q(r,{code:a?G.too_big:G.too_small,minimum:l?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(Q(r,{code:G.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(Q(r,{code:G.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,l)=>s.type._parseAsync(new $s(r,a,r.path,l)))).then(a=>dr.mergeArray(n,a));const o=[...r.data].map((a,l)=>s.type._parseSync(new $s(r,a,r.path,l)));return dr.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new mn({...this._def,minLength:{value:t,message:se.toString(r)}})}max(t,r){return new mn({...this._def,maxLength:{value:t,message:se.toString(r)}})}length(t,r){return new mn({...this._def,exactLength:{value:t,message:se.toString(r)}})}nonempty(t){return this.min(1,t)}}mn.create=(e,t)=>
vendor: 4,112 bytes, line 501
501new mn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ve.ZodArray,...ke(t)});function ia(e){if(e instanceof tt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Ps.create(ia(n))}return new tt({...e._def,shape:()=>t})}else return e instanceof mn?new mn({...e._def,type:ia(e.element)}):e instanceof Ps?Ps.create(ia(e.unwrap())):e instanceof si?si.create(ia(e.unwrap())):e instanceof Mo?Mo.create(e.items.map(t=>ia(t))):e}class tt extends Pe{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(),r=Ae.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==te.object){const u=this._getOrReturnCtx(t);return Q(u,{code:G.invalid_type,expected:te.object,received:u.parsedType}),ye}const{status:n,ctx:s}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),l=[];if(!(this._def.catchall instanceof Fs&&this._def.unknownKeys==="strip"))for(const u in s.data)a.includes(u)||l.push(u);const c=[];for(const u of a){const d=o[u],f=s.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new $s(s,f,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Fs){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of l)c.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(u==="strict")l.length>0&&(Q(s,{code:G.unrecognized_keys,keys:l}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of l){const f=s.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new $s(s,f,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const f=await d.key,m=await d.value;u.push({key:f,value:m,alwaysSet:d.alwaysSet})}return u}).then(u=>dr.mergeObjectSync(n,u)):dr.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return se.errToObj,new tt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var o,a;const s=((a=(o=this._def).errorMap)==null?void 0:a.call(o,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:se.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new tt({...this._def,unknownKeys:"strip"})}passthrough(){return new tt({...this._def,unknownKeys:"passthrough"})}extend(t){return new tt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new tt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ve.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new tt({...this._def,catchall:t})}pick(t){const r={};for(const n of Ae.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new tt({...this._def,shape:()=>r})}omit(t){const r={};for(const n of Ae.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new tt({...this._def,shape:()=>r})}deepPartial(){return ia(this)}partial(t){const r={};for(const n of Ae.objectKeys(this.shape)){const s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}return new tt({...this._def,shape:()=>r})}required(t){const r={};for(const n of Ae.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Ps;)o=o._def.innerType;r[n]=o}return new tt({...this._def,shape:()=>r})}keyof(){return Pk(Ae.objectKeys(this.shape))}}tt.create=(e,t)=>new tt({shape:()=>e,unknownKeys:"strip",catchall:Fs.create(),typeName:ve.ZodObject,...ke(t)});tt.strictCreate=(e,t)=>new tt({shape:()=>e,unknownKeys:"strict",catchall:Fs.create(),typeName:ve.ZodObject,...ke(t)});tt.lazycreate=(e,t)=>new tt({shape:e,unknownKeys:"strip",catchall:Fs.create(),typeName:ve.ZodObject,...ke(t)});class sd extends Pe{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function s(o){for(const l of o)if(l.result.status==="valid")return l.result;for(const l of o)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;
vendor: 3,376 bytes, line 501
501const a=o.map(l=>new Zr(l.ctx.common.issues));return Q(r,{code:G.invalid_union,unionErrors:a}),ye}if(r.common.async)return Promise.all(n.map(async o=>{const a={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(s);{let o;const a=[];for(const c of n){const u={...r,common:{...r.common,issues:[]},parent:null},d=c._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;const l=a.map(c=>new Zr(c));return Q(r,{code:G.invalid_union,unionErrors:l}),ye}}get options(){return this._def.options}}sd.create=(e,t)=>new sd({options:e,typeName:ve.ZodUnion,...ke(t)});function Ym(e,t){const r=is(e),n=is(t);if(e===t)return{valid:!0,data:e};if(r===te.object&&n===te.object){const s=Ae.objectKeys(t),o=Ae.objectKeys(e).filter(l=>s.indexOf(l)!==-1),a={...e,...t};for(const l of o){const c=Ym(e[l],t[l]);if(!c.valid)return{valid:!1};a[l]=c.data}return{valid:!0,data:a}}else if(r===te.array&&n===te.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o<e.length;o++){const a=e[o],l=t[o],c=Ym(a,l);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===te.date&&n===te.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class od extends Pe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=(o,a)=>{if(N0(o)||N0(a))return ye;const l=Ym(o.value,a.value);return l.valid?((C0(o)||C0(a))&&r.dirty(),{status:r.value,value:l.data}):(Q(n,{code:G.invalid_intersection_types}),ye)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,a])=>s(o,a)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}od.create=(e,t,r)=>new od({left:e,right:t,typeName:ve.ZodIntersection,...ke(r)});class Mo extends Pe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==te.array)return Q(n,{code:G.invalid_type,expected:te.array,received:n.parsedType}),ye;if(n.data.length<this._def.items.length)return Q(n,{code:G.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ye;!this._def.rest&&n.data.length>this._def.items.length&&(Q(n,{code:G.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const o=[...n.data].map((a,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new $s(n,a,n.path,l)):null}).filter(a=>!!a);return n.common.async?Promise.all(o).then(a=>dr.mergeArray(r,a)):dr.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new Mo({...this._def,rest:t})}}Mo.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Mo({items:e,typeName:ve.ZodTuple,rest:null,...ke(t)})};class M0 extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==te.map)return Q(n,{code:G.invalid_type,expected:te.map,received:n.parsedType}),ye;const s=this._def.keyType,o=this._def.valueType,a=[...n.data.entries()].map(([l,c],u)=>
vendor: 4,106 bytes, line 501
501({key:s._parse(new $s(n,l,n.path,[u,"key"])),value:o._parse(new $s(n,c,n.path,[u,"value"]))}));if(n.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of a){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return ye;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),l.set(u.value,d.value)}return{status:r.value,value:l}})}else{const l=new Map;for(const c of a){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return ye;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),l.set(u.value,d.value)}return{status:r.value,value:l}}}}M0.create=(e,t,r)=>new M0({valueType:t,keyType:e,typeName:ve.ZodMap,...ke(r)});class Wl extends Pe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==te.set)return Q(n,{code:G.invalid_type,expected:te.set,received:n.parsedType}),ye;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(Q(n,{code:G.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(Q(n,{code:G.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const o=this._def.valueType;function a(c){const u=new Set;for(const d of c){if(d.status==="aborted")return ye;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}const l=[...n.data.values()].map((c,u)=>o._parse(new $s(n,c,n.path,u)));return n.common.async?Promise.all(l).then(c=>a(c)):a(l)}min(t,r){return new Wl({...this._def,minSize:{value:t,message:se.toString(r)}})}max(t,r){return new Wl({...this._def,maxSize:{value:t,message:se.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}Wl.create=(e,t)=>new Wl({valueType:e,minSize:null,maxSize:null,typeName:ve.ZodSet,...ke(t)});class L0 extends Pe{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}L0.create=(e,t)=>new L0({getter:e,typeName:ve.ZodLazy,...ke(t)});class $0 extends Pe{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return Q(r,{received:r.data,code:G.invalid_literal,expected:this._def.value}),ye}return{status:"valid",value:t.data}}get value(){return this._def.value}}$0.create=(e,t)=>new $0({value:e,typeName:ve.ZodLiteral,...ke(t)});function Pk(e,t){return new ri({values:e,typeName:ve.ZodEnum,...ke(t)})}class ri extends Pe{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return Q(r,{expected:Ae.joinValues(n),received:r.parsedType,code:G.invalid_type}),ye}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return Q(r,{received:r.data,code:G.invalid_enum_value,options:n}),ye}return kr(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return ri.create(t,{...this._def,...r})}exclude(t,r=this._def){return ri.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}ri.create=Pk;class F0 extends Pe{_parse(t){const r=Ae.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==te.string&&n.parsedType!==te.number){const s=Ae.objectValues(r);return Q(n,{expected:Ae.joinValues(s),received:n.parsedType,code:G.invalid_type}),ye}if(this._cache||(this._cache=new Set(Ae.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=Ae.objectValues(r);return Q(n,{received:n.data,code:G.invalid_enum_value,options:s}),ye}return kr(t.data)}get enum(){return this._def.values}}F0.create=(e,t)=>new F0({values:e,typeName:ve.ZodNativeEnum,...ke(t)});class ad extends Pe{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==te.promise&&r.common.async===!1)return Q(r,{code:G.invali
vendor: 4,074 bytes, line 501
501d_type,expected:te.promise,received:r.parsedType}),ye;const n=r.parsedType===te.promise?r.data:Promise.resolve(r.data);return kr(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}ad.create=(e,t)=>new ad({type:e,typeName:ve.ZodPromise,...ke(t)});class ni extends Pe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:a=>{Q(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const a=s.transform(n.data,o);if(n.common.async)return Promise.resolve(a).then(async l=>{if(r.value==="aborted")return ye;const c=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return c.status==="aborted"?ye:c.status==="dirty"||r.value==="dirty"?qi(c.value):c});{if(r.value==="aborted")return ye;const l=this._def.schema._parseSync({data:a,path:n.path,parent:n});return l.status==="aborted"?ye:l.status==="dirty"||r.value==="dirty"?qi(l.value):l}}if(s.type==="refinement"){const a=l=>{const c=s.refinement(l,o);if(n.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(n.common.async===!1){const l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?ye:(l.status==="dirty"&&r.dirty(),a(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?ye:(l.status==="dirty"&&r.dirty(),a(l.value).then(()=>({status:r.value,value:l.value}))))}if(s.type==="transform")if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ti(a))return ye;const l=s.transform(a.value,o);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>ti(a)?Promise.resolve(s.transform(a.value,o)).then(l=>({status:r.value,value:l})):ye);Ae.assertNever(s)}}ni.create=(e,t,r)=>new ni({schema:e,typeName:ve.ZodEffects,effect:t,...ke(r)});ni.createWithPreprocess=(e,t,r)=>new ni({schema:t,effect:{type:"preprocess",transform:e},typeName:ve.ZodEffects,...ke(r)});class Ps extends Pe{_parse(t){return this._getType(t)===te.undefined?kr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ps.create=(e,t)=>new Ps({innerType:e,typeName:ve.ZodOptional,...ke(t)});class si extends Pe{_parse(t){return this._getType(t)===te.null?kr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}si.create=(e,t)=>new si({innerType:e,typeName:ve.ZodNullable,...ke(t)});class Qm extends Pe{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===te.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Qm.create=(e,t)=>new Qm({innerType:e,typeName:ve.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ke(t)});class Jm extends Pe{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return rd(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Zr(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Zr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Jm.create=(e,t)=>new Jm({innerType:e,typeName:ve.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ke(t)});class U0 extends Pe{_parse(t){if(this._getType(t)!==te.nan){const n=this._getOrReturnCtx(t);
501return Q(n,{code:G.invalid_type,expected:te.nan,received:n.parsedType}),ye}return{status:"valid",value:t.data}}}U0.create=e=>new U0({typeName:ve.ZodNaN,...ke(e)});class eU extends Pe{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class ey extends Pe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?ye:o.status==="dirty"?(r.dirty(),qi(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?ye:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new ey({in:t,out:r,typeName:ve.ZodPipeline})}}class Zm extends Pe{_parse(t){const r=this._def.innerType._parse(t),n=s=>(ti(s)&&(s.value=Object.freeze(s.value)),s);return rd(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}Zm.create=(e,t)=>new Zm({innerType:e,typeName:ve.ZodReadonly,...ke(t)});tt.lazycreate;var ve;(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"})(ve||(ve={}));const Rk=xs.create;Fs.create;mn.create;const pB=tt.create;tt.strictCreate;sd.create;od.create;Mo.create;ri.create;ad.create;Ps.create;si.create;const z0=[{label:"At least 6 characters",test:e=>e.length>=6},{label:"Contains uppercase letter",test:e=>/[A-Z]/.test(e)},{label:"Contains lowercase letter",test:e=>/[a-z]/.test(e)},{label:"Contains a number",test:e=>/\d/.test(e)},{label:"Contains special character",test:e=>/[!@#$%^&*(),.?":{}|<>]/.test(e)}],tU=({password:e})=>{const t=z0.filter(o=>o.test(e)).length,r=t===0?0:t<=2?1:t<=4?2:3,n=["","Weak","Medium","Strong"],s=["bg-muted","bg-destructive","bg-yellow-500","bg-green-500"];return e?i.jsxs("div",{className:"mt-2 space-y-2",children:[i.jsx("div",{className:"flex gap-1",children:[1,2,3].map(o=>i.jsx("div",{className:D("h-1 flex-1 rounded-full transition-colors",r>=o?s[r]:"bg-muted")},o))}),i.jsx("p",{className:D("text-xs font-medium",r===1&&"text-destructive",r===2&&"text-yellow-600",r===3&&"text-green-600"),children:n[r]}),i.jsx("ul",{className:"space-y-1",children:z0.map((o,a)=>{const l=o.test(e);return i.jsxs("li",{className:"flex items-center gap-2 text-xs",children:[l?i.jsx(Oo,{className:"w-3 h-3 text-green-500"}):i.jsx(sc,{className:"w-3 h-3 text-muted-foreground"}),i.jsx("span",{className:D(l?"text-green-600":"text-muted-foreground"),children:o.label})]},a)})})]}):null},rU=Rk().email("Please enter a valid email address"),nU=Rk().min(6,"Password must be at least 6 characters"),sU=()=>{var P,M;const e=Xr(),t=Hs(),{user:r,signIn:n,signUp:s,resetPassword:o}=Vn(),{items:a,getTotal:l}=Vt(),c=((M=(P=e.state)==null?void 0:P.from)==null?void 0:M.pathname)==="/checkout",u=()=>{const j=new URLSearchParams(e.search).get("mode");return j==="signup"?"signup":j==="reset"?"reset":j==="reset-confirm"?"reset-confirm":"login"},d=C=>`$${(C/100).toFixed(2)}`,[f,m]=h.useState(u),[p,w]=h.useState(""),[g,b]=h.useState(""),[v,y]=h.useState(""),[x,_]=h.useState(""),[S,k]=h.useState(!1),[N,E]=h.useState(!1),[T,R]=h.useState({});h.useEffect(()=>{const{data:{subscription:C}
501}=ie.auth.onAuthStateChange((I,F)=>{I==="PASSWORD_RECOVERY"&&(console.log("Password recovery detected, switching to reset-confirm mode"),m("reset-confirm"))});return(async()=>{const I=new URLSearchParams(window.location.hash.substring(1)),F=I.get("access_token"),B=I.get("type");if(F&&B==="recovery"){console.log("Recovery token found in URL, attempting to establish session");const J=I.get("refresh_token");if(J){const{error:Z}=await ie.auth.setSession({access_token:F,refresh_token:J});Z?console.error("Error setting recovery session:",Z):(console.log("Recovery session established successfully"),m("reset-confirm"),window.history.replaceState(null,"",window.location.pathname+"?mode=reset-confirm"))}}})(),()=>C.unsubscribe()},[]),h.useEffect(()=>{var C,j;if(r&&f!=="reset-confirm"){const I=((j=(C=e.state)==null?void 0:C.from)==null?void 0:j.pathname)||"/";t(I,{replace:!0})}},[r,t,e,f]);const L=[{test:C=>C.length>=6},{test:C=>/[A-Z]/.test(C)},{test:C=>/[a-z]/.test(C)},{test:C=>/\d/.test(C)},{test:C=>/[!@#$%^&*(),.?":{}|<>]/.test(C)}],O=C=>L.filter(j=>j.test(C)).length,A=()=>{const C={};if(f!=="reset-confirm")try{rU.parse(p)}catch(j){j instanceof Zr&&(C.email=j.errors[0].message)}if(f!=="reset"){try{nU.parse(g)}catch(j){j instanceof Zr&&(C.password=j.errors[0].message)}!C.password&&(f==="signup"||f==="reset-confirm")&&O(g)<3&&(C.password="Password must meet at least 3 of the 5 strength requirements")}return R(C),Object.keys(C).length===0},$=async C=>{if(C.preventDefault(),!!A()){E(!0);try{if(f==="login"){const{error:j}=await n(p,g);j?j.message.includes("Invalid login credentials")?re.error("Invalid email or password. Please try again."):re.error(j.message):re.success("Welcome back! You have successfully signed in.")}else if(f==="signup"){const{error:j}=await s(p,g,v,x);j?j.message.includes("already registered")?(re.error("An account with this email already exists. Please sign in."),m("login")):re.error(j.message):re.success("Account Created! Welcome to Happy Smackah!")}else if(f==="reset"){const{error:j}=await o(p);j?re.error(j.message):(re.success("Check your email â we sent you a password reset link."),m("login"))}else if(f==="reset-confirm"){const{error:j}=await ie.auth.updateUser({password:g});if(j)re.error(j.message);else{const I=r==null?void 0:r.email;I&&ie.functions.invoke("send-password-changed-confirmation",{body:{email:I}}).catch(F=>console.error("Failed to send confirmation email:",F)),re.success("Password updated successfully!"),t("/")}}}catch{re.error("An unexpected error occurred. Please try again.")}finally{E(!1)}}},z=C=>{m(C),R({})};return i.jsxs(i.Fragment,{children:[i.jsxs(Ro,{children:[i.jsx("title",{children:f==="login"?"Sign In | Happy Smackah":f==="signup"?"Create Account | Happy Smackah":f==="reset-confirm"?"Set New Password | Happy Smackah":"Reset Password | Happy Smackah"}),i.jsx("meta",{name:"description",content:"Sign in or create an account to register for events, make donations, and more."})]}),i.jsx(Ts,{children:i.jsx("section",{className:"pt-32 pb-20 min-h-screen bg-gradient-subtle flex items-center",children:i.jsx("div",{className:"container mx-auto px-4",children:i.jsxs("div",{className:"max-w-md mx-auto",children:[i.jsx("div",{className:"text-center mb-8",children:i.jsxs(ee,{to:"/",className:"inline-flex items-center gap-2",children:[i.jsx("div",{className:"w-12 h-12 bg-primary rounded-full flex items-center justify-center",children:i.jsx(vt,{className:"w-6 h-6 text-primary-foreground"})}),i.jsx("span",{className:"font-heading font-bold text-2xl text-foreground",children:"Happy Smackah"})]})}),i.jsxs(ot,{variant:"elevated",children:[i.jsxs(ur,{className:"text-center",children:[i.jsxs(Sr,{className:"text-2xl",children:[f==="login"&&"Welcome Back",f==="signup"&&(c?"Almost There!":"Create Account"),f==="reset"&&"Reset Password",f==="reset-confirm"&&"Set New Password"]}),i.jsxs(qs,{children:[f==="login"&&"Sign in to your Happy Smackah account",f==="signup"&&(c?"Create a free account to complete your registration":"Join the Happy Smackah community"),f==="reset"&&"Enter your email to receive a reset link",f==="reset-confirm"&&"Enter your new password below"]})]}),i.jsxs(at,{children:[i.jsxs("form",{onSubmit:$,className:"space-y-4",children:[f==="signup"&&i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground mb-2 block",children:"First Name"}),i.jsxs("div",{className:"relative",children:[i.jsx(Hr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground"}
501),i.jsx("input",{type:"text",value:v,onChange:C=>y(C.target.value),placeholder:"First",className:"w-full pl-10 pr-4 py-3 rounded-xl border-2 border-border focus:border-primary focus:outline-none transition-colors text-foreground bg-background"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground mb-2 block",children:"Last Name"}),i.jsx("input",{type:"text",value:x,onChange:C=>_(C.target.value),placeholder:"Last",className:"w-full px-4 py-3 rounded-xl border-2 border-border focus:border-primary focus:outline-none transition-colors text-foreground bg-background"})]})]}),f!=="reset-confirm"&&i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground mb-2 block",children:"Email Address"}),i.jsxs("div",{className:"relative",children:[i.jsx(tS,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground"}),i.jsx("input",{type:"email",value:p,onChange:C=>{w(C.target.value),T.email&&R({...T,email:void 0})},placeholder:"[email protected]",className:D("w-full pl-10 pr-4 py-3 rounded-xl border-2 focus:outline-none transition-colors text-foreground bg-background",T.email?"border-destructive":"border-border focus:border-primary")})]}),T.email&&i.jsx("p",{className:"text-sm text-destructive mt-1",children:T.email})]}),(f==="login"||f==="signup"||f==="reset-confirm")&&i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground mb-2 block",children:f==="reset-confirm"?"New Password":"Password"}),i.jsxs("div",{className:"relative",children:[i.jsx(O4,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground"}),i.jsx("input",{type:S?"text":"password",value:g,onChange:C=>{b(C.target.value),T.password&&R({...T,password:void 0})},placeholder:f==="reset-confirm"?"Enter new password":"Enter your password",className:D("w-full pl-10 pr-12 py-3 rounded-xl border-2 focus:outline-none transition-colors text-foreground bg-background",T.password?"border-destructive":"border-border focus:border-primary")}),i.jsx("button",{type:"button",onClick:()=>k(!S),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:S?i.jsx(j4,{className:"w-5 h-5"}):i.jsx(N4,{className:"w-5 h-5"})})]}),T.password&&i.jsx("p",{className:"text-sm text-destructive mt-1",children:T.password}),(f==="signup"||f==="reset-confirm")&&i.jsx(tU,{password:g})]}),f==="login"&&i.jsx("div",{className:"text-right",children:i.jsx("button",{type:"button",onClick:()=>z("reset"),className:"text-sm text-primary hover:underline",children:"Forgot password?"})}),i.jsx(ce,{type:"submit",variant:"hero",size:"lg",className:"w-full group",disabled:N,children:N?i.jsx("div",{className:"w-5 h-5 border-2 border-primary-foreground border-t-transparent rounded-full animate-spin"}):i.jsxs(i.Fragment,{children:[f==="login"&&"Sign In",f==="signup"&&"Create Account",f==="reset"&&"Send Reset Link",f==="reset-confirm"&&"Update Password",i.jsx(_t,{className:"w-5 h-5 transition-transform group-hover:translate-x-1"})]})})]}),c&&a.length>0&&i.jsxs("div",{className:"mt-4 p-3 bg-muted rounded-lg text-sm text-center",children:[i.jsx(bo,{className:"w-4 h-4 inline mr-2"}),a.length," item",a.length!==1?"s":""," in your cart ⢠",d(l()),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Your items are saved"})]}),i.jsxs("div",{className:"mt-6 text-center text-sm",children:[f==="login"&&i.jsxs("p",{className:"text-muted-foreground",children:["Don't have an account?"," ",i.jsx("button",{onClick:()=>z("signup"),className:"text-primary font-medium hover:underline",children:"Sign up"})]}),f==="signup"&&i.jsxs("p",{className:"text-muted-foreground",children:["Already have an account?"," ",i.jsx("button",{onClick:()=>z("login"),className:"text-primary font-medium hover:underline",children:"Sign in"})]}),(f==="reset"||f==="reset-confirm")&&i.jsxs("p",{className:"text-muted-foreground",children:[f==="reset"?"Remember your password?":"Changed your mind?"," ",i.jsx("button",{onClick:()=>z("login"),className:"text-primary font-medium hover:underline",children:"Sign in"})]})]})]})]})]})})})})]})},Ok=({variant:e="default",className:t})=>{const r=e==="checkout"?"Having trouble?":"Need help?";return i.jsxs("div",{className:D("flex items-center justify-center gap-2 text-sm text-muted-foreground",t),children:[i.jsx(b4,{className:"w-4 h-4"}),i.jsx("span",{children:r}),i.jsx("a",{href:"mailto:[email protected]",className:"underline hover:text-foreground transition-colors",children:"[email protected]"})]})},Ot=h.forwardRef(({className:e,type:t,...r},n)=>i.jsx("input",{type:t,className:D("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:n,...r}));Ot.displayName="Input";var oU="Label",Ak=h.forwardRef((e,t)=>
vendor: 18,893 bytes, line 501
501i.jsx(ue.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Ak.displayName=oU;var Ik=Ak;const aU=nc("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ye=h.forwardRef(({className:e,...t},r)=>i.jsx(Ik,{ref:r,className:D(aU(),e),...t}));Ye.displayName=Ik.displayName;function Xm(e,[t,r]){return Math.min(r,Math.max(t,e))}function ty(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 iU=[" ","Enter","ArrowUp","ArrowDown"],lU=[" ","Enter"],Lo="Select",[Jd,Zd,cU]=Dg(Lo),[vi,gB]=Zt(Lo,[cU,hi]),Xd=hi(),[uU,Ks]=vi(Lo),[dU,fU]=vi(Lo),Dk=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:o,value:a,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:m,required:p,form:w}=e,g=Xd(t),[b,v]=h.useState(null),[y,x]=h.useState(null),[_,S]=h.useState(!1),k=oc(u),[N,E]=gn({prop:n,defaultProp:s??!1,onChange:o,caller:Lo}),[T,R]=gn({prop:a,defaultProp:l,onChange:c,caller:Lo}),L=h.useRef(null),O=b?w||!!b.closest("form"):!0,[A,$]=h.useState(new Set),z=Array.from(A).map(P=>P.props.value).join(";");return i.jsx(Rd,{...g,children:i.jsxs(uU,{required:p,scope:t,trigger:b,onTriggerChange:v,valueNode:y,onValueNodeChange:x,valueNodeHasChildren:_,onValueNodeHasChildrenChange:S,contentId:ir(),value:T,onValueChange:R,open:N,onOpenChange:E,dir:k,triggerPointerDownPosRef:L,disabled:m,children:[i.jsx(Jd.Provider,{scope:t,children:i.jsx(dU,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(P=>{$(M=>new Set(M).add(P))},[]),onNativeOptionRemove:h.useCallback(P=>{$(M=>{const C=new Set(M);return C.delete(P),C})},[]),children:r})}),O?i.jsxs(oj,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:f,value:T,onChange:P=>R(P.target.value),disabled:m,form:w,children:[T===void 0?i.jsx("option",{value:""}):null,Array.from(A)]},z):null]})})};Dk.displayName=Lo;var Mk="SelectTrigger",Lk=h.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,o=Xd(r),a=Ks(Mk,r),l=a.disabled||n,c=be(t,a.onTriggerChange),u=Zd(r),d=h.useRef("touch"),[f,m,p]=ij(g=>{const b=u().filter(x=>!x.disabled),v=b.find(x=>x.value===a.value),y=lj(b,g,v);y!==void 0&&a.onValueChange(y.value)}),w=g=>{l||(a.onOpenChange(!0),p()),g&&(a.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return i.jsx(dg,{asChild:!0,...o,children:i.jsx(ue.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":aj(a.value)?"":void 0,...s,ref:c,onClick:Y(s.onClick,g=>{g.currentTarget.focus(),d.current!=="mouse"&&w(g)}),onPointerDown:Y(s.onPointerDown,g=>{d.current=g.pointerType;const b=g.target;b.hasPointerCapture(g.pointerId)&&b.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(w(g),g.preventDefault())}),onKeyDown:Y(s.onKeyDown,g=>{const b=f.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&m(g.key),!(b&&g.key===" ")&&iU.includes(g.key)&&(w(),g.preventDefault())})})})});Lk.displayName=Mk;var $k="SelectValue",Fk=h.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:o,placeholder:a="",...l}=e,c=Ks($k,r),{onValueNodeHasChildrenChange:u}=c,d=o!==void 0,f=be(t,c.onValueNodeChange);return yt(()=>{u(d)},[u,d]),i.jsx(ue.span,{...l,ref:f,style:{pointerEvents:"none"},children:aj(c.value)?i.jsx(i.Fragment,{children:a}):o})});Fk.displayName=$k;var hU="SelectIcon",Uk=h.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return i.jsx(ue.span,{"aria-hidden":!0,...s,ref:t,children:n||"â¼"})});Uk.displayName=hU;var mU="SelectPortal",zk=e=>i.jsx(Od,{asChild:!0,...e});zk.displayName=mU;var $o="SelectContent",Bk=h.forwardRef((e,t)=>{const r=Ks($o,e.__scopeSelect),[n,s]=h.useState();if(yt(()=>{s(new DocumentFragment)},[]),!r.open){const o=n;return o?ui.createPortal(i.jsx(Vk,{scope:e.__scopeSelect,children:i.jsx(Jd.Slot,{scope:e.__scopeSelect,children:i.jsx("div",{children:e.children})})}),o):null}return i.jsx(Hk,{...e,ref:t})});Bk.displayName=$o;var Ir=10,[Vk,Gs]=vi($o),pU="SelectContentImpl",gU=To("SelectContent.RemoveScroll"),Hk=h.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:a,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:m,collisionPadding:p,sticky:w,hideWhenDetached:g,avoidCollisions:b,...v}=e,y=Ks($o,r),[x,_]=h.useState(null),[S,k]=h.useState(null),N=be(t,V=>_(V)),[E,T]=h.useState(null),[R,L]=h.useState(null),O=Zd(r),[A,$]=h.useState(!1),z=h.useRef(!1);h.useEffect(()=>{if(x)return Lg(x)},[x]),Mg();const P=h.useCallback(V=>{const[le,...ge]=O().map(q=>q.ref.current),[de]=ge.slice(-1),ne=document.activeElement;for(const q of V)if(q===ne||(q==null||q.scrollIntoView({block:"nearest"}),q===le&&S&&(S.scrollTop=0),q===de&&S&&(S.scrollTop=S.scrollHeight),q==null||q.focus(),document.activeElement!==ne))return},[O,S]),M=h.useCallback(()=>P([E,x]),[P,E,x]);h.useEffect(()=>{A&&M()},[A,M]);const{onOpenChange:C,triggerPointerDownPosRef:j}=y;h.useEffect(()=>{if(x){let V={x:0,y:0};const le=de=>{var ne,q;V={x:Math.abs(Math.round(de.pageX)-(((ne=j.current)==null?void 0:ne.x)??0)),y:Math.abs(Math.round(de.pageY)-(((q=j.current)==null?void 0:q.y)??0))}},ge=de=>{V.x<=10&&V.y<=10?de.preventDefault():x.contains(de.target)||C(!1),document.removeEventListener("pointermove",le),j.current=null};return j.current!==null&&(document.addEventListener("pointermove",le),document.addEventListener("pointerup",ge,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",le),document.removeEventListener("pointerup",ge,{capture:!0})}}},[x,C,j]),h.useEffect(()=>{const V=()=>C(!1);return window.addEventListener("blur",V),window.addEventListener("resize",V),()=>{window.removeEventListener("blur",V),window.removeEventListener("resize",V)}},[C]);const[I,F]=ij(V=>{const le=O().filter(ne=>!ne.disabled),ge=le.find(ne=>ne.ref.current===document.activeElement),de=lj(le,V,ge);de&&setTimeout(()=>de.ref.current.focus())}),B=h.useCallback((V,le,ge)=>{const de=!z.current&&!ge;(y.value!==void 0&&y.value===le||de)&&(T(V),de&&(z.current=!0))},[y.value]),J=h.useCallback(()=>x==null?void 0:x.focus(),[x]),Z=h.useCallback((V,le,ge)=>{const de=!z.current&&!ge;(y.value!==void 0&&y.value===le||de)&&L(V)},[y.value]),Se=n==="popper"?ep:Wk,je=Se===ep?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:m,collisionPadding:p,sticky:w,hideWhenDetached:g,avoidCollisions:b}:{};return i.jsx(Vk,{scope:r,content:x,viewport:S,onViewportChange:k,itemRefCallback:B,selectedItem:E,onItemLeave:J,itemTextRefCallback:Z,focusSelectedItem:M,selectedItemText:R,position:n,isPositioned:A,searchRef:I,children:i.jsx(Wd,{as:gU,allowPinchZoom:!0,children:i.jsx(Bd,{asChild:!0,trapped:y.open,onMountAutoFocus:V=>{V.preventDefault()},onUnmountAutoFocus:Y(s,V=>{var le;(le=y.trigger)==null||le.focus({preventScroll:!0}),V.preventDefault()}),children:i.jsx(ec,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:V=>V.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:i.jsx(Se,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:V=>V.preventDefault(),...v,...je,onPlaced:()=>$(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:Y(v.onKeyDown,V=>{const le=V.ctrlKey||V.altKey||V.metaKey;if(V.key==="Tab"&&V.preventDefault(),!le&&V.key.length===1&&F(V.key),["ArrowUp","ArrowDown","Home","End"].includes(V.key)){let de=O().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes(V.key)&&(de=de.slice().reverse()),["ArrowUp","ArrowDown"].includes(V.key)){const ne=V.target,q=de.indexOf(ne);de=de.slice(q+1)}setTimeout(()=>P(de)),V.preventDefault()}})})})})})})});Hk.displayName=pU;var yU="SelectItemAlignedPosition",Wk=h.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,o=Ks($o,r),a=Gs($o,r),[l,c]=h.useState(null),[u,d]=h.useState(null),f=be(t,N=>d(N)),m=Zd(r),p=h.useRef(!1),w=h.useRef(!0),{viewport:g,selectedItem:b,selectedItemText:v,focusSelectedItem:y}=a,x=h.useCallback(()=>{if(o.trigger&&o.valueNode&&l&&u&&g&&b&&v){const N=o.trigger.getBoundingClientRect(),E=u.getBoundingClientRect(),T=o.valueNode.getBoundingClientRect(),R=v.getBoundingClientRect();if(o.dir!=="rtl"){const ne=R.left-E.left,q=T.left-ne,pe=N.left-q,Ce=N.width+pe,Le=Math.max(Ce,E.width),Ze=window.innerWidth-Ir,K=Xm(q,[Ir,Math.max(Ir,Ze-Le)]);l.style.minWidth=Ce+"px",l.style.left=K+"px"}else{const ne=E.right-R.right,q=window.innerWidth-T.right-ne,pe=window.innerWidth-N.right-q,Ce=N.width+pe,Le=Math.max(Ce,E.width),Ze=window.innerWidth-Ir,K=Xm(q,[Ir,Math.max(Ir,Ze-Le)]);l.style.minWidth=Ce+"px",l.style.right=K+"px"}const L=m(),O=window.innerHeight-Ir*2,A=g.scrollHeight,$=window.getComputedStyle(u),z=parseInt($.borderTopWidth,10),P=parseInt($.paddingTop,10),M=parseInt($.borderBottomWidth,10),C=parseInt($.paddingBottom,10),j=z+P+A+C+M,I=Math.min(b.offsetHeight*5,j),F=window.getComputedStyle(g),B=parseInt(F.paddingTop,10),J=parseInt(F.paddingBottom,10),Z=N.top+N.height/2-Ir,Se=O-Z,je=b.offsetHeight/2,V=b.offsetTop+je,le=z+P+V,ge=j-le;if(le<=Z){const ne=L.length>0&&b===L[L.length-1].ref.current;l.style.bottom="0px";const q=u.clientHeight-g.offsetTop-g.offsetHeight,pe=Math.max(Se,je+(ne?J:0)+q+M),Ce=le+pe;l.style.height=Ce+"px"}else{const ne=L.length>0&&b===L[0].ref.current;l.style.top="0px";const pe=Math.max(Z,z+g.offsetTop+(ne?B:0)+je)+ge;l.style.height=pe+"px",g.scrollTop=le-Z+g.offsetTop}l.style.margin=`${Ir}px 0`,l.style.minHeight=I+"px",l.style.maxHeight=O+"px",n==null||n(),requestAnimationFrame(()=>p.current=!0)}},[m,o.trigger,o.valueNode,l,u,g,b,v,o.dir,n]);yt(()=>x(),[x]);const[_,S]=h.useState();yt(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const k=h.useCallback(N=>{N&&w.current===!0&&(x(),y==null||y(),w.current=!1)},[x,y]);return i.jsx(xU,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:p,onScrollButtonChange:k,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:i.jsx(ue.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Wk.displayName=yU;var vU="SelectPopperPosition",ep=h.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=Ir,...o}=e,a=Xd(r);return i.jsx(fg,{...a,...o,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ep.displayName=vU;var[xU,ry]=vi($o,{}),tp="SelectViewport",qk=h.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,o=Gs(tp,r),a=ry(tp,r),l=be(t,o.onViewportChange),c=h.useRef(0);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),i.jsx(Jd.Slot,{scope:r,children:i.jsx(ue.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Y(s.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:m}=a;if(m!=null&&m.current&&f){const p=Math.abs(c.current-d.scrollTop);if(p>0){const w=window.innerHeight-Ir*2,g=parseFloat(f.style.minHeight),b=parseFloat(f.style.height),v=Math.max(g,b);if(v<w){const y=v+p,x=Math.min(w,y),_=y-x;f.style.height=x+"px",f.style.bottom==="0px"&&(d.scrollTop=_>0?_:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});qk.displayName=tp;var Kk="SelectGroup",[wU,bU]=vi(Kk),_U=h.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=ir();return i.jsx(wU,{scope:r,id:s,children:i.jsx(ue.div,{role:"group","aria-labelledby":s,...n,ref:t})})});_U.displayName=Kk;var Gk="SelectLabel",Yk=h.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=bU(Gk,r);return i.jsx(ue.div,{id:s.id,...n,ref:t})});Yk.displayName=Gk;var id="SelectItem",[SU,Qk]=vi(id),Jk=h.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:o,...a}=e,l=Ks(id,r),c=Gs(id,r),u=l.value===n,[d,f]=h.useState(o??""),[m,p]=h.useState(!1),w=be(t,y=>{var x;return(x=c.itemRefCallback)==null?void 0:x.call(c,y,n,s)}),g=ir(),b=h.useRef("touch"),v=()=>{s||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return i.jsx(SU,{scope:r,value:n,disabled:s,textId:g,isSelected:u,onItemTextChange:h.useCallback(y=>{f(x=>x||((y==null?void 0:y.textContent)??"").trim())},[]),children:i.jsx(Jd.ItemSlot,{scope:r,value:n,disabled:s,textValue:d,children:i.jsx(ue.div,{role:"option","aria-labelledby":g,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:w,onFocus:Y(a.onFocus,()=>p(!0)),onBlur:Y(a.onBlur,()=>p(!1)),onClick:Y(a.onClick,()=>{b.current!=="mouse"&&v()}),onPointerUp:Y(a.onPointerUp,()=>{b.current==="mouse"&&v()}),onPointerDown:Y(a.onPointerDown,y=>{b.current=y.pointerType}),onPointerMove:Y(a.onPointerMove,y=>{var x;b.current=y.pointerType,s?(x=c.onItemLeave)==null||x.call(c):b.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Y(a.onPointerLeave,y=>{var x;y.currentTarget===document.activeElement&&((x=c.onItemLeave)==null||x.call(c))}),onKeyDown:Y(a.onKeyDown,y=>{var _;((_=c.searchRef)==null?void 0:_.current)!==""&&y.key===" "||(lU.includes(y.key)&&v(),y.key===" "&&y.preventDefault())})})})})});Jk.displayName=id;var Ki="SelectItemText",Zk=h.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...o}=e,a=Ks(Ki,r),l=Gs(Ki,r),c=Qk(Ki,r),u=fU(Ki,r),[d,f]=h.useState(null),m=be(t,v=>f(v),c.onItemTextChange,v=>{var y;return(y=l.itemTextRefCallback)==null?void 0:y.call(l,v,c.value,c.disabled)}),p=d==null?void 0:d.textContent,w=h.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:g,onNativeOptionRemove:b}=u;return yt(()=>(g(w),()=>b(w)),[g,b,w]),i.jsxs(i.Fragment,{children:[i.jsx(ue.span,{id:c.textId,...o,ref:m}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?ui.createPortal(o.children,a.valueNode):null]})});Zk.displayName=Ki;var Xk="SelectItemIndicator",ej=h.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return Qk(Xk,r).isSelected?i.jsx(ue.span,{"aria-hidden":!0,...n,ref:t}):null});ej.displayName=Xk;var rp="SelectScrollUpButton",tj=h.forwardRef((e,t)=>{const r=Gs(rp,e.__scopeSelect),n=ry(rp,e.__scopeSelect),[s,o]=h.useState(!1),a=be(t,n.onScrollButtonChange);return yt(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollTop>0;o(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),s?i.jsx(nj,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});tj.displayName=rp;var np="SelectScrollDownButton",rj=h.forwardRef((e,t)=>{const r=Gs(np,e.__scopeSelect),n=ry(np,e.__scopeSelect),[s,o]=h.useState(!1),a=be(t,n.onScrollButtonChange);return yt(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;o(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),s?i.jsx(nj,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});rj.displayName=np;var nj=h.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,o=Gs("SelectScrollButton",r),a=h.useRef(null),l=Zd(r),c=h.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return h.useEffect(()=>()=>c(),[c]),yt(()=>{var d;const u=l().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),i.jsx(ue.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Y(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(n,50))}),onPointerMove:Y(s.onPointerMove,()=>{var u;(u=o.onItemLeave)==null||u.call(o),a.current===null&&(a.current=window.setInterval(n,50))}),onPointerLeave:Y(s.onPointerLeave,()=>{c()})})}),kU="SelectSeparator",sj=h.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return i.jsx(ue.div,{"aria-hidden":!0,...n,ref:t})});sj.displayName=kU;var sp="SelectArrow",jU=h.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=Xd(r),o=Ks(sp,r),a=Gs(sp,r);return o.open&&a.position==="popper"?i.jsx(hg,{...s,...n,ref:t}):null});jU.displayName=sp;var NU="SelectBubbleInput",oj=h.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const s=h.useRef(null),o=be(n,s),a=ty(t);return h.useEffect(()=>{const l=s.current;if(!l)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&d){const f=new Event("change",{bubbles:!0});d.call(l,t),l.dispatchEvent(f)}},[a,t]),i.jsx(ue.select,{...r,style:{...z_,...r.style},ref:o,defaultValue:t})});oj.displayName=NU;function aj(e){return e===""||e===void 0}function ij(e){const t=pt(e),r=h.useRef(""),n=h.useRef(0),s=h.useCallback(a=>{const l=r.current+a;t(l),function c(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),o=h.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,o]}function lj(e,t,r){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=CU(e,Math.max(o,0));s.length===1&&(a=a.filter(u=>u!==r));const c=a.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==r?c:void 0}function CU(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var EU=Dk,cj=Lk,TU=Fk,PU=Uk,RU=zk,uj=Bk,OU=qk,dj=Yk,fj=Jk,AU=Zk,IU=ej,hj=tj,mj=rj,pj=sj;const _o=EU,So=TU,Rs=h.forwardRef(({className:e,children:t,...r},n)=>i.jsxs(cj,{ref:n,className:D("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
501ing-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),...r,children:[t,i.jsx(PU,{asChild:!0,children:i.jsx(hn,{className:"h-4 w-4 opacity-50"})})]}));Rs.displayName=cj.displayName;const gj=h.forwardRef(({className:e,...t},r)=>i.jsx(hj,{ref:r,className:D("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(J1,{className:"h-4 w-4"})}));gj.displayName=hj.displayName;const yj=h.forwardRef(({className:e,...t},r)=>i.jsx(mj,{ref:r,className:D("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(hn,{className:"h-4 w-4"})}));yj.displayName=mj.displayName;const Os=h.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>i.jsx(RU,{children:i.jsxs(uj,{ref:s,className:D("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",r==="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:r,...n,children:[i.jsx(gj,{}),i.jsx(OU,{className:D("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),i.jsx(yj,{})]})}));Os.displayName=uj.displayName;const DU=h.forwardRef(({className:e,...t},r)=>i.jsx(dj,{ref:r,className:D("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));DU.displayName=dj.displayName;const On=h.forwardRef(({className:e,children:t,...r},n)=>i.jsxs(fj,{ref:n,className:D("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...r,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(IU,{children:i.jsx(Oo,{className:"h-4 w-4"})})}),i.jsx(AU,{children:t})]}));On.displayName=fj.displayName;const MU=h.forwardRef(({className:e,...t},r)=>i.jsx(pj,{ref:r,className:D("-mx-1 my-1 h-px bg-muted",e),...t}));MU.displayName=pj.displayName;var ef="Checkbox",[LU,yB]=Zt(ef),[$U,ny]=LU(ef);function FU(e){const{__scopeCheckbox:t,checked:r,children:n,defaultChecked:s,disabled:o,form:a,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[m,p]=gn({prop:r,defaultProp:s??!1,onChange:c,caller:ef}),[w,g]=h.useState(null),[b,v]=h.useState(null),y=h.useRef(!1),x=w?!!a||!!w.closest("form"):!0,_={checked:m,disabled:o,setChecked:p,control:w,setControl:g,name:l,form:a,value:d,hasConsumerStoppedPropagationRef:y,required:u,defaultChecked:As(s)?!1:s,isFormControl:x,bubbleInput:b,setBubbleInput:v};return i.jsx($U,{scope:t,..._,children:UU(f)?f(_):n})}var vj="CheckboxTrigger",xj=h.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},s)=>{const{control:o,value:a,disabled:l,checked:c,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:m,isFormControl:p,bubbleInput:w}=ny(vj,e),g=be(s,d),b=h.useRef(c);return h.useEffect(()=>{const v=o==null?void 0:o.form;if(v){const y=()=>f(b.current);return v.addEventListener("reset",y),()=>v.removeEventListener("reset",y)}},[o,f]),i.jsx(ue.button,{type:"button",role:"checkbox","aria-checked":As(c)?"mixed":c,"aria-required":u,"data-state":kj(c),"data-disabled":l?"":void 0,disabled:l,value:a,...n,ref:g,onKeyDown:Y(t,v=>{v.key==="Enter"&&v.preventDefault()}),onClick:Y(r,v=>{f(y=>As(y)?!0:!y),w&&p&&(m.current=v.isPropagationStopped(),m.current||v.stopPropagation())})})});xj.displayName=vj;var sy=h.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:s,defaultChecked:o,required:a,disabled:l,value:c,onCheckedChange:u,form:d,...f}=e;return i.jsx(FU,{__scopeCheckbox:r,checked:s,defaultChecked:o,disabled:l,required:a,onCheckedChange:u,name:n,form:d,value:c,internal_do_not_use_render:({isFormControl:m})=>i.jsxs(i.Fragment,{children:[i.jsx(xj,{...f,ref:t,__scopeCheckbox:r}),m&&i.jsx(Sj,{__scopeCheckbox:r})]})})});sy.displayName=ef;var wj="CheckboxIndicator",bj=h.forwardRef((e,t)=>
501{const{__scopeCheckbox:r,forceMount:n,...s}=e,o=ny(wj,r);return i.jsx(It,{present:n||As(o.checked)||o.checked===!0,children:i.jsx(ue.span,{"data-state":kj(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});bj.displayName=wj;var _j="CheckboxBubbleInput",Sj=h.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:n,hasConsumerStoppedPropagationRef:s,checked:o,defaultChecked:a,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:m,setBubbleInput:p}=ny(_j,e),w=be(r,p),g=ty(o),b=lg(n);h.useEffect(()=>{const y=m;if(!y)return;const x=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(x,"checked").set,k=!s.current;if(g!==o&&S){const N=new Event("click",{bubbles:k});y.indeterminate=As(o),S.call(y,As(o)?!1:o),y.dispatchEvent(N)}},[m,g,o,s]);const v=h.useRef(As(o)?!1:o);return i.jsx(ue.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??v.current,required:l,disabled:c,name:u,value:d,form:f,...t,tabIndex:-1,ref:w,style:{...t.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Sj.displayName=_j;function UU(e){return typeof e=="function"}function As(e){return e==="indeterminate"}function kj(e){return As(e)?"indeterminate":e?"checked":"unchecked"}const oy=h.forwardRef(({className:e,...t},r)=>i.jsx(sy,{ref:r,className:D("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:i.jsx(bj,{className:D("flex items-center justify-center text-current"),children:i.jsx(Oo,{className:"h-4 w-4"})})}));oy.displayName=sy.displayName;var tf="Collapsible",[zU,vB]=Zt(tf),[BU,ay]=zU(tf),jj=h.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:s,disabled:o,onOpenChange:a,...l}=e,[c,u]=gn({prop:n,defaultProp:s??!1,onChange:a,caller:tf});return i.jsx(BU,{scope:r,disabled:o,contentId:ir(),open:c,onOpenToggle:h.useCallback(()=>u(d=>!d),[u]),children:i.jsx(ue.div,{"data-state":uy(c),"data-disabled":o?"":void 0,...l,ref:t})})});jj.displayName=tf;var Nj="CollapsibleTrigger",iy=h.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,s=ay(Nj,r);return i.jsx(ue.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":uy(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...n,ref:t,onClick:Y(e.onClick,s.onOpenToggle)})});iy.displayName=Nj;var ly="CollapsibleContent",cy=h.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=ay(ly,e.__scopeCollapsible);return i.jsx(It,{present:r||s.open,children:({present:o})=>i.jsx(VU,{...n,ref:t,present:o})})});cy.displayName=ly;var VU=h.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:s,...o}=e,a=ay(ly,r),[l,c]=h.useState(n),u=h.useRef(null),d=be(t,u),f=h.useRef(0),m=f.current,p=h.useRef(0),w=p.current,g=a.open||l,b=h.useRef(g),v=h.useRef(void 0);return h.useEffect(()=>{const y=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(y)},[]),yt(()=>{const y=u.current;if(y){v.current=v.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const x=y.getBoundingClientRect();f.current=x.height,p.current=x.width,b.current||(y.style.transitionDuration=v.current.transitionDuration,y.style.animationName=v.current.animationName),c(n)}},[a.open,n]),i.jsx(ue.div,{"data-state":uy(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!g,...o,ref:d,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":w?`${w}px`:void 0,...e.style},children:g&&s})});function uy(e){return e?"open":"closed"}var HU=jj,xB=iy,wB=cy;const WU=HU,qU=iy,KU=cy,Pn=[{value:"YXS",label:"Youth Extra Small",category:"youth",sortOrder:1},{value:"YS",label:"Youth Small",category:"youth",sortOrder:2},{value:"YM",label:"Youth Medium",category:"youth",sortOrder:3},{value:"YL",label:"Youth Large",category:"youth",sortOrder:4},{value:"S",label:"Adult Small",category:"adult",sortOrder:5},{value:"M",label:"Adult Medium",category:"adult",sortOrder:6},{value:"L",label:"Adult Large",category:"adult",sortOrder:7},{value:"XL",label:"Adult XL",category:"adult",sortOrder:8},{value:"2XL",label:"Adult 2XL",category:"adult",sortOrder:9}],bB=Pn.map(e=>e.value),GU=e=>{var t;return((t=Pn.find(r=>r.value===e))==null?void 0:t.label)||e},_B=(e,t)=>{const{showCents:r=!0,locale:n="en-US",currency:s="USD"}={},o=e/100;return r?new Intl.NumberFormat(n,{style:"currency",currency:s,minimumFractionDigits:2,maximumFractionDigits:2}
501).format(o):new Intl.NumberFormat(n,{style:"currency",currency:s,minimumFractionDigits:0,maximumFractionDigits:0}).format(o)},ts=e=>`$${(e/100).toFixed(0)}`,YU="analytics_session_id";function Cj(){const e=sessionStorage.getItem(YU);if(e)try{const{id:t}=JSON.parse(e);return t}catch{return null}return null}async function oi(e,t={},r){const n=Cj();if(!n){console.warn("No analytics session found for conversion tracking");return}try{const{error:s}=await ie.from("conversion_events").insert([{session_id:n,event_type:e,event_data:t,page_path:window.location.pathname,user_id:r||null}]);s&&console.error("Failed to track conversion:",s)}catch(s){console.error("Conversion tracking error:",s)}}const Ej={started:e=>oi("registration_started",e),completed:e=>oi("registration_completed",e)},Tj={started:e=>oi("donation_started",e),completed:e=>oi("donation_completed",e)},Pj={started:e=>oi("sponsor_inquiry_started",e),completed:e=>oi("sponsor_inquiry_completed",e)},QU={"gmial.com":"gmail.com","gmai.com":"gmail.com","gmali.com":"gmail.com","gmal.com":"gmail.com","gamil.com":"gmail.com","gnail.com":"gmail.com","gmaill.com":"gmail.com","gmail.co":"gmail.com","gmail.cm":"gmail.com","gmail.om":"gmail.com","gmail.con":"gmail.com","gmail.cim":"gmail.com","gmail.vom":"gmail.com","gmaul.com":"gmail.com","gmeil.com":"gmail.com","gimail.com":"gmail.com","yaho.com":"yahoo.com","yahooo.com":"yahoo.com","yahoo.co":"yahoo.com","yahoo.cm":"yahoo.com","yahoo.con":"yahoo.com","yhaoo.com":"yahoo.com","yhoo.com":"yahoo.com","hotmial.com":"hotmail.com","hotmall.com":"hotmail.com","hotmai.com":"hotmail.com","hotmal.com":"hotmail.com","hotamil.com":"hotmail.com","hotmail.co":"hotmail.com","hotmail.con":"hotmail.com","outlok.com":"outlook.com","outloo.com":"outlook.com","outlool.com":"outlook.com","outlook.co":"outlook.com","outlook.con":"outlook.com","outllook.com":"outlook.com","icloud.clm":"icloud.com","icloud.co":"icloud.com","icloud.con":"icloud.com","icloud.cm":"icloud.com","icloud.om":"icloud.com","icould.com":"icloud.com","iclod.com":"icloud.com","icoud.com":"icloud.com","iclould.com":"icloud.com","aol.co":"aol.com","aol.con":"aol.com","aol.cm":"aol.com","comcast.ner":"comcast.net","comcast.ne":"comcast.net","comcas.net"
501:"comcast.net"};function JU(e){if(!e||!e.includes("@"))return null;const[t,r]=e.toLowerCase().split("@");if(!r)return null;const n=QU[r];return n?`${t}@${n}`:null}function dy({id:e,label:t,value:r,onChange:n,confirmValue:s,onConfirmChange:o,requireConfirmation:a,required:l,placeholder:c,helperText:u}){const[d,f]=h.useState(null),m=()=>{const b=r.trim();if(!b){f(null);return}f(JU(b))},p=()=>{d&&(n(d),f(null))},w=a&&r.includes("@"),g=w&&s.length>0&&s.trim().toLowerCase()!==r.trim().toLowerCase();return i.jsxs("div",{className:"space-y-2",children:[i.jsxs(Ye,{htmlFor:e,children:[t,l?" *":""]}),i.jsx(Ot,{id:e,type:"email",autoComplete:"email",value:r,onChange:b=>{n(b.target.value),d&&f(null)},onBlur:m,placeholder:c}),u&&!d&&i.jsx("p",{className:"text-xs text-muted-foreground",children:u}),d&&i.jsxs("p",{className:"text-xs flex items-center gap-1.5 text-amber-700 dark:text-amber-400",children:[i.jsx(Xa,{className:"w-3.5 h-3.5 flex-shrink-0"}),i.jsxs("span",{children:["Did you mean"," ",i.jsx("button",{type:"button",onClick:p,className:"font-semibold underline hover:no-underline",children:d}),"?"]})]}),w&&i.jsxs("div",{className:"space-y-1 pt-1",children:[i.jsxs(Ye,{htmlFor:`${e}-confirm`,className:"text-sm",children:["Confirm email",l?" *":""]}),i.jsx(Ot,{id:`${e}-confirm`,type:"email",autoComplete:"off",value:s,onChange:b=>o(b.target.value),onPaste:b=>b.preventDefault(),onDrop:b=>b.preventDefault(),placeholder:"Re-type to confirm","aria-invalid":g||void 0}),g?i.jsx("p",{className:"text-xs text-destructive",children:"Emails do not match."}):i.jsx("p",{className:"text-xs text-muted-foreground",children:"Pasting is disabled â please re-type to catch typos."})]})]})}function Rj(e,t,r){return!r||!e.trim()?!0:t.trim().toLowerCase()===e.trim().toLowerCase()}const ZU=({sku:e,shirtOptions:t,partnerDiscount:r,partnerId:n})=>{var Le,Ze;const{addItem:s,setEventId:o,getCartShirtCount:a}=Vt(),{activeEvent:l,getInventoryCount:c}=ht(),u=h.useCallback((K,xe)=>{const Ee=c(K,xe);return Ee===-1?-1:Math.max(0,Ee-a(K,xe))},[c,a]),{user:d}=Vn(),[f,m]=h.useState(!1),[p,w]=h.useState(!1),g=h.useRef(!1),[b,v]=h.useState(e.age_tiers&&e.age_tiers.length>0?e.age_tiers[0].id:null),y=n!==void 0,x=r!==void 0&&r>0,S=(()=>{if(t.length===0)return"";for(const K of t)for(const xe of Pn){const Ee=u(K.id,xe.value);if(Ee===-1||Ee>0)return K.id}return t[0].id})(),[k,N]=h.useState({firstName:"",lastName:"",email:"",shirtSize:"",shirtOptionId:S}),[E,T]=h.useState(""),[R,L]=h.useState(!1),[O,A]=h.useState(!1),$=t.find(K=>K.id===k.shirtOptionId),z=($==null?void 0:$.name.toLowerCase())==="no shirt",P=e.age_tiers&&e.age_tiers.length>0,M=P?(Le=e.age_tiers)==null?void 0:Le.find(K=>K.id===b):null,C=e.requires_waiver===!0,j=e.includes_shirt===!0,I=K=>x?Math.round(K*(1-(r||0)/100)):K,F=()=>M?M.price_cents:e.price_cents,B=()=>I(F()),J=()=>{if(!j)return 0;const K=t.find(xe=>xe.id===k.shirtOptionId);return K?K.price_cents:0},Z=()=>B()+J(),Se=()=>F()+J(),je=(K=!1)=>{if(!k.firstName.trim()||!k.lastName.trim()){re.error("Please enter participant name");return}if(k.email.trim()){if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(k.email.trim())){re.error("Please enter a valid email address");return}const Wn=((d==null?void 0:d.email)||"").trim().toLowerCase(),Xt=k.email.trim().toLowerCase()!==Wn;if(!Rj(k.email,E,Xt)){re.error("Participant emails do not match. Please re-type to confirm.");return}}if(C&&!R){re.error("Please accept the liability waiver");return}if(j&&!z&&!k.shirtSize){A(!0),re.error("Please select a shirt size");return}if(j&&!z&&!le()){re.error("Selected shirt size is sold out. Please choose another size.");return}A(!1);const xe=t.find(Ht=>Ht.id===k.shirtOptionId),Ee=k.firstName;if(j&&!z&&!xe){re.error("Could not resolve shirt option. Please re-select your shirt type.");return}l&&o(l.id),s({type:"registration",skuId:e.id,skuName:e.name,tierId:M==null?void 0:M.id,tierName:(M==null?void 0:M.name)||e.name,participant:{...k,shirtSize:j?z?"":k.shirtSize:"",shirtOptionId:j?k.shirtOptionId:"",shirtOptionName:j&&((xe==null?void 0:xe.name)||($==null?void 0:$.name))||""}
501,basePrice:B(),shirtPrice:j?J():0,waiverAccepted:C?R:void 0,partnerId:y?n:void 0,partnerDiscount:y?r:void 0});const ct=t.length>0?t[0].id:"";N({firstName:"",lastName:"",email:"",shirtSize:"",shirtOptionId:ct}),T(""),L(!1),A(!1),K?re.success(`${Ee} added! Ready for next participant.`):(w(!1),re.success(`${Ee} added to cart!`))},V=K=>{const xe=t.find(ct=>ct.id===K),Ee=(xe==null?void 0:xe.name.toLowerCase())==="no shirt";N(ct=>({...ct,shirtOptionId:K,shirtSize:Ee?"":ct.shirtSize}))},le=()=>{if(!k.shirtSize)return!0;const K=u(k.shirtOptionId,k.shirtSize);return K===-1||K>0},ge=()=>e.min_age&&e.max_age?`Ages ${e.min_age}-${e.max_age}`:e.min_age?`Ages ${e.min_age}+`:e.max_age?`Ages ${e.max_age} & under`:"All ages",de=C?R:!0,ne=()=>{if(P&&e.age_tiers){const K=Math.min(...e.age_tiers.map(xe=>xe.price_cents));return I(K)}return I(e.price_cents)},q=()=>P&&e.age_tiers?Math.min(...e.age_tiers.map(K=>K.price_cents)):e.price_cents,pe=(l==null?void 0:l.waiver_text)||qM,Ce=async()=>{if(d){m(!0);try{const{data:K,error:xe}=await ie.from("profiles").select("first_name, last_name, email").eq("user_id",d.id).single();if(xe)throw xe;K&&(N(Ee=>({...Ee,firstName:K.first_name||"",lastName:K.last_name||"",email:K.email||""})),T(""),re.success("Your info has been filled in"))}catch(K){console.error("Error fetching profile:",K),re.error("Could not load your profile")}finally{m(!1)}}};return i.jsxs(ot,{variant:"elevated",className:D("transition-all duration-300",p&&"ring-2 ring-primary"),children:[i.jsx(ur,{className:"cursor-pointer",onClick:()=>{!p&&!g.current&&(g.current=!0,Ej.started({event_id:(l==null?void 0:l.id)||"",amount:B()})),w(!p)},children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Sr,{className:"text-lg",children:e.name}),e.is_group_pack&&i.jsxs(Pt,{variant:"secondary",children:[e.group_size," pack"]}),x&&i.jsxs(Pt,{variant:"secondary",className:"bg-green-500/10 text-green-600 border-green-500/20",children:[i.jsx(M4,{className:"w-3 h-3 mr-1"}),r,"% off"]})]}),i.jsx(qs,{children:e.description||ge()})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("div",{className:"text-right",children:[x&&i.jsx("span",{className:"text-xs text-muted-foreground line-through block",children:ts(q())}),P?i.jsxs("span",{className:"text-sm text-muted-foreground",children:["from ",i.jsx("span",{className:D("text-lg font-bold",x?"text-green-600":"text-primary"),children:ts(ne())})]}):i.jsx("span",{className:D("text-lg font-bold",x?"text-green-600":"text-primary"),children:ts(B())})]}),p?i.jsx(J1,{className:"w-5 h-5 text-muted-foreground"}):i.jsx(hn,{className:"w-5 h-5 text-muted-foreground"})]})]})}),p&&i.jsxs(at,{className:"space-y-4 border-t pt-4",children:[P&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ye,{className:"font-semibold",children:"Select Age Group"}),i.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:(Ze=e.age_tiers)==null?void 0:Ze.map(K=>{const xe=K.price_cents,Ee=I(xe);return i.jsxs("button",{onClick:()=>v(K.id),className:D("p-3 rounded-lg border-2 text-left transition-all",b===K.id?"border-primary bg-primary/5":"border-border hover:border-primary/50"),children:[i.jsx("div",{className:"font-medium text-foreground",children:K.name}),i.jsx("div",{className:"text-sm text-muted-foreground",children:K.min_age!==null&&K.max_age!==null?`${K.min_age}-${K.max_age}`:K.min_age!==null?`${K.min_age}+`:K.max_age!==null?`â¤${K.max_age}`:"Any"}),i.jsxs("div",{className:"mt-1",children:[x&&i.jsx("span",{className:"text-xs text-muted-foreground line-through mr-2",children:ts(xe)}),i.jsx("span",{className:D("text-lg font-bold",x?"text-green-600":"text-primary"),children:ts(Ee)})]})]},K.id)})})]}),i.jsxs("div",{className:"space-y-3 sm:space-y-4 p-3 sm:p-4 bg-muted/30 rounded-lg",children:[i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2 text-foreground font-medium",children:[i.jsx(Hr,{className:"w-4 h-4"}),"Participant Details"]}
501),d&&i.jsxs(ce,{type:"button",variant:"ghost",size:"sm",onClick:Ce,disabled:f,className:"text-primary text-xs h-7 px-2",children:[f?i.jsx(Jr,{className:"w-3 h-3 animate-spin mr-1"}):i.jsx(H4,{className:"w-3 h-3 mr-1"}),"Use my info"]})]}),i.jsxs("div",{className:"grid sm:grid-cols-2 gap-3",children:[i.jsxs("div",{children:[i.jsx(Ye,{htmlFor:"firstName",children:"First Name *"}),i.jsx(Ot,{id:"firstName",value:k.firstName,onChange:K=>N({...k,firstName:K.target.value}),placeholder:"First name"})]}),i.jsxs("div",{children:[i.jsx(Ye,{htmlFor:"lastName",children:"Last Name *"}),i.jsx(Ot,{id:"lastName",value:k.lastName,onChange:K=>N({...k,lastName:K.target.value}),placeholder:"Last name"})]})]}),i.jsx(dy,{id:"email",label:"Email (optional)",value:k.email,onChange:K=>N({...k,email:K}),confirmValue:E,onConfirmChange:T,requireConfirmation:!!k.email.trim()&&k.email.trim().toLowerCase()!==((d==null?void 0:d.email)||"").trim().toLowerCase(),placeholder:"For race notifications",helperText:"Leave blank to use your account email"}),j&&t.length>0&&i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"text-xs text-muted-foreground bg-muted/50 border border-border rounded-md px-3 py-2 flex items-start gap-2",children:[i.jsx(ei,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),i.jsx("span",{children:"T-shirts are limited and offered first-come, first-served. Sizes and styles may sell out and are not guaranteed â register early to secure your preferred option."})]}),i.jsxs("div",{className:"grid sm:grid-cols-2 gap-3",children:[!z&&i.jsxs("div",{children:[i.jsxs(Ye,{htmlFor:"shirtSize",children:[i.jsx(ei,{className:"w-4 h-4 inline mr-1"}),"T-Shirt Size *"]}),i.jsxs(_o,{value:k.shirtSize,onValueChange:K=>{N({...k,shirtSize:K}),A(!1)},children:[i.jsx(Rs,{className:!le()||O?"border-destructive":"",children:i.jsx(So,{placeholder:"Select a size"})}),i.jsx(Os,{children:Pn.map(K=>{const xe=u(k.shirtOptionId,K.value),Ee=xe!==-1&&xe<=0,ct=xe>0&&xe<=WM;return i.jsx(On,{value:K.value,disabled:Ee,className:D(Ee&&"opacity-50"),children:i.jsxs("span",{className:"flex items-center gap-2",children:[K.label,Ee&&i.jsx(Pt,{variant:"destructive",className:"text-[10px] px-1.5 py-0",children:"SOLD OUT"}),ct&&!Ee&&i.jsxs("span",{className:"text-[10px] text-amber-600 dark:text-amber-400",children:["(",xe," left)"]})]})},K.value)})})]}),!le()&&i.jsxs("p",{className:"text-xs text-destructive mt-1 flex items-center gap-1",children:[i.jsx(Xa,{className:"w-3 h-3"}),"This size is sold out"]}),O&&le()&&!k.shirtSize&&i.jsxs("p",{className:"text-xs text-destructive mt-1 flex items-center gap-1",children:[i.jsx(Xa,{className:"w-3 h-3"}),"Please select a shirt size"]})]}),t.length>1&&i.jsxs("div",{children:[i.jsx(Ye,{children:"T-Shirt Type"}),i.jsx("div",{className:"flex flex-col sm:flex-row flex-wrap gap-2 mt-1",children:t.map(K=>i.jsxs("button",{onClick:()=>V(K.id),className:D("flex-1 min-w-[100px] py-2 px-3 rounded-lg border-2 text-sm font-medium transition-all",k.shirtOptionId===K.id?"border-secondary bg-secondary/10 text-secondary":"border-border hover:border-secondary/50 text-foreground"),children:[K.name,K.price_cents>0&&i.jsxs("span",{className:"block text-xs text-muted-foreground",children:["+",ts(K.price_cents)]})]},K.id))})]})]})]})]}),C&&i.jsx("div",{className:"p-4 rounded-lg border border-border bg-card",children:i.jsx(WU,{children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(oy,{id:`waiver-${e.id}`,checked:R,onCheckedChange:K=>L(K===!0),className:"mt-0.5"}),i.jsxs("div",{className:"flex-1",children:[i.jsxs("label",{htmlFor:`waiver-${e.id}`,className:"text-sm font-medium cursor-pointer flex items-center gap-2",children:[i.jsx(F4,{className:"w-4 h-4 text-primary"}),"I accept the liability waiver for this participant"]}),i.jsxs(qU,{className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground mt-1 transition-colors",children:[i.jsx(hn,{className:"w-3 h-3"}),"Read full waiver text"]}),i.jsx(KU,{children:i.jsx("div",{className:"mt-3 p-4 bg-muted/50 rounded-lg border border-border",children:i.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed whitespace-pre-wrap",children:pe})})})]})]})})}),i.jsxs("div",{className:"flex items-center justify-between pt-2 gap-2",children:[i.jsxs("div",{className:"text-lg font-bold text-foreground",children:[y&&Se()!==Z()&&i.jsx("span",{className:"text-sm text-muted-foreground line-through mr-2",children:ts(Se())}),"Total: ",i.jsx("span",{className:y?"text-green-600":"text-primary",children:ts(Z())})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(ce,{variant:"outline",onClick:()=>je(!0),disabled:!de,className:"gap-1 text-xs sm:text-sm",children:[i.jsx(Ao,{className:"w-4 h-4"}),i.jsx("span",{className:"hidden sm:inline",children:"Add &"})," Register Another"]}),i.jsxs(ce,{onClick:()=>je(!1),disabled:!de,className:"gap-2",children:[i.jsx(Ao,{className:"w-4 h-4"}),"Add to Cart"]})]})]})]})]})},XU=({tier:e})=>{const{addItem:t,getSponsorships:r,setEventId:n}=Vt(),{activeEvent:s}=ht(),[o,a]=h.useState(!1),l=h.useRef(!1),[c,u]=h.useState(""),[d,f]=h.useState(""),[m,p]=h.useState(""),[w,g]=h.useState(""),[b,v]=h.useState(!1),[y,x]=h.useState(""),_=e.icon,S=e.soldOut||e.available===0,k=r().some(R=>R.tierName===e.name),N=()=>
501{if(!c.trim()){re.error("Please enter your name");return}if(!d.trim()){re.error("Please enter your business name");return}if(!w.trim()){re.error("Please enter contact email");return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(w)){re.error("Please enter a valid email address");return}if(m.trim())try{new URL(m.startsWith("http")?m:`https://${m}`)}catch{re.error("Please enter a valid website URL");return}let L=0;if(b&&y.trim()&&(L=Number(y),!Number.isFinite(L)||L<0)){re.error("Additional contribution must be a positive number");return}s&&n(s.id);const O=e.price*100,A=Math.round(L*100);t({type:"sponsorship",tierId:e.name.toLowerCase().replace(/\s/g,"-"),tierName:e.name,contactName:c,companyName:d,contactEmail:w,websiteUrl:m.trim()?m.startsWith("http")?m:`https://${m}`:"",price:O+A,basePriceCents:O,extraContributionCents:A>0?A:void 0}),u(""),f(""),g(""),p(""),x(""),v(!1),a(!1),re.success(`${e.name} Sponsorship added to cart!`)},E=Number(y)||0,T=e.price+(b&&E>0?E:0);return i.jsxs(ot,{variant:"feature",className:D("relative flex flex-col transition-all duration-300",e.popular&&"ring-2 ring-secondary",S&&"opacity-60",o&&"ring-2 ring-primary",k&&"bg-primary/5"),children:[e.popular&&!S&&i.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2 z-10",children:i.jsx("span",{className:"px-3 py-1 rounded-full bg-secondary text-secondary-foreground text-xs font-semibold",children:"Most Popular"})}),S&&i.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2 z-10",children:i.jsx("span",{className:"px-3 py-1 rounded-full bg-destructive text-destructive-foreground text-xs font-semibold",children:"Sold Out"})}),k&&i.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2 z-10",children:i.jsx("span",{className:"px-3 py-1 rounded-full bg-primary text-primary-foreground text-xs font-semibold",children:"In Cart"})}),i.jsxs(ur,{className:D("text-center pb-2",!S&&!k&&"cursor-pointer"),onClick:()=>{!S&&!k&&(!o&&!l.current&&(l.current=!0,Pj.started({tier:e.name})),a(!o))},children:[i.jsx("div",{className:D("w-10 h-10 sm:w-12 sm:h-12 md:w-14 md:h-14 rounded-xl sm:rounded-2xl flex items-center justify-center mx-auto mb-2 sm:mb-3",e.color==="primary"&&"bg-primary/10",e.color==="secondary"&&"bg-secondary/10",e.color==="accent"&&"bg-accent/10",e.color==="muted"&&"bg-muted"),children:i.jsx(_,{className:D("w-5 h-5 sm:w-6 sm:h-6 md:w-7 md:h-7",e.color==="primary"&&"text-primary",e.color==="secondary"&&"text-secondary",e.color==="accent"&&"text-accent",e.color==="muted"&&"text-muted-foreground")})}),i.jsx(Sr,{className:"text-base sm:text-lg",children:e.name}),i.jsx("div",{className:"mt-1",children:i.jsxs("span",{className:"font-heading font-bold text-xl sm:text-2xl text-foreground",children:["$",e.price.toLocaleString()]})}),i.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[e.available,"/",e.totalAvailable," available"]}),!o&&!S&&!k&&i.jsxs("div",{className:"flex items-center justify-center gap-1 text-xs text-primary mt-2",children:[i.jsx("span",{children:"Click to expand"}),i.jsx(hn,{className:"w-4 h-4"})]})]}),i.jsxs(at,{className:"flex-1",children:[i.jsxs("div",{className:"space-y-2 mb-4",children:[i.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[i.jsx(Fn,{className:"w-4 h-4 text-primary shrink-0"}),i.jsxs("span",{className:"text-foreground font-medium",children:[e.compRegistrations," complimentary registrations"]})]}),i.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[i.jsx(U4,{className:"w-4 h-4 text-secondary shrink-0"}),i.jsxs("span",{className:"text-foreground font-medium",children:[e.discountCoupons," discount coupons"]})]})]}),i.jsxs("ul",{className:"space-y-2 mb-4",children:[e.features.slice(0,o?e.features.length:3).map((R,L)=>i.jsxs("li",{className:"flex items-start gap-2 text-sm",children:[i.jsx(Oo,{className:"w-4 h-4 text-success shrink-0 mt-0.5"}),i.jsx("span",{className:"text-muted-foreground",children:R})]},L)),!o&&e.features.length>3&&i.jsxs("li",{className:"text-xs text-muted-foreground pl-6",children:["+",e.features.length-3," more benefits..."]})]}),o&&i.jsxs("div",{className:"space-y-4 p-4 bg-muted/30 rounded-lg border-t mt
501-4",children:[i.jsxs("div",{className:"flex items-center gap-2 text-foreground font-medium",children:[i.jsx(yn,{className:"w-4 h-4"}),"Sponsor Details"]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{children:[i.jsx(Ye,{htmlFor:`contact-name-${e.name}`,children:"Your Name *"}),i.jsx(Ot,{id:`contact-name-${e.name}`,value:c,onChange:R=>u(R.target.value),placeholder:"John Smith"})]}),i.jsxs("div",{children:[i.jsx(Ye,{htmlFor:`company-${e.name}`,children:"Business Name *"}),i.jsx(Ot,{id:`company-${e.name}`,value:d,onChange:R=>f(R.target.value),placeholder:"Acme Corporation"})]}),i.jsx(dy,{id:`email-${e.name}`,label:"Contact Email",required:!0,value:w,onChange:g,confirmValue:"",onConfirmChange:()=>{},requireConfirmation:!1,placeholder:"[email protected]"}),i.jsxs("div",{children:[i.jsx(Ye,{htmlFor:`website-${e.name}`,children:"Business Website"}),i.jsx(Ot,{id:`website-${e.name}`,type:"url",value:m,onChange:R=>p(R.target.value),placeholder:"https://acme.com"})]}),i.jsx("div",{className:"pt-2 border-t border-border/60",children:b?i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ye,{htmlFor:`extra-${e.name}`,children:"Additional contribution (USD)"}),i.jsx(Ot,{id:`extra-${e.name}`,type:"number",min:"0",step:"1",value:y,onChange:R=>x(R.target.value),placeholder:"0"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Your additional contribution counts toward the same tier benefits."})]}):i.jsx("button",{type:"button",onClick:()=>v(!0),className:"text-sm text-primary hover:underline font-medium",children:"+ Want to give more?"})})]}),i.jsxs(ce,{onClick:N,className:"w-full gap-2",children:[i.jsx(Ao,{className:"w-4 h-4"}),"Add to Cart - $",T.toLocaleString()]})]}),!o&&!S&&!k&&i.jsx(ce,{variant:e.popular?"secondary":"outline",className:"w-full",onClick:()=>a(!0),children:"Select This Tier"}),k&&i.jsxs(ce,{variant:"outline",className:"w-full",disabled:!0,children:[i.jsx(Oo,{className:"w-4 h-4 mr-2"}),"Added to Cart"]})]})]})},ez=[25,50,100,250],ph=({donationType:e="general",beneficiaryId:t,beneficiaryName:r,showBeneficiarySelector:n=!1,title:s="Make a Donation",description:o="Support our mission with a tax-deductible donation",compact:a=!1,partnerId:l})=>{const{addItem:c,setEventId:u}=Vt(),{activeEvent:d}=ht(),[f,m]=h.useState(null),[p,w]=h.useState(""),[g,b]=h.useState(t?"beneficiary":e),[v,y]=h.useState([]),[x,_]=h.useState(t),[S,k]=h.useState(r),[N,E]=h.useState(!1),T=h.useRef(!1),R=()=>{T.current||(T.current=!0,Tj.started({beneficiary_id:x,beneficiary_name:S}))};h.useEffect(()=>{n&&L()},[n]),h.useEffect(()=>{if(x&&v.length>0){const P=v.find(M=>M.id===x);P&&k(P.full_name)}},[x,v]);const L=async()=>{E(!0);const{data:P,error:M}=await ie.from("beneficiaries").select("id, full_name, photo_url").order("created_at",{ascending:!1});P&&!M&&y(P),E(!1)},O=P=>{R(),m(P),w("")},A=P=>{R();const M=parseFloat(P);!isNaN(M)&&M>0?m(M):P===""&&m(null),w(P)},$=P=>{if(P==="general")b("general"),_(void 0),k(void 0);else{b("beneficiary"),_(P);const M=v.find(C=>C.id===P);k(M==null?void 0:M.full_name)}},z=()=>{if(!f||f<=0){re.error("Please enter a donation amount");return}u(d?d.id:"donation-general"),c({type:"donation",amount:Math.round(f*100),donationType:g,beneficiaryId:g==="beneficiary"?x:void 0,beneficiaryName:g==="beneficiary"?S:void 0,partnerId:l});const P=S?`$${f} donation in honor of ${S} added to cart!`:`$${f} donation added to cart!`;re.success(P),m(null),w("")};return i.jsxs(ot,{variant:a?"default":"elevated",children:[i.jsx(ur,{className:a?"pb-3":void 0,children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:D("rounded-full bg-accent/10 flex items-center justify-center",a?"w-10 h-10":"w-12 h-12"),children:i.jsx(vt,{className:D("text-accent",a?"w-5 h-5":"w-6 h-6")})}),i.jsxs("div",{children:[i.jsx(Sr,{className:a?"text-base":void 0,children:s}),i.jsx(qs,{className:a?"text-xs":void 0,children:o})]})]})}),i.jsxs(at,{className:D("space-y-4",a&&"pt-0"),children:[n&&i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Donate in honor of"}),i.jsxs(_o,{value:g==="general"?"general":x,onValueChange:$,disabled:N,children:[i.jsx(Rs,{children:i.jsx(So,{placeholder:"Select a beneficiary (optional)"})}),i.jsxs(Os,{children:[i.jsx(On,{value:"general",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(vt,{className:"w-4 h-4 text-primary"}),i.jsx("span",{children:"General Fund"})]})}),v.map(P=>i.jsx(On,{value:P.id,children:i.jsxs("div",{className:"flex items-center gap-2",children:[P.photo_url?i.jsx("img",{src:P.photo_url,alt:P.full_name,className:"w-5 h-5 rounded-full object-cover"}):i.jsx(Fn,{className:"w-4 h-4 text-secondary"}),i.jsx("span",{children:P.full_name})]})},P.id))]})]})]}),!n&&r&&i.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-secondary/10 border border-secondary/20",children:[i.jsx(Fn,{className:"w-5 h-5 text-secondary"}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-muted-foreground",children:"Donating in honor of"}),i.jsx("p",{className:"font-medium text-foreground",children:r})]})]}),i.jsx("div",{className:D("grid gap-2","grid-cols-4"),children:ez.map(P=>i.jsxs("button",{onClick:()=>O(P),className:D("rounded-lg border-2 text-center font-semibold transition-all",a?"py-2 px-1 text-sm":"py-3 px-2",f===P&&p===""?"border-accent bg-accent/10 text-accent":"border-border hover:border-accent/50 text-foreground"),children:["$",P]},P))}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground font-medium",children:"$"}),i.jsx(Ot,{type:"number",value:p,onChange:P=>A(P.target.value),placeholder:"Custom amount",className:"pl-8",min:"1"})]}),i.jsxs(ce,{onClick:z,variant:"secondary",className:"w-full gap-2",size:a?"default":"lg",disabled:!f||f<=0,children:[i.jsx(Ao,{className:"w-4 h-4"}),"Add $",f||0," Donation to Cart"]}),i.jsx("div",{className:D("p-3 rounded-lg border",g==="general"?"bg-emerald-50 dark:bg-emerald-950/30 border-emerald-200 dark:border-emerald-800":"bg-amber-50 dark:bg-amber-950/30 border-amber-200 dark:border-amber-800"),children:g==="general"?i.jsxs("p",{className:"text-xs text-emerald-800 dark:text-emerald-200 leading-relaxed",children:[i.jsx("strong",{children:"Tax Deductible:"})," Happy Smackah Foundation is a 501(c)(3) public charity. Please consult your tax professional regarding possible tax benefits. We are 100% volunteer with no paid staff."]}):i.jsxs("p",{className:"text-xs text-amber-800 dark:text-amber-200 leading-relaxed",children:[i.jsx("strong",{children:"Tax Notice:"})," Donations to specific beneficiaries are NOT tax deductible per IRS rules. All amounts (minus transaction fees) go directly to your selected recipient."]})})]})]})},tz=({sku:e,partnerId:t})=>{const{addItem:r,setEventId:n}=Vt(),{activeEvent:s}=ht(),o=l=>`$${(l/100).toFixed(0)}`,a=()=>{s&&n(s.id),r({type:"merchandise",skuId:e.id,skuName:e.name,description:e.description||void 0,price:e.price_cents,quantity:1,partnerId:t}),re.success(`${e.name} added to cart!`)};return i.jsxs(ot,{variant:"elevated",className:"transition-all hover:shadow-lg",children:[i.jsx(ur,{className:"pb-3",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-full bg-muted flex items-center justify-center",children:i.jsx(zd,{className:"w-5 h-5 text-primary"})}),i.jsxs("div",{children:[i.jsx(Sr,{className:"text-base",children:e.name}),e.description&&i.jsx(qs,{className:"text-xs",children:e.description})]})]}),i.jsx(Pt,{variant:"secondary",className:"text-lg font-bold",children:o(e.price_cents)})]})}),i.jsx(at,{className:"pt-0",children:i.jsxs(ce,{onClick:a,className:"w-full gap-2",variant:"outline",children:[i.jsx(Ao,{className:"w-4 h-4"}),"Add to Cart"]})})]})},B0=1e3,V0=1500,rz=({sku:e,shirtOptions:t,partnerId:r})=>{var E;const{addItem:n,setEventId:s,getCartShirtCount:o}=Vt(),{activeEvent:a}=ht(),[l,c]=h.useState(""),[u,d]=h.useState(""),[f,m]=h.useState([]),[p,w]=h.useState(!0),g=t.filter(T=>T.name.toLowerCase()!=="no shirt");h.useEffect(()=>{g.length===1&&!l&&c(g[0].id)},[g,l]),h.useEffect(()=>{if(!a)return;(async()=>{w(!0);const{data:R}=await ie.from("shirt_inventory").select("shirt_option_id, size, quantity, sold_count").eq("event_id",a.id);m(R||[]),w(!1)})()},[a]);const b=g.find(T=>T.id===l),v=(b==null?void 0:b.price_cents)||0,y=T=>{const R=Pn.find(O=>O.value===T);return((R==null?void 0:R.category)==="youth"?B0:V0)+v},x=u?y(u):null,_=(T,R)=>{const L=f.find($=>$.shirt_option_id===T&&$.size===R);if(!L)return{available:!0,remaining:999};const O=Math.max(0,L.quantity-L.sold_count),A=Math.max(0,O-o(T,R));return{available:A>0,remaining:A}},S=l&&u?_(l,u):{available:!0,remaining:999},k=T=>`$${(T/100).toFixed(0)}`,N=()=>
501{if(!l||!u){re.error("Please select a shirt option and size");return}if(!S.available){re.error("This size is out of stock");return}const T=Pn.find(R=>R.value===u);a&&s(a.id),n({type:"merchandise",skuId:e.id,skuName:e.name,price:y(u),quantity:1,partnerId:r,shirtSize:u,shirtOptionId:l,shirtOptionName:(b==null?void 0:b.name)||""}),re.success(`${e.name} (${(T==null?void 0:T.label)||u}) added to cart!`),d("")};return i.jsxs(ot,{variant:"elevated",className:"transition-all hover:shadow-lg",children:[i.jsx(ur,{className:"pb-3",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-full bg-muted flex items-center justify-center",children:i.jsx(ei,{className:"w-5 h-5 text-primary"})}),i.jsxs("div",{className:"flex-1",children:[i.jsx(Sr,{className:"text-base",children:e.name}),i.jsxs(qs,{className:"text-xs",children:["Youth sizes from ",k(B0)," · Adult sizes from ",k(V0),v>0&&b&&i.jsxs("span",{className:"block text-amber-600",children:[b.name," adds ",k(v)]})]})]}),x&&i.jsx(Pt,{variant:"secondary",className:"text-lg font-bold",children:k(x)})]})}),i.jsxs(at,{className:"space-y-4 pt-0",children:[g.length>1&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(Ye,{className:"text-sm",children:"Shirt Option"}),i.jsxs(_o,{value:l,onValueChange:c,children:[i.jsx(Rs,{children:i.jsx(So,{placeholder:"Select shirt option"})}),i.jsx(Os,{children:g.map(T=>i.jsx(On,{value:T.id,children:T.name},T.id))})]})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(Ye,{className:"text-sm",children:"Size"}),i.jsx("div",{className:"grid grid-cols-5 gap-1.5",children:Pn.map(T=>{const R=l?_(l,T.value):{available:!0,remaining:999},L=u===T.value,O=!R.available,A=R.remaining>0&&R.remaining<=5;return i.jsxs("button",{type:"button",disabled:O||!l,onClick:()=>d(T.value),className:D("relative py-2 px-1 text-xs font-medium rounded-md border transition-all text-center",L?"border-primary bg-primary text-primary-foreground ring-2 ring-primary/30":O?"border-border bg-muted text-muted-foreground cursor-not-allowed line-through opacity-50":"border-border hover:border-primary/50 hover:bg-muted/50 cursor-pointer",!l&&"opacity-50 cursor-not-allowed"),children:[T.value,A&&!L&&i.jsx("span",{className:"absolute -top-1 -right-1 w-2 h-2 rounded-full bg-amber-500"})]},T.value)})}),u&&i.jsxs("p",{className:"text-xs text-muted-foreground",children:[(E=Pn.find(T=>T.value===u))==null?void 0:E.label,S.remaining<=5&&S.available&&i.jsxs("span",{className:"text-amber-600 ml-1",children:["· Only ",S.remaining," left"]})]})]}),l&&u&&!S.available&&i.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[i.jsx(Xa,{className:"w-4 h-4"}),i.jsx("span",{children:"This size is currently out of stock"})]}),i.jsxs("p",{className:"text-xs text-muted-foreground bg-muted/50 border border-border rounded-md px-3 py-2 flex items-start gap-2",children:[i.jsx(ei,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),i.jsx("span",{children:"Shirts are limited and offered first-come, first-served. Sizes and styles may sell out and are not guaranteed."})]}),i.jsxs(ce,{onClick:N,className:"w-full gap-2",variant:"outline",disabled:!l||!u||!S.available||p,children:[p?i.jsx(Jr,{className:"w-4 h-4 animate-spin"}):i.jsx(Ao,{className:"w-4 h-4"}),"Add to Cart",x?` · ${k(x)}`:""]})]})]})},nz=[25,50,100,250],sz=({sku:e,partnerId:t})=>{const{addItem:r,setEventId:n}=Vt(),{activeEvent:s}=ht(),[o,a]=h.useState(null),[l,c]=h.useState(""),[u,d]=h.useState(""),[f,m]=h.useState([]),[p,w]=h.useState(!0);h.useEffect(()=>{(async()=>{w(!0);const{data:_,error:S}=await ie.from("beneficiaries").select("id, full_name, photo_url, event_id").eq("accepts_donations",!0).order("created_at",{ascending:!1});_&&!S&&m(_),w(!1)})()},[]);const g=f.find(x=>x.id===u),b=x=>{a(x),c("")},v=x=>{const _=parseFloat(x);!isNaN(_)&&_>0?a(_):x===""&&a(null),c(x)},y=()=>{if(!o||o<=0){re.error("Please enter a donation amount");return}if(!u){re.error("Please select a beneficiary");return}s&&n(s.id),r({type:"donation",amount:Math.round(o*100),donationType:"beneficiary",beneficiaryId:u,beneficiaryName:g==null?void 0:g.full_name,skuId:e.id,partnerId:t}),re.success(`$${o} donation in honor of ${g==null?void 0:g.full_name} added to cart!`),a(null),c("")};return i.jsxs(ot,{variant:"elevated",children:[i.jsx(ur,{children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-12 h-12 rounded-full bg-secondary/10 flex items-center justify-center",children:i.jsx(vt,{className:"w-6 h-6 text-secondary"})}),i.jsxs("div",{children:[i.jsx(Sr,{children:e.name}),i.jsx(qs,{children:e.description||"Donate in honor of a beneficiary"})]})]})}),i.jsxs(at,{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Select Beneficiary *"}),i.jsxs(_o,{value:u,onValueChange:d,disabled:p,children:[i.jsx(Rs,{children:i.jsx(So,{placeholder:p?"Loading...":"Choose who to honor"})}),i.jsx(Os,{className:"max-h-64",children:p?i.jsx("div",{className:"flex items-center justify-center py-4",children:i.jsx(Jr,{className:"w-4 h-4 animate-spin text-muted-foreground"})}):f.map(x=>i.jsx(On,{value:x.id,children:i.jsxs("div",{className:"flex items-center gap-2",children:[x.photo_url?i.jsx("img",{src:x.photo_url,alt:x.full_name,className:"w-5 h-5 rounded-full object-cover"}):i.jsx(Fn,{className:"w-4 h-4 text-secondary"}),i.jsx("span",{children:x.full_name})]})},x.id))})]})]}),g&&i.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-secondary/10 border border-secondary/20",children:[g.photo_url?i.jsx("img",{src:g.photo_url,alt:g.full_name,className:"w-10 h-10 rounded-full object-cover"}):i.jsx("div",{className:"w-10 h-10 rounded-full bg-secondary/20 flex items-center justify-center",children:i.jsx(Fn,{className:"w-5 h-5 text-secondary"})}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-muted-foreground",children:"Donating in honor of"}),i.jsx("p",{className:"font-medium text-foreground",children:g.full_name})]})]}),i.jsx("div",{className:"grid grid-cols-4 gap-2",children:nz.map(x=>i.jsxs("button",{onClick:()=>b(x),className:D("py-3 px-2 rounded-lg border-2 text-center font-semibold transition-all",o===x&&l===""?"border-secondary bg-secondary/10 text-secondary":"border-border hover:border-secondary/50 text-foreground"),children:["$",x]},x))}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground font-medium",children:"$"}
vendor: 4,453 bytes, line 501
501),i.jsx(Ot,{type:"number",value:l,onChange:x=>v(x.target.value),placeholder:"Custom amount",className:"pl-8",min:"1"})]}),i.jsxs(ce,{onClick:y,variant:"secondary",className:"w-full gap-2",size:"lg",disabled:!o||o<=0||!u,children:[i.jsx(Ao,{className:"w-4 h-4"}),"Add $",o||0," Donation to Cart"]}),i.jsx("div",{className:"p-3 rounded-lg bg-amber-50 dark:bg-amber-950/30 border border-amber-200 dark:border-amber-800",children:i.jsxs("p",{className:"text-xs text-amber-800 dark:text-amber-200 leading-relaxed",children:[i.jsx("strong",{children:"Tax Notice:"})," Donations earmarked to specific Happy Smackah beneficiaries are NOT tax deductible per IRS rules. All amounts (minus transaction fees) go directly to your selected recipient. Thank you for your generosity!"]})})]})]})};var rf="Dialog",[Oj,Aj]=Zt(rf),[oz,en]=Oj(rf),Ij=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,l=h.useRef(null),c=h.useRef(null),[u,d]=gn({prop:n,defaultProp:s??!1,onChange:o,caller:rf});return i.jsx(oz,{scope:t,triggerRef:l,contentRef:c,contentId:ir(),titleId:ir(),descriptionId:ir(),open:u,onOpenChange:d,onOpenToggle:h.useCallback(()=>d(f=>!f),[d]),modal:a,children:r})};Ij.displayName=rf;var Dj="DialogTrigger",Mj=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=en(Dj,r),o=be(t,s.triggerRef);return i.jsx(ue.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":my(s.open),...n,ref:o,onClick:Y(e.onClick,s.onOpenToggle)})});Mj.displayName=Dj;var fy="DialogPortal",[az,Lj]=Oj(fy,{forceMount:void 0}),$j=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,o=en(fy,t);return i.jsx(az,{scope:t,forceMount:r,children:h.Children.map(n,a=>i.jsx(It,{present:r||o.open,children:i.jsx(Od,{asChild:!0,container:s,children:a})}))})};$j.displayName=fy;var ld="DialogOverlay",Fj=h.forwardRef((e,t)=>{const r=Lj(ld,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=en(ld,e.__scopeDialog);return o.modal?i.jsx(It,{present:n||o.open,children:i.jsx(lz,{...s,ref:t})}):null});Fj.displayName=ld;var iz=To("DialogOverlay.RemoveScroll"),lz=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=en(ld,r);return i.jsx(Wd,{as:iz,allowPinchZoom:!0,shards:[s.contentRef],children:i.jsx(ue.div,{"data-state":my(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Fo="DialogContent",Uj=h.forwardRef((e,t)=>{const r=Lj(Fo,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=en(Fo,e.__scopeDialog);return i.jsx(It,{present:n||o.open,children:o.modal?i.jsx(cz,{...s,ref:t}):i.jsx(uz,{...s,ref:t})})});Uj.displayName=Fo;var cz=h.forwardRef((e,t)=>{const r=en(Fo,e.__scopeDialog),n=h.useRef(null),s=be(t,r.contentRef,n);return h.useEffect(()=>{const o=n.current;if(o)return Lg(o)},[]),i.jsx(zj,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Y(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Y(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0;(a.button===2||l)&&o.preventDefault()}),onFocusOutside:Y(e.onFocusOutside,o=>o.preventDefault())})}),uz=h.forwardRef((e,t)=>{const r=en(Fo,e.__scopeDialog),n=h.useRef(!1),s=h.useRef(!1);return i.jsx(zj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,l;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;((u=r.triggerRef.current)==null?void 0:u.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),zj=h.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,...a}=e,l=en(Fo,r),c=h.useRef(null),u=be(t,c);return Mg(),i.jsxs(i.Fragment,{children:[i.jsx(Bd,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:i.jsx(ec,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":my(l.open),...a,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(fz,{titleId:l.titleId}),i.jsx(mz,{contentRef:c,descriptionId:l.descriptionId})]})]})}),hy="DialogTitle",Bj=h.forwardRef((e,t)=>
501{const{__scopeDialog:r,...n}=e,s=en(hy,r);return i.jsx(ue.h2,{id:s.titleId,...n,ref:t})});Bj.displayName=hy;var Vj="DialogDescription",Hj=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=en(Vj,r);return i.jsx(ue.p,{id:s.descriptionId,...n,ref:t})});Hj.displayName=Vj;var Wj="DialogClose",qj=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=en(Wj,r);return i.jsx(ue.button,{type:"button",...n,ref:t,onClick:Y(e.onClick,()=>s.onOpenChange(!1))})});qj.displayName=Wj;function my(e){return e?"open":"closed"}var Kj="DialogTitleWarning",[dz,Gj]=bP(Kj,{contentName:Fo,titleName:hy,docsSlug:"dialog"}),fz=({titleId:e})=>{const t=Gj(Kj),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 502 503If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 504 505For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},hz="DialogDescriptionWarning",mz=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Gj(hz).contentName}}.`;return h.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},py=Ij,gy=Mj,yy=$j,dc=Fj,fc=Uj,hc=Bj,mc=Hj,nf=qj;const pz=py,gz=gy,yz=yy,Yj=h.forwardRef(({className:e,...t},r)=>i.jsx(dc,{className:D("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:r}));Yj.displayName=dc.displayName;const vz=nc("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Qj=h.forwardRef(({side:e="right",className:t,children:r,...n},s)=>i.jsxs(yz,{children:[i.jsx(Yj,{}),i.jsxs(fc,{ref:s,className:D(vz({side:e}),t),...n,children:[r,i.jsxs(nf,{className:"absolute right-4 top-4 roun
505ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[i.jsx(sc,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Qj.displayName=fc.displayName;const Jj=({className:e,...t})=>i.jsx("div",{className:D("flex flex-col space-y-2 text-center sm:text-left",e),...t});Jj.displayName="SheetHeader";const xz=({className:e,...t})=>i.jsx("div",{className:D("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});xz.displayName="SheetFooter";const Zj=h.forwardRef(({className:e,...t},r)=>i.jsx(hc,{ref:r,className:D("text-lg font-semibold text-foreground",e),...t}));Zj.displayName=hc.displayName;const wz=h.forwardRef(({className:e,...t},r)=>i.jsx(mc,{ref:r,className:D("text-sm text-muted-foreground",e),...t}));wz.displayName=mc.displayName;function bz(e,t){return h.useReducer((r,n)=>t[r][n]??r,e)}var vy="ScrollArea",[Xj,SB]=Zt(vy),[_z,jr]=Xj(vy),eN=h.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:s,scrollHideDelay:o=600,...a}=e,[l,c]=h.useState(null),[u,d]=h.useState(null),[f,m]=h.useState(null),[p,w]=h.useState(null),[g,b]=h.useState(null),[v,y]=h.useState(0),[x,_]=h.useState(0),[S,k]=h.useState(!1),[N,E]=h.useState(!1),T=be(t,L=>c(L)),R=oc(s);return i.jsx(_z,{scope:r,type:n,dir:R,scrollHideDelay:o,scrollArea:l,viewport:u,onViewportChange:d,content:f,onContentChange:m,scrollbarX:p,onScrollbarXChange:w,scrollbarXEnabled:S,onScrollbarXEnabledChange:k,scrollbarY:g,onScrollbarYChange:b,scrollbarYEnabled:N,onScrollbarYEnabledChange:E,onCornerWidthChange:y,onCornerHeightChange:_,children:i.jsx(ue.div,{dir:R,...a,ref:T,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});eN.displayName=vy;var tN="ScrollAreaViewport",rN=h.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:s,...o}=e,a=jr(tN,r),l=h.useRef(null),c=be(t,l,a.onViewportChange);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),i.jsx(ue.div,{"data-radix-scroll-area-viewport":"",...o,ref:c,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:i.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});rN.displayName=tN;var xn="ScrollAreaScrollbar",xy=h.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=jr(xn,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:a}=s,l=e.orientation==="horizontal";return h.useEffect(()=>(l?o(!0):a(!0),()=>{l?o(!1):a(!1)}),[l,o,a]),s.type==="hover"?i.jsx(Sz,{...n,ref:t,forceMount:r}):s.type==="scroll"?i.jsx(kz,{...n,ref:t,forceMount:r}):s.type==="auto"?i.jsx(nN,{...n,ref:t,forceMount:r}):s.type==="always"?i.jsx(wy,{...n,ref:t}):null});xy.displayName=xn;var Sz=h.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=jr(xn,e.__scopeScrollArea),[o,a]=h.useState(!1);return h.useEffect(()=>{const l=s.scrollArea;let c=0;if(l){const u=()=>{window.clearTimeout(c),a(!0)},d=()=>{c=window.setTimeout(()=>a(!1),s.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",d)}}},[s.scrollArea,s.scrollHideDelay]),i.jsx(It,{present:r||o,children:i.jsx(nN,{"data-state":o?"visible":"hidden",...n,ref:t})})}),kz=h.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=jr(xn,e.__scopeScrollArea),o=e.orientation==="horizontal",a=of(()=>c("SCROLL_END"),100),[l,c]=bz("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return h.useEffect(()=>{if(l==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[l,s.scrollHideDelay,c]),h.useEffect(()=>{const u=s.viewport,d=o?"scrollLeft":"scrollTop";if(u){let f=u[d];const m=()=>{const p=u[d];f!==p&&(c("SCROLL"),a()),f=p};return u.addEventListener("scroll",m),()=>u.removeEventListener("scroll",m)}},[s.viewport,o,c,a]),i.jsx(It,{present:r||l!=="hidden",children:i.jsx(wy,{"data-state":l==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:Y(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Y(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),nN=h.forwardRef((e,t)=>
vendor: 4,771 bytes, line 505
505{const r=jr(xn,e.__scopeScrollArea),{forceMount:n,...s}=e,[o,a]=h.useState(!1),l=e.orientation==="horizontal",c=of(()=>{if(r.viewport){const u=r.viewport.offsetWidth<r.viewport.scrollWidth,d=r.viewport.offsetHeight<r.viewport.scrollHeight;a(l?u:d)}},10);return ai(r.viewport,c),ai(r.content,c),i.jsx(It,{present:n||o,children:i.jsx(wy,{"data-state":o?"visible":"hidden",...s,ref:t})})}),wy=h.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,s=jr(xn,e.__scopeScrollArea),o=h.useRef(null),a=h.useRef(0),[l,c]=h.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=lN(l.viewport,l.content),d={...n,sizes:l,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:m=>o.current=m,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:m=>a.current=m};function f(m,p){return Pz(m,a.current,l,p)}return r==="horizontal"?i.jsx(jz,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const m=s.viewport.scrollLeft,p=H0(m,l,s.dir);o.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:m=>{s.viewport&&(s.viewport.scrollLeft=m)},onDragScroll:m=>{s.viewport&&(s.viewport.scrollLeft=f(m,s.dir))}}):r==="vertical"?i.jsx(Nz,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const m=s.viewport.scrollTop,p=H0(m,l);o.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:m=>{s.viewport&&(s.viewport.scrollTop=m)},onDragScroll:m=>{s.viewport&&(s.viewport.scrollTop=f(m))}}):null}),jz=h.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,o=jr(xn,e.__scopeScrollArea),[a,l]=h.useState(),c=h.useRef(null),u=be(t,c,o.onScrollbarXChange);return h.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),i.jsx(oN,{"data-orientation":"horizontal",...s,ref:u,sizes:r,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":sf(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(o.viewport){const m=o.viewport.scrollLeft+d.deltaX;e.onWheelScroll(m),uN(m,f)&&d.preventDefault()}},onResize:()=>{c.current&&o.viewport&&a&&n({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:ud(a.paddingLeft),paddingEnd:ud(a.paddingRight)}})}})}),Nz=h.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,o=jr(xn,e.__scopeScrollArea),[a,l]=h.useState(),c=h.useRef(null),u=be(t,c,o.onScrollbarYChange);return h.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),i.jsx(oN,{"data-orientation":"vertical",...s,ref:u,sizes:r,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":sf(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(o.viewport){const m=o.viewport.scrollTop+d.deltaY;e.onWheelScroll(m),uN(m,f)&&d.preventDefault()}},onResize:()=>{c.current&&o.viewport&&a&&n({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:ud(a.paddingTop),paddingEnd:ud(a.paddingBottom)}})}})}),[Cz,sN]=Xj(xn),oN=h.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:s,onThumbChange:o,onThumbPointerUp:a,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:f,...m}=e,p=jr(xn,r),[w,g]=h.useState(null),b=be(t,T=>g(T)),v=h.useRef(null),y=h.useRef(""),x=p.viewport,_=n.content-n.viewport,S=pt(d),k=pt(c),N=of(f,10);function E(T){if(v.current){const R=T.clientX-v.current.left,L=T.clientY-v.current.top;u({x:R,y:L})}}return h.useEffect(()=>{const T=R=>{const L=R.target;(w==null?void 0:w.contains(L))&&S(R,_)};return document.addEventListener("wheel",T,{passive:!1}),()=>document.removeEventListener("wheel",T,{passive:!1})},[x,w,_,S]),h.useEffect(k,[n,k]),ai(w,N),ai(p.content,N),i.jsx(Cz,{scope:r,scrollbar:w,hasThumb:s,onThumbChange:pt(o),onThumbPointerUp:pt(a),onThumbPositionChange:k,onThumbPointerDown:pt(l),children:i.jsx(ue.div,{...m,ref:b,style:{position:"absolute",...m.style},onPointerDown:Y(e.onPointerDown,T=>{T.button===0&&(T.target.setPointerCapture(T.pointerId),v.current=w.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),E(T))}),onPointerMove:Y(e.onPointerMove,E),onPointerUp:Y(e.onPointerUp,T=>{const R=T.target;R.hasPointerCapture(T.pointerId)&&R.releasePointerCapture(T.pointerId),document.body.style.webkitUserSelect=y.current,p.viewport&&(p.viewport.style.scrollBehavior=""),v.current=null})})})}),cd="ScrollAreaThumb",aN=h.forwardRef((e,t)=>
vendor: 4,067 bytes, line 505
505{const{forceMount:r,...n}=e,s=sN(cd,e.__scopeScrollArea);return i.jsx(It,{present:r||s.hasThumb,children:i.jsx(Ez,{ref:t,...n})})}),Ez=h.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...s}=e,o=jr(cd,r),a=sN(cd,r),{onThumbPositionChange:l}=a,c=be(t,f=>a.onThumbChange(f)),u=h.useRef(void 0),d=of(()=>{u.current&&(u.current(),u.current=void 0)},100);return h.useEffect(()=>{const f=o.viewport;if(f){const m=()=>{if(d(),!u.current){const p=Rz(f,l);u.current=p,l()}};return l(),f.addEventListener("scroll",m),()=>f.removeEventListener("scroll",m)}},[o.viewport,d,l]),i.jsx(ue.div,{"data-state":a.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:Y(e.onPointerDownCapture,f=>{const p=f.target.getBoundingClientRect(),w=f.clientX-p.left,g=f.clientY-p.top;a.onThumbPointerDown({x:w,y:g})}),onPointerUp:Y(e.onPointerUp,a.onThumbPointerUp)})});aN.displayName=cd;var by="ScrollAreaCorner",iN=h.forwardRef((e,t)=>{const r=jr(by,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?i.jsx(Tz,{...e,ref:t}):null});iN.displayName=by;var Tz=h.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,s=jr(by,r),[o,a]=h.useState(0),[l,c]=h.useState(0),u=!!(o&&l);return ai(s.scrollbarX,()=>{var f;const d=((f=s.scrollbarX)==null?void 0:f.offsetHeight)||0;s.onCornerHeightChange(d),c(d)}),ai(s.scrollbarY,()=>{var f;const d=((f=s.scrollbarY)==null?void 0:f.offsetWidth)||0;s.onCornerWidthChange(d),a(d)}),u?i.jsx(ue.div,{...n,ref:t,style:{width:o,height:l,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function ud(e){return e?parseInt(e,10):0}function lN(e,t){const r=e/t;return isNaN(r)?0:r}function sf(e){const t=lN(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function Pz(e,t,r,n="ltr"){const s=sf(r),o=s/2,a=t||o,l=s-a,c=r.scrollbar.paddingStart+a,u=r.scrollbar.size-r.scrollbar.paddingEnd-l,d=r.content-r.viewport,f=n==="ltr"?[0,d]:[d*-1,0];return cN([c,u],f)(e)}function H0(e,t,r="ltr"){const n=sf(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,a=t.content-t.viewport,l=o-n,c=r==="ltr"?[0,a]:[a*-1,0],u=Xm(e,c);return cN([0,a],[0,l])(u)}function cN(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function uN(e,t){return e>0&&e<t}var Rz=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function s(){const o={left:e.scrollLeft,top:e.scrollTop},a=r.left!==o.left,l=r.top!==o.top;(a||l)&&t(),r=o,n=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(n)};function of(e,t){const r=pt(e),n=h.useRef(0);return h.useEffect(()=>()=>window.clearTimeout(n.current),[]),h.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function ai(e,t){const r=pt(t);yt(()=>{let n=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return s.observe(e),()=>{window.cancelAnimationFrame(n),s.unobserve(e)}}},[e,r])}var dN=eN,Oz=rN,Az=iN;const fN=h.forwardRef(({className:e,children:t,...r},n)=>i.jsxs(dN,{ref:n,className:D("relative overflow-hidden",e),...r,children:[i.jsx(Oz,{className:"h-full w-full rounded-[inherit]",children:t}),i.jsx(hN,{}),i.jsx(Az,{})]}));fN.displayName=dN.displayName;const hN=h.forwardRef(({className:e,orientation:t="vertical",...r},n)=>i.jsx(xy,{ref:n,orientation:t,className:D("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:i.jsx(aN,{className:"relative flex-1 rounded-full bg-border"})}));hN.displayName=xy.displayName;const Iz=()=>{const[e,t]=h.useState(!1);return{validatePromo:async n=>{t(!0);try{const{data:s,error:o}=await ie.functions.invoke("validate-promo",{body:{code:n}});return o?{valid:!1,error:o.message}:s}
505catch(s){return{valid:!1,error:s instanceof Error?s.message:"Failed to validate promo code"}}finally{t(!1)}},loading:e}};function mN({showLabel:e=!1,className:t,compact:r=!1}){const{promo:n,setPromo:s,items:o,isItemEligible:a,getDiscount:l}=Vt(),{validatePromo:c,loading:u}=Iz(),[d,f]=h.useState(""),[m,p]=h.useState(null),w=n&&o.length>0&&l()===0,g=async()=>{if(!d.trim()){re.error("Please enter a promo code");return}const x=await c(d.trim().toUpperCase());if(x.valid){x.partnerSlug&&x.partnerName?p({slug:x.partnerSlug,name:x.partnerName}):p(null);const _={code:d.trim().toUpperCase(),percentOff:x.percentOff,amountOff:x.amountOff,appliesToTypes:x.appliesToTypes,includedSkuIds:x.includedSkuIds,excludedSkuIds:x.excludedSkuIds,discountMode:x.discountMode,maxItemsPerOrder:x.maxItemsPerOrder};s(_);const S=o.some(k=>{var E,T,R,L,O,A;if(!((E=_.appliesToTypes)!=null&&E.length)&&!((T=_.includedSkuIds)!=null&&T.length)&&!((R=_.excludedSkuIds)!=null&&R.length))return!0;const N=k.type==="registration"||k.type==="merchandise"||k.type==="donation"?k.skuId:void 0;return(L=_.excludedSkuIds)!=null&&L.length&&N&&_.excludedSkuIds.includes(N)?!1:(O=_.includedSkuIds)!=null&&O.length?N?_.includedSkuIds.includes(N):!1:(A=_.appliesToTypes)!=null&&A.length?_.appliesToTypes.includes(k.type):!0});o.length>0&&!S?x.partnerSlug&&x.partnerName?re.warning(`This code is valid on the ${x.partnerName} registration page.`):re.warning("Code accepted, but it doesn't apply to the items in your cart."):re.success("Promo code applied!"),f("")}else re.error(x.error||"Invalid promo code")},b=()=>{s(null),p(null),re.info("Promo code removed")},v=()=>{if(!n)return"";if(n.percentOff)return`${n.percentOff}% off`;if(n.amountOff){const x=`$${(n.amountOff/100).toFixed(2)}`;if(n.discountMode==="per_item"){const _=n.maxItemsPerOrder;return _?`${x} off each (up to ${_})`:`${x} off each`}return`${x} off`}return""},y=()=>
505{if(!(n!=null&&n.appliesToTypes)||n.appliesToTypes.length===0)return null;const x={registration:"Registrations",sponsorship:"Sponsorships",donation:"Donations",merchandise:"Merchandise"};return`${n.appliesToTypes.map(S=>x[S]||S).join(", ")} only`};return i.jsxs("div",{className:D("space-y-2",t),children:[e&&i.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[i.jsx(co,{className:"w-4 h-4"}),i.jsx("span",{children:"Promo Code"})]}),n?i.jsxs("div",{className:D("flex flex-col rounded-lg",w?"bg-amber-500/10 border border-amber-500/30":"bg-success/10 border border-success/30",r?"p-2 gap-1":"p-3 gap-2"),children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[w?i.jsx(Ag,{className:D("shrink-0 text-amber-500",r?"w-4 h-4":"w-5 h-5")}):i.jsx(Oo,{className:D("shrink-0 text-success",r?"w-4 h-4":"w-5 h-5")}),i.jsx("span",{className:D("font-medium truncate",r&&"text-sm",w?"text-amber-600":"text-success"),children:n.code}),i.jsxs("span",{className:D("text-muted-foreground shrink-0",r?"text-xs":"text-sm"),children:["(",v(),")"]})]}),i.jsx(ce,{variant:"ghost",size:r?"icon":"sm",onClick:b,className:"shrink-0",children:i.jsx(sc,{className:"w-4 h-4"})})]}),w&&i.jsx("span",{className:D("text-amber-600 italic pl-6 font-medium","text-xs"),children:m?i.jsxs(i.Fragment,{children:["This code is valid on the"," ",i.jsx(ee,{to:`/partner/${m.slug}`,className:"underline font-semibold hover:text-amber-700",children:m.name})," ","registration page."]}):"This code doesn't apply to items in your cart"}),!w&&y()&&i.jsx("span",{className:D("text-muted-foreground italic pl-6","text-xs"),children:y()})]}):i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Ot,{placeholder:"Enter promo code",value:d,onChange:x=>f(x.target.value.toUpperCase()),onKeyDown:x=>x.key==="Enter"&&g(),className:D("flex-1",r&&"h-9 text-sm")}),i.jsx(ce,{onClick:g,disabled:u,size:r?"sm":"default",children:u?i.jsx(Jr,{className:"w-4 h-4 animate-spin"}):"Apply"})]})]})}var pN="AlertDialog",[Dz,kB]=Zt(pN,[Aj]),Hn=Aj(),gN=e=>{const{__scopeAlertDialog:t,...r}=e,n=Hn(t);return i.jsx(py,{...n,...r,modal:!0})};gN.displayName=pN;var Mz="AlertDialogTrigger",yN=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Hn(r);return i.jsx(gy,{...s,...n,ref:t})});yN.displayName=Mz;var Lz="AlertDialogPortal",vN=e=>{const{__scopeAlertDialog:t,...r}=e,n=Hn(t);return i.jsx(yy,{...n,...r})};vN.displayName=Lz;var $z="AlertDialogOverlay",xN=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Hn(r);return i.jsx(dc,{...s,...n,ref:t})});xN.displayName=$z;var Da="AlertDialogContent",[Fz,Uz]=Dz(Da),zz=g_("AlertDialogContent"),wN=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,o=Hn(r),a=h.useRef(null),l=be(t,a),c=h.useRef(null);return i.jsx(dz,{contentName:Da,titleName:bN,docsSlug:"alert-dialog",children:i.jsx(Fz,{scope:r,cancelRef:c,children:i.jsxs(fc,{role:"alertdialog",...o,...s,ref:l,onOpenAutoFocus:Y(s.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=c.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[i.jsx(zz,{children:n}),i.jsx(Vz,{contentRef:a})]})})})});wN.displayName=Da;var bN="AlertDialogTitle",_N=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Hn(r);return i.jsx(hc,{...s,...n,ref:t})});_N.displayName=bN;var SN="AlertDialogDescription",kN=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Hn(r);return i.jsx(mc,{...s,...n,ref:t})});kN.displayName=SN;var Bz="AlertDialogAction",jN=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Hn(r);return i.jsx(nf,{...s,...n,ref:t})});jN.displayName=Bz;var NN="AlertDialogCancel",CN=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=Uz(NN,r),o=Hn(r),a=be(t,s);return i.jsx(nf,{...o,...n,ref:a})});CN.displayName=NN;var Vz=({contentRef:e})=>{const t=`\`${Da}\` requires a description for the component to be accessible for screen reader users. 506 507You can add a description to the \`${Da}\` by passing a \`${SN}\` component as a child, which also benefits sighted users by adding visible context to the dialog. 508 509Alternatively, 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 \`${Da}\`. 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. 510 511For more information, see https://radix-ui.com/primitives/docs/components/
511alert-dialog`;return h.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Hz=gN,Wz=yN,qz=vN,EN=xN,TN=wN,PN=jN,RN=CN,ON=_N,AN=kN;const Kz=Hz,Gz=Wz,Yz=qz,IN=h.forwardRef(({className:e,...t},r)=>i.jsx(EN,{className:D("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:r}));IN.displayName=EN.displayName;const DN=h.forwardRef(({className:e,...t},r)=>i.jsxs(Yz,{children:[i.jsx(IN,{}),i.jsx(TN,{ref:r,className:D("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})]}));DN.displayName=TN.displayName;const MN=({className:e,...t})=>i.jsx("div",{className:D("flex flex-col space-y-2 text-center sm:text-left",e),...t});MN.displayName="AlertDialogHeader";const LN=({className:e,...t})=>i.jsx("div",{className:D("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});LN.displayName="AlertDialogFooter";const $N=h.forwardRef(({className:e,...t},r)=>i.jsx(ON,{ref:r,className:D("text-lg font-semibold",e),...t}));$N.displayName=ON.displayName;const FN=h.forwardRef(({className:e,...t},r)=>i.jsx(AN,{ref:r,className:D("text-sm text-muted-foreground",e),...t}));FN.displayName=AN.displayName;const UN=h.forwardRef(({className:e,...t},r)=>i.jsx(PN,{ref:r,className:D(Pg(),e),...t}));UN.displayName=PN.displayName;const zN=h.forwardRef(({className:e,...t},r)=>i.jsx(RN,{ref:r,className:D(Pg({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));zN.displayName=RN.displayName;function Gi({itemName:e,onConfirm:t,size:r="icon",className:n}){return i.jsxs(Kz,{children:[i.jsx(Gz,{asChild:!0,children:i.jsx(ce,{variant:"ghost",size:r,className:D(r==="icon"&&"h-8 w-8",n),children:i.jsx(B4,{className:"w-4 h-4 text-destructive"})})}),i.jsxs(DN,{children:[i.jsxs(MN,{children:[i.jsx($N,{children:"Remove from cart?"}),i.jsxs(FN,{children:["Are you sure you want to remove ",i.jsx("span",{className:"font-medium text-foreground",children:e})," from your cart?"]})]}),i.jsxs(LN,{children:[i.jsx(zN,{children:"Cancel"}),i.jsx(UN,{onClick:t,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]})]})}const Qz=py,Jz=gy,Zz=yy,BN=h.forwardRef(({className:e,...t},r)=>i.jsx(dc,{ref:r,className:D("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}));BN.displayName=dc.displayName;const VN=h.forwardRef(({className:e,children:t,...r},n)=>i.jsxs(Zz,{children:[i.jsx(BN,{}),i.jsxs(fc,{ref:n,className:D("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,i.jsxs(nf,{className:"absolute right-4 top-4 roun
511ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[i.jsx(sc,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));VN.displayName=fc.displayName;const HN=({className:e,...t})=>i.jsx("div",{className:D("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});HN.displayName="DialogHeader";const WN=({className:e,...t})=>i.jsx("div",{className:D("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});WN.displayName="DialogFooter";const qN=h.forwardRef(({className:e,...t},r)=>i.jsx(hc,{ref:r,className:D("text-lg font-semibold leading-none tracking-tight",e),...t}));qN.displayName=hc.displayName;const Xz=h.forwardRef(({className:e,...t},r)=>i.jsx(mc,{ref:r,className:D("text-sm text-muted-foreground",e),...t}));Xz.displayName=mc.displayName;const KN=({item:e,className:t})=>{const{updateItem:r,eventId:n}=Vt(),{user:s}=Vn(),[o,a]=h.useState(""),[l,c]=h.useState(!1),[u,d]=h.useState([]),[f,m]=h.useState([]),[p,w]=h.useState(!1),[g,b]=h.useState(!1),[v,y]=h.useState({firstName:e.participant.firstName,lastName:e.participant.lastName,email:e.participant.email,shirtSize:e.participant.shirtSize,shirtOptionId:e.participant.shirtOptionId,shirtOptionName:e.participant.shirtOptionName}),[x,_]=h.useState(e.tierId),[S,k]=h.useState(e.tierName),[N,E]=h.useState(e.basePrice);h.useEffect(()=>{l&&n&&T()},[l,n,e.skuId]);const T=async()=>{var C;if(n){w(!0);try{const[j,I,F]=await Promise.all([ie.from("shirt_options").select("id, name, price_cents").eq("event_id",n).eq("is_available",!0).order("sort_order",{ascending:!0}),e.skuId?ie.from("registration_skus").select("includes_shirt").eq("id",e.skuId).maybeSingle():Promise.resolve({data:null,error:null}),e.skuId?ie.from("age_pricing_tiers").select("id, name, price_cents, min_age, max_age").eq("sku_id",e.skuId).order("sort_order",{ascending:!0}):Promise.resolve({data:null,error:null})]);if(j.error)throw j.error;if(d(j.data||[]),b(((C=I.data)==null?void 0:C.includes_shirt)===!0),F.error)throw F.error;m(F.data||[])}catch(j){console.error("Error fetching options:",j)}finally{w(!1)}}},R=C=>{const j=u.find(I=>I.id===C);j&&y({...v,shirtOptionId:j.id,shirtOptionName:j.name})},L=C=>{const j=f.find(I=>I.id===C);j&&(_(j.id),k(j.name),E(j.price_cents))},O=()=>{var I;if(!v.firstName.trim()||!v.lastName.trim()){re.error("Please enter participant name");return}if(!((I=v.email)!=null&&I.trim())){re.error("Please enter email address");return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v.email.trim())){re.error("Please enter a valid email address");return}{const F=((s==null?void 0:s.email)||"").trim().toLowerCase(),J=v.email.trim().toLowerCase()!==(e.participant.email||"").trim().toLowerCase()&&v.email.trim().toLowerCase()!==F;if(!Rj(v.email,o,J)){re.error("Participant emails do not match. Please re-type to confirm.");return}}if(g&&!M&&!v.shirtSize){re.error("Please select a shirt size");return}let j=e.shirtPrice;if(v.shirtOptionId!==e.participant.shirtOptionId){const F=u.find(B=>B.id===v.shirtOptionId);
511j=(F==null?void 0:F.price_cents)||0}r(e.id,{participant:{...e.participant,firstName:v.firstName,lastName:v.lastName,email:v.email,shirtSize:v.shirtSize,shirtOptionId:v.shirtOptionId,shirtOptionName:v.shirtOptionName},tierId:x,tierName:S,basePrice:N,shirtPrice:j}),re.success("Participant updated"),c(!1)},A=C=>{c(C),C&&(y({firstName:e.participant.firstName,lastName:e.participant.lastName,email:e.participant.email,shirtSize:e.participant.shirtSize,shirtOptionId:e.participant.shirtOptionId,shirtOptionName:e.participant.shirtOptionName}),a(""),_(e.tierId),k(e.tierName),E(e.basePrice))},$=g,z=f.length>0,P=u.find(C=>C.id===v.shirtOptionId),M=(P==null?void 0:P.name.toLowerCase())==="no shirt";return i.jsxs(Qz,{open:l,onOpenChange:A,children:[i.jsx(Jz,{asChild:!0,children:i.jsxs(ce,{variant:"ghost",size:"icon",className:D("h-8 w-8 text-muted-foreground hover:text-foreground",t),children:[i.jsx(D4,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Edit participant"})]})}),i.jsxs(VN,{className:"sm:max-w-md",children:[i.jsx(HN,{children:i.jsxs(qN,{className:"flex items-center gap-2",children:[i.jsx(Hr,{className:"h-5 w-5"}),"Edit Participant"]})}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{className:"grid sm:grid-cols-2 gap-3",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ye,{htmlFor:"edit-firstName",children:"First Name *"}),i.jsx(Ot,{id:"edit-firstName",value:v.firstName,onChange:C=>y({...v,firstName:C.target.value}),placeholder:"First name"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ye,{htmlFor:"edit-lastName",children:"Last Name *"}),i.jsx(Ot,{id:"edit-lastName",value:v.lastName,onChange:C=>y({...v,lastName:C.target.value}),placeholder:"Last name"})]})]}),i.jsx(dy,{id:"edit-email",label:"Email",required:!0,value:v.email,onChange:C=>y({...v,email:C}),confirmValue:o,onConfirmChange:a,requireConfirmation:!!v.email.trim()&&v.email.trim().toLowerCase()!==(e.participant.email||"").trim().toLowerCase()&&v.email.trim().toLowerCase()!==((s==null?void 0:s.email)||"").trim().toLowerCase(),placeholder:"[email protected]"}),z&&i.jsxs("div",{className:"space-y-2",children:[i.jsxs(Ye,{htmlFor:"edit-ageTier",children:[i.jsx(Fn,{className:"w-4 h-4 inline mr-1"}),"Age Group *"]}),i.jsxs(_o,{value:x||"",onValueChange:L,disabled:p,children:[i.jsx(Rs,{id:"edit-ageTier",children:i.jsx(So,{placeholder:p?"Loading...":"Select age group"})}),i.jsx(Os,{children:f.map(C=>i.jsxs(On,{value:C.id,children:[C.name," - $",(C.price_cents/100).toFixed(2)]},C.id))})]})]}),$&&i.jsxs(i.Fragment,{children:[e.participant.shirtOptionId&&u.length>0&&i.jsxs("div",{className:"space-y-2",children:[i.jsxs(Ye,{htmlFor:"edit-shirtOption",children:[i.jsx(ei,{className:"w-4 h-4 inline mr-1"}),"T-Shirt Type *"]}),i.jsxs(_o,{value:v.shirtOptionId||"",onValueChange:R,disabled:p,children:[i.jsx(Rs,{id:"edit-shirtOption",children:i.jsx(So,{placeholder:p?"Loading...":"Select type"})}),i.jsx(Os,{children:u.map(C=>i.jsxs(On,{value:C.id,children:[C.name,C.price_cents>0&&` (+$${(C.price_cents/100).toFixed(2)})`]},C.id))})]})]}),!M&&i.jsxs("div",{className:"space-y-2",children:[i.jsxs(Ye,{htmlFor:"edit-shirtSize",children:[i.jsx(ei,{className:"w-4 h-4 inline mr-1"}),"T-Shirt Size *"]}),i.jsxs(_o,{value:v.shirtSize||"",onValueChange:C=>y({...v,shirtSize:C}),children:[i.jsx(Rs,{id:"edit-shirtSize",className:v.shirtSize?"":"border-destructive",children:i.jsx(So,{placeholder:"Select a size"})}),i.jsx(Os,{children:Pn.map(C=>i.jsx(On,{value:C.value,children:C.label},C.value))})]})]})]})]}),i.jsxs(WN,{children:[i.jsx(ce,{variant:"outline",onClick:()=>c(!1),children:"Cancel"}),i.jsx(ce,{onClick:O,children:"Save Changes"})]})]})]})},W0=({onCheckout:e,checkoutLoading:t})=>{const r=Hs(),{user:n}=Vn(),{items:s,promo:o,removeItem:a,getSubtotal:l,getDiscount:c,getTotal:u,getItemCount:d,getItemDiscount:f}=Vt(),[m,p]=h.useState(!1),[w,g]=h.useState(""),[b,v]=h.useState(""),[y,x]=h.useState(!1);h.useEffect(()=>{let O=!1;return(async()=>{if(!n){p(!1);return}const{data:$}=await ie.from("profiles").select("first_name, last_name").eq("user_id",n.id).maybeSingle();if(O)return;const z=(($==null?void 0:$.first_name)||"").trim(),P=(($==null?void 0:$.last_name)||"").trim();!z||!P?(p(!0),g(z),v(P)):p(!1)})(),()=>{O=!0}},[n]);const _=async()=>
511{if(!n)return;const O=w.trim(),A=b.trim();if(!O||!A){re.error("Please enter both your first and last name");return}x(!0);const{error:$}=await ie.from("profiles").update({first_name:O,last_name:A}).eq("user_id",n.id);if(x(!1),$){re.error("Could not save your name. Please try again.");return}re.success("Thanks â your name has been saved."),p(!1)},S=()=>{if(n){if(m){re.error("Please complete your name before checking out.");return}e()}else r("/auth?mode=signup",{state:{from:{pathname:"/checkout"}}})},k=O=>`$${(O/100).toFixed(2)}`,N=O=>{const A=f(O),$=A>0;if(O.type==="registration"){const z=[O.participant.firstName,O.participant.lastName].filter(Boolean).join(" ")||"Participant",P=O.basePrice+O.shirtPrice,M=P-A;return i.jsxs("div",{className:D("flex items-start gap-3 p-3 rounded-lg bg-muted/50 group",$&&"ring-1 ring-green-500/30 bg-green-50/50 dark:bg-green-950/20"),children:[i.jsx("div",{className:"w-10 h-10 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0",children:i.jsx(Hr,{className:"w-5 h-5 text-primary"})}),i.jsx("div",{className:"flex-1 min-w-0",children:i.jsxs("div",{className:"flex items-start justify-between gap-2",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("p",{className:"font-medium text-foreground truncate",children:z}),i.jsx("p",{className:"text-xs text-muted-foreground",children:O.skuName}),O.participant.shirtSize&&i.jsxs("p",{className:"text-sm font-medium text-foreground mt-1",children:["Shirt: ",GU(O.participant.shirtSize)," (",O.participant.shirtSize,")",O.participant.shirtOptionName?` â ${O.participant.shirtOptionName}`:""]}),i.jsxs("div",{className:"flex items-center gap-1 mt-1 flex-wrap",children:[O.tierName&&i.jsx(Pt,{variant:"secondary",className:"text-xs",children:O.tierName}),$&&i.jsxs(Pt,{variant:"secondary",className:"text-xs bg-green-500/10 text-green-600 border-green-500/20",children:[i.jsx(co,{className:"w-3 h-3 mr-1"}),"-",k(A)]})]})]}),i.jsxs("div",{className:"text-right flex-shrink-0",children:[$?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"text-xs text-muted-foreground line-through",children:k(P)}),i.jsx("p",{className:"font-semibold text-green-600",children:k(M)})]}):i.jsx("p",{className:"font-semibold text-foreground",children:k(P)}),O.shirtPrice>0&&!O.participant.shirtSize&&i.jsxs("p",{className:"text-xs text-muted-foreground",children:["+",O.participant.shirtOptionName]})]})]})}),i.jsxs("div",{className:"flex items-center gap-1 md:opacity-0 md:group-hover:opacity-100 transition-opacity",children:[i.jsx(KN,{item:O}),i.jsx(Gi,{itemName:z,onConfirm:()=>a(O.id)})]})]},O.id)}if(O.type==="sponsorship"){const z=O.price,P=z-A;return i.jsxs("div",{className:D("flex items-start gap-3 p-3 rounded-lg bg-muted/50 group",$&&"ring-1 ring-green-500/30 bg-green-50/50 dark:bg-green-950/20"),children:[i.jsx("div",{className:"w-10 h-10 rounded-full bg-secondary/10 flex items-center justify-center flex-shrink-0",children:i.jsx(yn,{className:"w-5 h-5 text-secondary"})}),i.jsx("div",{className:"flex-1 min-w-0",children:i.jsxs("div",{className:"flex items-start justify-between gap-2",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsxs("p",{className:"font-medium text-foreground truncate",children:[O.tierName," Sponsor"]}),i.jsx("p",{className:"text-xs text-muted-foreground truncate",children:O.companyName}),O.extraContributionCents&&O.extraContributionCents>0&&i.jsxs("div",{className:"text-xs text-muted-foreground mt-1 space-y-0.5",children:[i.jsxs("div",{className:"flex justify-between gap-2",children:[i.jsxs("span",{children:["Tier (",O.tierName,")"]}),i.jsx("span",{children:k(O.basePriceCents??O.price-O.extraContributionCents)})]}),i.jsxs("div",{className:"flex justify-between gap-2 text-accent",children:[i.jsx("span",{children:"+ Additional contribution"}),i.jsx("span",{children:k(O.extraContributionCents)})]})]}),$&&i.jsxs(Pt,{variant:"secondary",className:"text-xs mt-1 bg-green-500/10 text-green-600 border-green-500/20",children:[i.jsx(co,{className:"w-3 h-3 mr-1"}),"-",k(A)]})]}),i.jsx("div",{className:"text-right flex-shrink-0",children:$?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"text-xs text-muted-foreground line-through",children:k(z)}),i.jsx("p",{className:"font-semibold text-green-600",children:k(P)})]}):i.jsx("p",{className:"font-semibold text-foreground",children:k(z)})})]})}),i.jsx(Gi,{itemName:`${O.tierName} Sponsor - ${O.companyName}`,onConfirm:()=>
511a(O.id),className:"md:opacity-0 md:group-hover:opacity-100 transition-opacity"})]},O.id)}if(O.type==="donation"){const z=O.amount,P=z-A;return i.jsxs("div",{className:D("flex items-start gap-3 p-3 rounded-lg bg-muted/50 group",$&&"ring-1 ring-green-500/30 bg-green-50/50 dark:bg-green-950/20"),children:[i.jsx("div",{className:"w-10 h-10 rounded-full bg-accent/10 flex items-center justify-center flex-shrink-0",children:i.jsx(vt,{className:"w-5 h-5 text-accent"})}),i.jsx("div",{className:"flex-1 min-w-0",children:i.jsxs("div",{className:"flex items-start justify-between gap-2",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("p",{className:"font-medium text-foreground",children:O.beneficiaryName?`In honor of ${O.beneficiaryName}`:"Donation"}),i.jsx("p",{className:"text-xs text-muted-foreground capitalize",children:O.donationType}),$&&i.jsxs(Pt,{variant:"secondary",className:"text-xs mt-1 bg-green-500/10 text-green-600 border-green-500/20",children:[i.jsx(co,{className:"w-3 h-3 mr-1"}),"-",k(A)]})]}),i.jsx("div",{className:"text-right flex-shrink-0",children:$?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"text-xs text-muted-foreground line-through",children:k(z)}),i.jsx("p",{className:"font-semibold text-green-600",children:k(P)})]}):i.jsx("p",{className:"font-semibold text-foreground",children:k(z)})})]})}),i.jsx(Gi,{itemName:O.beneficiaryName?`donation for ${O.beneficiaryName}`:`${O.donationType} donation`,onConfirm:()=>a(O.id),className:"md:opacity-0 md:group-hover:opacity-100 transition-opacity"})]},O.id)}if(O.type==="merchandise"){const z=O.price*O.quantity,P=z-A;return i.jsxs("div",{className:D("flex items-start gap-3 p-3 rounded-lg bg-muted/50 group",$&&"ring-1 ring-green-500/30 bg-green-50/50 dark:bg-green-950/20"),children:[i.jsx("div",{className:"w-10 h-10 rounded-full bg-muted flex items-center justify-center flex-shrink-0",children:i.jsx(zd,{className:"w-5 h-5 text-primary"})}),i.jsx("div",{className:"flex-1 min-w-0",children:i.jsxs("div",{className:"flex items-start justify-between gap-2",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("p",{className:"font-medium text-foreground truncate",children:O.skuName}),O.shirtSize&&i.jsxs("p",{className:"text-xs text-muted-foreground",children:[O.shirtSize,O.shirtOptionName?` â ${O.shirtOptionName}`:""]}),!O.shirtSize&&i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Qty: ",O.quantity]}),$&&i.jsxs(Pt,{variant:"secondary",className:"text-xs mt-1 bg-green-500/10 text-green-600 border-green-500/20",children:[i.jsx(co,{className:"w-3 h-3 mr-1"}),"-",k(A)]})]}),i.jsx("div",{className:"text-right flex-shrink-0",children:$?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"text-xs text-muted-foreground line-through",children:k(z)}),i.jsx("p",{className:"font-semibold text-green-600",children:k(P)})]}):i.jsx("p",{className:"font-semibold text-foreground",children:k(z)})})]})}),i.jsx(Gi,{itemName:O.skuName,onConfirm:()=>a(O.id),className:"md:opacity-0 md:group-hover:opacity-100 transition-opacity"})]},O.id)}return null},E=d(),T=l(),R=c(),L=u();return i.jsxs(pz,{children:[i.jsx(gz,{asChild:!0,children:i.jsxs(ce,{variant:"outline",size:"icon",className:"relative",children:[i.jsx(bo,{className:"w-5 h-5"}),E>0&&i.jsx(Pt,{className:"absolute -top-2 -right-2 h-5 w-5 p-0 flex items-center justify-center text-xs",variant:"default",children:E})]})}),i.jsxs(Qj,{className:"w-full sm:max-w-md flex flex-col",children:[i.jsx(Jj,{children:i.jsxs(Zj,{className:"flex items-center gap-2",children:[i.jsx(bo,{className:"w-5 h-5"}),"Your Cart",E>0&&i.jsxs(Pt,{variant:"secondary",children:[E," items"]})]})}),s.length===0?i.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center py-12",children:[i.jsx(bo,{className:"w-12 h-12 text-muted-foreground/50 mb-4"}),i.jsx("p",{className:"text-muted-foreground",children:"Your cart is empty"}),i.jsx("p",{className:"text-sm text-muted-foreground/70",children:"Add registrations, sponsorships, or donations to get started."})]}):i.jsxs(i.Fragment,{children:[i.jsx(fN,{className:"flex-1 -mx-6 px-6",children:i.jsx("div",{className:"space-y-3 py-4",children:s.map(N)})}),i.jsxs("div",{className:"border-t pt-4 space-y-3",children:[i.jsx(mN,{compact:!0,showLabel:!0}),i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Subtotal"}),i.jsx("span",{className:"text-foreground",children:k(T)})]}),R>0&&i.jsxs("div",{className:"flex justify-between text-sm text-success",children:[i.jsx("span",{children:"Discount"}),i.jsxs("span",{children:["-",k(R)]})]}),i.jsxs("div",{className:"flex justify-between items-center pt-2 border-t",children:[i.jsx("span",{className:"font-heading font-bold text-lg text-foreground",children:"Total"}),i.jsx("span",{className:"font-heading font-bold text-2xl text-primary",children:k(L)})]}),n&&m&&i.jsxs("div",{className:"rounded-lg border border-amber-500/40 bg-amber-500/10 p-3 space-y-2",children:[i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(Ag,{className:"w-4 h-4 text-amber-600 dar
511k:text-amber-400 mt-0.5 flex-shrink-0"}),i.jsxs("div",{className:"text-xs text-foreground",children:[i.jsx("p",{className:"font-medium",children:"Complete your name to continue"}),i.jsx("p",{className:"text-muted-foreground",children:"We need your full name on your account before checkout."})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsxs("div",{children:[i.jsx(Ye,{htmlFor:"cart-first-name",className:"text-xs",children:"First name"}),i.jsx(Ot,{id:"cart-first-name",value:w,onChange:O=>g(O.target.value),className:"h-9",autoComplete:"given-name"})]}),i.jsxs("div",{children:[i.jsx(Ye,{htmlFor:"cart-last-name",className:"text-xs",children:"Last name"}),i.jsx(Ot,{id:"cart-last-name",value:b,onChange:O=>v(O.target.value),className:"h-9",autoComplete:"family-name"})]})]}),i.jsx(ce,{size:"sm",className:"w-full",onClick:_,disabled:y||!w.trim()||!b.trim(),children:y?i.jsx(Jr,{className:"w-4 h-4 animate-spin"}):"Save name"})]}),i.jsx(ce,{variant:"hero",size:"lg",className:"w-full group",onClick:S,disabled:t||s.length===0||!!n&&m,children:t?i.jsx(Jr,{className:"w-5 h-5 animate-spin"}):n?i.jsxs(i.Fragment,{children:["Proceed to Checkout",i.jsx(_t,{className:"w-5 h-5 transition-transform group-hover:translate-x-1"})]}):i.jsxs(i.Fragment,{children:[i.jsx(W4,{className:"w-5 h-5"}),"Create Account to Checkout"]})}),i.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Secure checkout powered by Stripe"})]})]})]})]})};function e6(e){if(!e)return null;const t=e.match(/(?:youtube\.com\/(?:watch\?v=|embed\/)|youtu\.be\/)([a-zA-Z0-9_-]{11})/);if(t)return{type:"youtube",embedUrl:`https://www.youtube.com/embed/${t[1]}?autoplay=1&mute=1&loop=1&playlist=${t[1]}&controls=0&showinfo=0&rel=0&modestbranding=1&playsinline=1`};const r=e.match(/(?:vimeo\.com\/)(\d+)/);return r?{type:"vimeo",embedUrl:`https://player.vimeo.com/video/${r[1]}?autoplay=1&muted=1&loop=1&background=1&controls=0`}:{type:"direct",embedUrl:e}}function t6({pageKey:e,children:t,className:r,fallbackGradient:n="bg-gradient-to-br from-primary/10 via-background to-secondary/10"}){var g;const{branding:s,previewBranding:o}=Bo(),l=(g=(o||s).pageHeroImages)==null?void 0:g[e],c=!!(l!=null&&l.imageUrl),u=!!(l!=null&&l.videoUrl),d=c||u,f=(l==null?void 0:l.overlayOpacity)??60,m=(l==null?void 0:l.focalX)??50,p=(l==null?void 0:l.focalY)??50,w=u?e6(l.videoUrl):null;return i.jsxs("section",{className:D("relative py-16 sm:py-20 overflow-hidden",!d&&n,r),children:[d&&i.jsxs(i.Fragment,{children:[w?w.type==="direct"?i.jsx("video",{src:w.embedUrl,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"absolute inset-0 w-full h-full object-cover",poster:(l==null?void 0:l.imageUrl)||void 0,style:{objectPosition:`${m}% ${p}%`}}):i.jsxs(i.Fragment,{children:[c&&i.jsx("div",{className:"absolute inset-0 bg-cover",style:{backgroundImage:`url(${l.imageUrl})`,backgroundPosition:`${m}% ${p}%`}}),i.jsx("iframe",{src:w.embedUrl,className:"absolute w-[300%] h-[300%] top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-none",allow:"autoplay; fullscreen",style:{border:"none"},title:"Hero background video"})]}):c?i.jsx("div",{className:"absolute inset-0 bg-cover",style:{backgroundImage:`url(${l.imageUrl})`,backgroundPosition:`${m}% ${p}%`}}):null,i.jsx("div",{className:"absolute inset-0 bg-background",style:{opacity:f/100}})]}),i.jsx("div",{className:"relative z-10",children:t})]})}const r6=[{name:"Merchandise",price:2250,icon:k4,color:"primary",available:2,totalAvailable:2,compRegistrations:5,discountCoupons:20,features:["Video promotion opportunity","Logo on website front & sponsor page","Website premium spotlight rotation","Company name on t-shirt","Company name on event banner"]},{name:"Event",price:2e3,icon:z4,color:"primary",available:10,totalAvailable:10,compRegistrations:5,discountCoupons:20,features:["Video promotion opportunity","Logo on website front & sponsor page","Website premium spotlight rotation","Company name on t-shirt","Company name on event banner","Email communications header logo"]},{name:"Platinum",price:450,icon:x4,color:"secondary",popular:!0,available:20,totalAvailable:20,compRegistrations:4,discountCoupons:15,features:["Logo on website front & sponsor page","Website sponsor spotlight rotation","Company name on t-shirt","Company name on event banner","Exhibit booth at finish option"]},{name:"Gold",price:300,icon:A4,color:"accent",available:25,totalAvailable:25,compRegistrations:3,discountCoupons:15,features:["Logo on website front & sponsor page","Website sponsor spotlight rotation","Company name on t-shirt","Company name on event banner"]},{name:"Silver",price:200,icon:yn,color:"muted",available:50,totalAvailable:50,compRegistrations:2,discountCoupons:10,features:["Logo on website front & sponsor page","Website sponsor spotlight rotation","Company name on t-shirt"]},{name:"Community",price:100,icon:vt,color:"muted",available:100,totalAvailable:100,compRegistrations:1,discountCoupons:5,features:["Logo on website front & sponsor page","1 complimentary registration","5 discount registration coupons"]}],n6=()=>{const{activeEvent:e,registrationSkus:t,shirtOptions:r,beneficiaries:n,isLoading:s}=ht(),{getItemCount:o}=Vt(),a=Hs(),l=t.filter(w=>w.show_on_main_site!==!1),c=l.filter(w=>w.sku_type==="standard"||w.sku_type==="student"),u=l.filter(w=>w.sku_type==="addon"),d=l.filter(w=>w.sku_type==="donation"),f=d.find(w=>w.name.toLowerCase().includes("foundation")),m=d.find(w=>w.name.toLowerCase().includes("beneficiary")),p=()=>{a("/checkout")};return s?i.jsx(Ts,{children:i.jsx("section",{className:"pt-32 pb-12",children:i.jsxs("div",{className:"container mx-auto px-4 text-center",children:[i.jsx(Jr,{className:"w-8 h-8 animate-spin mx-auto text-primary"}),i.jsx("p",{className:"text-muted-foreground mt-4",children:"Loading..."})]})})}
511):e?i.jsxs(i.Fragment,{children:[i.jsxs(Ro,{children:[i.jsxs("title",{children:["Register | ",e.name]}),i.jsx("meta",{name:"description",content:`Register for ${e.name}. Multiple participants, sponsorships, and donations.`})]}),i.jsxs(Ts,{children:[i.jsx(t6,{pageKey:"register",className:"pt-32 pb-12",fallbackGradient:"bg-gradient-subtle",children:i.jsx("div",{className:"container mx-auto px-4",children:i.jsxs("div",{className:"max-w-3xl mx-auto text-center relative",children:[i.jsx("div",{className:"absolute right-0 top-0",children:i.jsx(W0,{onCheckout:p})}),i.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-primary/10 text-primary text-sm font-medium mb-6",children:[i.jsx(eS,{className:"w-4 h-4"}),"Registration"]}),i.jsxs("h1",{className:"text-4xl sm:text-5xl font-heading font-bold text-foreground mb-6",children:["Register for ",e.name]}),i.jsxs("p",{className:"text-lg text-muted-foreground mb-4",children:[Eg(e.event_date),e.start_time&&` at ${e.start_time}`,e.location_name&&` ⢠${e.location_name}`]}),i.jsxs(ba,{children:[i.jsx(_a,{asChild:!0,children:i.jsxs(ce,{variant:"heroGlass",size:"sm",className:"gap-2",children:[i.jsx(Og,{className:"w-4 h-4 text-primary"}),"View Route",i.jsx(hn,{className:"w-3 h-3 opacity-70"})]})}),i.jsxs(uo,{align:"center",className:"w-44",children:[i.jsx(Tt,{asChild:!0,children:i.jsx(ee,{to:"/course",className:"cursor-pointer w-full",children:"5K Course"})}),i.jsx(Tt,{asChild:!0,children:i.jsx(ee,{to:"/virtual-courses",className:"cursor-pointer w-full",children:"Virtual Courses"})})]})]})]})})}),c.length>0&&i.jsx("section",{className:"py-12 border-b border-border",children:i.jsx("div",{className:"container mx-auto px-4",children:i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[i.jsx(Fn,{className:"w-5 h-5 text-primary"}),i.jsx("h2",{className:"text-2xl font-heading font-bold text-foreground",children:"Race Registration"})]}),i.jsx("div",{className:"space-y-4",children:c.map(w=>{const g=w.includes_shirt?w.allow_no_shirt?r:r.filter(b=>b.name.toLowerCase()!=="no shirt"):[];return i.jsx(ZU,{sku:w,shirtOptions:g},w.id)})})]})})}),u.length>0&&i.jsx("section",{className:"py-12 border-b border-border",children:i.jsx("div",{className:"container mx-auto px-4",children:i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[i.jsx(zd,{className:"w-5 h-5 text-primary"}),i.jsx("h2",{className:"text-2xl font-heading font-bold text-foreground",children:"Merchandise"})]}),i.jsx("div",{className:"grid sm:grid-cols-2 gap-4",children:u.map(w=>w.includes_shirt?i.jsx(rz,{sku:w,shirtOptions:r},w.id):i.jsx(tz,{sku:w},w.id))})]})})}),i.jsx("section",{className:"py-12 border-b border-border",children:i.jsx("div",{className:"container mx-auto px-4",children:i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[i.jsx(vt,{className:"w-5 h-5 text-accent"}),i.jsx("h2",{className:"text-2xl font-heading font-bold text-foreground",children:"Make a Donation"})]}),i.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[m&&i.jsx(sz,{sku:m}),!m&&n.length>0&&i.jsx(ph,{title:"Honor a Beneficiary",description:"Donate in someone's honor",showBeneficiarySelector:!0}),f?i.jsx(ph,{title:f.name,description:f.description||"Support the Happy Smackah Foundation"}):i.jsx(ph,{title:"Foundation Donation",description:"Support the Happy Smackah Foundation"})]}),i.jsx(Ok,{className:"mt-8"})]})})}),i.jsx("section",{className:"py-12 border-b border-border bg-muted/30",children:i.jsx("div",{className:"container mx-auto px-4",children:i.jsxs("div",{className:"max-w-6xl mx-auto",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[i.jsx(yn,{className:"w-5 h-5 text-secondary"}),i.jsx("h2",{className:"text-2xl font-heading font-bold text-foreground",children:"Become a Sponsor"})]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3 sm:gap-4",children:r6.map(w=>i.jsx(XU,{tier:w},w.name))})]})})}),o()>0&&i.jsx("div",{className:"fixed bottom-4 right-4 sm:bottom-6 sm:right-6 z-50 pb-safe",children:i.jsx(W0,{onCheckout:p})})]})]}):i.jsxs(i.Fragment,{children:[i.jsx(Ro,{children:i.jsx("title",{children:"Registration | Happy Smackah"})}),i.jsx(Ts,{children:i.jsx("section",{className:"pt-32 pb-12",children:i.jsxs("div",{className:"container mx-auto px-4 text-center",children:[i.jsx(Xa,{className:"w-12 h-12 mx-auto text-muted-foreground mb-4"}),i.jsx("h1",{className:"text-2xl font-heading font-bold text-foreground mb-2",children:"Registration Not Available"}),i.jsx("p",{className:"text-muted-foreground",children:"There is no event currently open for registration."})]})})})]})},s6=e=>{const[t,r]=h.useState(!1),{items:n,eventId:s,promo:o,clearCart:a,getTotal:l,setEventId:c}=Vt(),{user:u}=Vn(),{refreshInventory:d,shirtOptions:f}=ht(),m=Hs(),p=b=>typeof b!="string"?!1:/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(b),w=n.length>0&&n.every(b=>b.type==="donation");return{checkout:async()=>{var v,y,x;if(n.length===0){re.error("Your cart is empty");return}let b=s;if(!w&&!p(b))try{const _=new Date().toISOString().split("T")[0],{data:S,error:k}=await ie.from("events").select("id").eq("status","published").gte("event_date",_).order("event_date",{ascending:!0}).limit(1).maybeSingle();if(k)throw k;S!=null&&S.id&&p(S.id)&&(b=S.id,c(S.id))}catch(_){console.warn("[CHECKOUT] Failed to recover eventId:",_)}if(!w&&!p(b)){re.error("No event selected");return}w&&!p(b)&&(b=""),r(!0);try{const _=n.map(A=>A.type==="registration"?{type:"registration",skuId:A.skuId,skuName:A.skuName,tierId:A.tierId,tierName:A.tierName,participant:{firstName:A.participant.firstName,lastName:A.participant.lastName,email:A.participant.email||"",shirtSize:A.participant.shirt
511Size||"",shirtOptionId:A.participant.shirtOptionId||"",shirtOptionName:A.participant.shirtOptionName||""},basePrice:A.basePrice,shirtPrice:A.shirtPrice,partnerId:A.partnerId,partnerDiscount:A.partnerDiscount}:A.type==="sponsorship"?{type:"sponsorship",tierId:A.tierId,tierName:A.tierName,contactName:A.contactName,companyName:A.companyName,contactEmail:A.contactEmail,websiteUrl:A.websiteUrl,price:A.price}:A.type==="donation"?{type:"donation",amount:A.amount,donationType:A.donationType,beneficiaryId:A.beneficiaryId,beneficiaryName:A.beneficiaryName,skuId:A.skuId,partnerId:A.partnerId}:{type:"merchandise",skuId:A.skuId,skuName:A.skuName,price:A.price,quantity:A.quantity,partnerId:A.partnerId,shirtSize:A.shirtSize,shirtOptionId:A.shirtOptionId,shirtOptionName:A.shirtOptionName}),S=l(),k=async A=>{try{await d()}catch{}const $=(A||[]).map(P=>{const M=f.find(j=>j.id===P.optionId);return`${(M==null?void 0:M.name)||"Shirt"} ${P.size} (${P.remaining} left)`}),z=$.length?`: ${$.join(", ")}`:"";re.error(`Sold out${z}. Please remove these items from your cart and try again.`,{duration:8e3})},N=async A=>{const $=A==null?void 0:A.context;if($&&typeof $.json=="function")try{return await $.json()}catch{}return null};if(S===0){console.log("[CHECKOUT] Total is $0, using free checkout flow");const{data:A,error:$}=await ie.functions.invoke("complete-free-checkout",{body:{items:_,eventId:b,promoCode:o==null?void 0:o.code,userId:(u==null?void 0:u.id)||null,userEmail:(u==null?void 0:u.email)||null}});if($){const z=await N($);if((z==null?void 0:z.error)==="out_of_stock"){await k(z.oversold),(v=e==null?void 0:e.onError)==null||v.call(e,"out_of_stock"),r(!1);return}throw new Error((z==null?void 0:z.message)||$.message)}if(console.log("[CHECKOUT] Free checkout response:",A),A!=null&&A.success){a(),m(`/payment-success?type=cart&free=true&order_number=${A.orderNumber||""}`);return}else throw new Error((A==null?void 0:A.error)||"Free checkout failed")}const E=`${window.location.origin}/payment-success?type=cart`,T=window.location.href,R=Cj(),{data:L,error:O}=await ie.functions.invoke("create-checkout",{body:{items:_,eventId:b,promoCode:o==null?void 0:o.code,userId:(u==null?void 0:u.id)||null,userEmail:(u==null?void 0:u.email)||null,successUrl:E,cancelUrl:T,analyticsSessionId:R}});if(O){const A=await N(O);if((A==null?void 0:A.error)==="out_of_stock"){await k(A.oversold),(y=e==null?void 0:e.onError)==null||y.call(e,"out_of_stock"),r(!1);return}throw new Error((A==null?void 0:A.message)||O.message)}if((L==null?void 0:L.error)==="out_of_stock"){await k(L.oversold),(x=e==null?void 0:e.onError)==null||x.call(e,"out_of_stock"),r(!1);return}if(console.log("[CHECKOUT] Response received:",L),L!=null&&L.url){console.log("[CHECKOUT] Redirecting to:",L.url),(window.top!==window.self?window.open(L.url,"_blank","noopener,noreferrer"):null)||window.location.assign(L.url);return}else throw new Error("No checkout URL returned")}catch(_){const S=_ instanceof Error?_.message:"Failed to create checkout";re.error(S),console.error("Cart checkout error:",_),r(!1)}},loading:t,canCheckout:n.length>0&&(w||p(s)),isZeroTotal:l()===0}},o6=()=>{const{items:e,getSubtotal:t,getDiscount:r,getTotal:n,getItemCount:s,removeItem:o,promo:a,getEligibleItemCount:l,isItemEligible:c,getItemDiscount:u}=Vt(),d=Hs(),{checkout:f,loading:m,canCheckout:p}=s6(),w=b=>`$${(b/100).toFixed(2)}`,g=async()=>{await f()};return s()===0?i.jsxs(Ts,{children:[i.jsx(Ro,{children:i.jsx("title",{children:"Checkout | Happy Smackah"})}),i.jsx("section",{className:"pt-32 pb-20",children:i.jsxs("div",{className:"container mx-auto px-4 text-center",children:[i.jsx(bo,{className:"w-16 h-16 mx-auto text-muted-foreground/50 mb-4"}),i.jsx("h1",{className:"text-2xl font-heading font-bold mb-2",children:"Your cart is empty"}),i.jsx("p",{className:"text-muted-foreground mb-6",children:"Add registrations, sponsorships, or donations to get started."}),i.jsxs(ce,{onClick:()=>d("/register"),children:[i.jsx(Um,{className:"w-4 h-4 mr-2"}),"Back to Register"]})]})})]}):i.jsxs(i.Fragment,{children:[i.jsx(Ro,{children:i.jsx("title",{children:"Checkout | Happy Smackah"})}),i.jsx(Ts,{children:i.jsx("section",{className:"pt-32 pb-20",children:i.jsx("div",{className:"container mx-auto px-4",children:i.jsxs("div",{className:"max-w-3xl mx-auto",children:[i.jsxs(ce,{variant:"ghost",onClick:()=>d("/register"),className:"mb-6",children:[i.jsx(Um,{className:"w-4 h-4 mr-2"}),"Back"]}),i.jsx("h1",{className:"text-3xl font-heading font-bold mb-8",children:"Checkout"}),i.jsx("div",{className:"space-y-3 sm:space-y-4 mb-6 sm:mb-8",children:e.map(b=>{const v=u(b),y=v>
5110,x=b.type==="registration"?b.basePrice+b.shirtPrice:b.type==="sponsorship"?b.price:b.type==="donation"?b.amount:b.type==="merchandise"?b.price*b.quantity:0,_=x-v;return i.jsx(ot,{variant:"elevated",className:D(a&&!c(b)&&"opacity-60",y&&"ring-1 ring-green-500/30 bg-green-50/50 dark:bg-green-950/20"),children:i.jsxs(at,{className:"py-3 sm:py-4 flex items-start sm:items-center gap-3 sm:gap-4",children:[i.jsxs("div",{className:"w-8 h-8 sm:w-10 sm:h-10 rounded-full flex items-center justify-center bg-muted shrink-0",children:[b.type==="registration"&&i.jsx(Hr,{className:"w-4 h-4 sm:w-5 sm:h-5 text-primary"}),b.type==="sponsorship"&&i.jsx(yn,{className:"w-4 h-4 sm:w-5 sm:h-5 text-secondary"}),b.type==="donation"&&i.jsx(vt,{className:"w-4 h-4 sm:w-5 sm:h-5 text-accent"}),b.type==="merchandise"&&i.jsx(zd,{className:"w-4 h-4 sm:w-5 sm:h-5 text-primary"})]}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("p",{className:"font-medium text-sm sm:text-base truncate",children:[b.type==="registration"&&`${b.participant.firstName} ${b.participant.lastName}`,b.type==="sponsorship"&&`${b.tierName} Sponsor`,b.type==="donation"&&(b.beneficiaryName?`Donation for ${b.beneficiaryName}`:"Donation"),b.type==="merchandise"&&b.skuName]}),i.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[i.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground truncate",children:[b.type==="registration"&&b.skuName,b.type==="sponsorship"&&b.companyName,b.type==="donation"&&(b.donationType==="beneficiary"?"In honor of beneficiary":"General fund"),b.type==="merchandise"&&`Qty: ${b.quantity}`]}),y&&i.jsxs(Pt,{variant:"secondary",className:"text-xs bg-green-500/10 text-green-600 border-green-500/20",children:[i.jsx(co,{className:"w-3 h-3 mr-1"}),"-",w(v)]})]})]}),i.jsx("div",{className:"text-right shrink-0",children:y?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"text-xs text-muted-foreground line-through",children:w(x)}),i.jsx("p",{className:"font-bold text-sm sm:text-base text-green-600",children:w(_)})]}):i.jsxs("p",{className:"font-bold text-sm sm:text-base flex items-center gap-1 sm:gap-2",children:[w(x),a&&!c(b)&&i.jsx("span",{className:"hidden sm:inline text-xs text-muted-foreground font-normal",children:"(no discount)"})]})}),i.jsxs("div",{className:"flex items-center gap-1",children:[b.type==="registration"&&i.jsx(KN,{item:b}),i.jsx(Gi,{itemName:b.type==="registration"?`${b.participant.firstName} ${b.participant.lastName}`:b.type==="sponsorship"?`${b.tierName} Sponsor`:b.type==="merchandise"?b.skuName:"Donation",onConfirm:()=>o(b.id)})]})]})},b.id)})}),i.jsxs(ot,{variant:"elevated",className:"mb-4 sm:mb-6",children:[i.jsx(ur,{className:"p-4 sm:p-6 pb-2 sm:pb-4",children:i.jsxs(Sr,{className:"text-base sm:text-lg flex items-center gap-2",children:[i.jsx(co,{className:"w-4 h-4 sm:w-5 sm:h-5"})," Promo Code"]})}),i.jsx(at,{className:"p-4 sm:p-6 pt-0 sm:pt-0",children:i.jsx(mN,{})})]}),i.jsxs(ot,{variant:"elevated",className:"mb-6 sm:mb-8",children:[i.jsx(ur,{className:"p-4 sm:p-6",children:i.jsx(Sr,{className:"text-base sm:text-lg",children:"Order Summary"})}),i.jsxs(at,{className:"p-4 sm:p-6 pt-0 space-y-3",children:[i.jsxs("div",{className:"flex justify-between text-sm sm:text-base",children:[i.jsx("span",{children:"Subtotal"}),i.jsx("span",{children:w(t())})]}),r()>0&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex justify-between text-success text-sm sm:text-base",children:[i.jsxs("span",{children:["Discount ",a&&`(${a.code})`]}),i.jsxs("span",{children:["-",w(r())]})]}),l()<s()&&i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Discount applied to ",l()," of ",s()," items"]}),i.jsxs("div",{className:"bg-success/10 text-success text-xs sm:text-sm font-medium px-3 py-2 rounded-md text-center",children:["ð You saved ",w(r())," with code ",a==null?void 0:a.code,"!"]})]}),i.jsx("hr",{}),i.jsxs("div",{className:"flex justify-between text-base sm:text-lg font-bold items-center",children:[i.jsx("span",{children:"Total"}),i.jsxs("span",{className:"flex items-center gap-2",children:[n()===0&&a&&i.jsx(Pt,{variant:"default",className:"bg-success text-success-foreground text-xs",children:"Free!"}),i.jsx("span",{className:"text-primary",children:w(n())})]})]})]})]}),i.jsx(Ok,{variant:"checkout",className:"mb-4"}),i.jsxs(ce,{variant:"hero",size:"lg",className:"w-full",onClick:g,disabled:m||!p,children:[m?i.jsx(Jr,{className:"w-5 h-5 animate-spin"}):i.jsx(S4,{className:"w-5 h-5"}),m?"Processing...":n()===0?"Complete Free Registration":`Pay ${w(n())}`]})]})})})})]})};
511function Jc({className:e,...t}){return i.jsx("div",{className:D("animate-pulse rounded-md bg-muted",e),...t})}var a6="Separator",q0="horizontal",i6=["horizontal","vertical"],GN=h.forwardRef((e,t)=>{const{decorative:r,orientation:n=q0,...s}=e,o=l6(n)?n:q0,l=r?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return i.jsx(ue.div,{"data-orientation":o,...l,...s,ref:t})});GN.displayName=a6;function l6(e){return i6.includes(e)}var YN=GN;const op=h.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>i.jsx(YN,{ref:s,decorative:r,orientation:t,className:D("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));op.displayName=YN.displayName;const Li=(e,t)=>new Intl.NumberFormat("en-US",{style:"currency",currency:t.toUpperCase()}).format(e/100),c6=({sessionId:e})=>{var u;const[t,r]=h.useState(null),[n,s]=h.useState(!0),[o,a]=h.useState(null),l=h.useRef(null);h.useEffect(()=>{(async()=>{if(!e){s(!1);return}try{const{data:f,error:m}=await ie.functions.invoke("get-checkout-session",{body:{sessionId:e}});if(m)throw new Error(m.message);if(f.error)throw new Error(f.error);r(f)}catch(f){const m=f instanceof Error?f.message:"Failed to load receipt";a(m),console.error("Error fetching session:",f)}finally{s(!1)}})()},[e]);const c=()=>{window.print()};return e?n?i.jsxs(ot,{className:"mt-6",children:[i.jsx(ur,{children:i.jsx(Jc,{className:"h-6 w-40"})}),i.jsxs(at,{className:"space-y-4",children:[i.jsx(Jc,{className:"h-4 w-full"}),i.jsx(Jc,{className:"h-4 w-3/4"}),i.jsx(Jc,{className:"h-4 w-1/2"})]})]}):o?i.jsx(ot,{className:"mt-6 border-destructive/50",children:i.jsx(at,{className:"p-6",children:i.jsxs("div",{className:"flex items-center gap-3 text-destructive",children:[i.jsx(Xa,{className:"w-5 h-5"}),i.jsxs("p",{children:["Could not load receipt: ",o]})]})})}):t?i.jsxs(i.Fragment,{children:[i.jsx("style",{children:` 512 @media print { 513 body * { 514 visibility: hidden; 515 } 516 .print-receipt, .print-receipt * { 517 visibility: visible; 518 } 519 .print-receipt { 520 position: absolute; 521 left: 0; 522 top: 0; 523 width: 100%; 524 padding: 2rem; 525 } 526 .no-print { 527 display: none !important; 528 } 529 } 530 `}),i.jsxs(ot,{className:"mt-6 print-receipt",ref:l,children:[i.jsx(ur,{className:"pb-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx($4,{className:"w-5 h-5 text-primary"}),i.jsx(Sr,{className:"text-lg",children:"Payment Receipt"})]}),i.jsxs(ce,{variant:"outline",size:"sm",onClick:c,className:"no-print",children:[i.jsx(L4,{className:"w-4 h-4 mr-2"}),"Print"]})]})}),i.jsxs(at,{className:"space-y-6",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-muted-foreground",children:"Date"}),i.jsx("p",{className:"font-medium",children:O3(new Date(t.created*1e3),"MMMM d, yyyy h:mm a")})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-muted-foreground",children:"Status"}),i.jsx("p",{className:"font-medium capitalize text-success",children:t.paymentStatus==="paid"?"Paid":t.paymentStatus})]}),t.customerEmail&&i.jsxs("div",{className:"col-span-2",children:[i.jsx("p",{className:"text-muted-foreground",children:"Email"}),i.jsx("p",{className:"font-medium",children:t.customerEmail})]}),t.customerName&&i.jsxs("div",{className:"col-span-2",children:[i.jsx("p",{className:"text-muted-foreground",children:"Name"}),i.jsx("p",{className:"font-medium",children:t.customerName})]})]}),i.jsx(op,{}),i.jsxs("div",{className:"space-y-3",children:[i.jsx("h4",{className:"font-medium text-sm text-muted-foreground uppercase tracking-wide",children:"Items"}),t.lineItems.map((d,f)=>i.jsxs("div",{className:"flex justify-between items-start",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("p",{className:"font-medium",children:d.name}),d.description&&i.jsx("p",{className:"text-sm text-muted-foreground",children:d.description}),d.quantity>1&&i.jsxs("p",{className:"text-sm text-muted-foreground",children:[d.quantity," Ã ",Li(d.unitAmou
vendor: 4,376 bytes, line 530
530nt,d.currency)]})]}),i.jsx("p",{className:"font-medium",children:Li(d.totalAmount,d.currency)})]},f))]}),i.jsx(op,{}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Subtotal"}),i.jsx("span",{children:Li(t.amountSubtotal,t.currency)})]}),t.amountDiscount>0&&i.jsxs("div",{className:"flex justify-between text-sm text-success",children:[i.jsx("span",{children:"Discount"}),i.jsxs("span",{children:["-",Li(t.amountDiscount,t.currency)]})]}),i.jsxs("div",{className:"flex justify-between font-bold text-lg pt-2 border-t",children:[i.jsx("span",{children:"Total"}),i.jsx("span",{children:Li(t.amountTotal,t.currency)})]})]}),i.jsxs("div",{className:"text-center text-xs text-muted-foreground pt-4 border-t space-y-1",children:[i.jsx("p",{children:"Thank you for supporting Happy Smackah Foundation!"}),i.jsx("p",{children:"Happy Smackah Foundation is a 501(c)(3) nonprofit organization."}),i.jsx("p",{children:"EIN: 90-0956093"}),i.jsx("p",{children:"240 Ncr 27e, Berthoud, CO 80513"}),i.jsxs("p",{className:"mt-2 font-mono",children:["Transaction ID: ",((u=t.metadata)==null?void 0:u.order_number)||t.id.slice(-12)]})]})]})]})]}):null:null};var _y="Radio",[u6,QN]=Zt(_y),[d6,f6]=u6(_y),JN=h.forwardRef((e,t)=>{const{__scopeRadio:r,name:n,checked:s=!1,required:o,disabled:a,value:l="on",onCheck:c,form:u,...d}=e,[f,m]=h.useState(null),p=be(t,b=>m(b)),w=h.useRef(!1),g=f?u||!!f.closest("form"):!0;return i.jsxs(d6,{scope:r,checked:s,disabled:a,children:[i.jsx(ue.button,{type:"button",role:"radio","aria-checked":s,"data-state":tC(s),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:p,onClick:Y(e.onClick,b=>{s||c==null||c(),g&&(w.current=b.isPropagationStopped(),w.current||b.stopPropagation())})}),g&&i.jsx(eC,{control:f,bubbles:!w.current,name:n,value:l,checked:s,required:o,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});JN.displayName=_y;var ZN="RadioIndicator",XN=h.forwardRef((e,t)=>{const{__scopeRadio:r,forceMount:n,...s}=e,o=f6(ZN,r);return i.jsx(It,{present:n||o.checked,children:i.jsx(ue.span,{"data-state":tC(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t})})});XN.displayName=ZN;var h6="RadioBubbleInput",eC=h.forwardRef(({__scopeRadio:e,control:t,checked:r,bubbles:n=!0,...s},o)=>{const a=h.useRef(null),l=be(a,o),c=ty(r),u=lg(t);return h.useEffect(()=>{const d=a.current;if(!d)return;const f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==r&&p){const w=new Event("click",{bubbles:n});p.call(d,r),d.dispatchEvent(w)}},[c,r,n]),i.jsx(ue.input,{type:"radio","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:l,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});eC.displayName=h6;function tC(e){return e?"checked":"unchecked"}var m6=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],af="RadioGroup",[p6,jB]=Zt(af,[Vd,QN]),rC=Vd(),nC=QN(),[g6,y6]=p6(af),sC=h.forwardRef((e,t)=>{const{__scopeRadioGroup:r,name:n,defaultValue:s,value:o,required:a=!1,disabled:l=!1,orientation:c,dir:u,loop:d=!0,onValueChange:f,...m}=e,p=rC(r),w=oc(u),[g,b]=gn({prop:o,defaultProp:s??null,onChange:f,caller:af});return i.jsx(g6,{scope:r,name:n,required:a,disabled:l,value:g,onValueChange:b,children:i.jsx(cS,{asChild:!0,...p,orientation:c,dir:w,loop:d,children:i.jsx(ue.div,{role:"radiogroup","aria-required":a,"aria-orientation":c,"data-disabled":l?"":void 0,dir:w,...m,ref:t})})})});sC.displayName=af;var oC="RadioGroupItem",aC=h.forwardRef((e,t)=>{const{__scopeRadioGroup:r,disabled:n,...s}=e,o=y6(oC,r),a=o.disabled||n,l=rC(r),c=nC(r),u=h.useRef(null),d=be(t,u),f=o.value===s.value,m=h.useRef(!1);return h.useEffect(()=>{const p=g=>{m6.includes(g.key)&&(m.current=!0)},w=()=>m.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",w),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",w)}},[]),i.jsx(uS,{asChild:!0,...l,focusable:!a,active:f,children:i.jsx(JN,{disabled:a,required:o.required,checked:f,...c,...s,name:o.name,ref:d,onCheck:()=>o.onValueChange(s.value),onKeyDown:Y(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:Y(s.onFocus,()=>{var p;m.current&&((p=u.current)==null||p.click())})})})});aC.displayName=oC;var v6="RadioGroupIndicator",iC=h.forwardRef((e,t)=>
530{const{__scopeRadioGroup:r,...n}=e,s=nC(r);return i.jsx(XN,{...s,...n,ref:t})});iC.displayName=v6;var lC=sC,cC=aC,x6=iC;const uC=h.forwardRef(({className:e,...t},r)=>i.jsx(lC,{className:D("grid gap-2",e),...t,ref:r}));uC.displayName=lC.displayName;const dC=h.forwardRef(({className:e,...t},r)=>i.jsx(cC,{ref:r,className:D("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:i.jsx(x6,{className:"flex items-center justify-center",children:i.jsx(X1,{className:"h-2.5 w-2.5 fill-current text-current"})})}));dC.displayName=cC.displayName;const fC=h.forwardRef(({className:e,...t},r)=>i.jsx("textarea",{className:D("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-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:r,...t}));fC.displayName="Textarea";const w6=({checkoutType:e,orderNumber:t})=>{const[r,n]=h.useState(null),[s,o]=h.useState(!0),[a,l]=h.useState(!1),[c,u]=h.useState(!1),[d,f]=h.useState(""),[m,p]=h.useState([]),[w,g]=h.useState("");h.useEffect(()=>{(async()=>{const{data:x}=await ie.from("survey_questions").select("*").eq("is_active",!0).limit(1).maybeSingle();if(x){const _=x.show_on_types,S=e==="cart"?"registration":e;(!_||_.length===0||S&&_.includes(S))&&n({id:x.id,question_text:x.question_text,question_type:x.question_type,options:x.options||[]})}o(!1)})()},[e]);const b=async()=>{if(!r)return;u(!0);const y={question_id:r.id,checkout_type:e==="cart"?"registration":e,order_number:t};r.question_type==="multiple_choice"?y.selected_options=[d]:r.question_type==="checkbox"?y.selected_options=m:y.free_text=w,await ie.from("survey_responses").insert(y),l(!0),u(!1)},v=()=>r?r.question_type==="multiple_choice"?d!=="":r.question_type==="checkbox"?m.length>0:w.trim().length>0:!1;return s||!r?null:a?i.jsx(ot,{className:"mt-6 border-border/50 bg-muted/30",children:i.jsxs(at,{className:"p-6 flex items-center gap-3 justify-center text-muted-foreground",children:[i.jsx(Z1,{className:"w-5 h-5 text-success"}),"Thanks for your feedback!"]})}):i.jsx(ot,{className:"mt-6 border-border/50",children:i.jsxs(at,{className:"p-6 space-y-4",children:[i.jsx("p",{className:"font-medium text-foreground text-left",children:r.question_text}),r.question_type==="multiple_choice"&&i.jsx(uC,{value:d,onValueChange:f,className:"space-y-2",children:r.options.map(y=>i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(dC,{value:y,id:`opt-${y}`}),i.jsx(Ye,{htmlFor:`opt-${y}`,className:"cursor-pointer",children:y})]},y))}),r.question_type==="checkbox"&&i.jsx("div",{className:"space-y-2",children:r.options.map(y=>i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(oy,{id:`chk-${y}`,checked:m.includes(y),onCheckedChange:x=>{p(_=>x?[..._,y]:_.filter(S=>S!==y))}}),i.jsx(Ye,{htmlFor:`chk-${y}`,className:"cursor-pointer",children:y})]},y))}),r.question_type==="open_text"&&i.jsx(fC,{value:w,onChange:y=>g(y.target.value),placeholder:"Your answer...",maxLength:1e3}),i.jsx(ce,{onClick:b,disabled:!v()||c,size:"sm",variant:"outline",className:"w-full sm:w-auto",children:c?"Submitting...":"Submit"})]})})},b6=()=>{const[e]=DA(),t=e.get("type"),r=e.get("session_id"),n=e.get("free")==="true",s=e.get("order_number"),{clearCart:o}=Vt(),{activeEvent:a}=ht(),l=h.useRef(!1),c=h.useRef(!1),u=a!=null&&a.event_date?Tg(a.event_date):new Date().getFullYear();h.useEffect(()=>{l.current||(l.current=!0,o())},[o]),h.useEffect(()=>{c.current||(c.current=!0,(t==="cart"||t==="registration")&&Ej.completed({event_id:(a==null?void 0:a.id)||"",amount:0}),t==="donation"&&Tj.completed({amount:0}),t==="sponsorship"&&Pj.completed({}))},[t,a==null?void 0:a.id]);const f=(()=>{if(t==="cart"&&n)return{title:"Registration Complete!",description:s?`Your free registration is confirmed! Order #${s}. A confirmation email with race details has been sent.`:"Your free registration is confirmed! A confirmation email with race details has been sent.",icon:"ð"};switch(t){case"donation":return{title:"Thank You for Your Donation!",description:"Your generous contribution will help local families facing medical hardship. A receipt has been sent to your email.",icon:"â¤ï¸"};case"registration":case"cart":return{title:"Registration Complete!",description:`You're all set for the Happy Smackah ${u} 5K Fun Run/Walk! A confirmation email with race details has been sent.`,icon:"ð"};case"sponsorship":return{title:"Welcome to Our Sponsor Family!",description:"Thank y
530ou for becoming a Happy Smackah sponsor. Our team will reach out shortly to coordinate your benefits.",icon:"ð¤"};default:return{title:"Payment Successful!",description:"Thank you for your support. A confirmation email has been sent.",icon:"â
"}}})();return i.jsxs(i.Fragment,{children:[i.jsxs(Ro,{children:[i.jsx("title",{children:"Payment Successful | Happy Smackah"}),i.jsx("meta",{name:"description",content:"Your payment was successful. Thank you for your support!"})]}),i.jsx(Ts,{children:i.jsx("section",{className:"pt-32 pb-20 min-h-[80vh]",children:i.jsx("div",{className:"container mx-auto px-4",children:i.jsxs("div",{className:"max-w-lg mx-auto text-center",children:[i.jsx(ot,{variant:"elevated",className:"p-8",children:i.jsxs(at,{className:"p-0 space-y-6",children:[i.jsx("div",{className:"w-20 h-20 rounded-full bg-success/10 flex items-center justify-center mx-auto",children:i.jsx(Z1,{className:"w-10 h-10 text-success"})}),i.jsx("div",{className:"text-5xl",children:f.icon}),i.jsx("h1",{className:"text-3xl font-heading font-bold text-foreground",children:f.title}),i.jsx("p",{className:"text-muted-foreground",children:f.description}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 pt-4",children:[i.jsx(ce,{asChild:!0,variant:"hero",className:"flex-1 group",children:i.jsxs(ee,{to:"/",children:[i.jsx(P4,{className:"w-5 h-5"}),"Back to Home",i.jsx(_t,{className:"w-5 h-5 transition-transform group-hover:translate-x-1"})]})}),(t==="registration"||t==="cart")&&i.jsx(ce,{asChild:!0,variant:"outline",className:"flex-1",children:i.jsxs(ee,{to:"/events",children:[i.jsx(Rg,{className:"w-5 h-5"}),"View Event Details"]})})]})]})}),i.jsx(w6,{checkoutType:t,orderNumber:s}),!n&&i.jsx(c6,{sessionId:r})]})})})})]})},_6=h.lazy(()=>ze(()=>import("./About-BdIJp2Yy.js"),__vite__mapDeps([0,1]))),S6=h.lazy(()=>ze(()=>import("./Events-B6Z7RwE0.js"),__vite__mapDeps([2,3,4,5,6,7]))),k6=h.lazy(()=>ze(()=>import("./Donate-CIwOFFPU.js"),[])),j6=h.lazy(()=>ze(()=>import("./PartnerRegister-CTZi-vw1.js"),__vite__mapDeps([8,9]))),N6=h.lazy(()=>ze(()=>import("./Sponsors-BvEPP0z6.js"),[])),C6=h.lazy(()=>ze(()=>import("./EventSponsors-DbpQqWzY.js"),[])),E6=h.lazy(()=>ze(()=>import("./Gallery-BuW-wA3y.js"),__vite__mapDeps([10,11,12,13,14,15]))),T6=h.lazy(()=>ze(()=>import("./Profile-Cs4Dle2X.js"),__vite__mapDeps([16,17,18,19,20,21,22,23,24,25,14,26,27,28,29,30,31,1,3,32,33,34,9,35]))),P6=h.lazy(()=>ze(()=>import("./Settings-Wjw2-BRG.js"),__vite__mapDeps([36,37,17,18,38,12,39,40,41]))),R6=h.lazy(()=>ze(()=>import("./MyOrders-vPbKPS8I.js"),__vite__mapDeps([42,11,43,1,44]))),O6=h.lazy(()=>ze(()=>import("./OrderDetail-DFT-QCai.js"),__vite__mapDeps([45,43,1]))),A6=h.lazy(()=>ze(()=>import("./AdminDashboard-6HgUxDx8.js").then(e=>e.a),__vite__mapDeps([46,20,47,44,48,4,49]))),I6=h.lazy(()=>ze(()=>import("./History-QwFOeIIS.js"),[])),D6=h.lazy(()=>ze(()=>import("./Story-D34MGbnG.js"),__vite__mapDeps([50,51,44,28,15]))),M6=h.lazy(()=>ze(()=>import("./Press-DqD1kQAR.js"),__vite__mapDeps([52,49]))),L6=h.lazy(()=>ze(()=>import("./Support-cfOZWkkP.js"),__vite__mapDeps([53,21]))),$6=h.lazy(()=>ze(()=>import("./Nominate-C7AJjydf.js"),__vite__mapDeps([54,55,33]))),F6=h.lazy(()=>ze(()=>import("./Course-DWFe6nQ6.js"),__vite__mapDeps([56,11,4,48,6,57,58,59,60,61,5]))),U6=h.lazy(()=>ze(()=>import("./VirtualCourses-Bjia559h.js"),__vite__mapDeps([62,28,63,12,64,6]))),z6=h.lazy(()=>ze(()=>import("./Unsubscribe-dB_Xq0SC.js"),__vite__mapDeps([65,34,33]))),B6=h.lazy(()=>ze(()=>import("./EmailPreferences-DCRvINmB.js"),__vite__mapDeps([66,19,33,9]))),V6=h.lazy(()=>ze(()=>import("./ConfirmEmailChange-BjylnyUr.js"),__vite__mapDeps([67,33,68]))),H6=h.lazy(()=>ze(()=>import("./CheckIn-XAoasxjQ.js"),__vite__mapDeps([69,70,49,71]))),W6=h.lazy(()=>ze(()=>import("./MerchPickup-BqTzeY_2.js"),__vite__mapDeps([72,70,49,47,71]))),q6=h.lazy(()=>ze(()=>import("./MerchLanding-BWIbzPPg.js"),__vite__mapDeps([73,40,23]))),K6=h.lazy(()=>ze(()=>import("./NotFound-dWiuqUX-.js"),[])),G6=()=>i.jsx("div",{className:"min-h-screen flex items-center justify-center",children:i.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}),Y6=new AO({defaultOptions:{queries:{staleTime:5*60*1e3,gcTime:10*60*1e3}}}),Q6=()=>i.jsx(C1,{children:i.jsx(IO,{client:Y6,children:i.jsx(GM,{children:i.jsx(JM,{children:i.jsx(ZM,{children:i.jsxs(r4,{children:[i.jsx(s4,{}),i.jsxs(cO,{children:[i.jsx(wP,{}),i.jsx(RA,{children:i.jsx(p4,{children:i.jsx(h.Suspense,{fallback:i.jsx(G6,{}),children:i.jsxs(SA,{children:[i.jsx(Oe,{path:"/",element:i.jsx(EF,{})}),i.jsx(Oe,{path:"/about",element:i.jsx(_6,{})}),i.jsx(Oe,{path:"/events",element:i.jsx(S6,{})}),i.jsx(Oe,{path:"/donate",element:i.jsx(k6,{})}),i.jsx(Oe,{path:"/register",element:i.jsx(n6,{})}),i.jsx(Oe,{path:"/checkout",element:i.jsx(Zs,{children:i.jsx(o6,{})})}),i.jsx(Oe,{path:"/partner/:slug",element:i.jsx(j6,{})}),i.jsx(Oe,{path:"/sponsors",element:i.jsx(N6,{})}),i.jsx(Oe,{path:"/sponsors/:slug",element:i.jsx(C6,{})}),i.jsx(Oe,{path:"/gallery",element:i.jsx(E6,{})}),i.jsx(Oe,{path:"/history",element:i.jsx(I6,{})}),i.jsx(Oe,{path:"/stories/:slug",element:i.jsx(D6,{})}),i.jsx(Oe,{path:"/news",element:i.jsx(M6,{})}),i.jsx(Oe,{path:"/support",element:i.jsx(L6,{})}),i.jsx(Oe,{path:"/nominate",element:i.jsx($6,{})}),i.jsx(Oe,{path:"/course",element:i.jsx(F6,{})}),i.jsx(Oe,{path:"/virtual-courses",element:i.jsx(U6,{})}),i.jsx(Oe,{path:"/shop/:slug",element:i.jsx(q6,{})}),i.jsx(Oe,{path:"/unsubscribe/:token",element:i.jsx(z6,{})}),i.jsx(Oe,{path:"/email-preferences/:token",element:i.jsx(B6,{})}),i.jsx(Oe,{path:"/confirm-email-change",element:i.jsx(V6,{})}),i.jsx(Oe,{path:"/auth",element:i.jsx(sU,{})}),i.jsx(Oe,{path:"/payment-success",element:i.jsx(b6,{})}),i.jsx(Oe,{path:"/order/:type/:token",element:i.jsx(O6,{})}),i.jsx(Oe,{path:"/my-orders",element:i.jsx(Zs,{children:i.jsx(R6,{})})}),i.jsx(Oe,{path:"/profile",element:i.jsx(Zs,{children:i.jsx(T6,{})})}),i.jsx(Oe,{path:"/settings",element:i.jsx(Zs,{children:i.jsx(P6,{})})}),i.jsx(Oe,{path:"/admin",element:i.jsx(Zs,{requireStaff:!0,children:i.jsx(A6,{})})}),i.jsx(Oe,{path:"/check-in",element:i.jsx(Zs,{requireCheckInStaff:!0,children:i.jsx(H6,{})})}),i.jsx(Oe,{path:"/merch-pickup",element:i.jsx(Zs,{requireCheckInStaff:!0,children:i.jsx(W6,{})})}),i.jsx(Oe,{path:"*",element:i.jsx(K6,{})})]})})})})]})]})})})})})});m_(document.getElementById("root")).render(i.jsx(Q6,{}));export{uo as $,x4 as A,ce as B,ot as C,Vi as D,KU as E,Rs as F,E4 as G,Ro as H,So as I,Os as J,On as K,Ts as L,tS as M,bo as N,Ok as O,t6 as P,Tj as Q,re as R,_o as S,lB as T,Fn as U,rh as V,Xa as W,M4 as X,ba as Y,_a as Z,hn as _,at as a,uO as a$,Tt as a0,ZU as a1,zd as a2,rz as a3,tz as a4,sz as a5,ph as a6,W0 as a7,yn as a8,XU as a9,B4 as aA,Qz as aB,VN as aC,HN as aD,qN as aE,WN as aF,Xr as aG,Um as aH,J1 as aI,j4 as aJ,N4 as aK,O3 as aL,_B as aM,eS as aN,ze as aO,pz as aP,gz as aQ,I4 as aR,Qj as aS,Jj as aT,Zj as aU,rS as aV,w4 as aW,ei as aX,F4 as aY,nB as aZ,sB as a_,k4 as aa,z4 as ab,U4 as ac,A4 as ad,Oi as ae,ae as af,sc as ag,Vn as ah,Ye as ai,Pt as aj,Jc as ak,uC as al,dC as am,Ot as an,fC as ao,uB as ap,L4 as aq,co as ar,V4 as as,iB as at,Ag as au,op as av,Hr as aw,Kx as ax,Gx as ay,$4 as az,vt as b,ty as b$,T4 as b0,b4 as b1,Dg as b2,Zt as b3,vB as b4,W as b5,gn as b6,be as b7,oc as b8,Y as b9,pt as bA,yt as bB,Jz as bC,O4 as bD,D4 as bE,ui as bF,cO as bG,zN as bH,UN as bI,Md as bJ,bO as bK,mO as bL,oB as bM,ym as bN,Mr as bO,Ld as bP,fO as bQ,hO as bR,a1 as bS,NO as bT,gO as bU,$t as bV,aB as bW,Vd as bX,cS as bY,uS as bZ,It as b_,ue as ba,ir as bb,HU as bc,xB as bd,wB as be,pB as bf,Rk as bg,X1 as bh,H4 as bi,oy as b
530j,ts as bk,Fm as bl,Ao as bm,KM as bn,JU as bo,S4 as bp,Kz as bq,DN as br,MN as bs,$N as bt,FN as bu,LN as bv,q4 as bw,Xu as bx,Xz as by,tU as bz,ee as c,lg as c0,Cl as c1,PO as c2,Gl as c3,cB as c4,ln as c5,Xm as c6,Z6 as c7,Z_ as c8,tB as c9,E5 as cA,Pg as cB,j5 as cC,k5 as cD,h_ as cE,fN as cF,W4 as cG,c5 as cH,Pn as cI,GU as cJ,bB as cK,wz as cL,xz as cM,A5 as cN,mB as cO,hB as cP,hN as cQ,rB as cR,P5 as cS,fB as cT,qg as cU,O5 as cV,XM as cW,nc as ca,Ut as cb,d0 as cc,Fl as cd,f0 as ce,mk as cf,Gd as cg,Io as ch,hi as ci,dg as cj,Lg as ck,Wd as cl,Mg as cm,Bd as cn,ec as co,fg as cp,hg as cq,Rd as cr,Od as cs,To as ct,gk as cu,h3 as cv,I5 as cw,ed as cx,p3 as cy,y3 as cz,Bo as d,Rg as e,Eg as f,_4 as g,Og as h,_t as i,i as j,Z1 as k,ur as l,Sr as m,qs as n,_5 as o,DA as p,Hs as q,h as r,ie as s,Vt as t,ht as u,D as v,Jr as w,Oo as x,WU as y,qU as z};
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.