vendor: 16,114 bytes, lines 1-9
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/StatsModal-CNsn7PlC.js","assets/createLucideIcon-CAdyUWaY.js","assets/activity-0J20ZEir.js","assets/x-BrqxZQnZ.js","assets/SettingsModal-DaOiLs9x.js","assets/SyncModal-BqG4SYDZ.js","assets/StudyDesk-BNzQxYkl.js","assets/StudyDesk-BC2x9dpe.css","assets/CalendarWidget-DTz6WwpM.js","assets/CommunityWallModal-CsuJY1TI.js","assets/AdminDashboard-COxCs6Jj.js"])))=>i.map(i=>d[i]); 2import{a as e,i as t,n,r,t as i}from"./createLucideIcon-CAdyUWaY.js";import{n as a,r as o,t as s}from"./x-BrqxZQnZ.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var c=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&ne(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function ee(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ne(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(ee)};else if(typeof MessageChannel<`u`){var te=new MessageChannel,O=te.port2;te.port1.onmessage=ee,D=function(){O.postMessage(null)}}else D=function(){_(ee,0)};function ne(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ne(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),l=t(((e,t)=>{t.exports=c()})),u=t((e=>{var t=l(),n=r(),i=o();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function u(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 d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(c(e)!==e)throw Error(a(188))}function p(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return f(i),e;if(o===r)return f(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),ee=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),te=Symbol.for(`react.activity`),O=Symbol.for(`react.memo_cache_sentinel`),ne=Symbol.iterator;function re(e){return typeof e!=`object`||!e?null:(e=ne&&e[ne]||e[`@@iterator`],typeof e==`function`?e:null)}var ie=Symbol.for(`react.client.reference`);function ae(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ie?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case te:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ee:return t=e.displayName||null,t===null?ae(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return ae(e(t))}catch{}}return null}var oe=Array.isArray,k=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se={pending:!1,data:null,method:null,action:null},ce=[],le=-1;function ue(e){return{current:e}}function j(e){0>le||(e.current=ce[le],ce[le]=null,le--)}function M(e,t){le++,ce[le]=e.current,e.current=t}var N=ue(null),de=ue(null),fe=ue(null),pe=ue(null);function me(e,t){switch(M(fe,t),M(de,e),M(N,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}j(N),M(N,e)}function he(){j(N),j(de),j(fe)}function ge(e){e.memoizedState!==null&&M(pe,e);var t=N.current,n=Hd(t,e.type);t!==n&&(M(de,e),M(N,n))}function _e(e){de.current===e&&(j(N),j(de)),pe.current===e&&(j(pe),Qf._currentValue=se)}var ve,ye;function be(e){if(ve===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ve=t&&t[1]||``,ye=-1<e.stack.indexOf(` 3 at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return` 4`+ve+e+ye}var xe=!1;function Se(e,t){if(!e||xe)return``;xe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(` 5`),l=s.split(` 6`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=` 7`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{xe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?be(n):``}function Ce(e,t){switch(e.tag){case 26:case 27:case 5:return be(e.type);case 16:return be(`Lazy`);case 13:return e.child!==t&&t!==null?be(`Suspense Fallback`):be(`Suspense`);case 19:return be(`SuspenseList`);case 0:case 15:return Se(e.type,!1);case 11:return Se(e.type.render,!1);case 1:return Se(e.type,!0);case 31:return be(`Activity`);default:return``}}function we(e){try{var t=``,n=null;do t+=Ce(e,n),n=e,e=e.return;while(e);return t}catch(e){return` 8Error generating stack: `+e.message+` 9`+e.stack}}var Te=Object.prototype.hasOwnProperty,Ee=t.unstable_scheduleCallback,De=t.unstable_cancelCallback,Oe=t.unstable_shouldYield,ke=t.unstable_requestPaint,Ae=t.unstable_now,je=t.unstable_getCurrentPriorityLevel,Me=t.unstable_ImmediatePriority,Ne=t.unstable_UserBlockingPriority,Pe=t.unstable_NormalPriority,Fe=t.unstable_LowPriority,Ie=t.unstable_IdlePriority,Le=t.log,Re=t.unstable_setDisableYieldValue,ze=null,Be=null;function Ve(e){if(typeof Le==`function`&&Re(e),Be&&typeof Be.setStrictMode==`function`)try{Be.setStrictMode(ze,e)}catch{}}var He=Math.clz32?Math.clz32:Ge,Ue=Math.log,We=Math.LN2;function Ge(e){return e>>>=0,e===0?32:31-(Ue(e)/We|0)|0}var Ke=256,qe=262144,Je=4194304;function Ye(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Xe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ye(n))):i=Ye(o):i=Ye(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ye(n))):i=Ye(o)):i=Ye(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ze(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Qe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function $e(){var e=Je;return Je<<=1,!(Je&62914560)&&(Je=4194304),e}function et(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function tt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function nt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-He(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&rt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function rt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-He(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function it(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-He(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function at(e,t){var n=t&-t;return n=n&42?1:ot(n),(n&(e.suspendedLanes|t))===0?n:0}function ot(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function st(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ct(){var e=A.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function lt(e,t){var n=A.p;try{return A.p=e,t()}finally{A.p=n}}var ut=Math.random().toString(36).slice(2),dt=`__reactFiber$`+ut,ft=`__reactProps$`+ut,pt=`__reactContainer$`+ut,mt=`__reactEvents$`+ut,ht=`__reactListeners$`+ut,gt=`__reactHandles$`+ut,_t=`__reactResources$`+ut,vt=`__reactMarker$`+ut;function yt(e){delete e[dt],delete e[ft],delete e[mt],delete e[ht],delete e[gt]}function bt(e){var t=e[dt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[pt]||n[dt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[dt])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function xt(e){if(e=e[dt]||e[pt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function St(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function Ct(e){var t=e[_t];return t||=e[_t]={hoistableStyles:new Map,hoistableScripts:new Map},t}function wt(e){e[vt]=!0}var Tt=new Set,Et={};function Dt(e,t){Ot(e,t),Ot(e+`Capture`,t)}function Ot(e,t){for(Et[e]=t,e=0;e<t.length;e++)Tt.add(t[e])}var kt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u
9037D\\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]*$`),At={},jt={};function Mt(e){return Te.call(jt,e)?!0:Te.call(At,e)?!1:kt.test(e)?jt[e]=!0:(At[e]=!0,!1)}function Nt(e,t,n){if(Mt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Pt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Ft(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function It(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Lt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Rt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function zt(e){if(!e._valueTracker){var t=Lt(e)?`checked`:`value`;e._valueTracker=Rt(e,t,``+e[t])}}function Bt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Lt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Vt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Ht=/[\n"\\]/g;function Ut(e){return e.replace(Ht,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Wt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+It(t)):e.value!==``+It(t)&&(e.value=``+It(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Kt(e,o,It(n)):Kt(e,o,It(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+It(s):e.removeAttribute(`name`)}function Gt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){zt(e);return}n=n==null?``:``+It(n),t=t==null?n:``+It(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),zt(e)}function Kt(e,t,n){t===`number`&&Vt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function qt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+It(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Jt(e,t,n){if(t!=null&&(t=``+It(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+It(n)}function Yt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(oe(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}
vendor: 9,505 bytes, line 9
9n=It(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),zt(e)}function Xt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Zt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function P(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Zt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Qt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(a(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&P(e,i,r)}else for(var o in t)t.hasOwnProperty(o)&&P(e,o,t[o])}function $t(e){if(e.indexOf(`-`)===-1)return!1;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 en=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),tn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function nn(e){return tn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function rn(){}var an=null;function on(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var sn=null,cn=null;function ln(e){var t=xt(e);if(t&&(e=t.stateNode)){var n=e[ft]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Wt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Ut(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[ft]||null;if(!i)throw Error(a(90));Wt(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Bt(r)}break a;case`textarea`:Jt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&qt(e,!!n.multiple,t,!1)}}}var un=!1;function dn(e,t,n){if(un)return e(t,n);un=!0;try{return e(t)}finally{if(un=!1,(sn!==null||cn!==null)&&(bu(),sn&&(t=sn,e=cn,cn=sn=null,ln(t),e)))for(t=0;t<e.length;t++)ln(e[t])}}function fn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ft]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(a(231,t,typeof n));return n}var pn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),mn=!1;if(pn)try{var hn={};Object.defineProperty(hn,"passive",{get:function(){mn=!0}}),window.addEventListener(`test`,hn,hn),window.removeEventListener(`test`,hn,hn)}catch{mn=!1}var gn=null,_n=null,vn=null;function yn(){if(vn)return vn;var e,t=_n,n=t.length,r,i=`value`in gn?gn.value:gn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return vn=i.slice(e,1<r?1-r:void 0)}function bn(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 xn(){return!0}function Sn(){return!1}function Cn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?xn:Sn,this.isPropagationStopped=Sn,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=xn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=xn)},persist:function(){},isPersistent:xn}),t}var wn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Tn=Cn(wn),En=h({},wn,{view:0,detail:0}),Dn=Cn(En),On,kn,An,jn=h({},En,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hn,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!==An&&(An&&e.type===`mousemove`?(On=e.screenX-An.screenX,kn=e.screenY-An.screenY):kn=On=0,An=e),On)},movementY:function(e){return`movementY`in e?e.movementY:kn}}),Mn=Cn(jn),Nn=Cn(h({},jn,{dataTransfer:0})),Pn=Cn(h({},En,{relatedTarget:0})),Fn=Cn(h({},wn,{animationName:0,elapsedTime:0,pseudoElement:0})),In=Cn(h({},wn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Ln=Cn(h({},wn,{data:0})),Rn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},zn={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:`F
95`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Bn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Vn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Bn[e])?!!t[e]:!1}function Hn(){return Vn}var Un=Cn(h({},En,{key:function(e){if(e.key){var t=Rn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=bn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?zn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hn,charCode:function(e){return e.type===`keypress`?bn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?bn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Wn=Cn(h({},jn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Gn=Cn(h({},En,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hn})),Kn=Cn(h({},wn,{propertyName:0,elapsedTime:0,pseudoElement:0})),qn=Cn(h({},jn,{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})),Jn=Cn(h({},wn,{newState:0,oldState:0})),Yn=[9,13,27,32],Xn=pn&&`CompositionEvent`in window,Zn=null;pn&&`documentMode`in document&&(Zn=document.documentMode);var Qn=pn&&`TextEvent`in window&&!Zn,$n=pn&&(!Xn||Zn&&8<Zn&&11>=Zn),er=` `,tr=!1;function nr(e,t){switch(e){case`keyup`:return Yn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function rr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var ir=!1;function ar(e,t){switch(e){case`compositionend`:return rr(t);case`keypress`:return t.which===32?(tr=!0,er):null;case`textInput`:return e=t.data,e===er&&tr?null:e;default:return null}}function or(e,t){if(ir)return e===`compositionend`||!Xn&&nr(e,t)?(e=yn(),vn=_n=gn=null,ir=!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 $n&&t.locale!==`ko`?null:t.data;default:return null}}var sr={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 cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!sr[e.type]:t===`textarea`}function lr(e,t,n,r){sn?cn?cn.push(r):cn=[r]:sn=r,t=Ed(t,`onChange`),0<t.length&&(n=new Tn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var ur=null,dr=null;function fr(e){yd(e,0)}function pr(e){if(Bt(St(e)))return e}function mr(e,t){if(e===`change`)return t}var hr=!1;if(pn){var gr;if(pn){var _r=`oninput`in document;if(!_r){var vr=document.createElement(`div`);vr.setAttribute(`oninput`,`return;`),_r=typeof vr.oninput==`function`}gr=_r}else gr=!1;hr=gr&&(!document.documentMode||9<document.documentMode)}function yr(){ur&&(ur.detachEvent(`onpropertychange`,br),dr=ur=null)}function br(e){if(e.propertyName===`value`&&pr(dr)){var t=[];lr(t,dr,e,on(e)),dn(fr,t)}}function F(e,t,n){e===`focusin`?(yr(),ur=t,dr=n,ur.attachEvent(`onpropertychange`,br)):e===`focusout`&&yr()}function xr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return pr(dr)}function Sr(e,t){if(e===`click`)return pr(t)}function Cr(e,t){if(e===`input`||e===`change`)return pr(t)}function wr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Tr=typeof Object.is==`function`?Object.is:wr;function Er(e,t){if(Tr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Te.call(t,i)||!Tr(e[i],t[i]))return!1}return!0}function Dr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Or(e,t){var n=Dr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Dr(n)}}function kr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?kr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ar(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Vt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Vt(e.document)}return t}function jr(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`)}var Mr=pn&&`documentMode`in document&&11>=document.documentMode,Nr=null,Pr=null,Fr=null,Ir=!1;function Lr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ir||Nr==null||Nr!==Vt(r)||(r=Nr,`selectionStart`in r&&jr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focu
vendor: 72,215 bytes, line 9
9sNode:r.focusNode,focusOffset:r.focusOffset}),Fr&&Er(Fr,r)||(Fr=r,r=Ed(Pr,`onSelect`),0<r.length&&(t=new Tn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Nr)))}function Rr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var zr={animationend:Rr(`Animation`,`AnimationEnd`),animationiteration:Rr(`Animation`,`AnimationIteration`),animationstart:Rr(`Animation`,`AnimationStart`),transitionrun:Rr(`Transition`,`TransitionRun`),transitionstart:Rr(`Transition`,`TransitionStart`),transitioncancel:Rr(`Transition`,`TransitionCancel`),transitionend:Rr(`Transition`,`TransitionEnd`)},Br={},Vr={};pn&&(Vr=document.createElement(`div`).style,`AnimationEvent`in window||(delete zr.animationend.animation,delete zr.animationiteration.animation,delete zr.animationstart.animation),`TransitionEvent`in window||delete zr.transitionend.transition);function Hr(e){if(Br[e])return Br[e];if(!zr[e])return e;var t=zr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Vr)return Br[e]=t[n];return e}var Ur=Hr(`animationend`),Wr=Hr(`animationiteration`),Gr=Hr(`animationstart`),Kr=Hr(`transitionrun`),qr=Hr(`transitionstart`),Jr=Hr(`transitioncancel`),Yr=Hr(`transitionend`),Xr=new Map,Zr=`abort auxClick beforeToggle 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(` `);Zr.push(`scrollEnd`);function Qr(e,t){Xr.set(e,t),Dt(t,[e])}var $r=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ei=[],ti=0,ni=0;function ri(){for(var e=ti,t=ni=ti=0;t<e;){var n=ei[t];ei[t++]=null;var r=ei[t];ei[t++]=null;var i=ei[t];ei[t++]=null;var a=ei[t];if(ei[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&si(n,i,a)}}function ii(e,t,n,r){ei[ti++]=e,ei[ti++]=t,ei[ti++]=n,ei[ti++]=r,ni|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ai(e,t,n,r){return ii(e,t,n,r),ci(e)}function oi(e,t){return ii(e,null,null,t),ci(e)}function si(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-He(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ci(e){if(50<du)throw du=0,fu=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var li={};function ui(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function di(e,t,n,r){return new ui(e,t,n,r)}function fi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function pi(e,t){var n=e.alternate;return n===null?(n=di(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function mi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function hi(e,t,n,r,i,o){var s=0;if(r=e,typeof e==`function`)fi(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,N.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case te:return e=di(31,n,t,i),e.elementType=te,e.lanes=o,e;case y:return gi(n.children,i,o,t);case b:s=8,i|=24;break;case x:return e=di(12,n,t,i|2),e.elementType=x,e.lanes=o,e;case T:return e=di(13,n,t,i),e.elementType=T,e.lanes=o,e;case E:return e=di(19,n,t,i),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case ee:s=14;break a;case D:s=16,r=null;break a}s=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=di(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function gi(e,t,n,r){return e=di(7,e,r,t),e.lanes=n,e}function _i(e,t,n){return e=di(6,e,null,t),e.lanes=n,e}function I(e){var t=di(18,null,null,0);return t.stateNode=e,t}function vi(e,t,n){return t=di(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var yi=new WeakMap;function bi(e,t){if(typeof e==`object`&&e){var n=yi.get(e);return n===void 0?(t={value:e,source:t,stack:we(t)},yi.set(e,t),t):n}return{value:e,source:t,stack:we(t)}}var xi=[],Si=0,Ci=null,wi=0,Ti=[],Ei=0,Di=null,Oi=1,ki=``;function Ai(e,t){xi[Si++]=wi,xi[Si++]=Ci,Ci=e,wi=t}function ji(e,t,n){Ti[Ei++]=Oi,Ti[Ei++]=ki,Ti[Ei++]=Di,Di=e;var r=Oi;e=ki;var i=32-He(r)-1;r&=~(1<<i),n+=1;var a=32-He(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Oi=1<<32-He(t)+i|n<<i|r,ki=a+e}else Oi=1<<a|n<<i|r,ki=e}function Mi(e){e.return!==null&&(Ai(e,1),ji(e,1,0))}function Ni(e){for(;e===Ci;)Ci=xi[--Si],xi[Si]=null,wi=xi[--Si],xi[Si]=null;for(;e===Di;)Di=Ti[--Ei],Ti[Ei]=null,ki=Ti[--Ei],Ti[Ei]=null,Oi=Ti[--Ei],Ti[Ei]=null}function Pi(e,t){Ti[Ei++]=Oi,Ti[Ei++]=ki,Ti[Ei++]=Di,Oi=t.id,ki=t.overflow,Di=e}var Fi=null,L=null,R=!1,Ii=null,Li=!1,Ri=Error(a(519));function zi(e){throw Gi(bi(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ri}function Bi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[dt]=e,t[ft]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<_d.length;n++)Q(_d[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),Gt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),Yt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Md(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=rn),t=!0):t=!1,t||zi(e,!0)}function Vi(e){for(Fi=e.return;Fi;)switch(Fi.tag){case 5:case 31:case 13:Li=!1;return;case 27:case 3:Li=!0;return;default:Fi=Fi.return}}function Hi(e){if(e!==Fi)return!1;if(!R)return Vi(e),R=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&L&&zi(e),Vi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));L=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));L=uf(e)}else t===27?(t=L,Zd(e.type)?(e=lf,lf=null,L=e):L=t):L=Fi?cf(e.stateNode.nextSibling):null;return!0}function Ui(){L=Fi=null,R=!1}function Wi(){var e=Ii;return e!==null&&(Zl===null?Zl=e:Zl.push.apply(Zl,e),Ii=null),e}function Gi(e){Ii===null?Ii=[e]:Ii.push(e)}var Ki=ue(null),qi=null,z=null;function Ji(e,t,n){M(Ki,t._currentValue),t._currentValue=n}function Yi(e){e._currentValue=Ki.current,j(Ki)}function Xi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Zi(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var s=i.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Xi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(a(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Xi(s,n,e),s=null}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function Qi(e,t,n,r){e=null;for(var i=t,o=!1;i!==null;){if(!o){if(i.flags&524288)o=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(a(387));if(s=s.memoizedProps,s!==null){var c=i.type;Tr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===pe.current){if(s=i.alternate,s===null)throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}i=i.return}e!==null&&Zi(t,e,n,r),t.flags|=262144}function $i(e){for(e=e.firstContext;e!==null;){if(!Tr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ea(e){qi=e,z=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function B(e){return na(qi,e)}function ta(e,t){return qi===null&&ea(e),na(e,t)}function na(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},z===null){if(e===null)throw Error(a(308));z=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else z=z.next=t;return n}var ra=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ia=t.unstable_scheduleCallback,aa=t.unstable_NormalPriority,oa={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sa(){return{controller:new ra,data:new Map,refCount:0}}function ca(e){e.refCount--,e.refCount===0&&ia(aa,function(){e.controller.abort()})}var la=null,ua=0,da=0,fa=null;function pa(e,t){if(la===null){var n=la=[];ua=0,da=dd(),fa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ua++,t.then(ma,ma),t}function ma(){if(--ua===0&&la!==null){fa!==null&&(fa.status=`fulfilled`);var e=la;la=null,da=0,fa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ha(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ga=k.S;k.S=function(e,t){eu=Ae(),typeof t==`object`&&t&&typeof t.then==`function`&&pa(e,t),ga!==null&&ga(e,t)};var _a=ue(null);function va(){var e=_a.current;return e===null?q.pooledCache:e}function ya(e,t){t===null?M(_a,_a.current):M(_a,t.pool)}function ba(){var e=va();return e===null?null:{parent:oa._currentValue,pool:e}}var xa=Error(a(460)),Sa=Error(a(474)),Ca=Error(a(542)),V={then:function(){}};function wa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ta(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(rn,rn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ka(e),e;default:if(typeof t.status==`string`)t.then(rn,rn);else{if(e=q,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ka(e),e}throw Da=t,xa}}function Ea(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Da=e,xa):e}}var Da=null;function Oa(){if(Da===null)throw Error(a(459));var e=Da;return Da=null,e}function ka(e){if(e===xa||e===Ca)throw Error(a(483))}var Aa=null,ja=0;function Ma(e){var t=ja;return ja+=1,Aa===null&&(Aa=[]),Ta(Aa,e,t)}function Na(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Pa(e,t){throw t.$$typeof===g?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Fa(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=pi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=_i(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===D&&Ea(a)===t.type)?(t=i(t,n.props),Na(t,n),t.return=e,t):(t=hi(n.type,n.key,n.props,null,e.mode,r),Na(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=vi(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=gi(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=_i(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=hi(t.type,t.key,t.props,null,e.mode,n),Na(n,t),n.return=e,n;case v:return t=vi(t,e.mode,n),t.return=e,t;case D:return t=Ea(t),f(e,t,n)}if(oe(t)||re(t))return t=gi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ma(t),n);if(t.$$typeof===C)return f(e,ta(e,t),n);Pa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case D:return n=Ea(n),p(e,t,n,r)}if(oe(n)||re(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ma(n),r);if(n.$$typeof===C)return p(e,t,ta(e,n),r);Pa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case D:return r=Ea(r),m(e,t,n,r,i)}if(oe(r)||re(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ma(r),i);if(r.$$typeof===C)return m(e,t,n,ta(t,r),i);Pa(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),R&&Ai(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return R&&Ai(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),R&&Ai(i,h),l}function g(i,s,c,l){if(c==null)throw Error(a(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),R&&Ai(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return R&&Ai(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),R&&Ai(i,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&Ea(l)===r.type){n(e,r.sibling),c=i(r,o.props),Na(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=gi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=hi(o.type,o.key,o.props,null,e.mode,c),Na(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=vi(o,e.mode,c),c.return=e,e=c}return s(e);case D:return o=Ea(o),b(e,r,o,c)}if(oe(o))return h(e,r,o,c);if(re(o)){if(l=re(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ma(o),c);if(o.$$typeof===C)return b(e,r,ta(e,o),c);Pa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=_i(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ja=0;var i=b(e,t,n,r);return Aa=null,i}catch(t){if(t===xa||t===Ca)throw t;var a=di(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ia=Fa(!0),La=Fa(!1),Ra=!1;function za(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ba(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function H(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Va(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ci(e),si(e,null,n),t}return ii(e,r,t,n),ci(e)}function Ha(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,it(e,n)}}function Ua(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Wa=!1;function Ga(){if(Wa){var e=fa;if(e!==null)throw e}}function Ka(e,t,n,r){Wa=!1;var i=e.updateQueue;Ra=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Y&f)===f:(r&f)===f){f!==0&&f===da&&(Wa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Ra=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Gl|=o,e.lanes=o,e.memoizedState=d}}function qa(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function Ja(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)qa(n[e],t)}var Ya=ue(null),Xa=ue(0);function Za(e,t){e=Ul,M(Xa,e),M(Ya,t),Ul=e|t.baseLanes}function Qa(){M(Xa,Ul),M(Ya,Ya.current)}function $a(){Ul=Xa.current,j(Ya),j(Xa)}var eo=ue(null),to=null;function no(e){var t=e.alternate;M(so,so.current&1),M(eo,e),to===null&&(t===null||Ya.current!==null||t.memoizedState!==null)&&(to=e)}function ro(e){M(so,so.current),M(eo,e),to===null&&(to=e)}function io(e){e.tag===22?(M(so,so.current),M(eo,e),to===null&&(to=e)):ao(e)}function ao(){M(so,so.current),M(eo,eo.current)}function oo(e){j(eo),to===e&&(to=null),j(so)}var so=ue(0);function co(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){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 lo=0,U=null,W=null,G=null,uo=!1,fo=!1,po=!1,mo=0,ho=0,go=null,_o=0;function vo(){throw Error(a(321))}function yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Tr(e[n],t[n]))return!1;return!0}function bo(e,t,n,r,i,a){return lo=a,U=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?Ls:Rs,po=!1,a=n(r,i),po=!1,fo&&(a=So(t,n,r,i)),xo(e),a}function xo(e){k.H=Is;var t=W!==null&&W.next!==null;if(lo=0,G=W=U=null,uo=!1,ho=0,go=null,t)throw Error(a(300));e===null||tc||(e=e.dependencies,e!==null&&$i(e)&&(tc=!0))}function So(e,t,n,r){U=e;var i=0;do{if(fo&&(go=null),ho=0,fo=!1,25<=i)throw Error(a(301));if(i+=1,G=W=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}k.H=zs,o=t(n,r)}while(fo);return o}function Co(){var e=k.H,t=e.useState()[0];return t=typeof t.then==`function`?Ao(t):t,e=e.useState()[0],(W===null?null:W.memoizedState)!==e&&(U.flags|=1024),t}function wo(){var e=mo!==0;return mo=0,e}function To(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Eo(e){if(uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}uo=!1}lo=0,G=W=U=null,fo=!1,ho=mo=0,go=null}function Do(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return G===null?U.memoizedState=G=e:G=G.next=e,G}function Oo(){if(W===null){var e=U.alternate;e=e===null?null:e.memoizedState}else e=W.next;var t=G===null?U.memoizedState:G.next;if(t!==null)G=t,W=e;else{if(e===null)throw U.alternate===null?Error(a(467)):Error(a(310));W=e,e={memoizedState:W.memoizedState,baseState:W.baseState,baseQueue:W.baseQueue,queue:W.queue,next:null},G===null?U.memoizedState=G=e:G=G.next=e}return G}function ko(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ao(e){var t=ho;return ho+=1,go===null&&(go=[]),e=Ta(go,e,t),t=U,(G===null?t.memoizedState:G.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?Ls:Rs),e}function jo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Ao(e);if(e.$$typeof===C)return B(e)}throw Error(a(438,String(e)))}function Mo(e){var t=null,n=U.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=U.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ko(),U.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=O;return t.index++,n}function No(e,t){return typeof t==`function`?t(e):t}function Po(e){return Fo(Oo(),W,e)}function Fo(e,t,n){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(lo&f)===f:(Y&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===da&&(d=!0);else if((lo&p)===p){u=u.next,p===da&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,U.lanes|=p,Gl|=p;f=u.action,po&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,U.lanes|=f,Gl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Tr(o,e.memoizedState)&&(tc=!0,d&&(n=fa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Io(e){var t=Oo(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);Tr(o,t.memoizedState)||(tc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Lo(e,t,n){var r=U,i=Oo(),o=R;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!Tr((W||i).memoizedState,n);if(s&&(i.memoizedState=n,tc=!0),i=i.queue,cs(Bo.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||G!==null&&G.memoizedState.tag&1){if(r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,i,n,t),null),q===null)throw Error(a(349));o||lo&127||Ro(r,t,n)}return n}function Ro(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=U.updateQueue,t===null?(t=ko(),U.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function zo(e,t,n,r){t.value=n,t.getSnapshot=r,Vo(t)&&Ho(e)}function Bo(e,t,n){return n(function(){Vo(t)&&Ho(e)})}function Vo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Tr(e,n)}catch{return!0}}function Ho(e){var t=oi(e,2);t!==null&&hu(t,e,2)}function Uo(e){var t=Do();if(typeof e==`function`){var n=e;if(e=n(),po){Ve(!0);try{n()}finally{Ve(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:e},t}function Wo(e,t,n,r){return e.baseState=n,Fo(e,W,typeof r==`function`?r:No)}function Go(e,t,n,r,i){if(Ns(e))throw Error(a(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};k.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ko(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ko(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=k.T,o={};k.T=o;try{var s=n(i,r),c=k.S;c!==null&&c(o,s),qo(e,t,s)}catch(n){Yo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),k.T=a}}else try{a=n(i,r),qo(e,t,a)}catch(n){Yo(e,t,n)}}function qo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Jo(e,t,n)},function(n){return Yo(e,t,n)}):Jo(e,t,n)}function Jo(e,t,n){t.status=`fulfilled`,t.value=n,Xo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ko(e,n)))}function Yo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Xo(t),t=t.next;while(t!==r)}e.action=null}function Xo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zo(e,t){return t}function Qo(e,t){if(R){var n=q.formState;if(n!==null){a:{var r=U;if(R){if(L){b:{for(var i=L,a=Li;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){L=cf(i.nextSibling),r=i.data===`F!`;break a}}zi(r)}r=!1}r&&(t=n[0])}}return n=Do(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zo,lastRenderedState:t},n.queue=r,n=As.bind(null,U,r),r.dispatch=n,r=Uo(!1),a=Ms.bind(null,U,!1,r.queue),r=Do(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Go.bind(null,U,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function $o(e){return es(Oo(),W,e)}function es(e,t,n){if(t=Fo(e,t,Zo)[0],e=Po(No)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Ao(t)}catch(e){throw e===xa?Ca:e}else r=t;t=Oo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(U.flags|=2048,rs(9,{destroy:void 0},ts.bind(null,i,n),null)),[r,a,e]}function ts(e,t){e.action=t}function ns(e){var t=Oo(),n=W;if(n!==null)return es(t,n,e);Oo(),t=t.memoizedState,n=Oo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function rs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=U.updateQueue,t===null&&(t=ko(),U.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function is(){return Oo().memoizedState}function as(e,t,n,r){var i=Do();U.flags|=e,i.memoizedState=rs(1|t,{destroy:void 0},n,r===void 0?null:r)}function os(e,t,n,r){var i=Oo();r=r===void 0?null:r;var a=i.memoizedState.inst;W!==null&&r!==null&&yo(r,W.memoizedState.deps)?i.memoizedState=rs(t,a,n,r):(U.flags|=e,i.memoizedState=rs(1|t,a,n,r))}function ss(e,t){as(8390656,8,e,t)}function cs(e,t){os(2048,8,e,t)}function ls(e){U.flags|=4;var t=U.updateQueue;if(t===null)t=ko(),U.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function us(e){var t=Oo().memoizedState;return ls({ref:t,nextImpl:e}),function(){if(K&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function ds(e,t){return os(4,2,e,t)}function fs(e,t){return os(4,4,e,t)}function ps(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ms(e,t,n){n=n==null?null:n.concat([e]),os(4,4,ps.bind(null,t,e),n)}function hs(){}function gs(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function _s(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&yo(t,r[1]))return r[0];if(r=e(),po){Ve(!0);try{e()}finally{Ve(!1)}}return n.memoizedState=[r,t],r}function vs(e,t,n){return n===void 0||lo&1073741824&&!(Y&261930)?e.memoizedState=t:(e.memoizedState=n,e=mu(),U.lanes|=e,Gl|=e,n)}function ys(e,t,n,r){return Tr(n,t)?n:Ya.current===null?!(lo&42)||lo&1073741824&&!(Y&261930)?(tc=!0,e.memoizedState=n):(e=mu(),U.lanes|=e,Gl|=e,t):(e=vs(e,n,r),Tr(e,t)||(tc=!0),e)}function bs(e,t,n,r,i){var a=A.p;A.p=a!==0&&8>a?a:8;var o=k.T,s={};k.T=s,Ms(e,!1,t,n);try{var c=i(),l=k.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?js(e,t,ha(c,r),pu(e)):js(e,t,r,pu(e))}catch(n){js(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{A.p=a,o!==null&&s.types!==null&&(o.types=s.types),k.T=o}}function xs(){}function Ss(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=Cs(e).queue;bs(e,i,t,se,n===null?xs:function(){return ws(e),n(r)})}function Cs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:se},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ws(e){var t=Cs(e);t.next===null&&(t=e.alternate.memoizedState),js(e,t.next.queue,{},pu())}function Ts(){return B(Qf)}function Es(){return Oo().memoizedState}function Ds(){return Oo().memoizedState}function Os(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=H(n);var r=Va(t,e,n);r!==null&&(hu(r,t,n),Ha(r,t,n)),t={cache:sa()},e.payload=t;return}t=t.return}}function ks(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ns(e)?Ps(t,n):(n=ai(e,t,n,r),n!==null&&(hu(n,e,r),Fs(n,t,r)))}function As(e,t,n){js(e,t,n,pu())}function js(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ns(e))Ps(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Tr(s,o))return ii(e,t,i,0),q===null&&ri(),!1}catch{}if(n=ai(e,t,i,r),n!==null)return hu(n,e,r),Fs(n,t,r),!0}return!1}function Ms(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ns(e)){if(t)throw Error(a(479))}else t=ai(e,n,r,2),t!==null&&hu(t,e,2)}function Ns(e){var t=e.alternate;return e===U||t!==null&&t===U}function Ps(e,t){fo=uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Fs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,it(e,n)}}var Is={readContext:B,use:jo,useCallback:vo,useContext:vo,useEffect:vo,useImperativeHandle:vo,useLayoutEffect:vo,useInsertionEffect:vo,useMemo:vo,useReducer:vo,useRef:vo,useState:vo,useDebugValue:vo,useDeferredValue:vo,useTransition:vo,useSyncExternalStore:vo,useId:vo,useHostTransitionStatus:vo,useFormState:vo,useActionState:vo,useOptimistic:vo,useMemoCache:vo,useCacheRefresh:vo};Is.useEffectEvent=vo;var Ls={readContext:B,use:jo,useCallback:function(e,t){return Do().memoizedState=[e,t===void 0?null:t],e},useContext:B,useEffect:ss,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),as(4194308,4,ps.bind(null,t,e),n)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){as(4,2,e,t)},useMemo:function(e,t){var n=Do();t=t===void 0?null:t;var r=e();if(po){Ve(!0);try{e()}finally{Ve(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Do();if(n!==void 0){var i=n(t);if(po){Ve(!0);try{n(t)}finally{Ve(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ks.bind(null,U,e),[r.memoizedState,e]},useRef:function(e){var t=Do();return e={current:e},t.memoizedState=e},useState:function(e){e=Uo(e);var t=e.queue,n=As.bind(null,U,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:hs,useDeferredValue:function(e,t){return vs(Do(),e,t)},useTransition:function(){var e=Uo(!1);return e=bs.bind(null,U,e.queue,!0,!1),Do().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=U,i=Do();if(R){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),q===null)throw Error(a(349));Y&127||Ro(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,ss(Bo.bind(null,r,o,e),[e]),r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,o,n,t),null),n},useId:function(){var e=Do(),t=q.identifierPrefix;if(R){var n=ki,r=Oi;n=(r&~(1<<32-He(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=mo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=_o++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ts,useFormState:Qo,useActionState:Qo,useOptimistic:function(e){var t=Do();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ms.bind(null,U,!0,n),n.dispatch=t,[e,t]},useMemoCache:Mo,useCacheRefresh:function(){return Do().memoizedState=Os.bind(null,U)},useEffectEvent:function(e){var t=Do(),n={impl:e};return t.memoizedState=n,function(){if(K&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},Rs={readContext:B,use:jo,useCallback:gs,useContext:B,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Po,useRef:is,useState:function(){return Po(No)},useDebugValue:hs,useDeferredValue:function(e,t){return ys(Oo(),W.memoizedState,e,t)},useTransition:function(){var e=Po(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:$o,useActionState:$o,useOptimistic:function(e,t){return Wo(Oo(),W,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};Rs.useEffectEvent=us;var zs={readContext:B,use:jo,useCallback:gs,useContext:B,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Io,useRef:is,useState:function(){return Io(No)},useDebugValue:hs,useDeferredValue:function(e,t){var n=Oo();return W===null?vs(n,e,t):ys(n,W.memoizedState,e,t)},useTransition:function(){var e=Io(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:ns,useActionState:ns,useOptimistic:function(e,t){var n=Oo();return W===null?(n.baseState=e,[e,n.queue.dispatch]):Wo(n,W,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};zs.useEffectEvent=us;function Bs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Vs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pu(),i=H(r);i.payload=t,n!=null&&(i.callback=n),t=Va(e,i,r),t!==null&&(hu(t,e,r),Ha(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pu(),i=H(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Va(e,i,r),t!==null&&(hu(t,e,r),Ha(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pu(),r=H(n);r.tag=2,t!=null&&(r.callback=t),t=Va(e,r,n),t!==null&&(hu(t,e,n),Ha(t,e,n))}};function Hs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Er(n,r)||!Er(i,a):!0}function Us(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Vs.enqueueReplaceState(t,t.state,null)}function Ws(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Gs(e){$r(e)}function Ks(e){console.error(e)}function qs(e){$r(e)}function Js(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ys(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Xs(e,t,n){return n=H(n),n.tag=3,n.payload={element:null},n.callback=function(){Js(e,t)},n}function Zs(e){return e=H(e),e.tag=3,e}function Qs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ys(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ys(t,n,r),typeof i!=`function`&&(ru===null?ru=new Set([this]):ru.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function $s(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Qi(t,n,i,!0),n=eo.current,n!==null){switch(n.tag){case 31:case 13:return to===null?Du():n.alternate===null&&Wl===0&&(Wl=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===V?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Gu(e,r,i)),!1;case 22:return n.flags|=65536,r===V?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Gu(e,r,i)),!1}throw Error(a(435,n.tag))}return Gu(e,r,i),Du(),!1}if(R)return t=eo.current,t===null?(r!==Ri&&(t=Error(a(423),{cause:r}),Gi(bi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=bi(r,n),i=Xs(e.stateNode,r,i),Ua(e,i),Wl!==4&&(Wl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Ri&&(e=Error(a(422),{cause:r}),Gi(bi(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=bi(o,n),Xl===null?Xl=[o]:Xl.push(o),Wl!==4&&(Wl=2),t===null)return!0;r=bi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Xs(n.stateNode,r,e),Ua(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ru===null||!ru.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Zs(i),Qs(i,e,n,r),Ua(n,i),!1}n=n.return}while(n!==null);return!1}var ec=Error(a(461)),tc=!1;function nc(e,t,n,r){t.child=e===null?La(t,null,n,r):Ia(t,e.child,n,r)}function rc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ea(t),r=bo(e,t,n,o,a,i),s=wo(),e!==null&&!tc?(To(e,t,i),Dc(e,t,i)):(R&&s&&Mi(t),t.flags|=1,nc(e,t,r,i),t.child)}function ic(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!fi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ac(e,t,a,r,i)):(e=hi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Oc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Er:n,n(o,r)&&e.ref===t.ref)return Dc(e,t,i)}return t.flags|=1,e=pi(a,r),e.ref=t.ref,e.return=t,t.child=e}function ac(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Er(a,r)&&e.ref===t.ref)if(tc=!1,t.pendingProps=r=a,Oc(e,i))e.flags&131072&&(tc=!0);else return t.lanes=e.lanes,Dc(e,t,i)}return pc(e,t,n,r,i)}function oc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return cc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ya(t,a===null?null:a.cachePool),a===null?Qa():Za(t,a),io(t);else return r=t.lanes=536870912,cc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ya(t,null),Qa(),ao(t)):(ya(t,a.cachePool),Za(t,a),ao(t),t.memoizedState=null);return nc(e,t,i,n),t.child}function sc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function cc(e,t,n,r,i){var a=va();return a=a===null?null:{parent:oa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ya(t,null),Qa(),io(t),e!==null&&Qi(e,t,r,!0),t.childLanes=i,null}function lc(e,t){return t=Sc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function uc(e,t,n){return Ia(t,e.child,null,n),e=lc(t,t.pendingProps),e.flags|=2,oo(t),t.memoizedState=null,e}function dc(e,t,n){var r=t.pendingProps,i=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(R){if(r.mode===`hidden`)return e=lc(t,r),t.lanes=536870912,sc(null,e);if(ro(t),(e=L)?(e=rf(e,Li),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Di===null?null:{id:Oi,overflow:ki},retryLane:536870912,hydrationErrors:null},n=I(e),n.return=t,t.child=n,Fi=t,L=null)):e=null,e===null)throw zi(t);return t.lanes=536870912,null}return lc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ro(t),i)if(t.flags&256)t.flags&=-257,t=uc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558));else if(tc||Qi(e,t,n,!1),i=(n&e.childLanes)!==0,tc||i){if(r=q,r!==null&&(s=at(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,oi(e,s),hu(r,e,s),ec;Du(),t=uc(e,t,n)}else e=o.treeContext,L=cf(s.nextSibling),Fi=t,R=!0,Ii=null,Li=!1,e!==null&&Pi(t,e),t=lc(t,r),t.flags|=4096;return t}return e=pi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function pc(e,t,n,r,i){return ea(t),n=bo(e,t,n,r,void 0,i),r=wo(),e!==null&&!tc?(To(e,t,i),Dc(e,t,i)):(R&&r&&Mi(t),t.flags|=1,nc(e,t,n,i),t.child)}function mc(e,t,n,r,i,a){return ea(t),t.updateQueue=null,n=So(t,r,n,i),xo(e),r=wo(),e!==null&&!tc?(To(e,t,a),Dc(e,t,a)):(R&&r&&Mi(t),t.flags|=1,nc(e,t,n,a),t.child)}function hc(e,t,n,r,i){if(ea(t),t.stateNode===null){var a=li,o=n.contextType;typeof o==`object`&&o&&(a=B(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Vs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},za(t),o=n.contextType,a.context=typeof o==`object`&&o?B(o):li,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Bs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Vs.enqueueReplaceState(a,a.state,null),Ka(t,r,a,i),Ga(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Ws(n,s);a.props=c;var l=a.context,u=n.contextType;o=li,typeof u==`object`&&u&&(o=B(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Us(t,a,r,o),Ra=!1;var f=t.memoizedState;a.state=f,Ka(t,r,a,i),Ga(),l=t.memoizedState,s||f!==l||Ra?(typeof d==`function`&&(Bs(t,n,d,r),l=t.memoizedState),(c=Ra||Hs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ba(e,t),o=t.memoizedProps,u=Ws(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=li,typeof l==`object`&&l&&(c=B(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Us(t,a,r,c),Ra=!1,f=t.memoizedState,a.state=f,Ka(t,r,a,i),Ga();var p=t.memoizedState;o!==d||f!==p||Ra||e!==null&&e.dependencies!==null&&$i(e.dependencies)?(typeof s==`function`&&(Bs(t,n,s,r),p=t.memoizedState),(u=Ra||Hs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&$i(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,fc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ia(t,e.child,null,i),t.child=Ia(t,null,n,i)):nc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Dc(e,t,i),e}function gc(e,t,n,r){return Ui(),t.flags|=256,nc(e,t,n,r),t.child}var _c={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vc(e){return{baseLanes:e,cachePool:ba()}}function yc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Jl),e}function bc(e,t,n){var r=t.pendingProps,i=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(so.current&2)!=0),s&&(i=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(R){if(i?no(t):ao(t),(e=L)?(e=rf(e,Li),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Di===null?null:{id:Oi,overflow:ki},retryLane:536870912,hydrationErrors:null},n=I(e),n.return=t,t.child=n,Fi=t,L=null)):e=null,e===null)throw zi(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,i?(ao(t),i=t.mode,c=Sc({mode:`hidden`,children:c},i),r=gi(r,i,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(null,r)):(no(t),xc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(no(t),t.flags&=-257,t=Cc(e,t,n)):t.memoizedState===null?(ao(t),c=r.fallback,i=t.mode,r=Sc({mode:`visible`,children:r.children},i),c=gi(c,i,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ia(t,e.child,null,n),r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,t=sc(null,r)):(ao(t),t.child=e.child,t.flags|=128,t=null);else if(no(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(a(419)),r.stack=``,r.digest=s,Gi({value:r,source:null,stack:null}),t=Cc(e,t,n)}else if(tc||Qi(e,t,n,!1),s=(n&e.childLanes)!==0,tc||s){if(s=q,s!==null&&(r=at(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,oi(e,r),hu(s,e,r),ec;af(c)||Du(),t=Cc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,L=cf(c.nextSibling),Fi=t,R=!0,Ii=null,Li=!1,e!==null&&Pi(t,e),t=xc(t,r.children),t.flags|=4096);return t}return i?(ao(t),c=r.fallback,i=t.mode,l=e.child,u=l.sibling,r=pi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=gi(c,i,n,null),c.flags|=2):c=pi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,sc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=vc(n):(i=c.cachePool,i===null?i=ba():(l=oa._currentValue,i=i.parent===l?i:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:i}),r.memoizedState=c,r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(e.child,r)):(no(t),n=e.child,e=n.sibling,n=pi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function xc(e,t){return t=Sc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Sc(e,t){return e=di(22,e,null,t),e.lanes=0,e}function Cc(e,t,n){return Ia(t,e.child,null,n),e=xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function wc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Xi(e.return,t,n)}function Tc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Ec(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=so.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,M(so,o),nc(e,t,r,n),r=R?wi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&wc(e,n,t);else if(e.tag===19)wc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&co(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Tc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&co(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Tc(t,!0,n,null,a,r);break;case`together`:Tc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Dc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Gl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Qi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=pi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=pi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Oc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&$i(e))):!0}function kc(e,t,n){switch(t.tag){case 3:me(t,t.stateNode.containerInfo),Ji(t,oa,e.memoizedState.cache),Ui();break;case 27:case 5:ge(t);break;case 4:me(t,t.stateNode.containerInfo);break;case 10:Ji(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ro(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(no(t),e=Dc(e,t,n),e===null?null:e.sibling):bc(e,t,n):(no(t),t.flags|=128,null);no(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Qi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Ec(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),M(so,so.current),r)break;return null;case 22:return t.lanes=0,oc(e,t,n,t.pendingProps);case 24:Ji(t,oa,e.memoizedState.cache)}return Dc(e,t,n)}function Ac(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)tc=!0;else{if(!Oc(e,n)&&!(t.flags&128))return tc=!1,kc(e,t,n);tc=!!(e.flags&131072)}else tc=!1,R&&t.flags&1048576&&ji(t,wi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ea(t.elementType),t.type=e,typeof e==`function`)fi(e)?(r=Ws(e,r),t.tag=1,t=hc(null,t,e,r,n)):(t.tag=0,t=pc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===w){t.tag=11,t=rc(null,t,e,r,n);break a}else if(i===ee){t.tag=14,t=ic(null,t,e,r,n);break a}}throw t=ae(e)||e,Error(a(306,t,``))}}return t;case 0:return pc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Ws(r,t.pendingProps),hc(e,t,r,i,n);case 3:a:{if(me(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,Ba(e,t),Ka(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ji(t,oa,r),r!==o.cache&&Zi(t,[oa],n,!0),Ga(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=gc(e,t,r,n);break a}else if(r!==i){i=bi(Error(a(424)),t),Gi(i),t=gc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(L=cf(e.firstChild),Fi=t,R=!0,Ii=null,Li=!0,n=La(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ui(),r===i){t=Dc(e,t,n);break a}nc(e,t,r,n)}t=t.child}return t;case 26:return fc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:R||(n=t.type,e=t.pendingProps,r=Bd(fe.current).createElement(n),r[dt]=t,r[ft]=e,Pd(r,n,e),wt(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ge(t),e===null&&R&&(r=t.stateNode=ff(t.type,t.pendingProps,fe.current),Fi=t,Li=!0,i=L,Zd(t.type)?(lf=i,L=cf(r.firstChild)):L=i),nc(e,t,t.pendingProps.children,n),fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&R&&((i=r=L)&&(r=tf(r,t.type,t.pendingProps,Li),r===null?i=!1:(t.stateNode=r,Fi=t,L=cf(r.firstChild),Li=!1,i=!0)),i||zi(t)),ge(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(i,o)?r=null:s!==null&&Ud(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=bo(e,t,Co,null,null,n),Qf._currentValue=i),fc(e,t),nc(e,t,r,n),t.child;case 6:return e===null&&R&&((e=n=L)&&(n=nf(n,t.pendingProps,Li),n===null?e=!1:(t.stateNode=n,Fi=t,L=null,e=!0)),e||zi(t)),null;case 13:return bc(e,t,n);case 4:return me(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ia(t,null,r,n):nc(e,t,r,n),t.child;case 11:return rc(e,t,t.type,t.pendingProps,n);case 7:return nc(e,t,t.pendingProps,n),t.child;case 8:return nc(e,t,t.pendingProps.children,n),t.child;case 12:return nc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ji(t,t.type,r.value),nc(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,ea(t),i=B(i),r=r(i),t.flags|=1,nc(e,t,r,n),t.child;case 14:return ic(e,t,t.type,t.pendingProps,n);case 15:return ac(e,t,t.type,t.pendingProps,n);case 19:return Ec(e,t,n);case 31:return dc(e,t,n);case 22:return oc(e,t,n,t.pendingProps);case 24:return ea(t),r=B(oa),e===null?(i=va(),i===null&&(i=q,o=sa(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},za(t),Ji(t,oa,i)):((e.lanes&n)!==0&&(Ba(e,t),Ka(t,null,null,n),Ga()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,Ji(t,oa,r),r!==i.cache&&Zi(t,[oa],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Ji(t,oa,r))),nc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function jc(e){e.flags|=4}function Mc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(wu())e.flags|=8192;else throw Da=V,Sa}else e.flags&=-16777217}function Nc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(wu())e.flags|=8192;else throw Da=V,Sa}function Pc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:$e(),e.lanes|=t,Yl|=t)}function Fc(e,t){if(!R)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ic(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Lc(e,t,n){var r=t.pendingProps;switch(Ni(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ic(t),null;case 1:return Ic(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Yi(oa),he(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Hi(t)?jc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Wi())),Ic(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(jc(t),o===null?(Ic(t),Mc(t,i,null,r,n)):(Ic(t),Nc(t,o))):o?o===e.memoizedState?(Ic(t),t.flags&=-16777217):(jc(t),Ic(t),Nc(t,o)):(e=e.memoizedProps,e!==r&&jc(t),Ic(t),Mc(t,i,e,r,n)),null;case 27:if(_e(t),n=fe.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Ic(t),null}e=N.current,Hi(t)?Bi(t,e):(e=ff(i,r,n),t.stateNode=e,jc(t))}return Ic(t),null;case 5:if(_e(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Ic(t),null}if(o=N.current,Hi(t))Bi(t,o);else{var s=Bd(fe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[dt]=t,o[ft]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&jc(t)}}return Ic(t),Mc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=fe.current,Hi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Fi,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[dt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||zi(t,!0)}else e=Bd(e).createTextNode(r),e[dt]=t,t.stateNode=e}return Ic(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Hi(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[dt]=t}else Ui(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),e=!1}else n=Wi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(oo(t),t):(oo(t),null);if(t.flags&128)throw Error(a(558))}return Ic(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Hi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[dt]=t}else Ui(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),i=!1}else i=Wi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(oo(t),t):(oo(t),null)}return oo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Pc(t,t.updateQueue),Ic(t),null);case 4:return he(),e===null&&Sd(t.stateNode.containerInfo),Ic(t),null;case 10:return Yi(t.type),Ic(t),null;case 19:if(j(so),r=t.memoizedState,r===null)return Ic(t),null;if(i=(t.flags&128)!=0,o=r.rendering,o===null)if(i)Fc(r,!1);else{if(Wl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=co(e),o!==null){for(t.flags|=128,Fc(r,!1),e=o.updateQueue,t.updateQueue=e,Pc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)mi(n,e),n=n.sibling;return M(so,so.current&1|2),R&&Ai(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ae()>tu&&(t.flags|=128,i=!0,Fc(r,!1),t.lanes=4194304)}else{if(!i)if(e=co(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Pc(t,e),Fc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!R)return Ic(t),null}else 2*Ae()-r.renderingStartTime>tu&&n!==536870912&&(t.flags|=128,i=!0,Fc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Ic(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ae(),e.sibling=null,n=so.current,M(so,i?n&1|2:n&1),R&&Ai(t,r.treeForkCount),e);case 22:case 23:return oo(t),$a(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Ic(t),t.subtreeFlags&6&&(t.flags|=8192)):Ic(t),n=t.updateQueue,n!==null&&Pc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&j(_a),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Yi(oa),Ic(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function Rc(e,t){switch(Ni(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yi(oa),he(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _e(t),null;case 31:if(t.memoizedState!==null){if(oo(t),t.alternate===null)throw Error(a(340));Ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(oo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return j(so),null;case 4:return he(),null;case 10:return Yi(t.type),null;case 22:case 23:return oo(t),$a(),e!==null&&j(_a),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Yi(oa),null;case 25:return null;default:return null}}function zc(e,t){switch(Ni(t),t.tag){case 3:Yi(oa),he();break;case 26:case 27:case 5:_e(t);break;case 4:he();break;case 31:t.memoizedState!==null&&oo(t);break;case 13:oo(t);break;case 19:j(so);break;case 10:Yi(t.type);break;case 22:case 23:oo(t),$a(),e!==null&&j(_a);break;case 24:Yi(oa)}}function Bc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Vc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Hc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ja(t,n)}catch(t){Z(e,e.return,t)}}}function Uc(e,t,n){n.props=Ws(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Wc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function Gc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}function Kc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function qc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[ft]=t}catch(t){Z(e,e.return,t)}}function Jc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Yc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Jc(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.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=rn));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[dt]=e,t[ft]=n}catch(t){Z(e,e.return,t)}}var $c=!1,el=!1,tl=!1,nl=typeof WeakSet==`function`?WeakSet:Set,rl=null;function il(e,t){if(e=e.containerInfo,Rd=sp,e=Ar(e),jr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,rl=t;rl!==null;)if(t=rl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,rl=e;else for(;rl!==null;){switch(t=rl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,i=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Ws(n.type,i);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Z(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(a(163))}if(e=t.sibling,e!==null){e.return=t.return,rl=e;break}rl=t.return}}function al(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:bl(e,n),r&4&&Bc(5,n);break;case 1:if(bl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=Ws(n.type,t.memoizedProps);t=t.memoizedState;
vendor: 4,306 bytes, line 9
9try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}r&64&&Hc(n),r&512&&Wc(n,n.return);break;case 3:if(bl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ja(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&Qc(n);case 26:case 5:bl(e,n),t===null&&r&4&&Kc(n),r&512&&Wc(n,n.return);break;case 12:bl(e,n);break;case 31:bl(e,n),r&4&&dl(e,n);break;case 13:bl(e,n),r&4&&fl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ju.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||$c,!r){t=t!==null&&t.memoizedState!==null||el,i=$c;var a=el;$c=r,(el=t)&&!a?Sl(e,n,(n.subtreeFlags&8772)!=0):bl(e,n),$c=i,el=a}break;case 30:break;default:bl(e,n)}}function ol(e){var t=e.alternate;t!==null&&(e.alternate=null,ol(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&yt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var sl=null,cl=!1;function ll(e,t,n){for(n=n.child;n!==null;)ul(e,t,n),n=n.sibling}function ul(e,t,n){if(Be&&typeof Be.onCommitFiberUnmount==`function`)try{Be.onCommitFiberUnmount(ze,n)}catch{}switch(n.tag){case 26:el||Gc(n,t),ll(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:el||Gc(n,t);var r=sl,i=cl;Zd(n.type)&&(sl=n.stateNode,cl=!1),ll(e,t,n),pf(n.stateNode),sl=r,cl=i;break;case 5:el||Gc(n,t);case 6:if(r=sl,i=cl,sl=null,ll(e,t,n),sl=r,cl=i,sl!==null)if(cl)try{(sl.nodeType===9?sl.body:sl.nodeName===`HTML`?sl.ownerDocument.body:sl).removeChild(n.stateNode)}catch(e){Z(n,t,e)}else try{sl.removeChild(n.stateNode)}catch(e){Z(n,t,e)}break;case 18:sl!==null&&(cl?(e=sl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(sl,n.stateNode));break;case 4:r=sl,i=cl,sl=n.stateNode.containerInfo,cl=!0,ll(e,t,n),sl=r,cl=i;break;case 0:case 11:case 14:case 15:Vc(2,n,t),el||Vc(4,n,t),ll(e,t,n);break;case 1:el||(Gc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Uc(n,t,r)),ll(e,t,n);break;case 21:ll(e,t,n);break;case 22:el=(r=el)||n.memoizedState!==null,ll(e,t,n),el=r;break;default:ll(e,t,n)}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Z(t,t.return,e)}}}function fl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Z(t,t.return,e)}}function pl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nl),t;default:throw Error(a(435,e.tag))}}function ml(e,t){var n=pl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Yu.bind(null,e,t);t.then(r,r)}})}function hl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){sl=c.stateNode,cl=!1;break a}break;case 5:sl=c.stateNode,cl=!1;break a;case 3:case 4:sl=c.stateNode.containerInfo,cl=!0;break a}c=c.return}if(sl===null)throw Error(a(160));ul(o,s,i),sl=null,cl=!1,o=i.alternate,o!==null&&(o.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)_l(t,e),t=t.sibling}var gl=null;function _l(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:hl(t,e),vl(e),r&4&&(Vc(3,e,e.return),Bc(3,e),Vc(5,e,e.return));break;case 1:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),r&64&&$c&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=gl;if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;b:switch(r){case`title`:o=i.getElementsByTagName(`title`)[0],(!o||o[vt]||o[dt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=i.createElement(r),i.head.insertBefore(o,i.querySelector(`head >
9 title`))),Pd(o,r,n),o[dt]=e,wt(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=i.createElement(r),Pd(o,r,n),i.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,i).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=i.createElement(r),Pd(o,r,n),i.head.appendChild(o);break;default:throw Error(a(468,r))}o[dt]=e,wt(o),r=o}e.stateNode=r}else Hf(i,e.type,e.stateNode);else e.stateNode=If(i,r,e.memoizedProps);
vendor: 22,579 bytes, line 9
9else o===r?r===null&&e.stateNode!==null&&qc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(i,e.type,e.stateNode):If(i,r,e.memoizedProps))}break;case 27:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),n!==null&&r&4&&qc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),e.flags&32){i=e.stateNode;try{Xt(i,``)}catch(t){Z(e,e.return,t)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,qc(e,i,n===null?i:n.memoizedProps)),r&1024&&(tl=!0);break;case 6:if(hl(t,e),vl(e),r&4){if(e.stateNode===null)throw Error(a(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Z(e,e.return,t)}}break;case 3:if(Bf=null,i=gl,gl=gf(t.containerInfo),hl(t,e),gl=i,vl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Z(e,e.return,t)}tl&&(tl=!1,yl(e));break;case 4:r=gl,gl=gf(e.stateNode.containerInfo),hl(t,e),vl(e),gl=r;break;case 12:hl(t,e),vl(e);break;case 31:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 13:hl(t,e),vl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&($l=Ae()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=$c,d=el;if($c=u||i,el=d||l,hl(t,e),el=d,$c=u,vl(e),r&8192)a:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||$c||el||xl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,i)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Z(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?``:l.memoizedProps}catch(e){Z(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;i?$d(m,!0):$d(l.stateNode,!1)}catch(e){Z(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ml(e,n))));break;case 19:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 30:break;case 21:break;default:hl(t,e),vl(e)}}function vl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Jc(r)){n=r;break}r=r.return}if(n==null)throw Error(a(160));switch(n.tag){case 27:var i=n.stateNode;Zc(e,Yc(e),i);break;case 5:var o=n.stateNode;n.flags&32&&(Xt(o,``),n.flags&=-33),Zc(e,Yc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Xc(e,Yc(e),s);break;default:throw Error(a(161))}}catch(t){Z(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;yl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function bl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)al(e,t.alternate,t),t=t.sibling}function xl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Vc(4,t,t.return),xl(t);break;case 1:Gc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Uc(t,t.return,n),xl(t);break;case 27:pf(t.stateNode);case 26:case 5:Gc(t,t.return),xl(t);break;case 22:t.memoizedState===null&&xl(t);break;case 30:xl(t);break;default:xl(t)}e=e.sibling}}function Sl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Sl(i,a,n),Bc(4,a);break;case 1:if(Sl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)qa(c[i],s)}catch(e){Z(r,r.return,e)}}n&&o&64&&Hc(a),Wc(a,a.return);break;case 27:Qc(a);case 26:case 5:Sl(i,a,n),n&&r===null&&o&4&&Kc(a),Wc(a,a.return);break;case 12:Sl(i,a,n);break;case 31:Sl(i,a,n),n&&o&4&&dl(i,a);break;case 13:Sl(i,a,n),n&&o&4&&fl(i,a);break;case 22:a.memoizedState===null&&Sl(i,a,n),Wc(a,a.return);break;case 30:break;default:Sl(i,a,n)}t=t.sibling}}function Cl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ca(n))}function wl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ca(e))}function Tl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)El(e,t,n,r),t=t.sibling}function El(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Tl(e,t,n,r),i&2048&&Bc(9,t);break;case 1:Tl(e,t,n,r);break;case 3:Tl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ca(e)));break;case 12:if(i&2048){Tl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Z(t,t.return,e)}}else Tl(e,t,n,r);break;case 31:Tl(e,t,n,r);break;case 13:Tl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Tl(e,t,n,r):(a._visibility|=2,Dl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Tl(e,t,n,r):Ol(e,t),i&2048&&Cl(o,t);break;case 24:Tl(e,t,n,r),i&2048&&wl(t.alternate,t);break;default:Tl(e,t,n,r)}}function Dl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Dl(a,o,s,c,i),Bc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Dl(a,o,s,c,i)):u._visibility&2?Dl(a,o,s,c,i):Ol(a,o),i&&l&2048&&Cl(o.alternate,o);break;case 24:Dl(a,o,s,c,i),i&&l&2048&&wl(o.alternate,o);break;default:Dl(a,o,s,c,i)}t=t.sibling}}function Ol(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ol(n,r),i&2048&&Cl(r.alternate,r);break;case 24:Ol(n,r),i&2048&&wl(r.alternate,r);break;default:Ol(n,r)}t=t.sibling}}var kl=8192;function Al(e,t,n){if(e.subtreeFlags&kl)for(e=e.child;e!==null;)jl(e,t,n),e=e.sibling}function jl(e,t,n){switch(e.tag){case 26:Al(e,t,n),e.flags&kl&&e.memoizedState!==null&&Gf(n,gl,e.memoizedState,e.memoizedProps);break;case 5:Al(e,t,n);break;case 3:case 4:var r=gl;gl=gf(e.stateNode.containerInfo),Al(e,t,n),gl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=kl,kl=16777216,Al(e,t,n),kl=r):Al(e,t,n));break;default:Al(e,t,n)}}function Ml(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Il(r,e)}Ml(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Pl(e),e=e.sibling}function Pl(e){switch(e.tag){case 0:case 11:case 15:Nl(e),e.flags&2048&&Vc(9,e,e.return);break;case 3:Nl(e);break;case 12:Nl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fl(e)):Nl(e);break;default:Nl(e)}}function Fl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Il(r,e)}Ml(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Vc(8,t,t.return),Fl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Fl(t));break;default:Fl(t)}e=e.sibling}}function Il(e,t){for(;rl!==null;){var n=rl;switch(n.tag){case 0:case 11:case 15:Vc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ca(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,rl=r;else a:for(n=e;rl!==null;){r=rl;var i=r.sibling,a=r.return;if(ol(r),r===n){rl=null;break a}if(i!==null){i.return=a,rl=i;break a}rl=a}}}var Ll={getCacheForType:function(e){var t=B(oa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return B(oa).controller.signal}},Rl=typeof WeakMap==`function`?WeakMap:Map,K=0,q=null,J=null,Y=0,X=0,zl=null,Bl=!1,Vl=!1,Hl=!1,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=null,Zl=null,Ql=!1,$l=0,eu=0,tu=1/0,nu=null,ru=null,iu=0,au=null,ou=null,su=0,cu=0,lu=null,uu=null,du=0,fu=null;function pu(){return K&2&&Y!==0?Y&-Y:k.T===null?ct():dd()}function mu(){if(Jl===0)if(!(Y&536870912)||R){var e=qe;qe<<=1,!(qe&3932160)&&(qe=262144),Jl=e}else Jl=536870912;return e=eo.current,e!==null&&(e.flags|=32),Jl}function hu(e,t,n){(e===q&&(X===2||X===9)||e.cancelPendingCommit!==null)&&(Su(e,0),yu(e,Y,Jl,!1)),tt(e,n),(!(K&2)||e!==q)&&(e===q&&(!(K&2)&&(Kl|=n),Wl===4&&yu(e,Y,Jl,!1)),rd(e))}function gu(e,t,n){if(K&6)throw Error(a(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ze(e,t),i=r?Au(e,t):Ou(e,t,!0),o=r;do{if(i===0){Vl&&!r&&yu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!vu(n)){i=Ou(e,t,!1),o=!1;continue}if(i===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=Xl;var l=c.current.memoizedState.isDehydrated;if(l&&(Su(c,s).flags|=256),s=Ou(c,s,!1),s!==2){if(Hl&&!l){c.errorRecoveryDisabledLanes|=o,Kl|=o,i=4;break a}o=Zl,Zl=i,o!==null&&(Zl===null?Zl=o:Zl.push.apply(Zl,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){Su(e,0),yu(e,t,0,!0);break}a:{switch(r=e,o=i,o){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t)break;case 6:yu(r,t,Jl,!Bl);break a;case 2:Zl=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=$l+300-Ae(),10<i)){if(yu(r,t,Jl,!Bl),Xe(r,0,!0)!==0)break a;su=t,r.timeoutHandle=Kd(_u.bind(null,r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,`Throttled`,-0,0),i);break a}_u(r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,null,-0,0)}}break}while(1);rd(e)}function _u(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:rn},jl(t,a,d);var m=(a&62914560)===a?$l-Ae():(a&4194048)===a?eu-Ae():0;if(m=qf(d,m),m!==null){su=a,e.cancelPendingCommit=m(Lu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),yu(e,a,o,!l);return}}Lu(e,t,a,n,r,i,o,s,c)}function vu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Tr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function yu(e,t,n,r){t&=~ql,t&=~Kl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-He(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&rt(e,n,t)}function bu(){return K&6?!0:(id(0,!1),!1)}function xu(){if(J!==null){if(X===0)var e=J.return;else e=J,z=qi=null,Eo(e),Aa=null,ja=0,e=J;for(;e!==null;)zc(e.alternate,e),e=e.return;J=null}}function Su(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),su=0,xu(),q=e,J=n=pi(e.current,null),Y=t,X=0,zl=null,Bl=!1,Vl=Ze(e,t),Hl=!1,Yl=Jl=ql=Kl=Gl=Wl=0,Zl=Xl=null,Ql=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-He(r),a=1<<i;t|=e[i],r&=~a}return Ul=t,ri(),n}function Cu(e,t){U=null,k.H=Is,t===xa||t===Ca?(t=Oa(),X=3):t===Sa?(t=Oa(),X=4):X=t===ec?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,zl=t,J===null&&(Wl=1,Js(e,bi(t,e.current)))}function wu(){var e=eo.current;return e===null?!0:(Y&4194048)===Y?to===null:(Y&62914560)===Y||Y&536870912?e===to:!1}function Tu(){var e=k.H;return k.H=Is,e===null?Is:e}function Eu(){var e=k.A;return k.A=Ll,e}function Du(){Wl=4,Bl||(Y&4194048)!==Y&&eo.current!==null||(Vl=!0),!(Gl&134217727)&&!(Kl&134217727)||q===null||yu(q,Y,Jl,!1)}function Ou(e,t,n){var r=K;K|=2;var i=Tu(),a=Eu();(q!==e||Y!==t)&&(nu=null,Su(e,t)),t=!1;var o=Wl;a:do try{if(X!==0&&J!==null){var s=J,c=zl;switch(X){case 8:xu(),o=6;break a;case 3:case 2:case 9:case 6:eo.current===null&&(t=!0);var l=X;if(X=0,zl=null,Pu(e,s,c,l),n&&Vl){o=0;break a}break;default:l=X,X=0,zl=null,Pu(e,s,c,l)}}ku(),o=Wl;break}catch(t){Cu(e,t)}while(1);return t&&e.shellSuspendCounter++,z=qi=null,K=r,k.H=i,k.A=a,J===null&&(q=null,Y=0,ri()),o}function ku(){for(;J!==null;)Mu(J)}function Au(e,t){var n=K;K|=2;var r=Tu(),i=Eu();q!==e||Y!==t?(nu=null,tu=Ae()+500,Su(e,t)):Vl=Ze(e,t);a:do try{if(X!==0&&J!==null){t=J;var o=zl;b:switch(X){case 1:X=0,zl=null,Pu(e,t,o,1);break;case 2:case 9:if(wa(o)){X=0,zl=null,Nu(t);break}t=function(){X!==2&&X!==9||q!==e||(X=7),rd(e)},o.then(t,t);break a;case 3:X=7;break a;case 4:X=5;break a;case 7:wa(o)?(X=0,zl=null,Nu(t)):(X=0,zl=null,Pu(e,t,o,7));break;case 5:var s=null;switch(J.tag){case 26:s=J.memoizedState;case 5:case 27:var c=J;if(s?Wf(s):c.stateNode.complete){X=0,zl=null;var l=c.sibling;if(l!==null)J=l;else{var u=c.return;u===null?J=null:(J=u,Fu(u))}break b}}X=0,zl=null,Pu(e,t,o,5);break;case 6:X=0,zl=null,Pu(e,t,o,6);break;case 8:xu(),Wl=6;break a;default:throw Error(a(462))}}ju();break}catch(t){Cu(e,t)}while(1);return z=qi=null,k.H=r,k.A=i,K=n,J===null?(q=null,Y=0,ri(),Wl):0}function ju(){for(;J!==null&&!Oe();)Mu(J)}function Mu(e){var t=Ac(e.alternate,e,Ul);e.memoizedProps=e.pendingProps,t===null?Fu(e):J=t}function Nu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=mc(n,t,t.pendingProps,t.type,void 0,Y);break;case 11:t=mc(n,t,t.pendingProps,t.type.render,t.ref,Y);break;case 5:Eo(t);default:zc(n,t),t=J=mi(t,Ul),t=Ac(n,t,Ul)}e.memoizedProps=e.pendingProps,t===null?Fu(e):J=t}function Pu(e,t,n,r){z=qi=null,Eo(t),Aa=null,ja=0;var i=t.return;try{if($s(e,i,t,n,Y)){Wl=1,Js(e,bi(n,e.current)),J=null;return}}catch(t){if(i!==null)throw J=i,t;Wl=1,Js(e,bi(n,e.current)),J=null;return}t.flags&32768?(R||r===1?e=!0:Vl||Y&536870912?e=!1:(Bl=e=!0,(r===2||r===9||r===3||r===6)&&(r=eo.current,r!==null&&r.tag===13&&(r.flags|=16384))),Iu(t,e)):Fu(t)}function Fu(e){var t=e;do{if(t.flags&32768){Iu(t,Bl);return}e=t.return;var n=Lc(t.alternate,t,Ul);if(n!==null){J=n;return}if(t=t.sibling,t!==null){J=t;return}J=t=e}while(t!==null);Wl===0&&(Wl=5)}function Iu(e,t){do{var n=Rc(e.alternate,e);if(n!==null){n.flags&=32767,J=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){J=e;return}J=e=n}while(e!==null);Wl=6,J=null}function Lu(e,t,n,r,i,o,s,c,l){e.cancelPendingCommit=null;do Hu();while(iu!==0);if(K&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));if(o=t.lanes|t.childLanes,o|=ni,nt(e,n,o,s,c,l),e===q&&(J=q=null,Y=0),ou=t,au=e,su=n,cu=o,lu=i,uu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Xu(Pe,function(){return Uu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=k.T,k.T=null,i=A.p,A.p=2,s=K,K|=4;try{il(e,t,n)}finally{K=s,A.p=i,k.T=r}}iu=1,Ru(),zu(),Bu()}}function Ru(){if(iu===1){iu=0;var e=au,t=ou,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=k.T,k.T=null;var r=A.p;A.p=2;var i=K;K|=4;try{_l(t,e);var a=zd,o=Ar(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&kr(s.ownerDocument.documentElement,s)){if(c!==null&&jr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Or(s,h),v=Or(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{K=i,A.p=r,k.T=n}}e.current=t,iu=2}}function zu(){if(iu===2){iu=0;var e=au,t=ou,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=k.T,k.T=null;var r=A.p;A.p=2;var i=K;K|=4;try{al(e,t.alternate,t)}finally{K=i,A.p=r,k.T=n}}iu=3}}function Bu(){if(iu===4||iu===3){iu=0,ke();var e=au,t=ou,n=su,r=uu;t.subtreeFlags&10256||t.flags&10256?iu=5:(iu=0,ou=au=null,Vu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ru=null),st(n),t=t.stateNode,Be&&typeof Be.onCommitFiberRoot==`function`)try{Be.onCommitFiberRoot(ze,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=k.T,i=A.p,A.p=2,k.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{k.T=t,A.p=i}}su&3&&Hu(),rd(e),i=e.pendingLanes,n&261930&&i&42?e===fu?du++:(du=0,fu=e):du=0,id(0,!1)}}function Vu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ca(t)))}function Hu(){return Ru(),zu(),Bu(),Uu()}function Uu(){if(iu!==5)return!1;var e=au,t=cu;cu=0;var n=st(su),r=k.T,i=A.p;try{A.p=32>n?32:n,k.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,K&6)throw Error(a(331));var c=K;if(K|=4,Pl(o.current),El(o,o.current,s,n),K=c,id(0,!1),Be&&typeof Be.onPostCommitFiberRoot==`function`)try{Be.onPostCommitFiberRoot(ze,o)}catch{}return!0}finally{A.p=i,k.T=r,Vu(e,t)}}function Wu(e,t,n){t=bi(n,t),t=Xs(e.stateNode,t,2),e=Va(e,t,2),e!==null&&(tt(e,2),rd(e))}function Z(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ru===null||!ru.has(r))){e=bi(n,e),n=Zs(2),r=Va(t,n,2),r!==null&&(Qs(n,r,t,e),tt(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Rl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Hl=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,q===e&&(Y&n)===n&&(Wl===4||Wl===3&&(Y&62914560)===Y&&300>Ae()-$l?!(K&2)&&Su(e,0):ql|=n,Yl===Y&&(Yl=0)),rd(e)}function qu(e,t){t===0&&(t=$e()),e=oi(e,t),e!==null&&(tt(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return Ee(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-He(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=Y,a=Xe(r,r===q?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ze(r,a)||(n=!0,ld(r,a));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Gd()&&(e=nd);for(var t=Ae(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}iu!==0&&iu!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-He(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Qe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=q,n=Y,n=Xe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(X===2||X===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&De(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ze(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&De(r),st(n)){case 2:case 8:n=Ne;break;case 32:n=Pe;break;case 268435456:n=Ie;break;default:n=Pe}return r=cd.bind(null,e),n=Ee(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&De(r),e.callbackPriority=2,e.callbackNode=null,2}function cd(e,t){if(iu!==0&&iu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Hu()&&e.callbackNode!==n)return null;var r=Y;return r=Xe(e,e===q?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(gu(e,r,t),sd(e,Ae()),e.callbackNode!=null&&e.callbackNode===n?cd.bind(null,e):null)}function ld(e,t){if(Hu())return null;gu(e,t,!0)}function ud(){Yd(function(){K&6?Ee(Me,ad):od()})}function dd(){if(nd===0){var e=da;e===0&&(e=Ke,Ke<<=1,!(Ke&261888)&&(Ke=256)),nd=e}return nd}function fd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:nn(``+e)}function pd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function md(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=fd((i[ft]||null).action),o=r.submitter;o&&(t=(t=o[ft]||null)?fd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Tn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(nd!==0){var e=o?pd(i,o):new FormData(i);Ss(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?pd(i,o):new FormData(i),Ss(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var hd=0;hd<Zr.length;hd++){var gd=Zr[hd];Qr(gd.toLowerCase(),`on`+(gd[0].toUpperCase()+gd.slice(1)))}Qr(Ur,`onAnimationEnd`),Qr(Wr,`onAnimationIteration`),Qr(Gr,`onAnimationStart`),Qr(`dblclick`,`onDoubleClick`),Qr(`focu
9sin`,`onFocus`),Qr(`focusout`,`onBlur`),Qr(Kr,`onTransitionRun`),Qr(qr,`onTransitionStart`),Qr(Jr,`onTransitionCancel`),Qr(Yr,`onTransitionEnd`),Ot(`onMouseEnter`,[`mouseout`,`mouseover`]),Ot(`onMouseLeave`,[`mouseout`,`mouseover`]),Ot(`onPointerEnter`,[`pointerout`,`pointerover`]),Ot(`onPointerLeave`,[`pointerout`,`pointerover`]),Dt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Dt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Dt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Dt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Dt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Dt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var _d=`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(` `),vd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(_d));function yd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){$r(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){$r(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[mt];n===void 0&&(n=t[mt]=new Set);var r=e+`__bubble`;n.has(r)||(Cd(t,e,2,!1),n.add(r))}function bd(e,t,n){var r=0;t&&(r|=4),Cd(n,e,r,t)}var xd=`_reactListening`+Math.random().toString(36).slice(2);function Sd(e){if(!e[xd]){e[xd]=!0,Tt.forEach(function(t){t!==`selectionchange`&&(vd.has(t)||bd(t,!1,e),bd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xd]||(t[xd]=!0,bd(`selectionchange`,!1,t))}}function Cd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!mn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function wd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=bt(s),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}s=s.parentNode}}r=r.return}dn(function(){var r=a,i=on(n),o=[];a:{var s=Xr.get(e);if(s!==void 0){var l=Tn,u=e;switch(e){case`keypress`:if(bn(n)===0)break a;case`keydown`:case`keyup`:l=Un;break;case`focusin`:u=`focus`,l=Pn;break;case`focusout`:u=`blur`,l=Pn;break;case`beforeblur`:case`afterblur`:l=Pn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Mn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Nn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Gn;break;case Ur:case Wr:case Gr:l=Fn;break;case Yr:l=Kn;break;case`scroll`:case`scrollend`:l=Dn;break;case`wheel`:l=qn;break;case`copy`:case`cut`:case`paste`:l=In;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Wn;break;case`toggle`:case`beforetoggle`:l=Jn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=fn(m,p),g!=null&&d.push(Td(m,g,h))),f)break;m=m.return}0<d.length&&(s=new l(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,s&&n!==an&&(u=n.relatedTarget||n.fromElement)&&(bt(u)||u[pt]))break a;if((l||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?bt(u):null,u!==null&&(f=c(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Mn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Wn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?s:St(l),h=u==null?s:St(u),s=new d(g,m+`leave`,l,n,i),s.target=f,s.relatedTarget=h,g=null,bt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Dd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Od(o,s,l,d,!1),u!==null&&f!==null&&Od(o,f,u,d,!0)}}a:{if(s=r?St(r):window,l=s.nodeName&&s.nodeName.toLowerCase(),l===`select`||l===`input`&&s.type===`file`)var v=mr;else if(cr(s))if(hr)v=Cr;else{v=xr;var y=F}else l=s.nodeName,!l||l.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&$t(r.elementType)&&(v=mr):v=Sr;if(v&&=v(e,r)){lr(o,v,n,i);break a}y&&y(e,s,r),e===`focusout`&&r&&s.type===`number`&&r.memoizedProps.value!=null&&Kt(s,`number`,s.value)}switch(y=r?St(r):window,e){case`focusin`:(cr(y)||y.contentEditable===`true`)&&(Nr=y,Pr=r,Fr=null);break;case`focusout`:Fr=Pr=Nr=null;break;case`mousedown`:Ir=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Ir=!1,Lr(o,n,i);break;case`selectionchange`:if(Mr)break;case`keydown`:case`keyup`:Lr(o,n,i)}var b;if(Xn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else ir?nr(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&($n&&n.locale!==`ko`&&(ir||x!==`onCompositionStart`?x===`onCompositionEnd`&&ir&&(b=yn()):(gn=i,_n=`value`in gn?gn.value:gn.textContent,ir=!0)),y=Ed(r,x),0<y.length&&(x=new Ln(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=rr(n),b!==null&&(x.data=b)))),(b=Qn?ar(e,n):or(e,n))&&(x=Ed(r,`onBeforeInput`),0<x.length&&(y=new Ln(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:y,listeners:x}),y.data=b)),md(o,e,r,n,i)}yd(o,t)})}function Td(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ed(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=fn(e,n),i!=null&&r.unshift(Td(e,i,a)),i=fn(e,t),i!=null&&r.push(Td(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Dd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=fn(n,a),l!=null&&o.unshift(Td(n,l,c))):i||(l=fn(n,a),l!=null&&o.push(Td(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var kd=/\r\n?/g,Ad=/\u0000|\uFFFD/g;
vendor: 10,431 bytes, lines 9-10
9function jd(e){return(typeof e==`string`?e:``+e).replace(kd,` 10`).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function $(e,t,n,r,i,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Xt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Xt(e,``+r);break;case`className`:Pt(e,`class`,r);break;case`tabIndex`:Pt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Pt(e,n,r);break;case`style`:Qt(e,r,o);break;case`data`:if(t!==`object`){Pt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=nn(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,i.name,i,null),$(e,t,`formEncType`,i.formEncType,i,null),$(e,t,`formMethod`,i.formMethod,i,null),$(e,t,`formTarget`,i.formTarget,i,null)):($(e,t,`encType`,i.encType,i,null),$(e,t,`method`,i.method,i,null),$(e,t,`target`,i.target,i,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=nn(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=rn);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=nn(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),Nt(e,`popover`,r);break;case`xlinkActuate`:Ft(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Ft(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Ft(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Ft(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Ft(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Ft(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Ft(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Ft(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Ft(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Nt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=en.get(n)||n,Nt(e,n,r))}}function Nd(e,t,n,r,i,o){switch(n){case`style`:Qt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Xt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Xt(e,``+r);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=rn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Et.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),o=e[ft]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,i),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Nt(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:$(e,t,o,s,n,null)}}i&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(a(137,t));break;default:$(e,t,r,d,n,null)}}Gt(e,o,c,l,u,s,i,!1);return;case`select`:for(i in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:$(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&qt(e,!!r,n,!0):qt(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:$(e,t,s,c,n,null)}Yt(e,r,i,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)Q(_d[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:$(e,t,u,r,n,null)}return;default:if($t(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||$(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:i=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}Wt(e,s,c,l,u,d,o,i);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||$(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&$(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?qt(e,!!n,n?[]:``,!1):qt(e,!!n,t,!0)):qt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&$(e,t,s,i,r,o)}Jt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:$(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&$(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(a(137,t));break;default:$(e,t,u,p,r,m)}return;default:if($t(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);
vendor: 4,461 bytes, line 10
10for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||$(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Hd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ud(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[vt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),yt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[vt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;
vendor: 20,904 bytes, line 10
10e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(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===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);yt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=A.d;A.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=bu();return e||t}function yf(e){var t=xt(e);t!==null&&t.tag===5&&t.type===`form`?ws(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Ut(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),wt(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Ut(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Ut(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Ut(n.imageSizes)+`"]`)):i+=`[href="`+Ut(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),wt(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Ut(r)+`"][href="`+Ut(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),wt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=Ct(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);wt(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=Ct(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),wt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=Ct(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),wt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var i=(i=fe.current)?gf(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=Ct(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=Ct(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=Ct(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Af(e){return`href="`+Ut(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),wt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Ut(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Ut(n.href)+`"]`);if(r)return t.instance=r,wt(r),r;var i=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),wt(r),Pd(r,`style`,i),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Af(n.href);var o=e.querySelector(jf(i));if(o)return t.state.loading|=4,t.instance=o,wt(o),o;r=Mf(n),(i=mf.get(i))&&Rf(r,i),o=(e.ownerDocument||e).createElement(`link`),wt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(i=e.querySelector(Ff(o)))?(t.instance=i,wt(i),i):(r=n,(i=mf.get(o))&&(r=h({},n),zf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),wt(i),Pd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[vt]||a[dt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,wt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),wt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:C,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=et(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=et(0),this.hiddenUpdates=et(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=di(3,null,null,t),e.current=a,a.stateNode=e,t=sa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},za(a),e}function tp(e){return e?(e=li,e):li}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=H(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Va(e,r,t),n!==null&&(hu(n,e,t),Ha(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=oi(e,67108864);t!==null&&hu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=pu();t=ot(t);var n=oi(e,t);n!==null&&hu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=k.T;k.T=null;var a=A.p;try{A.p=2,up(e,t,n,r)}finally{A.p=a,k.T=i}}function lp(e,t,n,r){var i=k.T;k.T=null;var a=A.p;try{A.p=8,up(e,t,n,r)}finally{A.p=a,k.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)wd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=xt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ye(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-He(o);s.entanglements[1]|=c,o&=~c}rd(a),!(K&6)&&(tu=Ae()+500,id(0,!1))}}break;case 31:case 13:s=oi(a,2),s!==null&&hu(s,a,2),bu(),ip(a,2)}if(a=dp(r),a===null&&wd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else wd(e,t,r,null,n)}}function dp(e){return e=on(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=bt(e),e!==null){var t=c(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=u(t),e!==null)return e;e=null}else if(n===31){if(e=d(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(e){switch(e){case`beforetoggle`: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`toggle`: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 2;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`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(je()){case Me:return 2;case Ne:return 8;case Pe:case Fe:return 32;case Ie:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`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`.split(` `);function Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=xt(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=bt(e.target);if(t!==null){var n=c(t);if(n!==null){if(t=n.tag,t===13){if(t=u(n),t!==null){e.blockedOn=t,lt(e.priority,function(){op(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,lt(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);an=r,n.target.dispatchEvent(r),an=null}else return t=xt(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=xt(n);a!==null&&(e.splice(t,3),t-=3,Ss(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ft]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ft]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;np(n,pu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),bu(),t[pt]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=ct();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.7`)throw Error(a(527,Lp,`19.2.7`));A.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:k,reconcilerVersion:`19.2.7`};
10if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{ze=zp.inject(Rp),Be=zp}catch{}}e.createRoot=function(e,t){if(!s(e))throw Error(a(299));var n=!1,r=``,i=Gs,o=Ks,c=qs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,i,o,c,Pp),e[pt]=t.current,Sd(e),new Fp(t)}})),d=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=u()})),f=e(r(),1),p=e(d(),1),m=`moodbyte-images`,h=`wallpapers`,g=1;function _(){return new Promise((e,t)=>{let n=indexedDB.open(m,g);n.onupgradeneeded=e=>{e.target.result.createObjectStore(h,{keyPath:`id`})},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)})}async function v(e,t){let n=await _();return new Promise((r,i)=>{let a=n.transaction(h,`readwrite`);a.objectStore(h).put({id:e,blob:t}),a.oncomplete=r,a.onerror=i})}async function y(e){let t=await _();return new Promise((n,r)=>{let i=t.transaction(h,`readonly`).objectStore(h).get(e);i.onsuccess=()=>n(i.result?.blob||null),i.onerror=r})}async function b(e){let t=await _();return new Promise((n,r)=>{let i=t.transaction(h,`readwrite`);i.objectStore(h).delete(e),i.oncomplete=n,i.onerror=r})}var x=n(),S=(0,f.createContext)(),C=e=>e===`rainy`?`rain`:e===`productive`?`focus`:e,w=e=>`/bg/${C(e)}${Math.floor(Math.random()*3)+1}.gif`,T=({children:e})=>{let[t,n]=a(`theme`,`chill`),[r,i]=a(`customBgsV2`,{night:[],rainy:[],chill:[],productive:[]}),[o,s]=(0,f.useState)(()=>w(t)),c=e=>{s(t=>(t&&t.startsWith(`blob:`)&&t!==e&&setTimeout(()=>{URL.revokeObjectURL(t)},2e3),e))},l=(e,t=r)=>{let n=t[e]||[],a=3+n.length,o=Math.floor(Math.random()*a);if(o<3)c(`/bg/${C(e)}${o+1}.gif`);else{let t=n[o-3];y(t).then(n=>{n?c(URL.createObjectURL(n)):(i(n=>({...n,[e]:(n[e]||[]).filter(e=>e!==t)})),c(w(e)))})}};return(0,f.useEffect)(()=>
10{l(t)},[]),(0,f.useEffect)(()=>{document.documentElement.setAttribute(`data-theme`,t),document.documentElement.style.setProperty(`--bg-image`,`url('${o}')`)},[t,o]),(0,x.jsx)(S.Provider,{value:{theme:t,bgImage:o,customBgs:r,changeTheme:e=>{n(e),l(e)},uploadCustomBgForTheme:async(e,n)=>{if(n.size>5*1024*1024){alert(`Image is too large! Please upload an image under 5MB.`);return}let a=r[e]||[];if(a.length>=3){alert(`You already have 3 custom backgrounds for this theme! Please delete one first to replace it.`);return}let o=`custom-bg-${e}-${Date.now()}`;await v(o,n),i({...r,[e]:[...a,o]}),t===e&&c(URL.createObjectURL(n))},removeCustomBg:async(e,n)=>{let a=r[e]||[],o={...r,[e]:a.filter(e=>e!==n)};i(o),await b(n),t===e&&l(e,o)}},children:e})},E=()=>(0,f.useContext)(S),ee=i(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),D=i(`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`}]]),te=i(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),O=i(`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`}]]),ne=i(`chart-no-axes-column`,[[`path`,{d:`M5 21v-6`,key:`1hz6c0`}],[`path`,{d:`M12 21V3`,key:`1lcnhd`}],[`path`,{d:`M19 21V9`,key:`unv183`}]]),re=i(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ie=i(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),ae=i(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),oe=i(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),k=i(`clipboard-list`,[[`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:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),A=i(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),se=i(`cloud-rain`,[[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`M16 14v6`,key:`1j4efv`}],[`path`,{d:`M8 14v6`,key:`17c4r9`}],[`path`,{d:`M12 16v6`,key:`c8a4gj`}]]),ce=i(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),le=i(`coffee`,[[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M14 2v2`,key:`6buw04`}],[`path`,{d:`M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1`,key:`pwadti`}],[`path`,{d:`M6 2v2`,key:`colzsn`}]]),ue=i(`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`}]]),j=i(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),M=i(`eye-off`,[[`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`}]]),N=i(`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`}]]),de=i(`flame`,[[`path`,{d:`M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4`,key:`1slcih`}]]),fe=i(`frown`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 16s-1.5-2-4-2-4 2-4 2`,key:`epbg0q`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),pe=i(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),me=i(`heart`,[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}]]),he=i(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),ge=i(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),_e=i(`infinity`,[[`path`,{d:`M6 16c5 0 7-8 12-8a4 4 0 0 1 0 8c-5 0-7-8-12-8a4 4 0 1 0 0 8`,key:`18ogeb`}]]),ve=i(`layout-list`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}],[`path`,{d:`M14 4h7`,key:`3xa0d5`}
10],[`path`,{d:`M14 9h7`,key:`1icrd9`}],[`path`,{d:`M14 15h7`,key:`1mj8o2`}],[`path`,{d:`M14 20h7`,key:`11slyb`}]]),ye=i(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),be=i(`meh`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`8`,x2:`16`,y1:`15`,y2:`15`,key:`1xb1d9`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),xe=i(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),Se=i(`music-2`,[[`circle`,{cx:`8`,cy:`18`,r:`4`,key:`1fc0mg`}],[`path`,{d:`M12 18V2l7 4`,key:`g04rme`}]]),Ce=i(`music`,[[`path`,{d:`M9 18V5l12-2v13`,key:`1jmyc2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}]]),we=i(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),Te=i(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),Ee=i(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),De=i(`pin-off`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),Oe=i(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),ke=i(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Ae=i(`quote`,[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]),je=i(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),Me=i(`repeat`,[[`path`,{d:`m17 2 4 4-4 4`,key:`nntrym`}],[`path`,{d:`M3 11v-1a4 4 0 0 1 4-4h14`,key:`84bu3i`}],[`path`,{d:`m7 22-4-4 4-4`,key:`1wqhfi`}],[`path`,{d:`M21 13v1a4 4 0 0 1-4 4H3`,key:`1rx37r`}]]),Ne=i(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Pe=i(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Fe=i(`shuffle`,[[`path`,{d:`m18 14 4 4-4 4`,key:`10pe0f`}],[`path`,{d:`m18 2 4 4-4 4`,key:`pucp1d`}],[`path`,{d:`M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22`,key:`1ailkh`}],[`path`,{d:`M2 6h1.972a4 4 0 0 1 3.6 2.2`,key:`km57vx`}],[`path`,{d:`M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45`,key:`os18l9`}]]),Ie=i(`skip-back`,[[`path`,{d:`M17.971 4.285A2 2 0 0 1 21 6v12a2 2 0 0 1-3.029 1.715l-9.997-5.998a2 2 0 0 1-.003-3.432z`,key:`15892j`}],[`path`,{d:`M3 20V4`,key:`1ptbpl`}]]),Le=i(`skip-forward`,[[`path`,{d:`M21 4v16`,key:`7j8fe9`}],[`path`,{d:`M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z`,key:`zs4d6`}]]),Re=i(`smile`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2`,key:`1y1vjs`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),ze=i(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594
101.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Be=i(`square-check-big`,[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Ve=i(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),He=i(`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`}]]),Ue=i(`sticky-note`,[[`path`,{d:`M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z`,key:`1dfntj`}],[`path`,{d:`M15 3v5a1 1 0 0 0 1 1h5`,key:`6s6qgf`}]]),We=i(`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`}]]),Ge=i(`timer`,[[`line`,{x1:`10`,x2:`14`,y1:`2`,y2:`2`,key:`14vaq8`}],[`line`,{x1:`12`,x2:`15`,y1:`14`,y2:`11`,key:`17fdiu`}],[`circle`,{cx:`12`,cy:`14`,r:`8`,key:`1e1u0o`}]]),Ke=i(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),qe=i(`triangle-alert`,[[`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`}]]),Je=i(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),Ye=i(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Xe=i(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),Ze=i(`volume-x`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`line`,{x1:`22`,x2:`16`,y1:`9`,y2:`15`,key:`1ewh16`}],[`line`,{x1:`16`,x2:`22`,y1:`9`,y2:`15`,key:`5ykzw1`}]]),Qe=i(`wind`,[[`path`,{d:`M12.8 19.6A2 2 0 1 0 14 16H2`,key:`148xed`}],[`path`,{d:`M17.5 8a2.5 2.5 0 1 1 2 4H2`,key:`1u4tom`}],[`path`,{d:`M9.8 4.4A2 2 0 1 1 11 8H2`,key:`75valh`}]]),$e=i(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),et=o(),tt=[{id:`great`,label:`Great`,icon:Re,themeHint:`chill`,color:`#facc15`},{id:`good`,label:`Good`,icon:le,themeHint:`productive`,color:`#22c55e`},{id:`okay`,label:`Okay`,icon:be,themeHint:`chill`,color:`#38bdf8`},{id:`meh`,label:`Meh`,icon:se,themeHint:`rainy`,color:`#94a3b8`},{id:`bad`,label:`Bad`,icon:fe,themeHint:`night`,color:`#a855f7`},{id:`angry`,label:`Angry`,icon:de,themeHint:`night`,color:`#ef4444`},{id:`tired`,label:`Tired`,icon:xe,themeHint:`night`,color:`#6366f1`},{id:`energetic`,label:`Energetic`,icon:$e,themeHint:`productive`,color:`#f97316`}],nt=e=>tt.find(t=>t.id===e)||tt[2];function rt({history:e}){let[t,n]=(0,f.useState)(()=>{let e=new Date;return e.setDate(1),e}),r=()=>{n(e=>{let t=new Date(e);return t.setMonth(e.getMonth()+1),t})},i=()=>{n(e=>{let t=new Date(e);return t.setMonth(e.getMonth()-1),t})},a=(0,f.useMemo)(()=>{let n=t.getFullYear(),r=t.getMonth(),i=new Date(n,r+1,0).getDate(),a=new Date(n,r,1).getDay(),o=[],s={};
10e.forEach(e=>{let t=new Date(e.timestamp),n=new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().split(`T`)[0];s[n]||(s[n]=e.mood)});for(let e=0;e<a;e++)o.push({empty:!0,key:`empty-start-${e}`});let c=new Date,l=new Date(c.getTime()-c.getTimezoneOffset()*6e4).toISOString().split(`T`)[0];for(let e=1;e<=i;e++){let t=new Date(n,r,e),i=new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().split(`T`)[0],a=s[i],c=`rgba(255, 255, 255, 0.05)`,u=t.toLocaleDateString(void 0,{month:`short`,day:`numeric`});if(a){let e=nt(a);c=e.color,u=`${u} - ${e.label}`}o.push({empty:!1,key:i,date:i,day:e,color:c,tooltip:u,moodId:a,isToday:i===l})}let u=o.length%7==0?0:7-o.length%7;for(let e=0;e<u;e++)o.push({empty:!0,key:`empty-end-${e}`});return o},[t,e]),o=t.toLocaleDateString(void 0,{month:`long`,year:`numeric`});return(0,x.jsxs)(`div`,{className:`mood-heatmap-container`,children:[(0,x.jsxs)(`div`,{className:`heatmap-header`,children:[(0,x.jsx)(`button`,{className:`month-nav`,onClick:i,children:(0,x.jsx)(ie,{size:16})}),(0,x.jsx)(`span`,{className:`heatmap-title`,children:o}),(0,x.jsx)(`button`,{className:`month-nav`,onClick:r,children:(0,x.jsx)(ae,{size:16})})]}),(0,x.jsx)(`div`,{className:`weekdays`,children:[`S`,`M`,`T`,`W`,`T`,`F`,`S`].map((e,t)=>(0,x.jsx)(`div`,{className:`weekday`,children:e},t))}),(0,x.jsx)(`div`,{className:`heatmap-grid`,children:a.map(e=>e.empty?(0,x.jsx)(`div`,{className:`heatmap-cell empty`},e.key):(0,x.jsx)(`div`,{className:`heatmap-cell ${e.isToday?`today`:``}`,style:{backgroundColor:e.color},title:e.tooltip},e.key))}),(0,x.jsx)(`style`,{children:` 11 .mood-heatmap-container { 12 background: rgba(0, 0, 0, 0.2); 13 border: 1px solid rgba(255, 255, 255, 0.05); 14 border-radius: 12px; 15 padding: 1rem; 16 margin-bottom: 1rem; 17 } 18 19 .heatmap-header { 20 display: flex; 21 justify-content: space-between; 22 align-items: center; 23 margin-bottom: 1rem; 24 } 25 26 .month-nav { 27 background: transparent; 28 border: none; 29 color: var(--text-muted); 30 cursor: pointer; 31 display: flex; 32 align-items: center; 33 justify-content: center; 34 padding: 0.2rem; 35 border-radius: 4px; 36 transition: background 0.2s, color 0.2s; 37 } 38 39 .month-nav:hover { 40 background: rgba(255, 255, 255, 0.1); 41 color: var(--text-color); 42 } 43 44 .heatmap-title { 45 font-family: 'Outfit', sans-serif; 46 font-size: 0.8rem; 47 font-weight: 600; 48 color: var(--text-color); 49 text-transform: uppercase; 50 letter-spacing: 0.05em; 51 } 52 53 .weekdays { 54 display: grid; 55 grid-template-columns: repeat(7, 16px); 56 gap: 6px; 57 margin-bottom: 0.5rem; 58 justify-content: center; 59 text-align: center; 60 } 61 62 .weekday { 63 font-size: 0.55rem; 64 color: var(--text-muted); 65 font-weight: 600; 66 } 67 68 .heatmap-grid { 69 display: grid; 70 grid-template-columns: repeat(7, 16px); 71 gap: 6px; 72 justify-content: center; 73 } 74 75 .heatmap-cell { 76 width: 16px; 77 height: 16px; 78 border-radius: 4px; 79 cursor: pointer; 80 transition: transform 0.1s, filter 0.2s, box-shadow 0.2s; 81 } 82 83 .heatmap-cell.empty { 84 background: transparent !important; 85 cursor: default; 86 } 87 88 .heatmap-cell:not(.empty):hover { 89 transform: scale(1.2); 90 filter: brightness(1.2); 91 z-index: 2; 92 } 93 94 .heatmap-cell.today { 95 border: 1.5px solid rgba(255, 255, 255, 0.9); 96 } 97 `})]})}function it(){let[e]=a(`moodHistory`,[]);return e.length===0?(0,x.jsx)(`div`,{className:`empty-history fade-in`,children:(0,x.jsx)(`p`,{className:`font-handwriting`,children:`No mood entries yet. Log how you're feeling today to start your journey!`})}):(0,x.jsxs)(`div`,{className:`mood-history-list fade-in`,children:[(0,x.jsx)(rt,{history:e}),e.map(e=>{let t=nt(e.mood),n=t.icon;return(0,x.jsxs)(`div`,{className:`history-card`,children:[(0,x.jsxs)(`div`,{className:`history-header`,children:[(0,x.jsxs)(`div`,{className:`mood-badge`,style:{color:t.color},children:[(0,x.jsx)(n,{size:14,strokeWidth:2.5}),(0,x.jsx)(`span`,{children:t.label})]}),(0,x.jsx)(`span`,{className:`timestamp text-muted`,children:new Date(e.timestamp).toLocaleStr
97ing(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})})]}),e.reflection&&(0,x.jsxs)(`div`,{className:`reflection-text`,children:[`"`,e.reflection,`"`]})]},e.id)}),(0,x.jsx)(`style`,{jsx:`true`,children:` 98 .empty-history { 99 padding: 2rem 1rem; 100 text-align: center; 101 color: var(--text-muted); 102 font-size: 0.85rem; 103 } 104 105 .mood-history-list { 106 display: flex; 107 flex-direction: column; 108 gap: 0.4rem; 109 } 110 111 .history-card { 112 padding: 0.6rem 0.7rem; 113 background: rgba(255,255,255,0.03); 114 border: 1px solid rgba(255,255,255,0.05); 115 border-radius: 10px; 116 display: flex; flex-direction: column; gap: 0.4rem; 117 transition: background 0.2s; 118 } 119 .history-card:hover { 120 background: rgba(255,255,255,0.06); 121 } 122 123 .history-header { 124 display: flex; 125 justify-content: space-between; 126 align-items: center; 127 } 128 129 .mood-badge { 130 display: flex; 131 align-items: center; 132 gap: 0.35rem; 133 font-weight: 600; 134 font-size: 0.75rem; 135 font-family: 'Outfit', sans-serif; 136 } 137 138 .timestamp { 139 font-size: 0.65rem; 140 opacity: 0.7; 141 } 142 143 .reflection-text { 144 font-style: italic; 145 color: rgba(255,255,255,0.7); 146 font-size: 0.75rem; 147 line-height: 1.4; 148 padding-left: 0.2rem; 149 border-left: 2px solid rgba(255,255,255,0.1); 150 } 151 `})]})}function at(e=768){let[t,n]=(0,f.useState)(()=>typeof window<`u`?window.innerWidth<=e:!1);return(0,f.useEffect)(()=>{let t=()=>n(window.innerWidth<=e);return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t)},[e]),t}function ot(){let e=at(),[t,n]=(0,f.useState)(null),[r,i]=(0,f.useState)(``),[o,s]=a(`moodHistory`,[]),[c,l]=(0,f.useState)(!1),[u,d]=(0,f.useState)(!1),[p,m]=(0,f.useState)(!1),[h,g]=(0,f.useState)({top:0,left:0}),[_,v]=(0,f.useState)(null),[y,b]=(0,f.useState)(!1),{theme:S,changeTheme:C}=E(),w=(0,f.useRef)(null),T=(0,f.useRef)(null),D=()=>{m(!0),setTimeout(()=>{d(!1),m(!1)},180)};(0,f.useEffect)(()=>{if(!u)return;let e=document.querySelector(`.sidebar-content`),t=document.querySelector(`.sidebar`);if(!e||!t||!w.current)return;let n=()=>{let n=w.current.getBoundingClientRect(),r=t.getBoundingClientRect(),i=e.getBoundingClientRect();if(n.bottom<i.top||n.top>i.bottom){D();return}g({top:n.top+n.height/2,left:r?r.left-260:n.left-280})};return e.addEventListener(`scroll`,n,{passive:!0}),window.addEventListener(`resize`,n),n(),()=>{e.removeEventListener(`scroll`,n),window.removeEventListener(`resize`,n)}},[u]),(0,f.useEffect)(()=>{let e=e=>{u&&!p&&T.current&&!T.current.contains(e.target)&&w.current&&!w.current.contains(e.target)&&D()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[u,p]);let te=e=>{e.stopPropagation(),u?D():d(!0)},O=()=>{if(!t)return;s([{id:Date.now().toString(),mood:t,reflection:r,timestamp:new Date().toISOString()},...o].slice(0,20));let e=tt.find(e=>e.id===t);e&&e.themeHint!==S?(v(e.themeHint),l(!0)):ne()},ne=()=>{l(!1),b(!0),setTimeout(()=>{n(null),i(``),b(!1)},2e3)},re=tt.find(e=>e.id===t);return(0,x.jsxs)(`div`,{className:`mood-selector-container`,ref:w,children:[(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{className:`mood-header-row`,children:(0,x.jsx)(`span`,{className:`mood-subtitle`,children:`How are you feeling?`})}),(0,x.jsx)(`div`,{className:`mood-grid`,children:tt.map(e=>{let r=e.icon;return(0,x.jsxs)(`button`,{className:`mood-btn ${t===e.id?`selected`:``}`,onClick:()=>{n(e.id),b(!1),l(!1)},style:{"--mood-color":e.color},children:[(0,x.jsx)(`div`,{className:`mood-icon-wrap`,children:(0,x.jsx)(r,{size:22})}),(0,x.jsx)(`span`,{className:`mood-label`,children:e.label})]},e.id)})}),t&&!c&&!y&&(0,x.jsxs)(`div`,{className:`reflection-area`,children:[(0,x.jsx)(`textarea`,{className:`reflection-input`,placeholder:`Why ${re?.label.toLowerCase()}? (optional)`,value:r,onChange:e=>i(e.target.value),rows:2}),(0,x.jsxs)(`button`,{className:`log-btn`,onClick:O,style:{"--mood-color":re?.color},children:[`Log mood `,(0,x.jsx)(ee,{size:14})]})]}),c&&!y&&(0,x.jsxs)(`div`,{className:`theme-prompt`,children:[(0,x.jsx)(we,{size:15}),(0,x.jsxs)(`span`,{children:[`Switch to `,(0,x.jsx)(`strong`,{children:_}),` theme to match your vibe?`]}),(0,x.jsxs)(`div`,{className:`theme-prompt-btns`,children:[(0,x.jsx)(`button`,{className:`tp-yes`,onClick:()=>{_&&C(_),ne()},children:`Yes`}),(0,x.jsx)(`button`,{className:`tp-no`,onClick:ne,children:`No`})]})]}),y&&(0,x.jsx)(`div`,{className:`log-success`,children:(0,x.jsx)(`span`,{children:`â Mood logged`})})]}),(0,x.jsx)(`div`,{className:`mood-tabs`,children:(0,x.jsxs)(`button`,{className:`mode-tab ${u?`active`:``}`,onClick:te,children:[(0,x.jsx)(he,{size:12}),` View History`]})}),(u||p)&&(0,et.createPortal)((0,x.jsxs)(`div`,{ref:T,className:`mood-portal-popup ${p?`closing`:``}
151`,style:{top:e?`50%`:`${h.top}px`,left:e?`50%`:`${h.left}px`,...e?{transform:`translate(-50%, -50%)`,width:`90%`,maxWidth:`350px`}:{}},children:[(0,x.jsxs)(`div`,{className:`mood-popup-content`,children:[(0,x.jsx)(`div`,{className:`popup-header`,children:(0,x.jsx)(`span`,{className:`popup-label`,children:`Mood Log`})}),(0,x.jsx)(`div`,{className:`history-scroll-area`,children:(0,x.jsx)(it,{})})]}),(0,x.jsx)(`div`,{className:`mood-popup-tail`})]}),document.body),(0,x.jsx)(`style`,{jsx:`true`,children:` 152 .mood-selector-container { 153 display: flex; flex-direction: column; gap: 1rem; position: relative; 154 } 155 156 .mood-header-row { 157 display: flex; justify-content: space-between; align-items: center; 158 } 159 .mood-subtitle { 160 font-size: 0.8rem; color: var(--text-muted); font-weight: 500; 161 } 162 163 /* Mood grid */ 164 .mood-grid { 165 display: grid; 166 grid-template-columns: repeat(4, 1fr); 167 gap: 0.5rem; 168 } 169 170 .mood-btn { 171 display: flex; flex-direction: column; 172 align-items: center; gap: 0.35rem; 173 padding: 0.6rem 0.3rem 0.5rem; 174 border-radius: 14px; 175 border: 1.5px solid rgba(255,255,255,0.06); 176 background: rgba(255,255,255,0.03); 177 transition: all 0.2s cubic-bezier(0.34,1.2,0.64,1); 178 cursor: pointer; 179 } 180 .mood-btn:hover { 181 background: rgba(255,255,255,0.08); 182 border-color: rgba(255,255,255,0.12); 183 transform: translateY(-3px); 184 } 185 .mood-btn.selected { 186 background: color-mix(in srgb, var(--mood-color) 12%, transparent); 187 border-color: var(--mood-color); 188 transform: translateY(-3px) scale(1.04); 189 box-shadow: 0 4px 16px color-mix(in srgb, var(--mood-color) 25%, transparent); 190 } 191 192 .mood-icon-wrap { 193 width: 38px; height: 38px; border-radius: 12px; 194 display: flex; align-items: center; justify-content: center; 195 background: rgba(255,255,255,0.05); 196 color: var(--text-muted); 197 transition: all 0.2s; 198 } 199 .mood-btn:hover .mood-icon-wrap { color: var(--text-color); } 200 .mood-btn.selected .mood-icon-wrap { 201 background: color-mix(in srgb, var(--mood-color) 15%, transparent); 202 color: var(--mood-color); 203 } 204 205 .mood-label { 206 font-size: 0.7rem; font-weight: 500; 207 color: var(--text-muted); 208 font-family: 'Outfit', sans-serif; 209 transition: color 0.2s; 210 } 211 .mood-btn.selected .mood-label { color: var(--mood-color); font-weight: 600; } 212 213 /* Reflection */ 214 .reflection-area { 215 display: flex; flex-direction: column; gap: 0.6rem; 216 animation: slideDown 0.22s cubic-bezier(0.34,1.2,0.64,1); 217 } 218 @keyframes slideDown { 219 from { opacity: 0; transform: translateY(-8px); } 220 to { opacity: 1; transform: translateY(0); } 221 } 222 .reflection-input { 223 width: 100%; resize: none; 224 background: rgba(0,0,0,0.2); 225 border: 1px solid rgba(255,255,255,0.08); 226 border-radius: 12px; padding: 0.7rem 0.9rem; 227 color: var(--text-color); font-size: 0.82rem; 228 font-family: 'Outfit', sans-serif; 229 outline: none; transition: border-color 0.2s; 230 box-sizing: border-box; 231 } 232 .reflection-input::placeholder { color: rgba(255,255,255,0.25); } 233 .reflection-input:focus { border-color: var(--mood-color, rgba(168,85,247,0.4)); } 234 235 /* Log button */ 236 .log-btn { 237 align-self: flex-end; 238 display: flex; align-items: center; gap: 0.4rem; 239 padding: 0.4rem 1rem; border-radius: 10px; 240 background: var(--mood-color, var(--primary)); 241 color: white; font-size: 0.8rem; font-weight: 600; 242 font-family: 'Outfit', sans-serif; 243 border: none; cursor: pointer; 244 opacity: 0.9; 245 transition: opacity 0.2s, transform 0.2s; 246 } 247 .log-btn:hover { opacity: 1; transform: scale(1.04); } 248 249 /* Theme prompt */ 250 .theme-prompt { 251 display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; 252 padding: 0.7rem 0.9rem; border-radius: 12px; 253 background: rgba(168,85,247,0.08); 254 border: 1px solid rgba(168,85,247,0.2); 255 font-size: 0.8rem; color: var(--text-color); 256 animation: slideDown 0.22s ease; 257 } 258 .theme-prompt strong { color: var(--primary-hover); } 259 .theme-prompt-btns { display: flex; gap: 0.4rem; margin-left: auto; } 260 .tp-yes, .tp-no { 261 padding: 0.25rem 0.7rem; border-radius: 7px; 262 font-size: 0.75rem; font-weight: 600; cursor: pointer; 263 font-family: 'Outfit', sans-serif; border: none; 264 } 265 .tp-yes { background: var(--primary); color: white; } 266 .tp-no { background: rgba(255,255,255,0.08); color: var(--text-muted); } 267 .tp-yes:hover { opacity: 0.88; } 268 .tp-no:hover { color: var(--text-color); } 269 270 /* Success flash */ 271 .log-success { 272 display: flex; align-items: center; justify-content: center; 273 padding: 0.6rem; border-radius: 12px; 274 background: rgba(74,222,128,0.1); 275 border: 1px solid rgba(74,222,128,0.25); 276 color: #4ade80; font-size: 0.82rem; font-weight: 600; 277 animation: fadeInOut 1.4s ease forwards; 278 } 279 @keyframes fadeInOut { 280 0% { opacity: 0; transform: scale(0.95); } 281 20% { opacity: 1; transform: scale(1); } 282 80% { opacity: 1; } 283 100% { opacity: 0; } 284 } 285 /* Mood tabs */ 286 .mood-tabs { 287 display: flex; gap: 0.5rem; 288 padding-top: 0.5rem; 289 border-top: 1px solid rgba(255,255,255,0.06); 290 } 291 .mode-tab { 292 flex: 1; display: flex; align-items: center; justify-content: center; 293 gap: 0.4rem; padding: 0.5rem; border-radius: 10px; 294 background: transparent; border: none; 295 color: var(--text-muted); font-size: 0.75rem; font-weight: 600; 296 font-family: 'Outfit', sans-serif; cursor: pointer; 297 transition: all 0.2s; 298 } 299 .mode-tab:hover { background: rgba(255,255,255,0.05); color: var(--text-color); } 300 .mode-tab.active { background: rgba(255,255,255,0.1); color: white; } 301 302 /* Portal Popups */ 303 .mood-portal-popup { 304 position: fixed; 305 transform: translateY(-50%); 306 width: 260px; 307 background: rgba(30, 30, 35, 0.6); 308 backdrop-filter: blur(20px); 309 border: 1px solid rgba(255, 255, 255, 0.15); 310 border-radius: 16px; 311 padding: 1.2rem; 312 box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1); 313 animation: popInLeft 0.2s cubic-bezier(0.4, 0, 0.2, 1); 314 z-index: 99999; 315 } 316 317 .mood-popup-content { 318 display: flex; 319 flex-direction: column; 320 gap: 1rem; 321 } 322 323 .popup-header { 324 margin-bottom: -0.5rem; 325 } 326 .popup-label { 327 font-size: 0.75rem; font-weight: 700; letter-spacing: 0.5px; 328 color: var(--text-muted); text-transform: uppercase; 329 } 330 331 .history-scroll-area { 332 max-height: 400px; 333 overflow-y: auto; 334 padding-right: 0.4rem; 335 margin-right: -0.4rem; 336 } 337 .history-scroll-area::-webkit-scrollbar { width: 4px; } 338 .history-scroll-area::-webkit-scrollbar-track { background: transparent; } 339 .history-scroll-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; } 340 341 .mood-popup-tail { 342 position: absolute; 343 right: -6px; 344 top: 50%; 345 margin-top: -6px; 346 width: 12px; height: 12px; 347 background: rgba(45, 45, 55, 0.65); 348 border-top: 1px solid rgba(255, 255, 255, 0.15); 349 border-right: 1px solid rgba(255, 255, 255, 0.15); 350 backdrop-filter: blur(16px); 351 transform: rotate(45deg); 352 border-radius: 2px; 353 z-index: -1; 354 } 355 356 @keyframes popInLeft { 357 from { opacity: 0; transform: translate(10px, -50%) scale(0.95); } 358 to { opacity: 1; transform: translate(0, -50%) scale(1); } 359 } 360 @keyframes popOutLeft { 361 from { opacity: 1; transform: translate(0, -50%) scale(1); } 362 to { opacity: 0; transform: translate(10px, -50%) scale(0.95); } 363 } 364 .mood-portal-popup.closing { 365 animation: popOutLeft 0.18s cubic-bezier(0.4, 0, 1, 1) forwards; 366 } 367 `})]})}var st=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],ct=[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`];function lt(e,t,n){return`${e}-${String(t+1).padStart(2,`0`)}-${String(n).padStart(2,`0`)}`}
367function ut({top:e,left:t,onConfirm:n,onClose:r}){let i=new Date,[a,o]=(0,f.useState)(new Date(i.getFullYear(),i.getMonth(),1)),[s,c]=(0,f.useState)(null),l=a.getFullYear(),u=a.getMonth(),d=new Date(l,u+1,0).getDate(),p=new Date(l,u,1).getDay(),m=[];for(let e=0;e<p;e++)m.push(null);for(let e=1;e<=d;e++)m.push(e);let h=lt(i.getFullYear(),i.getMonth(),i.getDate()),g=e=>{e&&c(lt(l,u,e))};return(0,et.createPortal)((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{className:`tdp-backdrop`,onClick:r}),(0,x.jsxs)(`div`,{className:`tdp-panel`,style:{top:`${e}px`,left:`${t}px`},children:[(0,x.jsx)(`div`,{className:`tdp-tail`}),(0,x.jsxs)(`div`,{className:`tdp-nav`,children:[(0,x.jsx)(`button`,{className:`tdp-nav-btn`,onClick:()=>o(new Date(l,u-1,1)),children:(0,x.jsx)(ie,{size:14})}),(0,x.jsxs)(`span`,{className:`tdp-month font-pixel`,children:[st[u],` `,l]}),(0,x.jsx)(`button`,{className:`tdp-nav-btn`,onClick:()=>o(new Date(l,u+1,1)),children:(0,x.jsx)(ae,{size:14})})]}),(0,x.jsxs)(`div`,{className:`tdp-grid`,children:[ct.map(e=>(0,x.jsx)(`div`,{className:`tdp-day-name font-pixel`,children:e},e)),m.map((e,t)=>{let n=e?lt(l,u,e):null;return(0,x.jsx)(`div`,{onClick:()=>g(e),className:`tdp-day 368 ${e?`tdp-day-active`:`tdp-day-empty`} 369 ${n===h?`tdp-today`:``} 370 ${n===s?`tdp-selected`:``} 371 `,children:e||``},t)})]}),(0,x.jsxs)(`div`,{className:`tdp-footer`,children:[s?(0,x.jsx)(`div`,{className:`tdp-picked-label`,children:new Date(s+`T12:00:00`).toLocaleDateString(void 0,{weekday:`short`,month:`short`,day:`numeric`})}):(0,x.jsx)(`div`,{className:`tdp-hint`,children:`Pick a date above`}),(0,x.jsxs)(`button`,{className:`tdp-confirm-btn`,onClick:()=>{s&&n(s)},disabled:!s,children:[(0,x.jsx)(re,{size:12}),`Set Date`]})]})]}),(0,x.jsx)(`style`,{children:` 372 .tdp-backdrop { 373 position: fixed; inset: 0; z-index: 99990; 374 } 375 .tdp-panel { 376 position: fixed; 377 transform: translateY(-50%); 378 width: 230px; 379 background: rgba(15, 22, 40, 0.96); 380 backdrop-filter: blur(18px); 381 border: 1px solid rgba(255,255,255,0.14); 382 border-radius: 14px; 383 box-shadow: 0 14px 40px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.07); 384 z-index: 99999; 385 overflow: hidden; 386 user-select: none; 387 -webkit-user-select: none; 388 animation: tdpPopIn 0.18s cubic-bezier(0.34,1.56,0.64,1); 389 } 390 @keyframes tdpPopIn { 391 from { opacity: 0; transform: translateY(-50%) scale(0.9); } 392 to { opacity: 1; transform: translateY(-50%) scale(1); } 393 } 394 395 .tdp-tail { 396 position: absolute; top: 50%; right: -6px; 397 width: 10px; height: 10px; 398 background: rgba(22, 30, 52, 0.96); 399 border: 1px solid rgba(255,255,255,0.14); 400 border-left: none; border-bottom: none; 401 transform: translateY(-50%) rotate(45deg); 402 z-index: -1; 403 } 404 405 .tdp-nav { 406 display: flex; align-items: center; justify-content: space-between; 407 padding: 10px 12px 8px; 408 border-bottom: 1px solid rgba(255,255,255,0.05); 409 } 410 .tdp-nav-btn { 411 background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); 412 color: #fff; border-radius: 6px; width: 26px; height: 26px; 413 display: flex; align-items: center; justify-content: center; 414 cursor: pointer; 415 } 416 .tdp-nav-btn:hover { background: var(--primary); border-color: var(--primary); } 417 .tdp-month { color: #fff; font-size: 0.65rem; } 418 419 .tdp-grid { 420 display: grid; grid-template-columns: repeat(7, 1fr); 421 gap: 3px; padding: 10px 10px 6px; text-align: center; 422 } 423 .tdp-day-name { color: rgba(255,255,255,0.35); font-size: 0.48rem; margin-bottom: 2px; } 424 .tdp-day { 425 height: 26px; border-radius: 6px; 426 display: flex; align-items: center; justify-content: center; 427 font-size: 0.75rem; font-family: 'Outfit', sans-serif; color: #fff; 428 } 429 .tdp-day-active { 430 background: rgba(255,255,255,0.03); 431 border: 1px solid rgba(255,255,255,0.05); 432 cursor: pointer; 433 } 434 .tdp-day-active:hover { background: rgba(255,255,255,0.1); } 435 .tdp-today { 436 background: var(--primary) !important; 437 border: none !important; 438 font-weight: 700; 439 box-shadow: 0 0 8px var(--primary); 440 } 441 .tdp-selected { 442 background: rgba(168,85,247,0.3) !important; 443 border-color: rgba(168,85,247,0.6) !important; 444 } 445 .tdp-day-empty { cursor: default; } 446 447 .tdp-footer { 448 display: flex; align-items: center; justify-content: space-between; 449 padding: 8px 12px 10px; 450 border-top: 1px solid rgba(255,255,255,0.05); 451 gap: 8px; 452 } 453 .tdp-picked-label { 454 font-size: 0.72rem; font-family: 'Outfit', sans-serif; 455 color: rgba(255,255,255,0.75); flex: 1; 456 } 457 .tdp-hint { 458 font-size: 0.68rem; font-family: 'Outfit', sans-serif; 459 color: rgba(255,255,255,0.25); flex: 1; 460 font-style: italic; 461 } 462 .tdp-confirm-btn { 463 display: flex; align-items: center; gap: 5px; 464 background: var(--primary); border: none; color: #fff; 465 border-radius: 8px; padding: 5px 10px; 466 font-size: 0.72rem; font-weight: 600; 467 font-family: 'Outfit', sans-serif; 468 cursor: pointer; white-space: nowrap; 469 transition: opacity 0.15s; 470 } 471 .tdp-confirm-btn:disabled { opacity: 0.35; cursor: default; } 472 .tdp-confirm-btn:not(:disabled):hover { opacity: 0.85; } 473 `})]}),document.body)}function dt(){let e=at(),[t,n]=a(`tasks`,[]),[r,i]=a(`taskHistory`,[]),[o,c]=(0,f.useState)(``),[l,u]=(0,f.useState)(`all`),[d,p]=(0,f.useState)(!1),[m,h]=(0,f.useState)(new Set),[g,_]=(0,f.useState)(!1),[v,y]=(0,f.useState)(!1),[b,S]=(0,f.useState)(!1),[C,w]=(0,f.useState)({top:0,left:0}),[T,E]=(0,f.useState)({top:0,left:0}),[ee,D]=(0,f.useState)(null),te=(0,f.useRef)(null),ne=(0,f.useRef)(null),ie=(0,f.useRef)(null),ae=(0,f.useRef)(null),oe=()=>{y(!0),setTimeout(()=>{_(!1),y(!1)},180)},A=()=>S(!1);(0,f.useEffect)(()=>
473{if(!g)return;let e=document.querySelector(`.sidebar-content`),t=document.querySelector(`.sidebar`);if(!e||!t||!ie.current)return;let n=()=>{let n=ie.current.getBoundingClientRect(),r=t.getBoundingClientRect(),i=e.getBoundingClientRect();if(n.bottom<i.top||n.top>i.bottom){oe();return}w({top:n.top+n.height/2,left:r?r.left-260:n.left-280})};return e.addEventListener(`scroll`,n,{passive:!0}),window.addEventListener(`resize`,n),n(),()=>{e.removeEventListener(`scroll`,n),window.removeEventListener(`resize`,n)}},[g]),(0,f.useEffect)(()=>{if(!g)return;let e=e=>{ae.current&&!ae.current.contains(e.target)&&ie.current&&!ie.current.contains(e.target)&&oe()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[g,v]);let se=e=>{e.stopPropagation(),g?oe():(b&&A(),_(!0))},ce=e=>{if(e.stopPropagation(),b){A();return}g&&oe();let t=te.current,n=document.querySelector(`.sidebar`);if(t&&n){let e=t.getBoundingClientRect(),r=n.getBoundingClientRect();E({top:e.top+e.height/2,left:r.left-246})}S(!0)},le=e=>{e.preventDefault(),o.trim()&&(n([{id:typeof crypto<`u`&&crypto.randomUUID?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`,text:o.trim(),completed:!1,createdAt:new Date().toISOString(),...ee?{calendarDate:ee}:{}},...t]),c(``),D(null))},ue=e=>{n(t.map(t=>t.id===e?{...t,completed:!t.completed}:t))},j=e=>{h(t=>new Set([...t,e])),setTimeout(()=>{n(t.filter(t=>t.id!==e)),h(t=>{let n=new Set(t);return n.delete(e),n})},280)},M=()=>{let e=t.filter(e=>e.completed),a=e.map(e=>e.id);i([...e.map(e=>({...e,archivedAt:new Date().toISOString()})),...r].slice(0,100)),h(e=>new Set([...e,...a])),setTimeout(()=>{n(t.filter(e=>!e.completed)),h(new Set)},280)},N=()=>{let e=localStorage.getItem(`stickyNotes`),t=e?JSON.parse(e):[];if(t.some(e=>e.type===`task-sync`))return;let n=window.innerWidth-360,r=[{id:`task-sync-widget`,type:`task-sync`,text:``,color:`#e9d5ff`,font:`'Outfit', sans-serif`,isPinned:!1,x:Math.floor(Math.random()*Math.max(20,n-220))+10,y:Math.floor(Math.random()*(window.innerHeight-300))+40,zIndex:20},...t];localStorage.setItem(`stickyNotes`,JSON.stringify(r)),window.dispatchEvent(new CustomEvent(`local-storage`,{detail:{key:`stickyNotes`,value:r}}))},de=t.filter(e=>e.completed).length,fe=t.length?de/t.length*100:0,pe=t.length>0&&de===t.length,me=t.filter(e=>l===`active`?!e.completed:l===`done`?e.completed:!0);return(0,x.jsxs)(`div`,{className:`task-container`,ref:ie,children:[(0,x.jsxs)(`div`,{className:`task-header`,children:[(0,x.jsxs)(`div`,{className:`task-stat-label`,children:[pe?(0,x.jsxs)(`span`,{className:`all-done-text`,children:[(0,x.jsx)(ze,{size:13}),` All done!`]}):(0,x.jsxs)(`span`,{children:[t.length-de,` remaining`]}),(0,x.jsxs)(`div`,{className:`task-header-right`,children:[(0,x.jsxs)(`span`,{className:`task-count-secondary`,children:[de,`/`,t.length]}),t.filter(e=>!e.completed).length>0&&(0,x.jsx)(`button`,{className:`history-icon-btn`,onClick:N,title:`Dump tasks to sticky note`,children:(0,x.jsx)(Ue,{size:14})}),(0,x.jsx)(`button`,{className:`history-icon-btn ${g?`active`:``}`,onClick:se,title:`Task History`,children:(0,x.jsx)(he,{size:14})})]})]}),(0,x.jsx)(`div`,{className:`progress-track`,children:(0,x.jsx)(`div`,{className:`progress-fill ${pe?`complete`:``}`,style:{width:`${fe}%`}})})]}),(0,x.jsxs)(`form`,{onSubmit:le,className:`task-input-form ${d?`focused`:``}`,children:[(0,x.jsx)(`input`,{ref:ne,type:`text`,placeholder:`Add a task...`,value:o,onChange:e=>c(e.target.value),onFocus:()=>p(!0),onBlur:()=>p(!1),className:`task-input`}),(0,x.jsxs)(`div`,{className:`input-actions`,style:{display:`flex`,gap:`4px`,alignItems:`center`},children:[!e&&ee&&(0,x.jsxs)(`span`,{className:`task-date-chip`,children:[new Date(ee+`T12:00:00`).toLocaleDateString(void 0,{month:`short`,day:`numeric`}),(0,x.jsx)(`button`,{type:`button`,className:`task-date-chip-clear`,onClick:()=>D(null),children:(0,x.jsx)(s,{size:9})})]}),!e&&o.trim()&&(0,x.jsx)(`button`,{ref:te,type:`button`,className:`add-btn icon-only ${b?`active`:``} ${ee?`has-date`:``}`,onClick:ce,title:`Set due date`,children:(0,x.jsx)(O,{size:14})}),o.trim()&&(0,x.jsx)(`button`,{type:`submit`,className:`add-btn icon-only`,title:`Add task`,children:(0,x.jsx)(ke,{size:14})})]})]}),t.length>0&&(0,x.jsx)(`div`,{className:`filter-tabs`,children:[`all`,`active`,`done`].map(e=>(0,x.jsxs)(`button`,{className:`filter-tab ${l===e?`active`:``}`,onClick:()=>u(e),children:[e.charAt(0).toUpperCase()+e.slice(1),e===`done`&&de>0&&(0,x.jsx)(`span`,{className:`filter-badge`,children:de}),e===`active`&&t.length-de>0&&(0,x.jsx)(`span`,{className:`filter-badge active-badge`,children:t.length-de})]},e))}),(0,x.jsxs)(`ul`,{className:`task-list`,children:[me.length===0&&(0,x.jsxs)(`li`,{className:`empty-state`,children:[(0,x.jsx)(k,{size:28,strokeWidth:1.2}),(0,x.jsx)(`span`,{children:l===`done`?`Nothing completed yet`:l===`active`?`All caught up!`:`No tasks yet. Enjoy the quiet.`})]}),me.map(e=>(0,x.jsxs)(`li`,{className:`task-item ${e.completed?`completed`:``} ${m.has(e.id)?`removing`:``}`,children:[(0,x.jsx)(`button`,{className:`checkbox`,onClick:()=>ue(e.id),"aria-label":e.completed?`Mark incomplete`:`Mark complete`,children:(0,x.jsx)(`span`,{className:`checkbox-inner`,children:e.completed&&(0,x.jsx)(re,{size:11,strokeWidth:3})})}),(0,x.jsxs)(`div`,{className:`task-text-group`,children:[(0,x.jsx)(`span`,{className:`task-text`,children:e.text}),e.calendarDate&&(0,x.jsxs)(`span`,{className:`task-date-label`,children:[(0,x.jsx)(O,{size:9}),new Date(e.calendarDate+`T12:00:00`).toLocaleDateString(void 0,{month:`short`,day:`numeric`})]})]}),(0,x.jsx)(`button`,{className:`delete-btn`,onClick:()=>j(e.id),"aria-label":`Delete task`,children:(0,x.jsx)(Ke,{size:14})})]},e.id))]},l),de>0&&(0,x.jsxs)(`button`,{className:`clear-btn`,onClick:M,children:[`Archive `,de,` completed`]}),(g||v)&&(0,et.createPortal)((0,x.jsxs)(`div`,{ref:ae,className:`task-portal-popup ${v?`closing`:``}
473`,style:{top:`${C.top}px`,left:`${C.left}px`},children:[(0,x.jsxs)(`div`,{className:`task-popup-content`,children:[(0,x.jsx)(`div`,{className:`popup-header`,children:(0,x.jsx)(`span`,{className:`popup-label`,children:`Task History`})}),(0,x.jsx)(`div`,{className:`history-scroll-area`,children:r.length===0?(0,x.jsx)(`div`,{className:`empty-history text-muted`,children:`No completed tasks archived yet.`}):(0,x.jsx)(`ul`,{className:`history-list`,children:r.map(e=>(0,x.jsxs)(`li`,{className:`history-item`,children:[(0,x.jsx)(re,{size:12,className:`history-check`,strokeWidth:3}),(0,x.jsxs)(`div`,{className:`history-item-info`,children:[(0,x.jsx)(`span`,{className:`history-text`,children:e.text}),(0,x.jsx)(`span`,{className:`history-date`,children:new Date(e.archivedAt).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})})]})]},e.id+e.archivedAt))})})]}),(0,x.jsx)(`div`,{className:`task-popup-tail`})]}),document.body),b&&(0,x.jsx)(ut,{top:T.top,left:T.left,onClose:A,onConfirm:e=>{D(e),A()}}),(0,x.jsx)(`style`,{jsx:`true`,children:` 474 .task-container { 475 display: flex; flex-direction: column; gap: 0.85rem; 476 } 477 478 /* Header */ 479 .task-header { display: flex; flex-direction: column; gap: 0.5rem; } 480 .task-stat-label { 481 display: flex; justify-content: space-between; align-items: center; 482 font-size: 0.78rem; color: var(--text-muted); 483 } 484 .all-done-text { 485 display: flex; align-items: center; gap: 0.3rem; 486 color: #a3e635; font-weight: 600; 487 } 488 .task-count-secondary { font-size: 0.72rem; opacity: 0.6; } 489 490 /* Progress bar */ 491 .progress-track { 492 width: 100%; height: 4px; 493 background: rgba(255,255,255,0.07); 494 border-radius: 4px; overflow: hidden; 495 } 496 .progress-fill { 497 height: 100%; 498 background: linear-gradient(90deg, var(--primary-hover), var(--primary)); 499 border-radius: 4px; 500 transition: width 0.4s cubic-bezier(0.4,0,0.2,1); 501 box-shadow: 0 0 8px rgba(168,85,247,0.4); 502 } 503 .progress-fill.complete { 504 background: linear-gradient(90deg, #4ade80, #a3e635); 505 box-shadow: 0 0 8px rgba(163,230,53,0.4); 506 } 507 508 /* Input form */ 509 .task-input-form { 510 display: flex; align-items: center; 511 background: rgba(0,0,0,0.2); 512 border: 1px solid rgba(255,255,255,0.08); 513 border-radius: 14px; padding: 6px 6px 6px 14px; 514 transition: border-color 0.2s, box-shadow 0.2s; 515 gap: 0; 516 } 517 .task-input-form.focused { 518 border-color: rgba(168,85,247,0.4); 519 box-shadow: 0 0 0 3px rgba(168,85,247,0.08); 520 } 521 .task-input { 522 flex: 1; background: transparent; border: none; outline: none; 523 color: var(--text-color); font-size: 0.85rem; 524 font-family: 'Outfit', sans-serif; min-width: 0; 525 } 526 .task-input::placeholder { color: rgba(255,255,255,0.3); } 527 528 /* Add button */ 529 .add-btn { 530 flex-shrink: 0; 531 padding: 0.25rem 0.7rem; 532 border-radius: 8px; 533 background: var(--primary); 534 border: none; 535 color: white; 536 font-size: 0.75rem; font-weight: 600; 537 font-family: 'Outfit', sans-serif; 538 cursor: pointer; 539 transition: opacity 0.15s, transform 0.15s; 540 white-space: nowrap; 541 animation: fadeInBtn 0.15s ease; 542 display: flex; 543 align-items: center; 544 justify-content: center; 545 } 546 .add-btn.icon-only { 547 padding: 0.4rem; 548 } 549 @keyframes fadeInBtn { 550 from { opacity: 0; transform: scale(0.9); } 551 to { opacity: 1; transform: scale(1); } 552 } 553 .add-btn:hover { opacity: 0.88; transform: scale(1.04); } 554 555 /* Filter tabs */ 556 .filter-tabs { 557 display: flex; gap: 0.4rem; 558 } 559 .filter-tab { 560 flex: 1; padding: 0.3rem 0.5rem; border-radius: 8px; 561 font-size: 0.72rem; font-weight: 500; 562 color: var(--text-muted); 563 background: rgba(255,255,255,0.03); 564 border: 1px solid rgba(255,255,255,0.06); 565 transition: all 0.2s; display: flex; align-items: center; 566 justify-content: center; gap: 0.3rem; 567 font-family: 'Outfit', sans-serif; cursor: pointer; 568 } 569 .filter-tab.active { 570 background: rgba(168,85,247,0.12); 571 border-color: rgba(168,85,247,0.3); 572 color: var(--primary-hover); 573 } 574 .filter-tab:hover:not(.active) { 575 background: rgba(255,255,255,0.06); 576 color: var(--text-color); 577 } 578 .filter-badge { 579 background: rgba(255,255,255,0.12); 580 color: var(--text-muted); 581 border-radius: 10px; padding: 0 5px; 582 font-size: 0.65rem; font-weight: 700; line-height: 1.6; 583 } 584 .active-badge { 585 background: rgba(168,85,247,0.2); 586 color: var(--primary-hover); 587 } 588 589 /* Task list scroll wrapper */ 590 .task-list-wrap { 591 position: relative; 592 } 593 .task-list-wrap::after { 594 content: ''; 595 position: absolute; bottom: 0; left: 0; right: 0; 596 height: 40px; 597 background: linear-gradient(to bottom, transparent, rgba(15,15,25,0.7)); 598 pointer-events: none; border-radius: 0 0 8px 8px; 599 opacity: 0; transition: opacity 0.2s; 600 } 601 .task-list-wrap.overflowing::after { opacity: 1; } 602 603 .task-list { 604 list-style: none; padding: 0; margin: 0; 605 display: flex; flex-direction: column; 606 max-height: 242px;
606 /* ~5 items à 44px + 4 gaps à 7px */ 607 overflow-y: auto; 608 scrollbar-width: thin; 609 scrollbar-color: transparent transparent; 610 transition: scrollbar-color 0.3s ease; 611 } 612 .task-list:hover { 613 scrollbar-color: rgba(168,85,247,0.3) transparent; 614 } 615 .task-list::-webkit-scrollbar { width: 3px; } 616 .task-list::-webkit-scrollbar-thumb { 617 background: transparent; 618 border-radius: 2px; 619 transition: background 0.3s ease; 620 } 621 .task-list:hover::-webkit-scrollbar-thumb { background: rgba(168,85,247,0.3); } 622 623 /* Empty state */ 624 .empty-state { 625 display: flex; flex-direction: column; align-items: center; 626 gap: 0.5rem; padding: 1.5rem 1rem; 627 color: var(--text-muted); font-size: 0.8rem; 628 opacity: 0.7; 629 } 630 631 /* Task item */ 632 .task-item { 633 display: flex; align-items: center; gap: 0.75rem; 634 padding: 0.65rem 0.75rem; border-radius: 12px; 635 margin-bottom: 0.45rem; 636 background: rgba(255,255,255,0.03); 637 border: 1px solid rgba(255,255,255,0.06); 638 animation: slideIn 0.22s cubic-bezier(0.34,1.56,0.64,1); 639 transform-origin: top; 640 } 641 @keyframes slideIn { 642 from { opacity: 0; transform: translateY(-8px) scale(0.97); } 643 to { opacity: 1; transform: translateY(0) scale(1); } 644 } 645 .task-item.removing { 646 animation: slideOut 0.22s ease-in forwards; 647 pointer-events: none; 648 overflow: hidden; 649 } 650 @keyframes slideOut { 651 0% { 652 opacity: 1; transform: translateY(0) scale(1); 653 max-height: 60px; padding-top: 0.65rem; padding-bottom: 0.65rem; 654 margin-bottom: 0.45rem; border-width: 1px; 655 } 656 100% { 657 opacity: 0; transform: translateY(-8px) scale(0.97); 658 max-height: 0; padding-top: 0; padding-bottom: 0; 659 margin-bottom: 0; border-width: 0; 660 } 661 } 662 .task-item:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); } 663 .task-item.completed { 664 background: rgba(0,0,0,0.1); 665 border-color: rgba(255,255,255,0.04); 666 } 667 668 /* Checkbox */ 669 .checkbox { 670 width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0; 671 border: 1.5px solid rgba(255,255,255,0.2); 672 display: flex; align-items: center; justify-content: center; 673 cursor: pointer; transition: all 0.2s; 674 background: transparent; 675 } 676 .checkbox:hover { border-color: var(--primary); } 677 .task-item.completed .checkbox { 678 background: linear-gradient(135deg, #4ade80, #22c55e); 679 border-color: transparent; 680 box-shadow: 0 0 8px rgba(74,222,128,0.3); 681 } 682 .checkbox-inner { display: flex; align-items: center; justify-content: center; color: white; } 683 684 /* Task text group */ 685 .task-text-group { 686 flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; 687 } 688 .task-text { 689 font-size: 0.83rem; color: var(--text-color); 690 word-break: break-word; line-height: 1.4; 691 transition: all 0.3s; 692 } 693 .task-item.completed .task-text { 694 text-decoration: line-through; 695 opacity: 0.4; 696 } 697 .task-date-label { 698 display: inline-flex; align-items: center; gap: 3px; 699 font-size: 0.64rem; font-family: 'Outfit', sans-serif; 700 color: rgba(168,85,247,0.7); 701 line-height: 1; 702 } 703 .task-item.completed .task-date-label { opacity: 0.35; } 704 705 /* Date chip in input row */ 706 .task-date-chip { 707 display: inline-flex; align-items: center; gap: 4px; 708 background: rgba(168,85,247,0.15); 709 border: 1px solid rgba(168,85,247,0.35); 710 border-radius: 20px; padding: 2px 8px 2px 9px; 711 font-size: 0.68rem; font-family: 'Outfit', sans-serif; 712 color: rgba(200,160,255,0.9); white-space: nowrap; 713 animation: fadeInBtn 0.15s ease; 714 } 715 .task-date-chip-clear { 716 background: none; border: none; padding: 0; 717 cursor: pointer; color: rgba(200,160,255,0.6); 718 display: flex; align-items: center; line-height: 1; 719 } 720 .task-date-chip-clear:hover { color: #f87171; } 721 722 /* Calendar button has-date tint */ 723 .add-btn.has-date { 724 background: rgba(168,85,247,0.2); 725 color: rgba(200,160,255,0.9); 726 } 727 .add-btn.active { 728 background: rgba(168,85,247,0.3); 729 } 730 731 /* Delete button */ 732 .delete-btn { 733 color: var(--text-muted); opacity: 0; 734 transition: all 0.15s; flex-shrink: 0; 735 display: flex; align-items: center; 736 padding: 2px; border-radius: 5px; 737 cursor: pointer; background: transparent; border: none; 738 } 739 .task-item:hover .delete-btn { opacity: 1; } 740 .delete-btn:hover { color: #f87171; background: rgba(248,113,113,0.1); } 741 742 /* Clear completed */ 743 .clear-btn { 744 width: 100%; padding: 0.4rem; border-radius: 10px; 745 font-size: 0.72rem; font-weight: 500; cursor: pointer; 746 color: var(--text-muted); 747 background: transparent; 748 border: 1px dashed rgba(255,255,255,0.1); 749 transition: all 0.2s; font-family: 'Outfit', sans-serif; 750 } 751 .clear-btn:hover { 752 border-color: rgba(248,113,113,0.4); 753 color: #f87171; 754 background: rgba(248,113,113,0.05); 755 } 756 .task-header-right { 757 display: flex; align-items: center; gap: 0.5rem; 758 } 759 .history-icon-btn { 760 background: transparent; border: none; padding: 0.2rem; 761 color: var(--text-muted); cursor: pointer; border-radius: 4px; 762 display: flex; align-items: center; transition: all 0.2s; 763 } 764 .history-icon-btn:hover, .history-icon-btn.active { 765 color: var(--text-color); background: rgba(255,255,255,0.1); 766 } 767 768 /* Portal Popups */ 769 .task-portal-popup { 770 position: fixed; 771 transform: translateY(-50%); 772 width: 260px; 773 background: rgba(30, 30, 35, 0.6); 774 backdrop-filter: blur(20px); 775 border: 1px solid rgba(255, 255, 255, 0.15); 776 border-radius: 16px; 777 padding: 1.2rem; 778 box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1); 779 animation: popInLeft 0.2s cubic-bezier(0.4, 0, 0.2, 1); 780 z-index: 99999; 781 } 782 .task-popup-content { 783 display: flex; flex-direction: column; gap: 1rem; 784 } 785 .popup-header { margin-bottom: -0.5rem; } 786 .popup-label { 787 font-size: 0.75rem; font-weight: 700; letter-spacing: 0.5px; 788 color: var(--text-muted); text-transform: uppercase; 789 } 790 .task-popup-tail { 791 position: absolute; right: -6px; top: 50%; margin-top: -6px; 792 width: 12px; height: 12px; 793 background: rgba(45, 45, 55, 0.65); 794 border-top: 1px solid rgba(255, 255, 255, 0.15); 795 border-right: 1px solid rgba(255, 255, 255, 0.15); 796 backdrop-filter: blur(16px); 797 transform: rotate(45deg); border-radius: 2px; z-index: -1; 798 } 799 800 /* History Scroll Area */ 801 .history-scroll-area { 802 max-height: 300px; overflow-y: auto; 803 padding-right: 0.4rem; margin-right: -0.4rem; 804 } 805 .history-scroll-area::-webkit-scrollbar { width: 4px; } 806 .history-scroll-area::-webkit-scrollbar-track { background: transparent; } 807 .history-scroll-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; } 808 809 .empty-history { 810 font-size: 0.8rem; text-align: center; padding: 2rem 0; 811 } 812 .history-list { 813 list-style: none; margin: 0; padding: 0; 814 display: flex; flex-direction: column; gap: 0.4rem; 815 } 816 .history-item { 817 display: flex; gap: 0.6rem; padding: 0.6rem 0.7rem; 818 background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); 819 border-radius: 10px; transition: background 0.2s; 820 } 821 .history-item:hover { background: rgba(255,255,255,0.06); } 822 .history-check { 823 color: #4ade80; flex-shrink: 0; margin-top: 2px; 824 } 825 .history-item-info { 826 display: flex; flex-direction: column; gap: 0.2rem; 827 } 828 .history-text { 829 font-size: 0.8rem; color: var(--text-color); font-weight: 500; 830 line-height: 1.3; 831 } 832 .history-date { 833 font-size: 0.65rem; color: var(--text-muted); opacity: 0.8; 834 } 835 836 @keyframes popInLeft { 837 from { opacity: 0; transform: translate(10px, -50%) scale(0.95); } 838 to { opacity: 1; transform: translate(0, -50%) scale(1); } 839 } 840 @keyframes popOutLeft { 841 from { opacity: 1; transform: translate(0, -50%) scale(1); } 842 to { opacity: 0; transform: translate(10px, -50%) scale(0.95); } 843 } 844 .task-portal-popup.closing { 845 animation: popOutLeft 0.18s cubic-bezier(0.4, 0, 1, 1) forwards; 846 } 847 `})]})}var ft=()=>Date.now();function pt(){let[,e]=a(`pomodoroStats`,{sessions:0}),[t,n]=(0,f.useState)(`work`),[r,i]=a(`pomodoroCustom`,45),o=Math.min(999,Math.max(1,parseInt(r,10)||45)),s=(0,f.useMemo)(()=>({work:{label:`Focus`,minutes:25},fastStudy:{label:`Sprint`,minutes:15},shortBreak:{label:`Break`,minutes:5},free:{label:`Free Track`,minutes:0},custom:{label:`Custom`,minutes:o}}),[o]),[c,l]=(0,f.useState)(0),[u,d]=(0,f.useState)(!1),[p,m]=(0,f.useState)(!1),[h,g]=(0,f.useState)(r.toString()),[_,v]=(0,f.useState)(!1),y=(0,f.useRef)(null),b=(0,f.useRef)(null),S=(0,f.useRef)(0),C=(0,f.useRef)(!1),w=t===`free`?1/0:s[t].minutes*60,T=(0,f.useCallback)(()=>
847{if(!u||!b.current)return c;let e=Math.floor((ft()-b.current)/1e3);return S.current+e},[u,c]),E=(0,f.useCallback)(()=>{C.current||(C.current=!0,b.current=null,S.current=w,l(w),d(!1),y.current=new Audio(`/alarm.mp3`),y.current.loop=!0,y.current.play().catch(e=>console.log(`Audio play failed:`,e)),v(!0),t===`work`&&e(e=>({...e,sessions:(e.sessions||0)+1})))},[t,e,w]);(0,f.useEffect)(()=>{if(!u)return;let e=()=>{let e=T();if(t===`free`){l(e);return}l(Math.min(e,w)),e>=w&&E()},n=setInterval(e,250),r=()=>e();return document.addEventListener(`visibilitychange`,r),()=>{clearInterval(n),document.removeEventListener(`visibilitychange`,r)}},[E,T,u,t,w]);let ee=()=>{if(!(p&&!ae())){if(u){let e=T();S.current=e,b.current=null,l(e),d(!1);return}C.current=!1,S.current=c,b.current=ft(),d(!0)}},D=()=>{v(!1),y.current&&(y.current.pause(),y.current.currentTime=0)},te=()=>{d(!1),b.current=null,S.current=0,C.current=!1,l(0)},O=e=>{n(e),d(!1),m(!1),b.current=null,S.current=0,C.current=!1,l(0)},ne=()=>{d(!1),b.current=null,S.current=0,C.current=!1,g(o.toString()),n(`custom`),l(0),m(!0)},re=e=>{g(e.target.value.replace(/[^0-9]/g,``))},ie=e=>{if(![`Backspace`,`Delete`,`Tab`,`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key)){if(e.key===`Enter`){ae();return}/^[0-9]$/.test(e.key)||e.preventDefault()}},ae=()=>{let e=parseInt(h,10);return!isNaN(e)&&e>0?(i(Math.min(999,e)),l(0),S.current=0,C.current=!1,n(`custom`),m(!1),!0):(g(o.toString()),m(!1),!1)},oe=e=>`${Math.floor(e/60).toString().padStart(2,`0`)}:${(e%60).toString().padStart(2,`0`)}`,k=t===`free`?c:Math.max(0,s[t].minutes*60-c);return(0,x.jsxs)(`div`,{className:`pomodoro-container`,children:[(0,x.jsx)(`div`,{className:`mode-selector`,children:Object.entries(s).filter(([e])=>e!==`custom`&&e!==`free`).map(([e,n])=>(0,x.jsx)(`button`,{className:`mode-btn ${t===e?`active`:``}`,onClick:()=>O(e),children:n.label},e))}),(0,x.jsx)(`div`,{className:`timer-display ${u?`running`:``}`,children:p?(0,x.jsxs)(`div`,{className:`custom-input-wrap`,children:[(0,x.jsx)(`input`,{type:`text`,inputMode:`numeric`,pattern:`[0-9]*`,value:h,onChange:re,onKeyDown:ie,onBlur:ae,autoFocus:!0,className:`custom-input font-pixel`,maxLength:3,placeholder:`00`}),(0,x.jsx)(`span`,{className:`min-label`,children:`min`})]}):(0,x.jsx)(`div`,{className:`time-text font-pixel`,onClick:()=>!u&&ne(),children:oe(k)})}),(0,x.jsx)(`div`,{className:`main-play-ctrl`,children:(0,x.jsx)(`button`,{className:`control-btn play-btn ${u?`active`:``}`,onClick:ee,children:u?(0,x.jsx)(Te,{size:28,fill:`currentColor`}):(0,x.jsx)(Oe,{size:28,fill:`currentColor`,style:{marginLeft:`4px`}})})}),(0,x.jsxs)(`div`,{className:`secondary-controls`,children:[(0,x.jsxs)(`button`,{className:`sec-btn`,onClick:te,title:`Reset`,children:[(0,x.jsx)(Ne,{size:14}),` Reset`]}),(0,x.jsxs)(`button`,{className:`sec-btn ${t===`custom`&&!p?`active`:``}`,onClick:ne,children:[(0,x.jsx)(A,{size:14}),` Custom`]}),(0,x.jsx)(`button`,{className:`sec-btn icon-only ${t===`free`?`active`:``}`,onClick:()=>O(`free`),title:`Free tracking mode`,children:(0,x.jsx)(_e,{size:16})})]}),_&&(0,et.createPortal)((0,x.jsx)(`div`,{className:`alarm-modal-overlay`,onClick:D,children:(0,x.jsxs)(`div`,{className:`alarm-modal`,onClick:e=>e.stopPropagation(),children:[(0,x.jsx)(`h3`,{className:`font-pixel`,children:`Time's Up!`}),(0,x.jsx)(`p`,{children:t===`work`?`Great focus session! Take a break.`:`Break is over. Ready to focus?`}),(0,x.jsx)(`button`,{className:`dismiss-btn`,onClick:D,children:`Dismiss Alarm`})]})}),document.body),(0,x.jsx)(`style`,{jsx:`true`,children:` 848 .pomodoro-container { 849 display: flex; flex-direction: column; align-items: center; gap: 1.2rem; 850 padding: 0.5rem; width: 100%; 851 } 852 853 /* Pills Selector */ 854 .mode-selector { 855 display: flex; background: rgba(0,0,0,0.25); border-radius: 24px; 856 padding: 4px; border: 1px solid rgba(255,255,255,0.08); width: 100%; 857 max-width: 280px; 858 } 859 .mode-btn { 860 flex: 1; padding: 0.4rem; border-radius: 20px; font-weight: 500; 861 font-size: 0.75rem; color: var(--text-muted); font-family: 'Outfit', sans-serif; 862 transition: all 0.3s ease; text-align: center; 863 } 864 .mode-btn.active { 865 background: rgba(255,255,255,0.1); color: var(--text-color); 866 box-shadow: 0 4px 12px rgba(0,0,0,0.1); font-weight: 600; 867 } 868 869 /* Timer Text */ 870 .timer-display { 871 display: flex; align-items: center; justify-content: center; 872 height: 80px; margin: 0.5rem 0; 873 } 874 .time-text { 875 font-size: 3rem; color: var(--text-color); cursor: pointer; 876 text-shadow: 0 4px 20px rgba(0,0,0,0.5); letter-spacing: -1px; 877 transition: color 0.3s, transform 0.2s; 878 } 879 .time-text:hover { 880 transform: scale(1.05); 881 } 882 .timer-display.running .time-text { 883 color: var(--primary); 884 text-shadow: 0 0 20px rgba(168,85,247,0.4); 885 } 886 887 /* Custom Input */ 888 .custom-input-wrap { 889 display: flex; flex-direction: column; align-items: center; 890 position: relative; 891 } 892 .custom-input { 893 width: 120px; background: transparent; border: none; 894 border-bottom: 3px dashed var(--primary); border-radius: 0; 895 color: var(--primary); font-size: 3rem; text-align: center; 896 padding: 0 0.5rem; outline: none; box-shadow: none; 897 transition: all 0.2s; 898 } 899 .custom-input:focus { 900 border-bottom-color: var(--primary-hover); 901 text-shadow: 0 0 15px rgba(168,85,247,0.4); 902 } 903 .custom-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } 904 .min-label { 905 font-size: 0.8rem; color: var(--primary); margin-top: 0.5rem; 906 font-family: 'Outfit', sans-serif; font-weight: 600; letter-spacing: 1px; 907 text-transform: uppercase; 908 } 909 910 /* Play/Pause Button */ 911 .main-play-ctrl { 912 display: flex; justify-content: center; 913 } 914 .play-btn { 915 width: 64px; height: 64px; border-radius: 50%; display: flex; 916 align-items: center; justify-content: center; 917 background: rgba(0,0,0,0.3); color: var(--text-color); 918 border: 1px solid rgba(255,255,255,0.15); 919 transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 920 } 921 .play-btn.active { 922 background: rgba(168,85,247,0.15); border-color: var(--primary); 923 color: var(--primary); box-shadow: inset 0 0 15px rgba(168,85,247,0.2), 0 4px 20px rgba(168,85,247,0.2); 924 } 925 .play-btn:hover { 926 transform: scale(1.05); background: var(--primary); border-color: var(--primary); 927 color: white; box-shadow: 0 4px 20px rgba(168,85,247,0.4); 928 } 929 .play-btn:active { transform: scale(0.95); } 930 931 /* Secondary Controls */ 932 .secondary-controls { 933 display: flex; align-items: center; justify-content: center; gap: 0.8rem; 934 margin-top: 0.5rem; 935 } 936 .sec-btn { 937 display: flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.8rem; 938 border-radius: 16px; background: rgba(255,255,255,0.05); 939 border: 1px solid rgba(255,255,255,0.08); color: var(--text-muted); 940 font-size: 0.7rem; font-weight: 500; transition: all 0.2s; 941 } 942 .sec-btn.icon-only { padding: 0.4rem; justify-content: center; } 943 .sec-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-color); } 944 .sec-btn.active { background: rgba(168,85,247,0.15); color: var(--primary); border-color: rgba(168,85,247,0.3); } 945 .input-row .control-btn.active { 946 background: rgba(56, 189, 248, 0.2); 947 border-color: rgba(56, 189, 248, 0.4); 948 color: #38bdf8; 949 } 950 951 /* Alarm Modal */ 952 .alarm-modal-overlay { 953 position: fixed; inset: 0; 954 background: rgba(0, 0, 0, 0.6); 955 backdrop-filter: blur(4px); 956 z-index: 10005; 957 display: flex; align-items: center; justify-content: center; 958 } 959 .alarm-modal { 960 background: #1e293b; 961 border: 1px solid rgba(255, 255, 255, 0.1); 962 border-radius: 16px; 963 padding: 24px; width: 320px; text-align: center; 964 box-shadow: 0 10px 40px rgba(0,0,0,0.5); 965 animation: popIn 0.2s ease-out forwards; 966 } 967 @keyframes popIn { 968 from { opacity: 0; transform: scale(0.95) translateY(10px); } 969 to { opacity: 1; transform: scale(1) translateY(0); } 970 } 971 .alarm-modal h3 { 972 margin: 0 0 12px 0; color: #38bdf8; font-size: 1.5rem; 973 animation: pulseText 1.5s infinite; 974 } 975 @keyframes pulseText { 976 0%, 100% { opacity: 1; } 977 50% { opacity: 0.6; } 978 } 979 .alarm-modal p { 980 margin: 0 0 24px 0; color: #94a3b8; font-size: 1rem; 981 } 982 .dismiss-btn { 983 width: 100%; padding: 12px; border-radius: 8px; 984 background: var(--primary); border: none; color: #fff; 985 font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 1rem; 986 cursor: pointer; transition: background 0.2s; 987 } 988 .dismiss-btn:hover { 989 background: #0ea5e9; 990 } 991 `})]})}function mt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ht(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}var gt=e=>e?(...t)=>e(...t):(...e)=>
vendor: 3,004 bytes, line 991
991fetch(...e),_t=class extends Error{constructor(e,t=`FunctionsError`,n){super(e),this.name=t,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}},vt=class extends _t{constructor(e){super(`Failed to send a request to the Edge Function`,`FunctionsFetchError`,e)}},yt=class extends _t{constructor(e){super(`Relay Error invoking the Edge Function`,`FunctionsRelayError`,e)}},bt=class extends _t{constructor(e){super(`Edge Function returned a non-2xx status code`,`FunctionsHttpError`,e)}},xt;(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`})(xt||={});var St=class{constructor(e,{headers:t={},customFetch:n,region:r=xt.Any}={}){this.url=e,this.headers=t,this.region=r,this.fetch=gt(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return ht(this,arguments,void 0,function*(e,t={}){var n;let r,i,a;try{let{headers:n,method:o,body:s,signal:c,timeout:l}=t,u={},{region:d}=t;d||=this.region;let f=new URL(`${this.url}/${e}`);d&&d!==`any`&&(u[`x-region`]=d,f.searchParams.set(`forceFunctionRegion`,d));let p,m=!!n&&Object.keys(n).some(e=>e.toLowerCase()===`content-type`);s&&!m?typeof Blob<`u`&&s instanceof Blob||s instanceof ArrayBuffer?(u[`Content-Type`]=`application/octet-stream`,p=s):typeof s==`string`?(u[`Content-Type`]=`text/plain`,p=s):typeof FormData<`u`&&s instanceof FormData?p=s:(u[`Content-Type`]=`application/json`,p=JSON.stringify(s)):p=s&&typeof s!=`string`&&!(typeof Blob<`u`&&s instanceof Blob)&&!(s instanceof ArrayBuffer)&&!(typeof FormData<`u`&&s instanceof FormData)?JSON.stringify(s):s;let h=c;l&&(i=new AbortController,r=setTimeout(()=>i.abort(),l),c?(h=i.signal,a=()=>i.abort(),c.addEventListener(`abort`,a)):h=i.signal);let g=yield this.fetch(f.toString(),{method:o||`POST`,headers:Object.assign(Object.assign(Object.assign({},u),this.headers),n),body:p,signal:h}).catch(e=>{throw new vt(e)}),_=g.headers.get(`x-relay-error`);if(_&&_===`true`)throw new yt(g);if(!g.ok)throw new bt(g);let v=(g.headers.get(`Content-Type`)??`text/plain`).split(`;`)[0].trim().toLowerCase(),y;return y=v===`application/json`?yield g.json():v===`application/octet-stream`||v===`application/pdf`?yield g.blob():v===`text/event-stream`?g:v===`multipart/form-data`?yield g.formData():yield g.text(),{data:y,error:null,response:g}}catch(e){return{data:null,error:e,response:e instanceof bt||e instanceof yt?e.context:void 0}}finally{r&&clearTimeout(r),a&&((n=t.signal)==null||n.removeEventListener(`abort`,a))}})}},Ct=3,wt=e=>Math.min(1e3*2**e,3e4),Tt=[520,503],Et=[`GET`,`HEAD`,`OPTIONS`],Dt=class extends Error{constructor(e){super(e.message),this.name=`PostgrestError`,this.details=e.details,this.hint=e.hint,this.co
991de=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function Ot(e,t){return new Promise(n=>{if(t?.aborted){n();return}let r=setTimeout(()=>{t?.removeEventListener(`abort`,i),n()},e);function i(){clearTimeout(r),n()}t?.addEventListener(`abort`,i)})}function kt(e,t,n,r){return!(!r||n>=Ct||!Et.includes(e)||!Tt.includes(t))}var At=class{constructor(e){this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError??!1,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle??!1,this.shouldStripNulls=e.shouldStripNulls??!1,this.urlLengthLimit=e.urlLengthLimit??8e3,this.retryEnabled=e.retry??!0,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get(`Accept`)===`text/csv`)throw Error(`stripNulls() cannot be used with csv()`);return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var n=this;if(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`),this.shouldStripNulls){let e=this.headers.get(`Accept`);e===`application/vnd.pgrst.object+json`?this.headers.set(`Accept`,`application/vnd.pgrst.object+json;nulls=stripped`):(!e||e===`application/json`)&&this.headers.set(`Accept`,`application/vnd.pgrst.array+json;nulls=stripped`)}let r=this.fetch,i=(async()=>{let e=0;for(;;){let t={};n.headers.forEach((e,n)=>{t[n]=e}),e>0&&(t[`X-Retry-Count`]=String(e));let i;try{i=await r(n.url.toString(),{method:n.method,headers:t,body:JSON.stringify(n.body,(e,t)=>typeof t==`bigint`?t.toString():t),signal:n.signal})}catch(t){if(t?.name===`AbortError`||t?.code===`ABORT_ERR`||!Et.includes(n.method))throw t;if(n.retryEnabled&&e<Ct){let t=wt(e);e++,await Ot(t,n.signal);continue}throw t}if(kt(n.method,i.status,e,n.retryEnabled)){let t=i.headers?.get(`Retry-After`)??null,r=t===null?wt(e):Math.max(0,parseInt(t,10)||0)*1e3;await i.text(),e++,await Ot(r,n.signal);continue}return await n.processResponse(i)}})();return this.shouldThrowOnError||(i=i.catch(e=>{let t=``,n=``,r=``,i=e?.cause;if(i){let n=i?.message??``,r=i?.code??``;t=`${e?.name??`FetchError`}: ${e?.message}`,t+=`\n\nCaused by: ${i?.name??`Error`}: ${n}`,r&&(t+=` (${r})`),i?.stack&&(t+=`\n${i.stack}`)}else t=e?.stack??``;let a=this.url.toString().length;return e?.name===`AbortError`||e?.code===`ABORT_ERR`?(r=``,n=`Request was aborted (timeout or manual cancellation)`,a>this.urlLengthLimit&&(n+=`. Note: Your request URL is ${a} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):(i?.name===`HeadersOverflowError`||i?.code===`UND_ERR_HEADERS_OVERFLOW`)&&(r=``,n=`HTTP headers exceeded server limits (typically 16KB)`,a>this.urlLengthLimit&&(n+=`. Your request URL is ${a} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${e?.name??`FetchError`}: ${e?.message}`,details:t,hint:n,code:r},data:null,count:null,status:0,statusText:``}})),i.then(e,t)}async processResponse(e){var t=this;let n=null,r=null,i=null,a=e.status,o=e.statusText;if(e.ok){if(t.method!==`HEAD`){let i=await e.text();if(i!==``)if(t.headers.get(`Accept`)===`text/csv`)r=i;else if(t.headers.get(`Accept`)&&t.headers.get(`Accept`)?.includes(`application/vnd.pgrst.plan+text`))r=i;else try{r=JSON.parse(i)}catch{if(n={message:i},r=null,t.shouldThrowOnError)throw new Dt({message:i,details:``,hint:``,code:``})}}let s=t.headers.get(`Prefer`)?.match(/count=(exact|planned|estimated)/),c=e.headers.get(`content-range`)?.split(`/`);s&&c&&c.length>1&&(i=parseInt(c[1])),t.isMaybeSingle&&Array.isArray(r)&&(r.length>1?(n={code:`PGRST116`,details:`Results contain ${r.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:`JSON object requested, multiple (or no) rows returned`},r=null,i=null,a=406,o=`Not Acceptable`):r=r.length===1?r[0]:null)}else{let i=await e.text();try{n=JSON.parse(i),Array.isArray(n)&&e.status===404&&(r=[],n=null,a=200,o=`OK`)}
vendor: 10,009 bytes, line 991
991catch{e.status===404&&i===``?(a=204,o=`No Content`):n={message:i}}if(n&&t.shouldThrowOnError)throw new Dt(n)}return{success:n===null,error:n,data:r,count:i,status:a,statusText:o}}returns(){return this}overrideTypes(){return this}},jt=class extends At{throwOnError(){return super.throwOnError()}select(e){let t=!1,n=(e??`*`).split(``).map(e=>/\s/.test(e)&&!t?``:(e===`"`&&(t=!t),e)).join(``);return this.url.searchParams.set(`select`,n),this.headers.append(`Prefer`,`return=representation`),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:r,referencedTable:i=r}={}){let a=i?`${i}.order`:`order`,o=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${o?`${o},`:``}${e}.${t?`asc`:`desc`}${n===void 0?``:n?`.nullsfirst`:`.nullslast`}`),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){let r=n===void 0?`limit`:`${n}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:r=n}={}){let i=r===void 0?`offset`:`${r}.offset`,a=r===void 0?`limit`:`${r}.limit`;return this.url.searchParams.set(i,`${e}`),this.url.searchParams.set(a,`${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.isMaybeSingle=!0,this}csv(){return this.headers.set(`Accept`,`text/csv`),this}geojson(){return this.headers.set(`Accept`,`application/geo+json`),this}explain({analyze:e=!1,verbose:t=!1,settings:n=!1,buffers:r=!1,wal:i=!1,format:a=`text`}={}){let o=[e?`analyze`:null,t?`verbose`:null,n?`settings`:null,r?`buffers`:null,i?`wal`:null].filter(Boolean).join(`|`),s=this.headers.get(`Accept`)??`application/json`;return this.headers.set(`Accept`,`application/vnd.pgrst.plan+${a}; for="${s}"; options=${o};`),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}},Mt=RegExp(`[,()]`),Nt=class extends jt{throwOnError(){return super.throwOnError()}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){let n=Array.from(new Set(t)).map(e=>typeof e==`string`&&Mt.test(e)?`"${e}"`:`${e}`).join(`,`);return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,t){let n=Array.from(new Set(t)).map(e=>typeof e==`string`&&Mt.test(e)?`"${e}"`:`${e}`).join(`,`);return this.url.searchParams.append(e,`not.in.(${n})`),this}contains(e,t){return typeof t==`string`?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(`,`)}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t==`string`?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(`,`)}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t==`string`?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(`,`)}}`),this}textSearch(e,t,{config:n,type:r}={}){let i=``;r===`plain`?i=`pl`:r===`phrase`?i=`ph`:r===`websearch`&&(i=`w`);let a=n===void 0?``:`(${n})`;return this.url.searchParams.append(e,`${i}fts${a}.${t}`),this}match(e){return Object.entries(e).filter(([e,t])=>t!==void 0).forEach(([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t,referencedTable:n=t}={}){let r=n?`${n}.or`:`or`;return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}},Pt=class{constructor(e,{headers:t={},schema:n,fetch:r,urlLengthLimit:i=8e3,retry:a}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=r,this.urlLengthLimit=i,this.retry=a}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){let{head:n=!1,count:r}=t??{},i=n?`HEAD`:`GET`,a=!1,o=(e??`*`).split(``).map(e=>/\s/.test(e)&&!a?``:(e===`"`&&(a=!a),e)).join(``),{url:s,headers:c}=this.cloneRequestState();return s.searchParams.set(`select`,o),r&&c.append(`Prefer`,`count=${r}`),new Nt({method:i,url:s,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:n=!0}={}){let{url:r,headers:i}=this.cloneRequestState();if(t&&i.append(`Prefer`,`count=${t}`),n||i.append(`Prefer`,`missing=default`),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);r.searchParams.set(`columns`,e.join(`,`))}}return new Nt({method:`POST`,url:r,headers:i,schema:this.schema,body:e,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:i=!0}={}){let{url:a,headers:o}=this.cloneRequestState();if(o.append(`Prefer`,`resolution=${n?`ignore`:`merge`}-duplicates`),t!==void 0&&a.searchParams.set(`on_conflict`,t),r&&o.append(`Prefer`,`count=${r}`),i||o.append(`Prefer`,`missing=default`),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);a.searchParams.set(`columns`,e.join(`,`))}}return new Nt({method:`POST`,url:a,headers:o,schema:this.schema,body:e,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){let{url:n,headers:r}=this.cloneRequestState();return t&&r.append(`Prefer`,`count=${t}`),new Nt({method:`PATCH`,url:n,headers:r,schema:this.schema,body:e,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){let{url:t,headers:n}=this.cloneRequestState();return e&&n.append(`Prefer`,`count=${e}`),new Nt({method:`DELETE`,url:t,headers:n,schema:this.schema,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function Ft(e){"@babel/helpers - typeof";return Ft=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Ft(e)}function It(e,t){if(Ft(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Ft(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Lt(e){var t=It(e,`string`);return Ft(t)==`symbol`?t:t+``}function Rt(e,t,n){return(t=Lt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Bt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?zt(Object(n),!0).forEach(function(t){Rt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Vt=class e{constructor(e,{headers:t={},schema:n,fetch:r,timeout:i,urlLengthLimit:a=8e3,retry:o}={}){this.url=e,this.headers=new Headers(t),this.schemaName=n,this.urlLengthLimit=a;let s=r??globalThis.fetch;i!==void 0&&i>0?this.fetch=(e,t)=>{let n=new AbortController,r=setTimeout(()=>n.abort(),i),a=t?.signal;if(a){if(a.aborted)return clearTimeout(r),s(e,t);let i=()=>{clearTimeout(r),n.abort()};return a.addEventListener(`abort`,i,{once:!0}),s(e,Bt(Bt({},t),{},{signal:n.signal})).finally(()=>{clearTimeout(r),a.removeEventListener(`abort`,i)})}return s(e,Bt(Bt({},t),{},{signal:n.signal})).finally(()=>clearTimeout(r))}:this.fetch=s,this.retry=o}from(e){if(!e||typeof e!=`string`||e.trim()===``)throw Error(`Invalid relation name: relation must be a non-empty string.`);return new Pt(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new e(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,t={},{head:n=!1,get:r=!1,count:i}={}){let a,o=new URL(`${this.url}/rpc/${e}`),s,c=e=>typeof e==`object`&&!!e&&(!Array.isArray(e)||e.some(c)),l=n&&Object.values(t).some(c);l?(a=`POST`,s=t):n||r?(a=n?`HEAD`:`GET`,Object.entries(t).filter(([e,t])=>t!==void 0).map(([e,t])=>[e,Array.isArray(t)?`{${t.join(`,`)}}`:`${t}
991`]).forEach(([e,t])=>{o.searchParams.append(e,t)})):(a=`POST`,s=t);let u=new Headers(this.headers);return l?u.set(`Prefer`,i?`count=${i},return=minimal`:`return=minimal`):i&&u.set(`Prefer`,`count=${i}`),new Nt({method:a,url:o,headers:u,schema:this.schemaName,body:s,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}},Ht=class{constructor(){}static detectEnvironment(){if(typeof WebSocket<`u`)return{type:`native`,wsConstructor:WebSocket};let e=globalThis;if(typeof globalThis<`u`&&e.WebSocket!==void 0)return{type:`native`,wsConstructor:e.WebSocket};let t=typeof global<`u`?global:void 0;if(t&&t.WebSocket!==void 0)return{type:`native`,wsConstructor:t.WebSocket};if(typeof globalThis<`u`&&e.WebSocketPair!==void 0&&globalThis.WebSocket===void 0)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`&&e.EdgeRuntime||typeof navigator<`u`&&navigator.userAgent?.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.`};let n=globalThis.process;if(n){let e=n.versions;if(e&&e.node)return{type:`unsupported`,error:`Node.js detected but native WebSocket not found.`,workaround:`Ensure you are running Node.js 22+ or provide a WebSocket implementation via the transport option.`}}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(){let e=this.detectEnvironment();if(e.wsConstructor)return e.wsConstructor;let t=e.error||`WebSocket not supported in this environment.`;throw e.workaround&&(t+=`\n\nSuggested solution: ${e.workaround}`),Error(t)}static isWebSocketSupported(){try{return this.detectEnvironment().type===`native`}catch{return!1}}},Ut=`realtime-js/2.110.8`,Wt=`1.0.0`,Gt=`2.0.0`,Kt=Gt,qt=1e4,Jt={closed:`closed`,errored:`errored`,joined:`joined`,joining:`joining`,leaving:`leaving`},Yt={close:`phx_close`,error:`phx_error`,join:`phx_join`,reply:`phx_reply`,leave:`phx_leave`,access_token:`access_token`},Xt={connecting:`connecting`,open:`open`,closing:`closing`,closed:`closed`},Zt=class{constructor(e){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=e??[]}encode(e,t){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event==`string`)return t(this._binaryEncodeUserBroadcastPush(e));let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(e){return this._isArrayBuffer(e.payload?.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){let t=e.payload?.payload??new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,t)}_encodeJsonUserBroadcastPush(e){let t=e.payload?.payload??{},n=new TextEncoder().encode(JSON.stringify(t)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,n)}_encodeUserBroadcastPush(e,t,n){let r=new TextEncoder,i=r.encode(e.topic),a=r.encode(e.ref??``),o=r.encode(e.join_ref??``),s=r.encode(e.payload.event),c=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},l=r.encode(Object.keys(c).length===0?``:JSON.stringify(c));if(o.length>255)throw Error(`joinRef length ${o.length} exceeds maximum of 255`);if(a.length>255)throw Error(`ref length ${a.length} exceeds maximum of 255`);if(i.length>255)throw Error(`topic length ${i.length} exceeds maximum of 255`);if(s.length>255)throw Error(`userEvent length ${s.length} exceeds maximum of 255`);if(l.length>255)throw Error(`metadata length ${l.length} exceeds maximum of 255`);let u=this.USER_BROADCAST_PUSH_META_LENGTH+o.length+a.length+i.length+s.length+l.length,d=new ArrayBuffer(this.HEADER_LENGTH+u),f=new DataView(d),p=new Uint8Array(d),m=0;f.setUint8(m++,this.KINDS.userBroadcastPush),f.setUint8(m++,o.length),f.setUint8(m++,a.length),f.setUint8(m++,i.length),f.setUint8(m++,s.length),f.setUint8(m++,l.length),f.setUint8(m++,t),p.set(o,m),m+=o.length,p.set(a,m),m+=a.length,p.set(i,m),m+=i.length,p.set(s,m),m+=s.length,p.set(l,m),m+=l.length;var h=new Uint8Array(d.byteLength+n.byteLength);return h.set(new Uint8Array(d),0),h.set(new Uint8Array(n),d.byteLength),h.buffer}decode(e,t){if(this._isArrayBuffer(e))return t(this._binaryDecode(e));if(typeof e==`string`){let[n,r,i,a,o]=JSON.parse(e);return t({join_ref:n,ref:r,topic:i,event:a,payload:o})}return t({})}_binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,t,r)}}_decodeUserBroadcast(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),o=t.getUint8(4),s=this.HEADER_LENGTH+4,c=n.decode(e.slice(s,s+r));s+=r;let l=n.decode(e.slice(s,s+i));s+=i;let u=n.decode(e.slice(s,s+a));s+=a;let d=e.slice(s,e.byteLength),f=o===this.JSON_ENCODING?JSON.parse(n.decode(d)):d,p={type:this.BROADCAST_EVENT,event:l,payload:f};return a>0&&(p.meta=JSON.parse(u)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:p}}_isArrayBuffer(e){return e instanceof ArrayBuffer||e?.constructor?.name===`ArrayBuffer`}_pick(e,t){return!e||typeof e!=`object`?{}:Object.fromEntries(Object.entries(e).filter(([e])=>t.includes(e)))}},P;(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`})(P||={});var Qt=(e,t,n={})=>{let r=n.skipTypes??[];return t?Object.keys(t).reduce((n,i)=>(n[i]=$t(i,e,t,r),n),{}):{}},$t=(e,t,n,r)=>{let i=t.find(t=>t.name===e)?.type,a=n[e];return i&&!r.includes(i)?en(i,a):tn(a)},en=(e,t)=>{if(e.charAt(0)===`_`)return on(t,e.slice(1,e.length));switch(e){case P.bool:return nn(t);case P.float4:case P.float8:case P.int2:case P.int4:case P.int8:case P.numeric:case P.oid:return rn(t);case P.json:case P.jsonb:return an(t);case P.timestamp:return sn(t);case P.abstime:case P.date:case P.daterange:case P.int4range:case P.int8range:case P.money:case P.reltime:case P.text:case P.time:case P.timestamptz:case P.timetz:case P.tsrange:case P.tstzrange:return tn(t);default:return tn(t)}},tn=e=>e,nn=e=>{switch(e){case`t`:return!0;case`f`:return!1;default:return e}},rn=e=>{if(typeof e==`string`){let t=parseFloat(e);
vendor: 35,287 bytes, lines 991-992
991if(!Number.isNaN(t))return t}return e},an=e=>{if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e},on=(e,t)=>{if(typeof e!=`string`)return e;let n=e.length-1,r=e[n];if(e[0]===`{`&&r===`}`){let r,i=e.slice(1,n);try{r=JSON.parse(`[`+i+`]`)}catch{r=i?i.split(`,`):[]}return r.map(e=>en(t,e))}return e},sn=e=>typeof e==`string`?e.replace(` `,`T`):e,cn=e=>{let 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+=`/api/broadcast`,t.href},ln=e=>typeof e==`function`?e:function(){return e},un=typeof self<`u`?self:null,dn=typeof window<`u`?window:null,fn=un||dn||globalThis,pn=`2.0.0`,mn=1e4,hn=1e3,gn=100,_n={connecting:0,open:1,closing:2,closed:3},vn={closed:`closed`,errored:`errored`,joined:`joined`,joining:`joining`,leaving:`leaving`},yn={close:`phx_close`,error:`phx_error`,join:`phx_join`,reply:`phx_reply`,leave:`phx_leave`},bn={longpoll:`longpoll`,websocket:`websocket`},xn={complete:4},Sn=`base64url.bearer.phx.`,Cn=class{constructor(e,t,n,r){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),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()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:n}){this.recHooks.filter(t=>t.status===e).forEach(e=>e.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger(`timeout`,{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},wn=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries+=1,this.callback()},this.timerCalc(this.tries+1))}},Tn=class{constructor(e,t,n){this.state=vn.closed,this.topic=e,this.params=ln(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Cn(this,yn.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new wn(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive(`ok`,()=>{this.state=vn.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(e=>e.send()),this.pushBuffer=[]}),this.joinPush.receive(`error`,e=>{this.state=vn.errored,this.socket.hasLogger()&&this.socket.log(`channel`,`error ${this.topic}`,e),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log(`channel`,`close ${this.topic}`),this.state=vn.closed,this.socket.remove(this)}),this.onError(e=>{this.socket.hasLogger()&&this.socket.log(`channel`,`error ${this.topic}`,e),this.isJoining()&&this.joinPush.reset(),this.state=vn.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive(`timeout`,()=>{this.socket.hasLogger()&&this.socket.log(`channel`,`timeout ${this.topic}`,this.joinPush.timeout),new Cn(this,yn.leave,ln({}),this.timeout).send(),this.state=vn.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(yn.reply,(e,t)=>{this.trigger(this.replyEventName(t),e)})}join(e=this.timeout){if(this.joinedOnce)throw Error(`tried to join multiple times. 'join' can only be called a single time per channel instance`);return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=vn.closed,this.bindings=[]}onClose(e){this.on(yn.close,e)}onError(e){return this.on(yn.error,t=>e(t))}on(e,t){let n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:t}),n}off(e,t){this.bindings=this.bindings.filter(n=>!(n.event===e&&(t===void 0||t===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=this.timeout){if(t||={},!this.joinedOnce)throw Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new Cn(this,e,function(){return t},n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=vn.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log(`channel`,`leave ${this.topic}`),this.trigger(yn.close,`leave`)},n=new Cn(this,yn.leave,ln({}),e);return n.receive(`ok`,()=>t()).receive(`timeout`,()=>t()),n.send(),this.canPush()||n.trigger(`ok`,{}),n}onMessage(e,t,n){return t}filterBindings(e,t,n){return!0}isMember(e,t,n,r){return this.topic===e?r&&r!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log(`channel`,`dropping outdated message`,{topic:e,event:t,payload:n,joinRef:r}),!1):!0:!1}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=vn.joining,this.joinPush.resend(e))}trigger(e,t,n,r){let i=this.onMessage(e,t,n,r);if(t&&!i)throw Error(`channel onMessage callbacks must return the payload, modified or unmodified`);let a=this.bindings.filter(r=>r.event===e&&this.filterBindings(r,t,n));for(let e=0;e<a.length;e++)a[e].callback(i,n,r||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===vn.closed}isErrored(){return this.state===vn.errored}isJoined(){return this.state===vn.joined}isJoining(){return this.state===vn.joining}isLeaving(){return this.state===vn.leaving}},En=class{static request(e,t,n,r,i,a,o){if(fn.XDomainRequest){let n=new fn.XDomainRequest;return this.xdomainRequest(n,e,t,r,i,a,o)}else if(fn.XMLHttpRequest){let s=new fn.XMLHttpRequest;return this.xhrRequest(s,e,t,n,r,i,a,o)}else if(fn.fetch&&fn.AbortController)return this.fetchRequest(e,t,n,r,i,a,o);else throw Error(`No suitable XMLHttpRequest implementation found`)}static fetchRequest(e,t,n,r,i,a,o){let s={method:e,headers:n,body:r},c=null;return i&&(c=new AbortController,setTimeout(()=>c.abort(),i),s.signal=c.signal),fn.fetch(t,s).then(e=>e.text()).then(e=>this.parseJSON(e)).then(e=>o&&o(e)).catch(e=>{e.name===`AbortError`&&a?a():o&&o(null)}),c}static xdomainRequest(e,t,n,r,i,a,o){return e.timeout=i,e.open(t,n),e.onload=()=>{let t=this.parseJSON(e.responseText);o&&o(t)},a&&(e.ontimeout=a),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,i,a,o,s){e.open(t,n,!0),e.timeout=a;for(let[t,n]of Object.entries(r))e.setRequestHeader(t,n);return e.onerror=()=>s&&s(null),e.onreadystatechange=()=>{e.readyState===xn.complete&&s&&s(this.parseJSON(e.responseText))},o&&(e.ontimeout=o),e.send(i),e}static parseJSON(e){if(!e||e===``)return null;try{return JSON.parse(e)}catch{return console&&console.log(`failed to parse JSON response`,e),null}}static serialize(e,t){let n=[];for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let i=t?`${t}[${r}]`:r,a=e[r];typeof a==`object`?n.push(this.serialize(a,i)):n.push(encodeURIComponent(i)+`=`+encodeURIComponent(a))}return n.join(`&`)}static appendParams(e,t){return Object.keys(t).length===0?e:`${e}${e.match(/\?/)?`&`:`?`}${this.serialize(t)}`}},Dn=e=>{let t=``,n=new Uint8Array(e),r=n.byteLength;for(let e=0;e<r;e++)t+=String.fromCharCode(n[e]);return btoa(t)},On=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(Sn)&&(this.authToken=atob(t[1].slice(Sn.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=_n.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace(`ws://`,`http://`).replace(`wss://`,`https://`).replace(RegExp(`(.*)/`+bn.websocket),`$1/`+bn.longpoll)}endpointURL(){return En.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=_n.connecting}ontimeout(){this.onerror(`timeout`),this.closeAndRetry(1005,`timeout`,!1)}isActive(){return this.readyState===_n.open||this.readyState===_n.connecting}poll(){let e={Accept:`application/json`};this.authToken&&(e[`X-Phoenix-AuthToken`]=this.authToken),this.ajax(`GET`,e,null,()=>this.ontimeout(),e=>{if(e){var{status:t,token:n,messages:r}=e;if(t===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,`session_gone`,!1);return}this.token=n}else t=0;switch(t){case 200:r.forEach(e=>{setTimeout(()=>this.onmessage({data:e}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=_n.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,`forbidden`,!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,`internal server error`,500);break;default:throw Error(`unhandled poll status ${t}`)}})}send(e){typeof e!=`string`&&(e=Dn(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e,t=0){this.awaitingBatchAck=!0;let n=t+gn,r=e.slice(t,n);this.ajax(`POST`,{"Content-Type":`application/x-ndjson`},r.join(` 992`),()=>this.onerror(`timeout`),t=>{!t||t.status!==200?(this.awaitingBatchAck=!1,this.onerror(t&&t.status),this.closeAndRetry(1011,`internal server error`,!1)):n<e.length?this.batchSend(e,n):this.batchBuffer.length>0?(this.batchSend(this.batchBuffer),this.batchBuffer=[]):this.awaitingBatchAck=!1})}close(e,t,n){for(let e of this.reqs)e.abort();this.readyState=_n.closed;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<`u`?this.onclose(new CloseEvent(`close`,r)):this.onclose(r)}ajax(e,t,n,r,i){let a;a=En.request(e,this.endpointURL(),t,n,this.timeout,()=>{this.reqs.delete(a),r()},e=>{this.reqs.delete(a),this.isActive()&&i(e)}),this.reqs.add(a)}},kn=class e{constructor(t,n={}){let r=n.events||{state:`presence_state`,diff:`presence_diff`};this.state=Object.create(null),this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(r.state,t=>{let{onJoin:n,onLeave:r,onSync:i}=this.caller;this.joinRef=this.channel.joinRef(),this.state=e.syncState(this.state,t,n,r),this.pendingDiffs.forEach(t=>{this.state=e.syncDiff(this.state,t,n,r)}),this.pendingDiffs=[],i()}),this.channel.on(r.diff,t=>{let{onJoin:n,onLeave:r,onSync:i}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(t):(this.state=e.syncDiff(this.state,t,n,r),i())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(t){return e.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,t,n,r){let i=this.toNullProtoObj(this.clone(e));t=this.toNullProtoObj(t);let a=Object.create(null),o=Object.create(null);return this.map(i,(e,n)=>{t[e]||(o[e]=n)}),this.map(t,(e,t)=>{let n=i[e];if(n){let r=t.metas.map(e=>e.phx_ref),i=n.metas.map(e=>e.phx_ref),s=t.metas.filter(e=>i.indexOf(e.phx_ref)<0),c=n.metas.filter(e=>r.indexOf(e.phx_ref)<0);s.length>0&&(a[e]=t,a[e].metas=s),c.length>0&&(o[e]=this.clone(n),o[e].metas=c)}else a[e]=t}),this.syncDiff(i,{joins:a,leaves:o},n,r)}static syncDiff(e,t,n,r){e=this.toNullProtoObj(e);let{joins:i,leaves:a}=this.clone(t);return n||=function(){},r||=function(){},this.map(i,(t,r)=>{let i=e[t];if(e[t]=this.clone(r),i){let n=e[t].metas.map(e=>e.phx_ref),r=i.metas.filter(e=>n.indexOf(e.phx_ref)<0);e[t].metas.unshift(...r)}n(t,i,r)}),this.map(a,(t,n)=>{let i=e[t];if(!i)return;let a=n.metas.map(e=>e.phx_ref);i.metas=i.metas.filter(e=>a.indexOf(e.phx_ref)<0),r(t,i,n),i.metas.length===0&&delete e[t]}),e}static list(e,t){return t||=function(e,t){return t},this.map(e,(e,n)=>t(e,n))}static map(e,t){return Object.getOwnPropertyNames(e).map(n=>t(n,e[n]))}static toNullProtoObj(e){if(Object.getPrototypeOf(e)===null)return e;let t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(n=>{t[n]=e[n]}),t}static clone(e){return JSON.parse(JSON.stringify(e))}},An={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,r,i,a,o]=JSON.parse(e);return t({join_ref:n,ref:r,topic:i,event:a,payload:o})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:i,payload:a}=e,o=new TextEncoder,s=o.encode(t),c=o.encode(n),l=o.encode(i),u=o.encode(r);this.assertFieldSize(s.byteLength,`join_ref`),this.assertFieldSize(c.byteLength,`ref`),this.assertFieldSize(l.byteLength,`topic`),this.assertFieldSize(u.byteLength,`event`);let d=this.META_LENGTH+s.byteLength+c.byteLength+l.byteLength+u.byteLength,f=new ArrayBuffer(this.HEADER_LENGTH+d),p=new Uint8Array(f),m=new DataView(f),h=0;m.setUint8(h++,this.KINDS.push),m.setUint8(h++,s.byteLength),m.setUint8(h++,c.byteLength),m.setUint8(h++,l.byteLength),m.setUint8(h++,u.byteLength),p.set(s,h),h+=s.byteLength,p.set(c,h),h+=c.byteLength,p.set(l,h),h+=l.byteLength,p.set(u,h),h+=u.byteLength;var g=new Uint8Array(f.byteLength+a.byteLength);return g.set(p,0),g.set(new Uint8Array(a),f.byteLength),g.buffer},assertFieldSize(e,t){if(e>255)throw Error(`unable to convert ${t} to binary: must be less than or equal to 255 bytes, but is ${e} bytes`)},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,r);case this.KINDS.reply:return this.decodeReply(e,t,r);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,r)}},decodePush(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,s=n.decode(e.slice(o,o+r));o+=r;let c=n.decode(e.slice(o,o+i));o+=i;let l=n.decode(e.slice(o,o+a));return o+=a,{join_ref:s,ref:null,topic:c,event:l,payload:e.slice(o,e.byteLength)}},decodeReply(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),o=t.getUint8(4),s=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(e.slice(s,s+r));s+=r;let l=n.decode(e.slice(s,s+i));s+=i;let u=n.decode(e.slice(s,s+a));s+=a;let d=n.decode(e.slice(s,s+o));s+=o;let f={status:d,response:e.slice(s,e.byteLength)};return{join_ref:c,ref:l,topic:u,event:yn.reply,payload:f}},decodeBroadcast(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=this.HEADER_LENGTH+2,o=n.decode(e.slice(a,a+r));a+=r;let s=n.decode(e.slice(a,a+i));return a+=i,{join_ref:null,ref:null,topic:o,event:s,payload:e.slice(a,e.byteLength)}}},jn=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||mn,this.transport=t.transport||fn.WebSocket||On,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let n=null;try{n=fn&&fn.sessionStorage}catch{}this.sessionStore=t.sessionStorage||n,this.establishedConnections=0,this.defaultEncoder=An.encode.bind(An),this.defaultDecoder=An.decode.bind(An),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||`arraybuffer`,this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport===On?(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder):(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder);let r=null;dn&&dn.addEventListener&&(dn.addEventListener(`pagehide`,e=>{this.conn&&(this.disconnect(),r=this.connectClock)}),dn.addEventListener(`pageshow`,e=>{r===this.connectClock&&(r=null,this.connect())}),dn.addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=e=>t.rejoinAfterMs?t.rejoinAfterMs(e):[1e3,2e3,5e3][e-1]||1e4,this.reconnectAfterMs=e=>t.reconnectAfterMs?t.reconnectAfterMs(e):[10,50,100,150,200,250,500,1e3,2e3][e-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(e,t,n)=>{console.log(`${e}: ${t}`,n)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=ln(t.params||{}),this.endPoint=`${e}/${bn.websocket}`,this.vsn=t.vsn||pn,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new wn(()=>{if(this.pageHidden){this.log(`Not reconnecting as page is hidden!`),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken&&ln(t.authToken)}getLongPollTransport(){return On}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&=(this.conn.close(),null),this.transport=e}protocol(){return location.protocol.match(/^https/)?`wss`:`ws`}endPointURL(){let e=En.appendParams(En.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)===`/`?e.charAt(1)===`/`?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`:e}disconnect(e,t,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,n)}connect(e){e&&(console&&console.log(`passing params to connect is deprecated. Instead pass :params to the Socket constructor`),this.params=ln(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==On?this.connectWithFallback(On,this.longPollFallbackMs):this.transportConnect())}log(e,t,n){this.logger&&this.logger(e,t,n)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),n=Date.now();this.push({topic:`phoenix`,event:`heartbeat`,payload:{},ref:t});let r=this.onMessage(i=>{i.ref===t&&(this.off([r]),e(Date.now()-n))});return!0}transportName(e){switch(e){case On:return`LongPoll`;default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=[`phoenix`,`${Sn}${btoa(this.authToken()).replace(/=/g,``)}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let n=!1,r=!0,i,a=this.transportName(e),o=t=>{this.log(`transport`,`falling back to ${a}...`,t),this.off([void 0,i]),r=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${a}`))return o(`memorized`);this.fallbackTimer=setTimeout(o,t),i=this.onError(e=>{this.log(`transport`,`error`,e),r&&!n&&(clearTimeout(this.fallbackTimer),o(e))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(n=!0,!r){let t=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${t}`,`true`),this.log(`transport`,`established ${t} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(o,t),this.ping(e=>{this.log(`transport`,`connected to primary after`,e),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log(`transport`,`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks(`open`)}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log(`transport`,`heartbeat timeout. Attempting to re-establish connection`);try{this.heartbeatCallback(`timeout`)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}this.triggerChanError(Error(`heartbeat timeout`)),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),hn,`heartbeat timeout`)}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,n){if(!this.conn)return e&&e();let r=this.conn;this.waitForBufferDone(r,()=>{t?r.close(t,n||``):r.close(),this.waitForSocketClosed(r,()=>{this.conn===r&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,n=1){if(n===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,n+1)},150*n)}waitForSocketClosed(e,t,n=1){if(n===5||e.readyState===_n.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,n+1)},150*n)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log(`transport`,`close`,e),this.triggerChanError(e),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks(`close`,e)}onConnError(e){this.hasLogger()&&this.log(`transport`,`error`,e);let t=this.transport,n=this.establishedConnections;this.triggerStateCallbacks(`error`,e,t,n),(t===this.transport||n>0)&&this.triggerChanError(e)}triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(yn.error,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case _n.connecting:return`connecting`;case _n.open:return`open`;case _n.closing:return`closing`;default:return`closed`}}isConnected(){return this.connectionState()===`open`}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([t])=>e.indexOf(t)===-1)}channel(e,t={}){let n=new Tn(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:i,join_ref:a}=e;this.log(`push`,`${t} ${n} (${a}, ${i})`,r)}this.isConnected()?this.encode(e,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(e,e=>this.conn.send(e)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback(`disconnected`)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:`phoenix`,event:`heartbeat`,payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback(`sent`)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,e=>{let{topic:t,event:n,payload:r,ref:i,join_ref:a}=e;if(i&&i===this.pendingHeartbeatRef){let e=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(r.status===`ok`?`ok`:`error`,e)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log(`receive`,`${r.status||``} ${t} ${n} ${i&&`(`+i+`)`||``}`.trim(),r);for(let e=0;e<this.channels.length;e++){let o=this.channels[e];o.isMember(t,n,r,a)&&o.trigger(n,r,i,a)}this.triggerStateCallbacks(`message`,e)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([n,r])=>{try{r(...t)}catch(t){this.log(`error`,`error in ${e} callback`,t)}})}catch(t){this.log(`error`,`error triggering ${e} callbacks`,t)}}leaveOpenTopic(e){let t=this.channels.find(t=>t.topic===e&&(t.isJoined()||t.isJoining()));t&&(this.hasLogger()&&this.log(`transport`,`leaving duplicate topic "${e}"`),t.leave())}},Mn=class e{constructor(t,n){let r=Fn(n);this.presence=new kn(t.getChannel(),r),this.presence.onJoin((n,r,i)=>{let a=e.onJoinPayload(n,r,i);t.getChannel().trigger(`presence`,a)}),this.presence.onLeave((n,r,i)=>{let a=e.onLeavePayload(n,r,i);t.getChannel().trigger(`presence`,a)}),this.presence.onSync(()=>{t.getChannel().trigger(`presence`,{event:`sync`})})}get state(){return e.transformState(this.presence.state)}static transformState(e){return e=Pn(e),Object.getOwnPropertyNames(e).reduce((t,n)=>{let r=e[n];return t[n]=Nn(r),t},{})}static onJoinPayload(e,t,n){return{event:`join`,key:e,currentPresences:In(t),newPresences:Nn(n)}}static onLeavePayload(e,t,n){return{event:`leave`,key:e,currentPresences:In(t),leftPresences:Nn(n)}}};function Nn(e){return e.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function Pn(e){return JSON.parse(JSON.stringify(e))}function Fn(e){return e?.events&&{events:e.events}}function In(e){return e?.metas?Nn(e):[]}var Ln;(function(e){e.SYNC=`sync`,e.JOIN=`join`,e.LEAVE=`leave`})(Ln||={});var Rn=class{get state(){return this.presenceAdapter.state}constructor(e,t){this.channel=e,this.presenceAdapter=new Mn(this.channel.channelAdapter,t)}};function zn(e){if(e instanceof Error)return e;if(typeof e==`string`)return Error(e);if(e&&typeof e==`object`){let t=e;if(typeof t.code==`number`){let n=typeof t.reason==`string`&&t.reason?` (${t.reason})`:``;return Error(`socket closed: ${t.code}${n}`,{cause:e})}return Error(`channel error: transport failure`,{cause:e})}return Error(`channel error: connection lost`)}var Bn=class{constructor(e,t,n){let r=Vn(n);this.channel=e.getSocket().channel(t,r),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,t){return this.channel.on(e,t)}off(e,t){this.channel.off(e,t)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,t,n){let r;try{r=this.channel.push(e,t,n)}catch{throw Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>100){let e=this.channel.pushBuffer.shift();e.cancelTimeout(),this.socket.log(`channel`,`discarded push due to buffer overflow: ${e.event}`,e.payload())}return r}updateJoinPayload(e){let t=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},t),e)}canPush(){return this.socket.isConnected()&&this.state===Jt.joined}isJoined(){return this.state===Jt.joined}isJoining(){return this.state===Jt.joining}isClosed(){return this.state===Jt.closed}isLeaving(){return this.state===Jt.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}};function Vn(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:``,enabled:!1},private:!1},e.config)}}var Hn=/[,()"\\]/,Un=e=>Hn.test(e)||e!==e.trim(),Wn=e=>`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`,Gn=e=>{let t=e===null?`null`:String(e);return Un(t)?Wn(t):t},Kn=e=>e===null?`null`:String(e),qn=(e,t)=>{if(e===`in`){let e=Array.isArray(t)?t:[t];if(e.length===0)throw Error("Realtime `in` filter requires at least one value.");return`in.(${Array.from(new Set(e)).map(e=>Gn(e)).join(`,`)})`}return e===`is`?`is.${Kn(t)}`:`${e}.${Gn(t)}`},Jn=class{constructor(){this.filters=[]}add(e,t,n,r=!1){let i=r?`not.`:``;return this.filters.push(`${e}=${i}${qn(t,n)}`),this}eq(e,t){return this.add(e,`eq`,t)}neq(e,t){return this.add(e,`neq`,t)}gt(e,t){return this.add(e,`gt`,t)}gte(e,t){return this.add(e,`gte`,t)}lt(e,t){return this.add(e,`lt`,t)}lte(e,t){return this.add(e,`lte`,t)}in(e,t){return this.add(e,`in`,t)}like(e,t){return this.add(e,`like`,t)}ilike(e,t){return this.add(e,`ilike`,t)}match(e,t){return this.add(e,`match`,t)}imatch(e,t){return this.add(e,`imatch`,t)}is(e,t){return this.add(e,`is`,t)}isDistinct(e,t){return this.add(e,`isdistinct`,t)}not(e,t,n){return this.add(e,t,n,!0)}build(){return this.filters.join(`,`)}toString(){return this.build()}},Yn;(function(e){e.ALL=`*`,e.INSERT=`INSERT`,e.UPDATE=`UPDATE`,e.DELETE=`DELETE`})(Yn||={});var Xn;(function(e){e.BROADCAST=`broadcast`,e.PRESENCE=`presence`,e.POSTGRES_CHANGES=`postgres_changes`,e.SYSTEM=`system`})(Xn||={});var Zn;(function(e){e.SUBSCRIBED=`SUBSCRIBED`,e.TIMED_OUT=`TIMED_OUT`,e.CLOSED=`CLOSED`,e.CHANNEL_ERROR=`CHANNEL_ERROR`})(Zn||={});var Qn=class e{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,t={config:{}},n){if(this.topic=e,this.params=t,this.socket=n,this.bindings={},this.subTopic=e.replace(/^realtime:/i,``),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:``,enabled:!1},private:!1},t.config),this.channelAdapter=new Bn(this.socket.socketAdapter,e,this.params),this.presence=new Rn(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=cn(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&this.params.config?.broadcast?.replay)throw Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,t=this.timeout){if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){let{config:{broadcast:n,presence:r,private:i}}=this.params,a=this.bindings.postgres_changes?.map(e=>e.filter)??[],o=!!this.bindings[Xn.PRESENCE]&&this.bindings[Xn.PRESENCE].length>0||this.params.config.presence?.enabled===!0,s={},c={broadcast:n,presence:Object.assign(Object.assign({},r),{enabled:o}),postgres_changes:a,private:i};this.socket.accessTokenValue&&(s.access_token=this.socket.accessTokenValue),this._onError(t=>{e?.(Zn.CHANNEL_ERROR,zn(t))}),this._onClose(()=>e?.(Zn.CLOSED)),this.updateJoinPayload(Object.assign({config:c},s)),this._updateFilterMessage(),this.channelAdapter.subscribe(t).receive(`ok`,async({postgres_changes:t})=>{if(this.socket._isManualToken()||this.socket.setAuth(),t===void 0){e?.(Zn.SUBSCRIBED);return}this._updatePostgresBindings(t,e)}).receive(`error`,t=>{this.state=Jt.errored;let n=Object.values(t).join(`, `)||`error`;e?.(Zn.CHANNEL_ERROR,Error(n,{cause:t}))}).receive(`timeout`,()=>{e?.(Zn.TIMED_OUT)})}return this}_updatePostgresBindings(t,n){let r=this.bindings.postgres_changes,i=r?.length??0,a=[];for(let o=0;o<i;o++){let i=r[o],{filter:{event:s,schema:c,table:l,filter:u}}=i,d=t&&t[o];if(d&&d.event===s&&e.isFilterValueEqual(d.schema,c)&&e.isFilterValueEqual(d.table,l)&&e.isFilterValueEqual(d.filter,u))a.push(Object.assign(Object.assign({},i),{id:d.id}));else{this.unsubscribe(),this.state=Jt.errored,n?.(Zn.CHANNEL_ERROR,Error(`mismatch between server and client bindings for postgres changes`));return}}this.bindings.postgres_changes=a,this.state!=Jt.errored&&n&&n(Zn.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:`presence`,event:`track`,payload:e},t)}async untrack(e={}){return await this.send({type:`presence`,event:`untrack`},e)}on(e,t,n){let r=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),i=e===Xn.PRESENCE||e===Xn.POSTGRES_CHANGES;if(r&&i)throw this.socket.log(`channel`,`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,t,n)}async httpSend(e,t,n={}){if(t==null)return Promise.reject(Error(`Payload is required for httpSend()`));let r=t instanceof ArrayBuffer||ArrayBuffer.isView(t),i={apikey:this.socket.apiKey?this.socket.apiKey:``,"Content-Type":r?`application/octet-stream`:`application/json`};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);let a=new URL(this.broadcastEndpointURL);a.pathname+=`/${encodeURIComponent(this.subTopic)}/events/${encodeURIComponent(e)}`,this.private&&a.searchParams.set(`private`,`true`);let o={method:`POST`,headers:i,body:r?t:JSON.stringify(t)},s=await this._fetchWithTimeout(a.toString(),o,n.timeout??this.timeout);if(s.status===202)return{success:!0};if(s.status===404)return Promise.reject(Error(`httpSend() requires Realtime server v2.97.0 or newer; the endpoint returned 404. Update your Supabase CLI to a recent version, or upgrade the Realtime server in your self-hosted setup. See https://github.com/supabase/supabase-js/blob/master/packages/core/realt
992ime-js/migrations/httpsend-server-version.md`));let c=s.statusText;try{let e=await s.json();c=e.error||e.message||c}catch{}return Promise.reject(Error(c))}async send(e,t={}){if(!this.channelAdapter.canPush()&&e.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.`);let{event:n,payload:r}=e,i={apikey:this.socket.apiKey?this.socket.apiKey:``,"Content-Type":`application/json`};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);let a={method:`POST`,headers:i,body:JSON.stringify({messages:[{topic:this.subTopic,event:n,payload:r,private:this.private}]})};try{let e=await this._fetchWithTimeout(this.broadcastEndpointURL,a,t.timeout??this.timeout);return await e.body?.cancel(),e.ok?`ok`:`error`}catch(e){return e instanceof Error&&e.name===`AbortError`?`timed out`:`error`}}else return new Promise(n=>{let r=this.channelAdapter.push(e.type,e,t.timeout||this.timeout);e.type===`broadcast`&&!this.params?.config?.broadcast?.ack&&n(`ok`),r.receive(`ok`,()=>n(`ok`)),r.receive(`error`,()=>n(`error`)),r.receive(`timeout`,()=>n(`timed out`))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(t=>{this.channelAdapter.unsubscribe(e).receive(`ok`,()=>t(`ok`)).receive(`timeout`,()=>t(`timed out`)).receive(`error`,()=>t(`error`))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,t,n){let r=new AbortController,i=setTimeout(()=>r.abort(),n),a=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:r.signal}));return clearTimeout(i),a}_on(e,t,n){let r=e.toLocaleLowerCase(),i=t?.filter;(i instanceof Jn||typeof i==`object`&&i&&typeof i.build==`function`)&&(t=Object.assign(Object.assign({},t),{filter:i.build()}));let a=this.channelAdapter.on(e,n),o={type:r,filter:t,callback:n,ref:a};return this.bindings[r]?this.bindings[r].push(o):this.bindings[r]=[o],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,t,n)=>{let r=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(r,n))return!1;let i=this.bindings[r]?.find(t=>t.ref===e.ref);if(!i)return!0;if([`broadcast`,`presence`,`postgres_changes`].includes(r))if(`id`in i){let e=i.id,n=i.filter?.event;return e&&t.ids?.includes(e)&&(n===`*`||n?.toLocaleLowerCase()===t.data?.type.toLocaleLowerCase())}else{let e=(i?.filter?.event)?.toLocaleLowerCase();return e===`*`||e===(t?.event)?.toLocaleLowerCase()}else return i.type.toLocaleLowerCase()===r})}_notThisChannelEvent(e,t){let{close:n,error:r,leave:i,join:a}=Yt;return t&&[n,r,i,a].includes(e)&&t!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,t,n)=>{if(typeof t==`object`&&`ids`in t){let e=t.data,{schema:n,table:r,commit_timestamp:i,type:a,errors:o}=e;return Object.assign(Object.assign({},{schema:n,table:r,commit_timestamp:i,eventType:a,new:{},old:{},errors:o}),this._getPayloadRecords(e))}return t})}copyBindings(e){if(this.joinedOnce)throw Error(`cannot copy bindings into joined channel`);for(let t in e.bindings)for(let n of e.bindings[t])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(e,t){return(e??void 0)===(t??void 0)}_getPayloadRecords(e){let t={new:{},old:{}};return(e.type===`INSERT`||e.type===`UPDATE`)&&(t.new=Qt(e.columns,e.record)),(e.type===`UPDATE`||e.type===`DELETE`)&&(t.old=Qt(e.columns,e.old_record)),t}},$n=class{constructor(e,t){this.socket=new jn(e,t)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,t,n,r=1e4){return new Promise(i=>{setTimeout(()=>i(`timeout`),r),this.socket.disconnect(()=>{e(),i(`ok`)},t,n)})}push(e){this.socket.push(e)}log(e,t,n){this.socket.log(e,t,n)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Xt.connecting}isDisconnecting(){return this.socket.connectionState()==Xt.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}},er={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},tr=[1e3,2e3,5e3,1e4],nr=1e4;function rr(){let e=new Map;return{get length(){return e.size},clear(){e.clear()},getItem(t){return e.has(t)?e.get(t):null},key(t){return Array.from(e.keys())[t]??null},removeItem(t){e.delete(t)},setItem(t,n){e.set(t,String(n))}}}function ir(){try{if(typeof globalThis<`u`&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return rr()}var ar=` 993 addEventListener("message", (e) => { 994 if (e.data.event === "start") { 995 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 996 } 997 });`,or=class{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,t){if(this.channels=[],this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint=``,this.headers={},this.params={}
997,this.ref=0,this.serializer=new Zt,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),!t?.params?.apikey)throw Error(`API key is required to connect to Realtime`);this.apiKey=t.params.apikey;let n=this._initializeOptions(t);this.socketAdapter=new $n(e,n),this.httpEndpoint=cn(e),this.fetch=this._resolveFetch(t?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely(`connect`),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){let t=e.message;throw Error(`WebSocket not available: ${t}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,t){return this._cancelPendingDisconnect(),this.isDisconnecting()?`ok`:await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,t)}getChannels(){return this.channels}async removeChannel(e){let t=await e.unsubscribe();return t===`ok`&&e.teardown(),t}async removeAllChannels(){let e=this.channels.map(async e=>{let t=await e.unsubscribe();return e.teardown(),t}),t=await Promise.all(e);return await this.disconnect(),t}log(e,t,n){this.socketAdapter.log(e,t,n)}connectionState(){return this.socketAdapter.connectionState()||Xt.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,t={config:{}}){let n=`realtime:${e}`,r=this.getChannels().find(e=>e.topic===n);if(r)return r;{let n=new Qn(`realtime:${e}`,t,this);return this._cancelPendingDisconnect(),this.channels.push(n),n}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(t=>t.topic!==e.topic),this.channels.length===0&&(this.log(`transport`,`no channels remaining, scheduling disconnect`),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log(`transport`,`disconnecting immediately - no channels`),this.disconnect();return}
997this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log(`transport`,`deferred disconnect fired - no channels, disconnecting`),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log(`transport`,`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log(`transport`,`pending disconnect cancelled - channel activity detected`),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(e=null){let t,n=!1;if(e)t=e,n=!0;else if(this.accessToken)try{t=await this.accessToken()}catch(e){this.log(`error`,`Error fetching access token from callback`,e),t=this.accessTokenValue}else t=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=t&&(this.accessTokenValue=t,this.channels.forEach(e=>{let n={access_token:t,version:Ut};t&&e.updateJoinPayload(n),e.joinedOnce&&e.channelAdapter.isJoined()&&e.channelAdapter.push(Yt.access_token,{access_token:t})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e=`general`){this._isManualToken()||this.setAuth().catch(t=>{this.log(`error`,`Error setting auth in ${e}`,t)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(e=>{this.log(`error`,`error waiting for auth on connect`,e)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(t,n)=>{t!==`disconnected`&&(t==`sent`&&this._setAuthSafely(),e&&e(t,n))}}_startWorkerHeartbeat(){this.workerUrl?this.log(`worker`,`starting worker for from ${this.workerUrl}`):this.log(`worker`,`starting default worker`);let e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=e=>{this.log(`worker`,`worker error`,e.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=e=>{e.data.event===`keepAlive`&&this.sendHeartbeat()},this.workerRef.postMessage({event:`start`,interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&=(this.log(`worker`,`terminating worker`),this.workerRef.terminate(),void 0)}_workerObjectUrl(e){let t;if(e)t=e;else{let e=new Blob([ar],{type:`application/javascript`});t=URL.createObjectURL(e)}return t}_initializeOptions(e){this.worker=e?.worker??!1,this.accessToken=e?.accessToken??null;let t={};t.timeout=e?.timeout??qt,t.heartbeatIntervalMs=e?.heartbeatIntervalMs??er.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=e?.disconnectOnEmptyChannelsAfterMs??2*(e?.heartbeatIntervalMs??er.HEARTBEAT_INTERVAL),t.transport=e?.transport??Ht.getWebSocketConstructor(),t.params=e?.params,t.logger=e?.logger,t.heartbeatCallback=this._wrapHeartbeatCallback(e?.heartbeatCallback),t.sessionStorage=e?.sessionStorage??ir(),t.reconnectAfterMs=e?.reconnectAfterMs??(e=>tr[e-1]||nr);let n,r,i=e?.vsn??Kt;switch(i){case Wt:n=(e,t)=>t(JSON.stringify(e)),r=(e,t)=>t(JSON.parse(e));break;case Gt:n=this.serializer.encode.bind(this.serializer),r=this.serializer.decode.bind(this.serializer);break;default:throw Error(`Unsupported serializer version: ${t.vsn}`)}if(t.vsn=i,t.encode=e?.encode??n,t.decode=e?.decode??r,t.beforeReconnect=this._reconnectAuth.bind(this),(e?.logLevel||e?.log_level)&&(this.logLevel=e.logLevel||e.log_level,t.params=Object.assign(Object.assign({},t.params),{log_level:this.logLevel})),this.worker){if(typeof window<`u`&&!window.Worker)throw Error(`Web Worker is not supported`);this.workerUrl=e?.workerUrl,t.autoSendHeartbeat=!this.worker}return t}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
vendor: 4,836 bytes, line 997
997,sr=class extends Error{constructor(e,t){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)&&t.icebergType?.includes(`CommitState`)===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function cr(e,t,n){let r=new URL(t,e);if(n)for(let[e,t]of Object.entries(n))t!==void 0&&r.searchParams.set(e,t);return r.toString()}async function lr(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 ur(e){let t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:i,body:a,headers:o}){let s=cr(e.baseUrl,r,i),c=await lr(e.auth),l=await t(s,{method:n,headers:{...a?{"Content-Type":`application/json`}:{},...c,...o},body:a?JSON.stringify(a):void 0}),u=await l.text(),d=(l.headers.get(`content-type`)||``).includes(`application/json`),f=d&&u?JSON.parse(u):u;if(!l.ok){let e=d?f:void 0,t=e?.error;throw new sr(t?.message??`Request failed with status ${l.status}`,{status:l.status,icebergType:t?.type,icebergCode:t?.code,details:e})}return{status:l.status,headers:l.headers,data:f}}}}function dr(e){return e.join(`�`)}var fr=class{constructor(e,t=``){this.client=e,this.prefix=t}async listNamespaces(e){let t=e?{parent:dr(e.namespace)}:void 0;return(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(e=>({namespace:e}))}async createNamespace(e,t){let n={namespace:e.namespace,properties:t?.properties};return(await this.client.request({method:`POST`,path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:`DELETE`,path:`${this.prefix}/namespaces/${dr(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces/${dr(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:`HEAD`,path:`${this.prefix}/namespaces/${dr(e.namespace)}`}),!0}catch(e){if(e instanceof sr&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(e){if(e instanceof sr&&e.status===409)return;throw e}}};function pr(e){return e.join(`�`)}var mr=class{constructor(e,t=``,n){this.client=e,this.prefix=t,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces/${pr(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){let n={};return this.accessDelegation&&(n[`X-Iceberg-Access-Delegation`]=this.accessDelegation),(await this.client.request({method:`POST`,path:`${this.prefix}/namespaces/${pr(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){let n=await this.client.request({method:`POST`,path:`${this.prefix}/namespaces/${pr(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":n.data[`metadata-location`],metadata:n.data.metadata}}async dropTable(e,t){await this.client.request({method:`DELETE`,path:`${this.prefix}/namespaces/${pr(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String(t?.purge??!1)}})}async loadTable(e){let t={};return this.accessDelegation&&(t[`X-Iceberg-Access-Delegation`]=this.accessDelegation),(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces/${pr(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){let t={};this.accessDelegation&&(t[`X-Iceberg-Access-Delegation`]=this.accessDelegation);try{return await this.client.request({method:`HEAD`,path:`${this.prefix}/namespaces/${pr(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(e){if(e instanceof sr&&e.status===404)return!1;throw e}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof sr&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},hr=class{constructor(e){let t=`v1`;e.catalogName&&(t+=`/${e.catalogName}`);let n=e.baseUrl.endsWith(`/`)?e.baseUrl:`${e.baseUrl}/`;this.client=ur({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(`,`),this.namespaceOps=new fr(this.client,t),this.tableOps=new mr(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)}
997async 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)}};function gr(e){"@babel/helpers - typeof";return gr=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},gr(e)}function _r(e,t){if(gr(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(gr(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function vr(e){var t=_r(e,`string`);return gr(t)==`symbol`?t:t+``}function yr(e,t,n){return(t=vr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function br(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function F(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?br(Object(n),!0).forEach(function(t){yr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):br(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var xr=class extends Error{constructor(e,t=`storage`,n,r){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t===`vectors`?`StorageVectorsError`:`StorageError`,this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function Sr(e){return typeof e==`object`&&!!e&&`__isStorageError`in e}var Cr=class extends xr{constructor(e,t,n,r=`storage`){super(e,r,t,n),this.name=r===`vectors`?`StorageVectorsApiError`:`StorageApiError`,this.status=t,this.statusCode=n}toJSON(){return F({},super.toJSON())}},wr=class extends xr{constructor(e,t,n=`storage`){super(e,n),this.name=n===`vectors`?`StorageVectorsUnknownError`:`StorageUnknownError`,this.originalError=t}};function Tr(e,t,n){let r=F({},e),i=t.toLowerCase();for(let e of Object.keys(r))e.toLowerCase()===i&&delete r[e];return r[i]=n,r}function Er(e){let t={};for(let[n,r]of Object.entries(e))t[n.toLowerCase()]=r;return t}var Dr=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),Or=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},kr=e=>{if(Array.isArray(e))return e.map(e=>kr(e));if(typeof e==`function`||e!==Object(e))return e;let t={};return Object.entries(e).forEach(([e,n])=>{let r=e.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace(/[-_]/g,``));t[r]=kr(n)}),t},Ar=e=>!e||typeof e!=`string`||e.length===0||e.length>100||e.trim()!==e||e.includes(`/`)||e.includes(`\\`)?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),jr=e=>e.split(`/`).map(encodeURIComponent).join(`/`),Mr=e=>{if(typeof e==`object`&&e){let t=e;if(typeof t.msg==`string`)return t.msg;if(typeof t.message==`string`)return t.message;if(typeof t.error_description==`string`)return t.error_description;if(typeof t.error==`string`)return t.error;if(typeof t.error==`object`&&t.error!==null){let e=t.error;if(typeof e.message==`string`)return e.message}}return JSON.stringify(e)},Nr=async(e,t,n,r)=>{if(typeof e==`object`&&e&&`json`in e&&typeof e.json==`function`){let n=e,i=parseInt(String(n.status),10);Number.isFinite(i)||(i=500),n.json().then(e=>{let n=e?.statusCode||e?.code||i+``;t(new Cr(Mr(e),i,n,r))}).catch(()=>{let e=i+``;t(new Cr(n.statusText||`HTTP ${i} error`,i,e,r))})}else t(new wr(Mr(e),e,r))},Pr=(e,t,n,r)=>{let i={method:e,headers:t?.headers||{}};if(e===`GET`||e===`HEAD`||!r)return F(F({},i),n);if(Or(r)){let e=t?.headers||{},n;for(let[t,r]of Object.entries(e))t.toLowerCase()===`content-type`&&(n=r);i.headers=Tr(e,`Content-Type`,n??`application/json`),i.body=JSON.stringify(r)}else i.body=r;return t?.duplex&&(i.duplex=t.duplex),F(F({},i),n)};async function Fr(e,t,n,r,i,a,o){return new Promise((s,c)=>{e(n,Pr(t,r,i,a)).then(e=>{if(!e.ok)throw e;if(r?.noResolveJson)return e;if(o===`vectors`){let t=e.headers.get(`content-type`);if(e.headers.get(`content-length`)===`0`||e.status===204||!t||!t.includes(`application/json`))return{}}return e.json()}).then(e=>s(e)).catch(e=>Nr(e,c,r,o))})}function Ir(e=`storage`){return{get:async(t,n,r,i)=>Fr(t,`GET`,n,r,i,void 0,e),post:async(t,n,r,i,a)=>Fr(t,`POST`,n,i,a,r,e),put:async(t,n,r,i,a)=>Fr(t,`PUT`,n,i,a,r,e),head:async(t,n,r,i)=>Fr(t,`HEAD`,n,F(F({},r),{},{noResolveJson:!0}),i,void 0,e),remove:async(t,n,r,i,a)=>Fr(t,`DELETE`,n,i,a,r,e)}}var{get:Lr,post:Rr,put:zr,head:Br,remove:Vr}=Ir(`storage`),Hr=Ir(`vectors`),Ur=class{constructor(e,t={},n,r=`storage`){this.shouldThrowOnError=!1,this.url=e,this.headers=Er(t),this.fetch=Dr(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=Tr(this.headers,e,t),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(Sr(e))return{data:null,error:e};throw e}}},Wr=Symbol.toStringTag,Gr=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Wr]=`StreamDownloadBuilder`,this.promise=null}
997then(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.execute(),this.promise}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Sr(t))return{data:null,error:t};throw t}}},Kr=Symbol.toStringTag,qr=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Kr]=`BlobDownloadBuilder`,this.promise=null}asStream(){return new Gr(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.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(Sr(t))return{data:null,error:t};throw t}}},Jr={limit:100,offset:0,sortBy:{column:`name`,order:`asc`}},Yr={cacheControl:`3600`,contentType:`text/plain;charset=UTF-8`,upsert:!1},Xr=class extends Ur{constructor(e,t={},n,r){super(e,t,r,`storage`),this.bucketId=n}async uploadOrUpdate(e,t,n,r){var i=this;return i.handleOperation(async()=>{let a,o=F(F({},Yr),r),s=F(F({},i.headers),e===`POST`&&{"x-upsert":String(o.upsert)}),c=o.metadata;if(typeof Blob<`u`&&n instanceof Blob?(a=new FormData,a.append(`cacheControl`,o.cacheControl),c&&a.append(`metadata`,i.encodeMetadata(c)),a.append(``,n)):typeof FormData<`u`&&n instanceof FormData?(a=n,a.has(`cacheControl`)||a.append(`cacheControl`,o.cacheControl),c&&!a.has(`metadata`)&&a.append(`metadata`,i.encodeMetadata(c))):(a=n,s[`cache-control`]=`max-age=${o.cacheControl}`,s[`content-type`]=o.contentType,c&&(s[`x-metadata`]=i.toBase64(i.encodeMetadata(c))),(typeof ReadableStream<`u`&&a instanceof ReadableStream||a&&typeof a==`object`&&`pipe`in a&&typeof a.pipe==`function`)&&!o.duplex&&(o.duplex=`half`)),r?.headers)for(let[e,t]of Object.entries(r.headers))s=Tr(s,e,t);let l=i._removeEmptyFolders(t),u=i._getFinalPath(l),d=await(e==`PUT`?zr:Rr)(i.fetch,`${i.url}/object/${u}`,a,F({headers:s},o?.duplex?{duplex:o.duplex}:{}));return{path:l,id:d.Id,fullPath:d.Key}})}async upload(e,t,n){return this.uploadOrUpdate(`POST`,e,t,n)}async uploadToSignedUrl(e,t,n,r){var i=this;let a=i._removeEmptyFolders(e),o=i._getFinalPath(a),s=new URL(i.url+`/object/upload/sign/${o}`);return s.searchParams.set(`token`,t),i.handleOperation(async()=>{let e,t=F(F({},Yr),r),o=F(F({},i.headers),{"x-upsert":String(t.upsert)}),c=t.metadata;if(typeof Blob<`u`&&n instanceof Blob?(e=new FormData,e.append(`cacheControl`,t.cacheControl),c&&e.append(`metadata`,i.encodeMetadata(c)),e.append(``,n)):typeof FormData<`u`&&n instanceof FormData?(e=n,e.has(`cacheControl`)||e.append(`cacheControl`,t.cacheControl),c&&!e.has(`metadata`)&&e.append(`metadata`,i.encodeMetadata(c))):(e=n,o[`cache-control`]=`max-age=${t.cacheControl}`,o[`content-type`]=t.contentType,c&&(o[`x-metadata`]=i.toBase64(i.encodeMetadata(c))),(typeof ReadableStream<`u`&&e instanceof ReadableStream||e&&typeof e==`object`&&`pipe`in e&&typeof e.pipe==`function`)&&!t.duplex&&(t.duplex=`half`)),r?.headers)for(let[e,t]of Object.entries(r.headers))o=Tr(o,e,t);return{path:a,fullPath:(await zr(i.fetch,s.toString(),e,F({headers:o},t?.duplex?{duplex:t.duplex}:{}))).Key}})}async createSignedUploadUrl(e,t){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(e),i=F({},n.headers);t?.upsert&&(i[`x-upsert`]=`true`);let a=await Rr(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:i}),o=new URL(n.url+a.url),s=o.searchParams.get(`token`);if(!s)throw new xr(`No token returned by API`);return{signedUrl:o.toString(),path:e,token:s}})}async update(e,t,n){return this.uploadOrUpdate(`PUT`,e,t,n)}async move(e,t,n){var r=this;return r.handleOperation(async()=>await Rr(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,de
997stinationBucket:n?.destinationBucket},{headers:r.headers}))}async copy(e,t,n){var r=this;return r.handleOperation(async()=>({path:(await Rr(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n?.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(e,t,n){var r=this;return r.handleOperation(async()=>{let i=r._getFinalPath(e),a=typeof n?.transform==`object`&&n.transform!==null&&Object.keys(n.transform).length>0,o=await Rr(r.fetch,`${r.url}/object/sign/${i}`,F({expiresIn:t},a?{transform:n.transform}:{}),{headers:r.headers}),s=new URLSearchParams;n?.download&&s.set(`download`,n.download===!0?``:n.download),n?.cacheNonce!=null&&s.set(`cacheNonce`,String(n.cacheNonce));let c=s.toString();return{signedUrl:encodeURI(`${r.url}${o.signedURL}${c?`&${c}`:``}`)}})}async createSignedUrls(e,t,n){var r=this;return r.handleOperation(async()=>{let i=await Rr(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:t,paths:e},{headers:r.headers}),a=new URLSearchParams;n?.download&&a.set(`download`,n.download===!0?``:n.download),n?.cacheNonce!=null&&a.set(`cacheNonce`,String(n.cacheNonce));let o=a.toString();return i.map(e=>F(F({},e),{},{signedUrl:e.signedURL?encodeURI(`${r.url}${e.signedURL}${o?`&${o}`:``}`):null}))})}download(e,t,n){let r=typeof t?.transform==`object`&&t.transform!==null&&Object.keys(t.transform).length>0?`render/image/authenticated`:`object`,i=new URLSearchParams;t?.transform&&this.applyTransformOptsToQuery(i,t.transform),t?.cacheNonce!=null&&i.set(`cacheNonce`,String(t.cacheNonce));let a=i.toString(),o=this._getFinalPath(e);return new qr(()=>Lr(this.fetch,`${this.url}/${r}/${o}${a?`?${a}`:``}`,{headers:this.headers,noResolveJson:!0},n),this.shouldThrowOnError)}async info(e){var t=this;let n=t._getFinalPath(e);return t.handleOperation(async()=>kr(await Lr(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;let n=t._getFinalPath(e);try{return await Br(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(Sr(e)){let t=e instanceof Cr?e.status:e instanceof wr?e.originalError?.status:void 0;if(t!==void 0&&[400,404].includes(t))return{data:!1,error:e}}throw e}}getPublicUrl(e,t){let n=this._getFinalPath(e),r=new URLSearchParams;t?.download&&r.set(`download`,t.download===!0?``:t.download),t?.transform&&this.applyTransformOptsToQuery(r,t.transform),t?.cacheNonce!=null&&r.set(`cacheNonce`,String(t.cacheNonce));let i=r.toString(),a=typeof t?.transform==`object`&&t.transform!==null&&Object.keys(t.transform).length>0?`render/image`:`object`;return{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}`)+(i?`?${i}`:``)}}}async remove(e){var t=this;return t.handleOperation(async()=>await Vr(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async purgeCache(e,t,n){var r=this;return r.handleOperation(async()=>{let i=jr(r._getFinalPath(e)),a=new URLSearchParams;t?.transformations&&a.set(`transformations`,`true`);let o=a.toString();return await Vr(r.fetch,`${r.url}/cdn/${i}${o?`?${o}`:``}`,{},{headers:r.headers},n)})}async list(e,t,n){var r=this;return r.handleOperation(async()=>{let i=t?.sortBy?F(F({},Jr.sortBy),t.sortBy):Jr.sortBy,a=F(F(F({},Jr),t),{},{sortBy:i,prefix:e||``});return await Rr(r.fetch,`${r.url}/object/list/${r.bucketId}`,a,{headers:r.headers},n)})}async listV2(e,t){var n=this;return n.handleOperation(async()=>{let r=F({},e);return await Rr(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<`u`?Buffer.from(e).toString(`base64`):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,``)}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,``).replace(/\/+/g,`/`)}applyTransformOptsToQuery(e,t){return t.width&&e.set(`width`,t.width.toString()),t.height&&e.set(`height`,t.height.toString()),t.resize&&e.set(`resize`,t.resize),t.format&&e.set(`format`,t.format),t.quality&&e.set(`quality`,t.quality.toString()),e}},Zr={"X-Client-Info":`storage-js/2.110.8`},Qr=class extends Ur{constructor(e,t={},n,r){let i=new URL(e);r?.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes(`storage.supabase.`)&&(i.hostname=i.hostname.replace(`supabase.`,`storage.supabase.`));let a=i.href.replace(/\/$/,``),o=F(F({},Zr),t);super(a,o,n,`storage`)}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let n=t.listBucketOptionsToQueryString(e);return await Lr(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Lr(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await Rr(n.fetch,`${n.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async updateBucket(e,t){var n=this;return n.handleOperation(async()=>await zr(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await Rr(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Vr(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}async purgeBucketCache(e,t,n){var r=this;return r.handleOperation(async()=>{let i=new URLSearchParams;t?.transformations&&i.set(`transformations`,`true`);let a=i.toString();return await Vr(r.fetch,`${r.url}/cdn/${jr(e)}${a?`?${a}`:``}`,{},{headers:r.headers},n)})}listBucketOptionsToQueryString(e){let 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>
9970?`?`+new URLSearchParams(t).toString():``}},$r=class extends Ur{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=F(F({},Zr),t);super(r,i,n,`storage`)}async createBucket(e){var t=this;return t.handleOperation(async()=>await Rr(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let n=new URLSearchParams;e?.limit!==void 0&&n.set(`limit`,e.limit.toString()),e?.offset!==void 0&&n.set(`offset`,e.offset.toString()),e?.sortColumn&&n.set(`sortColumn`,e.sortColumn),e?.sortOrder&&n.set(`sortOrder`,e.sortOrder),e?.search&&n.set(`search`,e.search);let r=n.toString(),i=r?`${t.url}/bucket?${r}`:`${t.url}/bucket`;return await Lr(t.fetch,i,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Vr(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!Ar(e))throw new xr(`Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.`);let n=new hr({baseUrl:this.url,catalogName:e,auth:{type:`custom`,getHeaders:async()=>t.headers},fetch:this.fetch}),r=this.shouldThrowOnError;return new Proxy(n,{get(e,t){let n=e[t];return typeof n==`function`?async(...t)=>{try{return{data:await n.apply(e,t),error:null}}catch(e){if(r)throw e;return{data:null,error:e}}}:n}})}},ei=class extends Ur{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=F(F({},Zr),{},{"Content-Type":`application/json`},t);super(r,i,n,`vectors`)}async createIndex(e){var t=this;return t.handleOperation(async()=>await Hr.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await Hr.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await Hr.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await Hr.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},ti=class extends Ur{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=F(F({},Zr),{},{"Content-Type":`application/json`},t);super(r,i,n,`vectors`)}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw Error(`Vector batch size must be between 1 and 500 items`);return t.handleOperation(async()=>await Hr.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await Hr.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw Error(`segmentCount must be between 1 and 16`);if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await Hr.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await Hr.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw Error(`Keys batch size must be between 1 and 500 items`);return t.handleOperation(async()=>await Hr.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},ni=class extends Ur{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=F(F({},Zr),{},{"Content-Type":`application/json`},t);super(r,i,n,`vectors`)}async createBucket(e){var t=this;return t.handleOperation(async()=>await Hr.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Hr.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await Hr.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Hr.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},ri=class extends ni{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new ii(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,n=this;return t().call(n,e)}async getBucket(e){var t=()=>super.getBucket,n=this;return t().call(n,e)}async listBuckets(e={}){var t=()=>super.listBuckets,n=this;return t().call(n,e)}async deleteBucket(e){var t=()=>super.deleteBucket,n=this;return t().call(n,e)}},ii=class extends ei{constructor(e,t,n,r){super(e,t,r),this.vectorBucketName=n}async createIndex(e){var t=()=>super.createIndex,n=this;return t().call(n,F(F({},e),{},{vectorBucketName:n.vectorBucketName}))}
997async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,F(F({},e),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,n=this;return t().call(n,n.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,n=this;return t().call(n,n.vectorBucketName,e)}index(e){return new ai(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},ai=class extends ti{constructor(e,t,n,r,i){super(e,t,i),this.vectorBucketName=n,this.indexName=r}async putVectors(e){var t=()=>super.putVectors,n=this;return t().call(n,F(F({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,F(F({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,F(F({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,F(F({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,F(F({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},oi=class extends Qr{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new Xr(this.url,this.headers,e,this.fetch)}get vectors(){return new ri(this.url+`/vector`,{headers:this.headers,fetch:this.fetch})}get analytics(){return new $r(this.url+`/iceberg`,this.headers,this.fetch)}},si=`2.110.8`,ci=30*1e3,li=3*ci,ui=2*ci,di=`http://localhost:9999`,fi=`supabase.auth.token`,pi={"X-Client-Info":`gotrue-js/${si}`},mi=`X-Supabase-Api-Version`,hi={"2024-01-01":{timestamp:Date.parse(`2024-01-01T00:00:00.0Z`),name:`2024-01-01`}},gi=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,_i=class extends Error{constructor(e,t,n){super(e),this.__isAuthError=!0,this.name=`AuthError`,this.status=t,this.code=n}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}};function I(e){return typeof e==`object`&&!!e&&`__isAuthError`in e}var vi=class extends _i{constructor(e,t,n){super(e,t,n),this.name=`AuthApiError`,this.status=t,this.code=n}};function yi(e){return I(e)&&e.name===`AuthApiError`}var bi=class extends _i{constructor(e,t){super(e),this.name=`AuthUnknownError`,this.originalError=t}},xi=class extends _i{constructor(e,t,n,r){super(e,n,r),this.name=t,this.status=n}},Si=class extends xi{constructor(){super(`Auth session missing!`,`AuthSessionMissingError`,400,void 0)}};function Ci(e){return I(e)&&e.name===`AuthSessionMissingError`}var wi=class extends xi{constructor(){super(`Auth session or user missing`,`AuthInvalidToken
997ResponseError`,500,void 0)}},Ti=class extends xi{constructor(e){super(e,`AuthInvalidCredentialsError`,400,void 0)}},Ei=class extends xi{constructor(e,t=null){super(e,`AuthImplicitGrantRedirectError`,500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}};function Di(e){return I(e)&&e.name===`AuthImplicitGrantRedirectError`}var Oi=class extends xi{constructor(e,t=null){super(e,`AuthPKCEGrantCodeExchangeError`,500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}},ki=class extends xi{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`)}},Ai=class extends xi{constructor(e,t){super(e,`AuthRetryableFetchError`,t,void 0)}};function ji(e){return I(e)&&e.name===`AuthRetryableFetchError`}var Mi=class extends xi{constructor(e=`Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)`){super(e,`AuthRefreshDiscardedError`,409,void 0)}};function Ni(e){return I(e)&&e.name===`AuthRefreshDiscardedError`}var Pi=class extends xi{constructor(e,t,n){super(e,`AuthWeakPasswordError`,t,`weak_password`),this.reasons=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}},Fi=class extends xi{constructor(e){super(e,`AuthInvalidJwtError`,400,`invalid_jwt`)}},L=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`.split(``),R=` 998\r=`.split(``),Ii=(()=>{let e=Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<R.length;t+=1)e[R[t].charCodeAt(0)]=-2;for(let t=0;t<L.length;t+=1)e[L[t].charCodeAt(0)]=t;return e})();function Li(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;)n(L[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6;else if(t.queuedBits>0)for(t.queue<<=6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;)n(L[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6}function Ri(e,t,n){let r=Ii[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else if(r===-2)return;else throw Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}function zi(e){let t=[],n=e=>{t.push(String.fromCodePoint(e))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},a=e=>{Hi(e,r,n)};for(let t=0;t<e.length;t+=1)Ri(e.charCodeAt(t),i,a);return t.join(``)}function Bi(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 Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function Vi(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){let t=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|t)+65536,n+=1}Bi(r,t)}}function Hi(e,t,n){if(t.utf8seq===0){if(e<=127){n(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 Error(`Invalid UTF-8 sequence`);--t.utf8seq}else if(t.utf8seq>0){if(e<=127)throw Error(`Invalid UTF-8 sequence`);t.codepoint=t.codepoint<<6|e&63,--t.utf8seq,t.utf8seq===0&&n(t.codepoint)}}function Ui(e){let t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};for(let t=0;t<e.length;t+=1)Ri(e.charCodeAt(t),n,r);return new Uint8Array(t)}function Wi(e){let t=[];return Vi(e,e=>t.push(e)),new Uint8Array(t)}function Gi(e){let t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};return e.forEach(e=>Li(e,n,r)),Li(null,n,r),t.join(``)}function Ki(e){return Math.round(Date.now()/1e3)+e}function qi(){return Symbol(`auth-callback`)}var z=()=>typeof window<`u`&&typeof document<`u`,Ji={tested:!1,writable:!1},Yi=()=>
998{if(!z())return!1;try{if(typeof globalThis.localStorage!=`object`)return!1}catch{return!1}if(Ji.tested)return Ji.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Ji.tested=!0,Ji.writable=!0}catch{Ji.tested=!0,Ji.writable=!1}return Ji.writable};function Xi(e){let t={},n=new URL(e);if(n.hash&&n.hash[0]===`#`)try{new URLSearchParams(n.hash.substring(1)).forEach((e,n)=>{t[n]=e})}catch{}return n.searchParams.forEach((e,n)=>{t[n]=e}),t}var Zi=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),Qi=e=>typeof e==`object`&&!!e&&`status`in e&&`ok`in e&&`json`in e&&typeof e.json==`function`,$i=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},ea=async(e,t)=>{let n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return null}},B=async(e,t)=>{await e.removeItem(t)},ta=class e{constructor(){this.promise=new e.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}};ta.promiseConstructor=Promise;function na(e){let t=e.split(`.`);if(t.length!==3)throw new Fi(`Invalid JWT structure`);for(let e=0;e<t.length;e++)if(!gi.test(t[e]))throw new Fi(`JWT not in base64url format`);return{header:JSON.parse(zi(t[0])),payload:JSON.parse(zi(t[1])),signature:Ui(t[2]),raw:{header:t[0],payload:t[1]}}}async function ra(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function ia(e,t){return new Promise((n,r)=>{(async()=>{for(let i=0;i<1/0;i++)try{let r=await e(i);if(!t(i,null,r)){n(r);return}}catch(e){if(!t(i,e)){r(e);return}}})()})}function aa(e){return(`0`+e.toString(16)).substr(-2)}function oa(){let e=new Uint32Array(56);if(typeof crypto>`u`){let e=``;for(let t=0;t<56;t++)e+=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~`.charAt(Math.floor(Math.random()*66));return e}return crypto.getRandomValues(e),Array.from(e,aa).join(``)}async function sa(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t),r=new Uint8Array(n);return Array.from(r).map(e=>String.fromCharCode(e)).join(``)}async function ca(e){if(!(typeof crypto<`u`&&crypto.subtle!==void 0&&typeof TextEncoder<`u`))return console.warn(`WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256.`),e;let t=await sa(e);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}async function la(e,t,n=!1){let r=oa(),i=r;n&&(i+=`/recovery`),await $i(e,`${t}-code-verifier`,i);let a=await ca(r);return[a,r===a?`plain`:`s256`]}var ua=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function da(e){let t=e.headers.get(mi);if(!t||!t.match(ua))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function fa(e){if(!e)throw Error(`Missing exp claim`);if(e<=Math.floor(Date.now()/1e3))throw Error(`JWT has expired`)}function pa(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 Error(`Invalid alg claim`)}}var ma=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function ha(e){if(!ma.test(e))throw Error(`@supabase/auth-js: Expected parameter to be UUID but is not`)}function ga(e){if(!e.passkey)throw Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function _a(){return new Proxy({},{get:(e,t)=>{if(t===`__isUserNotAvailableProxy`)return!0;if(typeof t==`symbol`){let e=t.toString();if(e===`Symbol(Symbol.toPrimitive)`||e===`Symbol(Symbol.toStringTag)`||e===`Symbol(util.inspect.custom)`)return}throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${t}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function va(e,t){return new Proxy(e,{get:(e,n,r)=>{if(n===`__isInsecureUserWarningProxy`)return!0;
998if(typeof n==`symbol`){let t=n.toString();if(t===`Symbol(Symbol.toPrimitive)`||t===`Symbol(Symbol.toStringTag)`||t===`Symbol(util.inspect.custom)`||t===`Symbol(nodejs.util.inspect.custom)`)return Reflect.get(e,n,r)}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(e,n,r)}})}function ya(e){return JSON.parse(JSON.stringify(e))}var ba=e=>{if(typeof e==`object`&&e){let t=e;if(typeof t.msg==`string`)return t.msg;if(typeof t.message==`string`)return t.message;if(typeof t.error_description==`string`)return t.error_description;if(typeof t.error==`string`)return t.error}return JSON.stringify(e)},xa=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function Sa(e){if(!Qi(e))throw new Ai(ba(e),0);if(xa.includes(e.status))throw new Ai(ba(e),e.status);let t;try{t=await e.json()}catch(e){throw new bi(ba(e),e)}let n,r=da(e);if(r&&r.getTime()>=hi[`2024-01-01`].timestamp&&typeof t==`object`&&t&&typeof t.code==`string`?n=t.code:typeof t==`object`&&t&&typeof t.error_code==`string`&&(n=t.error_code),!n){if(typeof t==`object`&&t&&typeof t.weak_password==`object`&&t.weak_password&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.reasons.reduce((e,t)=>e&&typeof t==`string`,!0))throw new Pi(ba(t),e.status,t.weak_password.reasons)}else if(n===`weak_password`)throw new Pi(ba(t),e.status,t.weak_password?.reasons||[]);else if(n===`session_not_found`)throw new Si;throw new vi(ba(t),e.status||500,n)}var Ca=(e,t,n,r)=>{let i={method:e,headers:t?.headers||{}};return e===`GET`?i:(i.headers=Object.assign({"Content-Type":`application/json;charset=UTF-8`},t?.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))};async function V(e,t,n,r){let i=Object.assign({},r?.headers);i[`X-Supabase-Api-Version`]||(i[mi]=hi[`2024-01-01`].name),r?.jwt&&(i.Authorization=`Bearer ${r.jwt}`);let a=r?.query??{};r?.redirectTo&&(a.redirect_to=r.redirectTo);let o=await wa(e,t,n+(Object.keys(a).length?`?`+new URLSearchParams(a).toString():``),{headers:i,noResolveJson:r?.noResolveJson},{},r?.body);return r?.xform?r?.xform(o):{data:Object.assign({},o),error:null}}async function wa(e,t,n,r,i,a){let o=Ca(t,r,i,a),s;try{s=await e(n,Object.assign({},o))}catch(e){throw new Ai(ba(e),0)}if(s.ok||await Sa(s),r?.noResolveJson)return s;try{return await s.json()}catch(e){await Sa(e)}}function Ta(e){let t=null;ja(e)&&(t=Object.assign({},e),e.expires_at||(t.expires_at=Ki(e.expires_in)));let n=e.user??(typeof e?.id==`string`?e:null);return{data:{session:t,user:n},error:null}}function Ea(e){let t=Ta(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((e,t)=>e&&typeof t==`string`,!0)&&(t.data.weak_password=e.weak_password),t}function Da(e){return{data:{user:e.user??e},error:null}}function Oa(e){return{data:e,error:null}}function ka(e){let{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:a}=e,o=mt(e,[`action_link`,`email_otp`,`hashed_token`,`redirect_to`,`verification_type`]);return{data:{properties:{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:a},user:Object.assign({},o)},error:null}}function Aa(e){return e}function ja(e){return!!e.access_token&&!!e.refresh_token&&!!e.expires_in}var Ma=[`global`,`local`,`others`],Na=class{constructor({url:e=``,headers:t={},fetch:n,experimental:r}){this.url=e,this.headers=t,this.fetch=Zi(n),this.experimental=r??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}
998async signOut(e,t=Ma[0]){if(Ma.indexOf(t)<0)throw Error(`@supabase/auth-js: Parameter scope must be one of ${Ma.join(`, `)}`);try{return await V(this.fetch,`POST`,`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(e){if(I(e))return{data:null,error:e};throw e}}async inviteUserByEmail(e,t={}){try{return await V(this.fetch,`POST`,`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:Da})}catch(e){if(I(e))return{data:{user:null},error:e};throw e}}async generateLink(e){try{let{options:t}=e,n=mt(e,[`options`]),r=Object.assign(Object.assign({},n),t);return`newEmail`in n&&(r.new_email=n?.newEmail,delete r.newEmail),await V(this.fetch,`POST`,`${this.url}/admin/generate_link`,{body:r,headers:this.headers,xform:ka,redirectTo:t?.redirectTo})}catch(e){if(I(e))return{data:{properties:null,user:null},error:e};throw e}}async createUser(e){try{return await V(this.fetch,`POST`,`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Da})}catch(e){if(I(e))return{data:{user:null},error:e};throw e}}async listUsers(e){try{let t={nextPage:null,lastPage:0,total:0},n=await V(this.fetch,`GET`,`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(e?.page)?.toString()??``,per_page:(e?.perPage)?.toString()??``},xform:Aa});if(n.error)throw n.error;let r=await n.json(),i=n.headers.get(`x-total-count`)??0,a=n.headers.get(`link`)?.split(`,`)??[];return a.length>0&&(a.forEach(e=>{let n=parseInt(e.split(`;`)[0].split(`=`)[1].substring(0,1)),r=JSON.parse(e.split(`;`)[1].split(`=`)[1]);t[`${r}Page`]=n}),t.total=parseInt(i)),{data:Object.assign(Object.assign({},r),t),error:null}}catch(e){if(I(e))return{data:{users:[]},error:e};throw e}}async getUserById(e){ha(e);try{return await V(this.fetch,`GET`,`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Da})}catch(e){if(I(e))return{data:{user:null},error:e};throw e}}async updateUserById(e,t){ha(e);try{return await V(this.fetch,`PUT`,`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:Da})}catch(e){if(I(e))return{data:{user:null},error:e};throw e}}async deleteUser(e,t=!1){ha(e);try{return await V(this.fetch,`DELETE`,`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:Da})}catch(e){if(I(e))return{data:{user:null},error:e};throw e}}async _listFactors(e){ha(e.userId);try{let{data:t,error:n}=await V(this.fetch,`GET`,`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:n}}catch(e){if(I(e))return{data:null,error:e};throw e}}async _deleteFactor(e){ha(e.userId),ha(e.id);try{return{data:await V(this.fetch,`DELETE`,`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(e){if(I(e))return{data:null,error:e};throw e}}async _listOAuthClients(e){try{let t={nextPage:null,lastPage:0,total:0},n=await V(this.fetch,`GET`,`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(e?.page)?.toString()??``,per_page:(e?.perPage)?.toString()??``},xform:Aa});if(n.error)throw n.error;let r=await n.json(),i=n.headers.get(`x-total-count`)??0,a=n.headers.get(`link`)?.split(`,`)??[];return a.length>0&&(a.forEach(e=>{let n=parseInt(e.split(`;`)[0].split(`=`)[1].substring(0,1)),r=JSON.parse(e.split(`;`)[1].split(`=`)[1]);t[`${r}Page`]=n}),t.total=parseInt(i)),{data:Object.assign(Object.assign({},r),t),error:null}}catch(e){if(I(e))return{data:{clients:[]},error:e};throw e}}async _createOAuthClient(e){try{return await V(this.fetch,`POST`,`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(I(e))return{data:null,error:e};throw e}}async _getOAuthClient(e){try{return await V(this.fetch,`GET`,`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(I(e))return{data:null,error:e};throw e}}async _updateOAuthClient(e,t){try{return await V(this.fetch,`PUT`,`${this.url}/admin/oauth/clients/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(I(e))return{data:null,error:e};throw e}}async _deleteOAuthClient(e){try{return await V(this.fetch,`DELETE`,`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(I(e))return{data:null,error:e};throw e}}async _regenerateOAuthClientSecret(e){try{return await V(this.fetch,`POST`,`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(I(e))return{data:null,error:e};throw e}}async _listCustomProviders(e){try{let t={};return e?.type&&(t.type=e.type),await V(this.fetch,`GET`,`${this.url}/admin/custom-providers`,{headers:this.headers,query:t,xform:e=>({data:{providers:e?.providers??[]},error:null})})}catch(e){if(I(e))return{data:{providers:[]},error:e};throw e}}async _createCustomProvider(e){try{return await V(this.fetch,`POST`,`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(I(e))return{data:null,error:e};throw e}}async _getCustomProvider(e){try{return await V(this.fetch,`GET`,`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(I(e))return{data:null,error:e};throw e}}async _updateCustomProvider(e,t){try{return await V(this.fetch,`PUT`,`${this.url}/admin/custom-providers/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(I(e))return{data:null,error:e};throw e}}async _deleteCustomProvider(e){try{return await V(this.fetch,`DELETE`,`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(I(e))return{data:null,error:e};throw e}}async _adminListPasskeys(e){ga(this.experimental),ha(e.userId);try{return await V(this.fetch,`GET`,`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(I(e))return{data:null,error:e};throw e}}async _adminDeletePasskey(e){ga(this.experimental),ha(e.userId),ha(e.passkeyId);try{return await V(this.fetch,`DELETE`,`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(I(e))return{data:null,error:e};throw e}}};function Pa(e={}){return{getItem:t=>
998e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}globalThis&&Yi()&&globalThis.localStorage&&globalThis.localStorage.getItem(`supabase.gotrue-js.locks.debug`);var Fa=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}};function Ia(){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 La(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function Ra(e){return parseInt(e,16)}function za(e){let t=new TextEncoder().encode(e);return`0x`+Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``)}function Ba(e){let{chainId:t,domain:n,expirationTime:r,issuedAt:i=new Date,nonce:a,notBefore:o,requestId:s,resources:c,scheme:l,uri:u,version:d}=e;if(!Number.isInteger(t))throw Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${t}`);if(!n)throw Error(`@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.`);if(a&&a.length<8)throw Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${a}`);if(!u)throw Error(`@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.`);if(d!==`1`)throw Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${d}`);if(e.statement?.includes(` 999`))throw Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`);let f=La(e.address),p=`${l?`${l}://${n}`:n} wants you to sign in with your Ethereum account:\n${f}\n\n${e.statement?`${e.statement}\n`:``}`,m=`URI: ${u}\nVersion: ${d}\nChain ID: ${t}${a?`\nNonce: ${a}`:``}\nIssued At: ${i.toISOString()}`;if(r&&(m+=`\nExpiration Time: ${r.toISOString()}`),o&&(m+=`\nNot Before: ${o.toISOString()}`),s&&(m+=`\nRequest ID: ${s}`),c){let e=` 1000Resources:`;for(let t of c){if(!t||typeof t!=`string`)throw Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${t}`);e+=`\n- ${t}`}m+=e}return`${p}\n${m}`}var H=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),this.__isWebAuthnError=!0,this.name=r??(n instanceof Error?n.name:void 0)??`Unknown Error`,this.code=t}toJSON(){return{name:this.name,message:this.message,code:this.code}}},Va=class extends H{constructor(e,t){super({code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:t,message:e}),this.name=`WebAuthnUnknownError`,this.originalError=t}};function Ha({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new H({message:`Registration ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`ConstraintError`){if(n.authenticatorSelection?.requireResidentKey===!0)return new H({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.authenticatorSelection?.userVerification===`required`)return new H({message:`User verification was required during automatic registration but it could not be performed`,code:`ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE`,cause:e});if(n.authenticatorSelection?.userVerification===`required`)return new H({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 H({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new H({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`NotSupportedError`)return n.pubKeyCredParams.filter(e=>e.type===`public-key`).length===0?new H({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new H({message:`No available authenticator supported any of the specified pubKeyCredParams algorithms`,code:`ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG`,cause:e});else if(e.name===`SecurityError`){let t=window.location.hostname;if(!Ya(t))return new H({message:`${window.location.hostname}
1000 is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new H({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`TypeError`){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new H({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 H({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 H({message:`a Non-Webauthn related error has occurred`,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e})}function Ua({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new H({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new H({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=window.location.hostname;if(!Ya(t))return new H({message:`${window.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new H({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new H({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 H({message:`a Non-Webauthn related error has occurred`,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e})}var Wa=new class{createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}};function Ga(e){if(!e)throw Error(`Credential creation options are required`);if(typeof PublicKeyCredential<`u`&&`parseCreationOptionsFromJSON`in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON==`function`)return PublicKeyCredential.parseCreationOptionsFromJSON(e);let{challenge:t,user:n,excludeCredentials:r}=e,i=mt(e,[`challenge`,`user`,`excludeCredentials`]),a=Ui(t).buffer,o=Object.assign(Object.assign({},n),{id:Ui(n.id).buffer}),s=Object.assign(Object.assign({},i),{challenge:a,user:o});if(r&&r.length>0){s.excludeCredentials=Array(r.length);for(let e=0;e<r.length;e++){let t=r[e];s.excludeCredentials[e]=Object.assign(Object.assign({},t),{id:Ui(t.id).buffer,type:t.type||`public-key`,transports:t.transports})}}return s}function Ka(e){if(!e)throw Error(`Credential request options are required`);if(typeof PublicKeyCredential<`u`&&`parseRequestOptionsFromJSON`in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON==`function`)return PublicKeyCredential.parseRequestOptionsFromJSON(e);let{challenge:t,allowCredentials:n}=e,r=mt(e,[`challenge`,`allowCredentials`]),i=Ui(t).buffer,a=Object.assign(Object.assign({},r),{challenge:i});if(n&&n.length>0){a.allowCredentials=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e];a.allowCredentials[e]=Object.assign(Object.assign({},t),{id:Ui(t.id).buffer,type:t.type||`public-key`,transports:t.transports})}}return a}function qa(e){if(`toJSON`in e&&typeof e.toJSON==`function`)return e.toJSON();let t=e;return{id:e.id,rawId:e.id,response:{attestationObject:Gi(new Uint8Array(e.response.attestationObject)),clientDataJSON:Gi(new Uint8Array(e.response.clientDataJSON))},type:`public-key`,clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:t.authenticatorAttachment??void 0}}function Ja(e){if(`toJSON`in e&&typeof e.toJSON==`function`)return e.toJSON();let t=e,n=e.getClientExtensionResults(),r=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:Gi(new Uint8Array(r.authenticatorData)),clientDataJSON:Gi(new Uint8Array(r.clientDataJSON)),signature:Gi(new Uint8Array(r.signature)),userHandle:r.userHandle?Gi(new Uint8Array(r.userHandle)):void 0},type:`public-key`,clientExtensionResults:n,authenticatorAttachment:t.authenticatorAttachment??void 0}}function Ya(e){return e===`localhost`||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function Xa(){return!!(z()&&`PublicKeyCredential`in window&&window.PublicKeyCredential&&`credentials`in navigator&&typeof(navigator==null?void 0:navigator.credentials)?.create==`function`&&typeof(navigator==null?void 0:navigator.credentials)?.get==`function`)}async function Za(e){try{let t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Va(`Browser returned unexpected credential type`,t)}:{data:null,error:new Va(`Empty credential response`,t)}}
1000catch(t){return{data:null,error:Ha({error:t,options:e})}}}async function Qa(e){try{let t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Va(`Browser returned unexpected credential type`,t)}:{data:null,error:new Va(`Empty credential response`,t)}}catch(t){return{data:null,error:Ua({error:t,options:e})}}}var $a={hints:[`security-key`],authenticatorSelection:{authenticatorAttachment:`cross-platform`,requireResidentKey:!1,userVerification:`preferred`,residentKey:`discouraged`},attestation:`direct`},eo={userVerification:`preferred`,hints:[`security-key`],attestation:`direct`};function to(...e){let t=e=>typeof e==`object`&&!!e&&!Array.isArray(e),n=e=>e instanceof ArrayBuffer||ArrayBuffer.isView(e),r={};for(let i of e)if(i)for(let e in i){let a=i[e];if(a!==void 0)if(Array.isArray(a))r[e]=a;else if(n(a))r[e]=a;else if(t(a)){let n=r[e];t(n)?r[e]=to(n,a):r[e]=to(a)}else r[e]=a}return r}function no(e,t){return to($a,e,t||{})}function ro(e,t){return to(eo,e,t||{})}var io=class{constructor(e){this.client=e,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(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:`webauthn`}))}async _challenge({factorId:e,webauthn:t,friendlyName:n,signal:r},i){try{let{data:a,error:o}=await this.client.mfa.challenge({factorId:e,webauthn:t});if(!a)return{data:null,error:o};let s=r??Wa.createNewAbortSignal();if(a.webauthn.type===`create`){let{user:e}=a.webauthn.credential_options.publicKey;if(!e.name){let t=n;if(t)e.name=`${e.id}:${t}`;else{let t=(await this.client.getUser()).data.user,n=t?.user_metadata?.name||t?.email||t?.id||`User`;e.name=`${e.id}:${n}`}}e.displayName||=e.name}switch(a.webauthn.type){case`create`:{let{data:t,error:n}=await Za({publicKey:no(a.webauthn.credential_options.publicKey,i?.create),signal:s});return t?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:t}},error:null}:{data:null,error:n}}case`request`:{let t=ro(a.webauthn.credential_options.publicKey,i?.request),{data:n,error:r}=await Qa(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:t,signal:s}));return n?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:n}},error:null}:{data:null,error:r}}}}catch(e){return I(e)?{data:null,error:e}:{data:null,error:new bi(`Unexpected error in challenge`,e)}}}async _verify({challengeId:e,factorId:t,webauthn:n}){return this.client.mfa.verify({factorId:t,challengeId:e,webauthn:n})}async _authenticate({factorId:e,webauthn:{rpId:t=typeof window<`u`?window.location.hostname:void 0,rpOrigins:n=typeof window<`u`?[window.location.origin]:void 0,signal:r}={}},i){if(!t)return{data:null,error:new _i(`rpId is required for WebAuthn authentication`)};try{if(!Xa())return{data:null,error:new bi(`Browser does not support WebAuthn`,null)};let{data:a,error:o}=await this.challenge({factorId:e,webauthn:{rpId:t,rpOrigins:n},signal:r},{request:i});if(!a)return{data:null,error:o};let{webauthn:s}=a;return this._verify({factorId:e,challengeId:a.challengeId,webauthn:{type:s.type,rpId:t,rpOrigins:n,credential_response:s.credential_response}})}catch(e){return I(e)?{data:null,error:e}:{data:null,error:new bi(`Unexpected error in authenticate`,e)}}}async _register({friendlyName:e,webauthn:{rpId:t=typeof window<`u`?window.location.hostname:void 0,rpOrigins:n=typeof window<`u`?[window.location.origin]:void 0,signal:r}={}},i){if(!t)return{data:null,error:new _i(`rpId is required for WebAuthn registration`)};try{if(!Xa())return{data:null,error:new bi(`Browser does not support WebAuthn`,null)};let{data:a,error:o}=await this._enroll({friendlyName:e});if(!a)return await this.client.mfa.listFactors().then(t=>t.data?.all.find(t=>t.factor_type===`webauthn`&&t.friendly_name===e&&t.status!==`unverified`)).then(e=>e?this.client.mfa.unenroll({factorId:e?.id}):void 0),{data:null,error:o};let{data:s,error:c}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:t,rpOrigins:n},signal:r},{create:i});return s?this._verify({factorId:a.id,challengeId:s.challengeId,webauthn:{rpId:t,rpOrigins:n,type:s.webauthn.type,credential_response:s.webauthn.credential_response}}):{data:null,error:c}}catch(e){return I(e)?{data:null,error:e}:{data:null,error:new bi(`Unexpected error in register`,e)}}}};Ia();var ao={url:di,storageKey:fi,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:pi,flowType:`implicit`,debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},oo={},so=class e{get jwks(){return oo[this.storageKey]?.jwks??{keys:[]}}set jwks(e){oo[this.storageKey]=Object.assign(Object.assign({},oo[this.storageKey]),{jwks:e})}get jwks_cached_at(){return oo[this.storageKey]?.cachedAt??-(2**53-1)}set jwks_cached_at(e){oo[this.storageKey]=Object.assign(Object.assign({},oo[this.storageKey]),{cachedAt:e})}constructor(t){var n;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.lastRefreshFailure=null,this._sessionRemovalEpoch=0,this.initializePromise=null,this._pendingInitNotifications=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lock=null,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;let r=Object.assign(Object.assign({},ao),t);if(this.storageKey=r.storageKey,this.instanceID=e.nextInstanceID[this.storageKey]??0,e.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!r.debug,typeof r.debug==`function`&&(this.logger=r.debug),this.instanceID>0&&z()){let e=`${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(e),this.logDebugMessages&&console.trace(e)}if(this.persistSession=r.persistSession,this.autoRefreshToken=r.autoRefreshToken,this.experimental=r.experimental??{},this.admin=new Na({url:r.url,headers:r.headers,fetch:r.fetch,experimental:this.experimental}),this.url=r.url,this.headers=r.headers,this.fetch=Zi(r.fetch),this.detectSessionInUrl=r.detectSessionInUrl,this.flowType=r.flowType,this.hasCustomAuthorizationHeader=r.hasCustomAuthorizationHeader,this.throwOnError=r.throwOnError,this.lockAcquireTimeout=r.lockAcquireTimeout,r.lock!=null&&(this.lock=r.lock),this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=-(2**53-1)),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 io(this)}
1000,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.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(r.storage?this.storage=r.storage:Yi()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Pa(this.memoryStorage)),r.userStorage&&(this.userStorage=r.userStorage)):(this.memoryStorage={},this.storage=Pa(this.memoryStorage)),z()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(e){console.error(`Failed to create a new BroadcastChannel, multi-tab state changes will not be available`,e)}(n=this.broadcastChannel)==null||n.addEventListener(`message`,async e=>{this._debug(`received broadcast notification from other tab or client`,e),(e.data.event===`TOKEN_REFRESHED`||e.data.event===`SIGNED_IN`)&&(this.lastRefreshFailure=null);try{await this._notifyAllSubscribers(e.data.event,e.data.session,!1)}catch(e){this._debug(`#broadcastChannel`,`error`,e)}})}r.skipAutoInitialize||this.initialize().catch(e=>{this._debug(`#initialize()`,`error`,e)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${si}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){if(this.initializePromise)return await this.initializePromise;this._pendingInitNotifications=[],this.initializePromise=(async()=>this.lock==null?await this._initialize():await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))();let e=await this.initializePromise,t=this._pendingInitNotifications??[];this._pendingInitNotifications=null;for(let e of t)await this._notifyAllSubscribers(e.event,e.session,e.broadcast);return e}async _initialize(){try{let e={},t=`none`;if(z()&&(e=Xi(window.location.href),this._isImplicitGrantCallback(e)?t=`implicit`:await this._isPKCECallback(e)&&(t=`pkce`)),z()&&this.detectSessionInUrl&&t!==`none`){let{data:n,error:r}=await this._getSessionFromURL(e,t);if(r){if(this._debug(`#_initialize()`,`error detecting session from URL`,r),Di(r)){let e=r.details?.code;if(e===`identity_already_exists`||e===`identity_not_found`||e===`single_identity_not_deletable`)return{error:r}}return{error:r}}let{session:i,redirectType:a}=n;return this._debug(`#_initialize()`,`detected session in URL`,i,`redirect type`,a),await this._saveSession(i),setTimeout(async()=>{a===`recovery`?await this._notifyAllSubscribers(`PASSWORD_RECOVERY`,i):await this._notifyAllSubscribers(`SIGNED_IN`,i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){return I(e)?this._returnResult({error:e}):this._returnResult({error:new bi(`Unexpected error during initialization`,e)})}finally{await this._handleVisibilityChange(),this._debug(`#_initialize()`,`end`)}}async signInAnonymously(e){try{let{data:t,error:n}=await V(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,body:{data:e?.options?.data??{},gotrue_meta_security:{captcha_token:e?.options?.captchaToken}},xform:Ta});if(n||!t)return this._returnResult({data:{user:null,session:null},error:n});let r=t.session,i=t.user;return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers(`SIGNED_IN`,r)),this._returnResult({data:{user:i,session:r},error:null})}catch(e){if(I(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signUp(e){try{let t;if(`email`in e){let{email:n,password:r,options:i}=e,a=null,o=null;this.flowType===`pkce`&&([a,o]=await la(this.storage,this.storageKey)),t=await V(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,redirectTo:i?.emailRedirectTo,body:{email:n,password:r,data:i?.data??{},gotrue_meta_security:{captcha_token:i?.captchaToken},code_challenge:a,code_challenge_method:o},xform:Ta})}else if(`phone`in e){let{phone:n,password:r,options:i}=e;t=await V(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,body:{phone:n,password:r,data:i?.data??{},channel:i?.channel??`sms`,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Ta})}else throw new Ti(`You must provide either an email or phone number and a password`);let{data:n,error:r}=t;if(r||!n)return await B(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:r});let i=n.session,a=n.user;return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers(`SIGNED_IN`,i)),this._returnResult({data:{user:a,session:i},error:null})}catch(e){if(await B(this.storage,`${this.storageKey}-code-verifier`),I(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithPassword(e){try{let t;if(`email`in e){let{email:n,password:r,options:i}=e;t=await V(this.fetch,`POST`,`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:n,password:r,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Ea})}else if(`phone`in e){let{phone:n,password:r,options:i}=e;t=await V(this.fetch,`POST`,`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:n,password:r,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Ea})}else throw new Ti(`You must provide either an email or phone number and a password`);let{data:n,error:r}=t;if(r)return this._returnResult({data:{user:null,session:null},error:r});if(!n||!n.session||!n.user){let e=new wi;return this._returnResult({data:{user:null,session:null},error:e})}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:r})}catch(e){if(I(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOAuth(e){return await this._handleProviderSignIn(e.provider,{redirectTo:e.options?.redirectTo,scopes:e.options?.scopes,queryParams:e.options?.queryParams,skipBrowserRedirect:e.options?.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this.lock==null?this._exchangeCodeForSession(e):this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){let{chain:t}=e;switch(t){case`ethereum`:return await this.signInWithEthereum(e);case`solana`:return await this.signInWithSolana(e);default:throw Error(`@supabase/auth-js: Unsupported chain "${t}"`)}}async signInWithEthereum(e){let t,n;if(`message`in e)t=e.message,n=e.signature;else{let{chain:r,wallet:i,statement:a,options:o}=e,s;if(!z()){if(typeof i!=`object`||!o?.url)throw Error(`@supabase/auth-js: Both wallet and url must be specified in non-browser environments.`);s=i}else if(typeof i==`object`)s=i;else{let e=window;if(`ethereum`in e&&typeof e.ethereum==`object`&&`request`in e.ethereum&&typeof e.ethereum.request==`function`)s=e.ethereum;else throw 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.`)}let c=new URL(o?.url??window.location.href),l=await s.request({method:`eth_requestAccounts`}).then(e=>e).catch(()=>{throw Error(`@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid`)});if(!l||l.length===0)throw Error(`@supabase/auth-js: No accounts available. Please ensure the wallet is connected.`);let u=La(l[0]),d=o?.signInWithEthereum?.chainId;d||=Ra(await s.request({method:`eth_chainId`})),t=Ba({domain:c.host,address:u,statement:a,uri:c.href,version:`1`,chainId:d,nonce:o?.signInWithEthereum?.nonce,issuedAt:o?.signInWithEthereum?.issuedAt??new Date,expirationTime:o?.signInWithEthereum?.expirationTime,notBefore:o?.signInWithEthereum?.notBefore,requestId:o?.signInWithEthereum?.requestId,resources:o?.signInWithEthereum?.resources}),n=await s.request({method:`personal_sign`,params:[za(t),u]})}try{let{data:r,error:i}=await V(this.fetch,`POST`,`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:`ethereum`,message:t,signature:n},e.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options?.captchaToken}}:null),xform:Ta});if(i)throw i;if(!r||!r.session||!r.user){let e=new wi;return this._returnResult({data:{user:null,session:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign({},r),error:i})}catch(e){if(I(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSolana(e){let t,n;if(`message`in e)t=e.message,n=e.signature;else{let{chain:r,wallet:i,statement:a,options:o}=e,s;if(!z()){if(typeof i!=`object`||!o?.url)throw Error(`@supabase/auth-js: Both wallet and url must be specified in non-browser environments.`);s=i}else if(typeof i==`object`)s=i;else{let e=window;if(`solana`in e&&typeof e.solana==`object`&&(`signIn`in e.solana&&typeof e.solana.signIn==`function`||`signMessage`in e.
1000solana&&typeof e.solana.signMessage==`function`))s=e.solana;else throw 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.`)}let c=new URL(o?.url??window.location.href);if(`signIn`in s&&s.signIn){let e=await s.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},o?.signInWithSolana),{version:`1`,domain:c.host,uri:c.href}),a?{statement:a}:null)),r;if(Array.isArray(e)&&e[0]&&typeof e[0]==`object`)r=e[0];else if(e&&typeof e==`object`&&`signedMessage`in e&&`signature`in e)r=e;else throw Error(`@supabase/auth-js: Wallet method signIn() returned unrecognized value`);if(`signedMessage`in r&&`signature`in r&&(typeof r.signedMessage==`string`||r.signedMessage instanceof Uint8Array)&&r.signature instanceof Uint8Array)t=typeof r.signedMessage==`string`?r.signedMessage:new TextDecoder().decode(r.signedMessage),n=r.signature;else throw Error(`@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields`)}else{if(!(`signMessage`in s)||typeof s.signMessage!=`function`||!(`publicKey`in s)||typeof s!=`object`||!s.publicKey||!(`toBase58`in s.publicKey)||typeof s.publicKey.toBase58!=`function`)throw Error(`@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API`);t=[`${c.host} wants you to sign in with your Solana account:`,s.publicKey.toBase58(),...a?[``,a,``]:[``],`Version: 1`,`URI: ${c.href}`,`Issued At: ${o?.signInWithSolana?.issuedAt??new Date().toISOString()}`,...o?.signInWithSolana?.notBefore?[`Not Before: ${o.signInWithSolana.notBefore}`]:[],...o?.signInWithSolana?.expirationTime?[`Expiration Time: ${o.signInWithSolana.expirationTime}`]:[],...o?.signInWithSolana?.chainId?[`Chain ID: ${o.signInWithSolana.chainId}`]:[],...o?.signInWithSolana?.nonce?[`Nonce: ${o.signInWithSolana.nonce}`]:[],...o?.signInWithSolana?.requestId?[`Request ID: ${o.signInWithSolana.requestId}`]:[],...o?.signInWithSolana?.resources?.length?[`Resources`,...o.signInWithSolana.resources.map(e=>`- ${e}`)]:[]].join(` 1001`);let e=await s.signMessage(new TextEncoder().encode(t),`utf8`);if(!e||!(e instanceof Uint8Array))throw Error(`@supabase/auth-js: Wallet signMessage() API returned an recognized value`);n=e}}try{let{data:r,error:i}=await V(this.fetch,`POST`,`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:`solana`,message:t,signature:Gi(n)},e.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options?.captchaToken}}:null),xform:Ta});if(i)throw i;if(!r||!r.session||!r.user){let e=new wi;return this._returnResult({data:{user:null,session:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign({},r),error:i})}catch(e){if(I(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _exchangeCodeForSession(e){let[t,n]=(await ea(this.storage,`${this.storageKey}-code-verifier`)??``).split(`/`);try{if(!t&&this.flowType===`pkce`)throw new ki;let{data:r,error:i}=await V(this.fetch,`POST`,`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:t},xform:Ta});if(await B(this.storage,`${this.storageKey}-code-verifier`),i)throw i;if(!r||!r.session||!r.user){let e=new wi;return this._returnResult({data:{user:null,session:null,redirectType:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(n===`recovery`?`PASSWORD_RECOVERY`:`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign(Object.assign({},r),{redirectType:n??null}),error:i})}catch(e){if(await B(this.storage,`${this.storageKey}-code-verifier`),I(e))return this._returnResult({data:{user:null,session:null,redirectType:null},error:e});throw e}}async signInWithIdToken(e){try{let{options:t,provider:n,token:r,access_token:i,nonce:a}=e,{data:o,error:s}=await V(this.fetch,`POST`,`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:r,access_token:i,nonce:a,gotrue_meta_security:{captcha_token:t?.captchaToken}},xform:Ta});if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!o||!o.session||!o.user){let e=new wi;return this._returnResult({data:{user:null,session:null},error:e})}return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers(`SIGNED_IN`,o.session)),this._returnResult({data:o,error:s})}catch(e){if(I(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOtp(e){try{if(`email`in e){let{email:t,options:n}=e,r=null,i=null;this.flowType===`pkce`&&([r,i]=await la(this.storage,this.storageKey));let{error:a}=await V(this.fetch,`POST`,`${this.url}/otp`,{headers:this.headers,body:{email:t,data:n?.data??{},create_user:n?.shouldCreateUser??!0,gotrue_meta_security:{captcha_token:n?.captchaToken},code_challenge:r,code_challenge_method:i},redirectTo:n?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}if(`phone`in e){let{phone:t,options:n}=e,{data:r,error:i}=await V(this.fetch,`POST`,`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:n?.data??{},create_user:n?.shouldCreateUser??!0,gotrue_meta_security:{captcha_token:n?.captchaToken},channel:n?.channel??`sms`}});return this._returnResult({data:{user:null,session:null,messageId:r?.message_id},error:i})}throw new Ti(`You must provide either an email or phone number.`)}catch(e){if(await B(this.storage,`${this.storageKey}-code-verifier`),I(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async verifyOtp(e){try{let t,n;`options`in e&&(t=e.options?.redirectTo,n=e.options?.captchaToken);let{data:r,error:i}=await V(this.fetch,`POST`,`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:n}}),redirectTo:t,xform:Ta});if(i)throw i;if(!r)throw Error(`An error occurred on token verification.`);let a=r.session,o=r.user;return a?.access_token&&(await this._saveSession(a),await this._notifyAllSubscribers(e.type==`recovery`?`PASSWORD_RECOVERY`:`SIGNED_IN`,a)),this._returnResult({data:{user:o,session:a},error:null})}catch(e){if(I(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSSO(e){try{let t=null,n=null;this.flowType===`pkce`&&([t,n]=await la(this.storage,this.storageKey));let r=await V(this.fetch,`POST`,`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},`providerId`in e?{provider_id:e.providerId}:null),`domain`in e?{domain:e.domain}:null),{redirect_to:e.options?.redirectTo??void 0}),e?.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:t,code_challenge_method:n}),headers:this.headers,xform:Oa});return r.data?.url&&z()&&!e.options?.skipBrowserRedirect&&window.location.assign(r.data.url),this._returnResult(r)}catch(e){if(await B(this.storage,`${this.storageKey}-code-verifier`),I(e))return this._returnResult({data:null,error:e});throw e}}async reauthenticate(){return await this.initializePromise,this.lock==null?await this._reauthenticate():await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;if(n)throw n;if(!t)throw new Si;let{error:r}=await V(this.fetch,`GET`,`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return this._returnResult({data:{user:null,session:null},error:r})})}catch(e){if(I(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{let t=`${this.url}/resend`;if(`email`in e){let{email:n,type:r,options:i}=e,a=null,o=null;this.flowType===`pkce`&&([a,o]=await la(this.storage,this.storageKey));let{error:s}=await V(this.fetch,`POST`,t,{headers:this.headers,body:{email:n,type:r,gotrue_meta_security:{captcha_token:i?.captchaToken},code_challenge:a,code_challenge_method:o},redirectTo:i?.emailRedirectTo});return s&&await B(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:s})}else if(`phone`in e){let{phone:n,type:r,options:i}=e,{data:a,error:o}=await V(this.fetch,`POST`,t,{headers:this.headers,body:{phone:n,type:r,gotrue_meta_security:{captcha_token:i?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:a?.message_id},error:o})}throw new Ti(`You must provide either an email or phone number and a type`)}catch(e){if(await B(this.storage,`${this.storageKey}-code-verifier`),I(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async getSession(){return await this.initializePromise,this.lock==null?await this._useSession(async e=>e):await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e))}async _acquireLock(e,t){this._debug(`#_acquireLock`,`begin`,e);try{if(this.lockAcquired){let e=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),n=(async()=>(await e,await t()))();return this.pendingInLock.push((async()=>{try{await n}catch{}})()),n}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug(`#_acquireLock`,`lock acquired for storage key`,this.storageKey);try{this.lockAcquired=!0;let e=t();for(this.pendingInLock.push((async()=>{try{await e}catch{}})()),await e;this.pendingInLock.length;){let e=[...this.pendingInLock];await Promise.all(e),this.pendingInLock.splice(0,e.length)}return await e}finally{this._debug(`#_acquireLock`,`lock released for storage key`,this.storageKey),this.lockAcquired=!1}})}finally{this._debug(`#_acquireLock`,`end`)}}async _useSession(e){this._debug(`#_useSession`,`begin`);try{return await e(await this.__loadSession())}finally{this._debug(`#_useSession`,`end`)}}async __loadSession(){this._debug(`#__loadSession()`,`begin`),this.lock!=null&&!this.lockAcquired&&this._debug(`#__loadSession()`,`used outside of an acquired lock!`,Error().stack);try{let e=null,t=await ea(this.storage,this.storageKey);if(this._debug(`#getSession()`,`session from storage`,t),t!==null&&(this._isValidSession(t)?e=t:(this._debug(`#getSession()`,`session from storage is not val
1001id`),await this._removeSession())),!e)return{data:{session:null},error:null};let n=e.expires_at?e.expires_at*1e3-Date.now()<li:!1;if(this._debug(`#__loadSession()`,`session has${n?``:` not`} expired`,`expires_at`,e.expires_at),!n){if(this.userStorage){let t=await ea(this.userStorage,this.storageKey+`-user`);t?.user?e.user=t.user:e.user=_a()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){let t={value:this.suppressGetSessionWarning};e.user=va(e.user,t),t.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}let{data:r,error:i}=await this._callRefreshToken(e.refresh_token);if(i){if(e.expires_at&&e.expires_at*1e3>Date.now()){let t=await ea(this.storage,this.storageKey);if(t&&t.refresh_token===e.refresh_token)return this._returnResult({data:{session:e},error:null})}return this._returnResult({data:{session:null},error:i})}return this._returnResult({data:{session:r},error:null})}finally{this._debug(`#__loadSession()`,`end`)}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;let t;return t=this.lock==null?await this._getUser():await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser()),t.data.user&&(this.suppressGetSessionWarning=!0),t}async _getUser(e){try{return e?await V(this.fetch,`GET`,`${this.url}/user`,{headers:this.headers,jwt:e,xform:Da}):await this._useSession(async e=>{let{data:t,error:n}=e;if(n)throw n;return!t.session?.access_token&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Si}:await V(this.fetch,`GET`,`${this.url}/user`,{headers:this.headers,jwt:t.session?.access_token??void 0,xform:Da})})}catch(e){if(I(e))return Ci(e)&&(await this._removeSession(),await B(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:e});throw e}}async updateUser(e,t={}){return await this.initializePromise,this.lock==null?await this._updateUser(e,t):await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async n=>{let{data:r,error:i}=n;if(i)throw i;if(!r.session)throw new Si;let a=r.session,o=null,s=null;this.flowType===`pkce`&&e.email!=null&&([o,s]=await la(this.storage,this.storageKey));let{data:c,error:l}=await V(this.fetch,`PUT`,`${this.url}/user`,{headers:this.headers,redirectTo:t?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:s}),jwt:a.access_token,xform:Da});if(l)throw l;return a.user=c.user,await this._saveSession(a),await this._notifyAllSubscribers(`USER_UPDATED`,a),this._returnResult({data:{user:a.user},error:null})})}catch(e){if(await B(this.storage,`${this.storageKey}-code-verifier`),I(e))return this._returnResult({data:{user:null},error:e});throw e}}async setSession(e){return await this.initializePromise,this.lock==null?await this._setSession(e):await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Si;let t=Date.now()/1e3,n=t,r=!0,i=null,{payload:a}=na(e.access_token);if(a.exp&&(n=a.exp,r=n<=t),r){let{data:t,error:n}=await this._callRefreshToken(e.refresh_token);if(n)return this._returnResult({data:{user:null,session:null},error:n});if(!t)return{data:{user:null,session:null},error:null};i=t}else{let{data:r,error:a}=await this._getUser(e.access_token);if(a)return this._returnResult({data:{user:null,session:null},error:a});i={access_token:e.access_token,refresh_token:e.refresh_token,user:r.user,token_type:`bearer`,expires_in:n-t,expires_at:n},await this._saveSession(i),await this._notifyAllSubscribers(`SIGNED_IN`,i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(e){if(I(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}}async refreshSession(e){return await this.initializePromise,this.lock==null?await this._refreshSession(e):await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{if(!e){let{data:n,error:r}=t;if(r)throw r;e=n.session??void 0}if(!e?.refresh_token)throw new Si;let{data:n,error:r}=await this._callRefreshToken(e.refresh_token);return r?this._returnResult({data:{user:null,session:null},error:r}):n?this._returnResult({data:{user:n.user,session:n},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(e){if(I(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _getSessionFromURL(e,t){try{if(!z())throw new Ei(`No browser detected.`);if(e.error||e.error_description||e.error_code)throw new Ei(e.error_description||`Error in URL with unspecified error_description`,{error:e.error||`unspecified_error`,code:e.error_code||`unspecified_code`});switch(t){case`implicit`:if(this.flowType===`pkce`)throw new Oi(`Not a valid PKCE flow url.`);break;case`pkce`:if(this.flowType===`implicit`)throw new Ei(`Not a valid implicit grant flow url.`);break;default:}if(t===`pkce`){if(this._debug(`#_initialize()`,`begin`,`is PKCE flow`,!0),!e.code)throw new Oi(`No code detected.`);let{data:t,error:n}=await this._exchangeCodeForSession(e.code);
1001if(n)throw n;let r=new URL(window.location.href);return r.searchParams.delete(`code`),window.history.replaceState(window.history.state,``,r.toString()),{data:{session:t.session,redirectType:t.redirectType??null},error:null}}let{provider_token:n,provider_refresh_token:r,access_token:i,refresh_token:a,expires_in:o,expires_at:s,token_type:c}=e;if(!i||!o||!a||!c)throw new Ei(`No session defined in URL`);let l=Math.round(Date.now()/1e3),u=parseInt(o),d=l+u;s&&(d=parseInt(s));let f=d-l;f*1e3<=3e4&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${f}s, should have been closer to ${u}s`);let p=d-u;l-p>=120?console.warn(`@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale`,p,d,l):l-p<0&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew`,p,d,l);let{data:m,error:h}=await this._getUser(i);if(h)throw h;let g={provider_token:n,provider_refresh_token:r,access_token:i,expires_in:u,expires_at:d,refresh_token:a,token_type:c,user:m.user};return window.location.hash=``,this._debug(`#_getSessionFromURL()`,`clearing window.location.hash`),this._returnResult({data:{session:g,redirectType:e.type},error:null})}catch(e){if(I(e))return this._returnResult({data:{session:null,redirectType:null},error:e});throw e}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl==`function`?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error||e.error_description||e.error_code)}async _isPKCECallback(e){let t=await ea(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:`global`}){return await this.initializePromise,this.lock==null?await this._signOut(e):await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:`global`}){return await this._useSession(async t=>{let n=async()=>{await this._removeSession(),await B(this.storage,`${this.storageKey}-code-verifier`)},{data:r,error:i}=t;if(i&&!Ci(i))return this._returnResult({error:i});let a=r.session?.access_token;if(a){let{error:t}=await this.admin.signOut(a,e);if(t&&!(yi(t)&&(t.status===404||t.status===401||t.status===403)||Ci(t)))return e!==`others`&&await n(),this._returnResult({error:t})}return e!==`others`&&await n(),this._returnResult({error:null})})}onAuthStateChange(e){let t=qi(),n={id:t,callback:e,unsubscribe:()=>{this._debug(`#unsubscribe()`,`state change callback with id removed`,t),this.stateChangeEmitters.delete(t)}};return this._debug(`#onAuthStateChange()`,`registered callback with id`,t),this.stateChangeEmitters.set(t,n),(async()=>{await this.initializePromise,this.lock==null?await this._emitInitialSession(t):await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(t)})})(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async t=>{try{let{data:{session:n},error:r}=t;if(r)throw r;await this.stateChangeEmitters.get(e)?.callback(`INITIAL_SESSION`,n),this._debug(`INITIAL_SESSION`,`callback id`,e,`session`,n)}catch(t){await this.stateChangeEmitters.get(e)?.callback(`INITIAL_SESSION`,null),this._debug(`INITIAL_SESSION`,`callback id`,e,`error`,t),Ci(t)||ji(t)?console.warn(t):console.error(t)}})}async resetPasswordForEmail(e,t={}){let n=null,r=null;this.flowType===`pkce`&&([n,r]=await la(this.storage,this.storageKey,!0));try{return await V(this.fetch,`POST`,`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:r,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(e){if(await B(this.storage,`${this.storageKey}-code-verifier`),I(e))return this._returnResult({data:null,error:e});throw e}}async getUserIdentities(){try{let{data:e,error:t}=await this.getUser();if(t)throw t;return this._returnResult({data:{identities:e.user.identities??[]},error:null})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async linkIdentity(e){return`token`in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){try{let{data:t,error:n}=await this._useSession(async t=>{let{data:n,error:r}=t;if(r)throw r;let i=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:e.options?.redirectTo,scopes:e.options?.scopes,queryParams:e.options?.queryParams,skipBrowserRedirect:!0});return await V(this.fetch,`GET`,i,{headers:this.headers,jwt:n.session?.access_token??void 0})});if(n)throw n;return z()&&!e.options?.skipBrowserRedirect&&window.location.assign(t?.url),this._returnResult({data:{provider:e.provider,url:t?.url},error:null})}catch(t){if(I(t))return this._returnResult({data:{provider:e.provider,url:null},error:t});throw t}}async linkIdentityIdToken(e){return await this._useSession(async t=>{try{let{error:n,data:{session:r}}=t;if(n)throw n;let{options:i,provider:a,token:o,access_token:s,nonce:c}=e,{data:l,error:u}=await V(this.fetch,`POST`,`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:r?.access_token??void 0,body:{provider:a,id_token:o,access_token:s,nonce:c,link_identity:!0,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Ta});return u?this._returnResult({data:{user:null,session:null},error:u}):!l||!l.session||!l.user?this._returnResult({data:{user:null,session:null},error:new wi}):(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers(`USER_UPDATED`,l.session)),this._returnResult({data:l,error:u}))}catch(e){if(await B(this.storage,`${this.storageKey}-code-verifier`),I(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}})}async unlinkIdentity(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)throw r;return await V(this.fetch,`DELETE`,`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:n.session?.access_token??void 0})})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _refreshAccessToken(e){let t=`#_refreshAccessToken()`;this._debug(t,`begin`);try{let n=Date.now();return await ia(async n=>(n>0&&await ra(200*2**(n-1)),this._debug(t,`refreshing attempt`,n),await V(this.fetch,`POST`,`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Ta})),(e,t)=>{let r=200*2**e;return t&&ji(t)&&Date.now()+r-n<3e4})}catch(e){if(this._debug(t,`error`,e),I(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}finally{this._debug(t,`end`)}}_isValidSession(e){return typeof e==`object`&&!!e&&`access_token`in e&&`refresh_token`in e&&`expires_at`in e}async _handleProviderSignIn(e,t){let n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug(`#_handleProviderSignIn()`,`provider`,e,`options`,t,`url`,n),z()&&!t.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){let e=`#_recoverAndRefresh()`;this._debug(e,`begin`);try{let t=await ea(this.storage,this.storageKey);if(t&&this.userStorage){let e=await ea(this.userStorage,this.storageKey+`-user`);!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!e&&(e={user:t.user},await $i(this.userStorage,this.storageKey+`-user`,e)),t.user=e?.user??_a()}else if(t&&!t.user&&!t.user){let e=await ea(this.storage,this.storageKey+`-user`);e&&e?.user?(t.user=e.user,await B(this.storage,this.storageKey+`-user`),await $i(this.storage,this.storageKey,t)):t.user=_a()}if(this._debug(e,`session from storage`,t),!this._isValidSession(t)){this._debug(e,`session is not val
1001id`),t!==null&&await this._removeSession();return}let n=(t.expires_at??1/0)*1e3-Date.now()<li;if(this._debug(e,`session has${n?``:` not`} expired with margin of ${li}s`),n){if(this.autoRefreshToken&&t.refresh_token){let{error:n}=await this._callRefreshToken(t.refresh_token);n&&(Ni(n)?this._debug(e,`refresh discarded by commit guard`,n):this._debug(e,`refresh failed`,n))}}else if(t.user&&t.user.__isUserNotAvailableProxy===!0)try{let{data:n,error:r}=await this._getUser(t.access_token);!r&&n?.user?(t.user=n.user,await this._saveSession(t),await this._notifyAllSubscribers(`SIGNED_IN`,t)):this._debug(e,`could not get user data, skipping SIGNED_IN notification`)}catch(t){console.error(`Error getting user data:`,t),this._debug(e,`error getting user data, skipping SIGNED_IN notification`,t)}else await this._notifyAllSubscribers(`SIGNED_IN`,t)}catch(t){this._debug(e,`error`,t),ji(t)?console.warn(t):console.error(t);return}finally{this._debug(e,`end`)}}async _callRefreshToken(e){var t,n;if(!e)throw new Si;if(this.refreshingDeferred)return this.refreshingDeferred.promise;if(this.lastRefreshFailure&&this.lastRefreshFailure.refreshToken===e&&Date.now()<this.lastRefreshFailure.expiresAt)return this._debug(`#_callRefreshToken()`,`returning cached failure (cooldown active)`),this.lastRefreshFailure.result;let r=`#_callRefreshToken()`;this._debug(r,`begin`);try{this.refreshingDeferred=new ta;let t=await ea(this.storage,this.storageKey),{data:n,error:i}=await this._refreshAccessToken(e);if(i)throw i;if(!n.session)throw new Si;let a=await ea(this.storage,this.storageKey);if(t!==null&&(a===null||a.refresh_token!==t.refresh_token)){this._debug(r,`commit guard: storage changed since refresh started, discarding rotated tokens`,{startedWith:`present`,nowHolds:a?`replaced`:`cleared`});let e={data:null,error:new Mi};return this.refreshingDeferred.resolve(e),e}let o=this._sessionRemovalEpoch;if(await this._saveSession(n.session),this._sessionRemovalEpoch!==o){this._debug(r,`commit guard (post-save): _removeSession ran during _saveSession, undoing write`),await B(this.storage,this.storageKey),this.userStorage&&await B(this.userStorage,this.storageKey+`-user`);let e={data:null,error:new Mi};return this.refreshingDeferred.resolve(e),e}await this._notifyAllSubscribers(`TOKEN_REFRESHED`,n.session);let s={data:n.session,error:null};return this.lastRefreshFailure=null,this.refreshingDeferred.resolve(s),s}catch(i){if(this._debug(r,`error`,i),I(i)){let n={data:null,error:i};if(!ji(i)){let e=await ea(this.storage,this.storageKey);e?.expires_at&&e.expires_at*1e3>Date.now()?this._debug(r,`proactive refresh failed, access token still valid â preserving session`):await this._removeSession()}return this.lastRefreshFailure={refreshToken:e,result:n,expiresAt:Date.now()+ui},(t=this.refreshingDeferred)==null||t.resolve(n),n}throw(n=this.refreshingDeferred)==null||n.reject(i),i}finally{this.refreshingDeferred=null,this._debug(r,`end`)}}async _notifyAllSubscribers(e,t,n=!0){if(this._pendingInitNotifications!==null&&n){this._pendingInitNotifications.push({event:e,session:t,broadcast:n});return}let r=`#_notifyAllSubscribers(${e})`;this._debug(r,`begin`,t,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:t});let r=[],i=Array.from(this.stateChangeEmitters.values()).map(async n=>{try{await n.callback(e,t)}catch(e){r.push(e)}});if(await Promise.all(i),r.length>0){for(let e=0;e<r.length;e+=1)console.error(r[e]);throw r[0]}}finally{this._debug(r,`end`)}}async _saveSession(e){this._debug(`#_saveSession()`,e),this.suppressGetSessionWarning=!0;let t=Object.assign({},e),n=t.user&&t.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&t.user&&await $i(this.userStorage,this.storageKey+`-user`,{user:t.user});let e=Object.assign({},t);delete e.user;let r=ya(e);await $i(this.storage,this.storageKey,r)}else{let e=ya(t);await $i(this.storage,this.storageKey,e)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug(`#_removeSession()`),this.lastRefreshFailure=null,this.suppressGetSessionWarning=!1,await B(this.storage,this.storageKey),await B(this.storage,this.storageKey+`-code-verifier`),await B(this.storage,this.storageKey+`-user`),this.userStorage&&await B(this.userStorage,this.storageKey+`-user`),await this._notifyAllSubscribers(`SIGNED_OUT`,null)}_removeVisibilityChangedCallback(){this._debug(`#_removeVisibilityChangedCallback()`);let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&z()&&window!=null&&window.removeEventListener&&window.removeEventListener(`visibilitychange`,e)}
1001catch(e){console.error(`removing visibilitychange callback failed`,e)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug(`#_startAutoRefresh()`);let e=setInterval(()=>this._autoRefreshTokenTick(),ci);this.autoRefreshTicker=e,e&&typeof e==`object`&&typeof e.unref==`function`?e.unref():typeof Deno<`u`&&typeof Deno.unrefTimer==`function`&&Deno.unrefTimer(e);let t=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=t,t&&typeof t==`object`&&typeof t.unref==`function`?t.unref():typeof Deno<`u`&&typeof Deno.unrefTimer==`function`&&Deno.unrefTimer(t)}async _stopAutoRefresh(){this._debug(`#_stopAutoRefresh()`);let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);let t=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,t&&clearTimeout(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async dispose(){var e;this._removeVisibilityChangedCallback(),await this._stopAutoRefresh(),(e=this.broadcastChannel)==null||e.close(),this.broadcastChannel=null,this.stateChangeEmitters.clear()}async _autoRefreshTokenTick(){if(this._debug(`#_autoRefreshTokenTick()`,`begin`),this.lock!=null){try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async t=>{let{data:{session:n}}=t;if(!n||!n.refresh_token||!n.expires_at){this._debug(`#_autoRefreshTokenTick()`,`no session`);return}let r=Math.floor((n.expires_at*1e3-e)/ci);this._debug(`#_autoRefreshTokenTick()`,`access token expires in ${r} ticks, a tick lasts ${ci}ms, refresh threshold is 3 ticks`),r<=3&&await this._callRefreshToken(n.refresh_token)})}catch(e){console.error(`Auto refresh tick failed with error. This is likely a transient error.`,e)}}finally{this._debug(`#_autoRefreshTokenTick()`,`end`)}})}catch(e){if(e instanceof Fa)this._debug(`auto refresh token tick lock not available`);else throw e}return}if(this.refreshingDeferred!==null){this._debug(`#_autoRefreshTokenTick()`,`refresh already in flight, skipping`);return}try{let e=Date.now();try{await this._useSession(async t=>{let{data:{session:n}}=t;if(!n||!n.refresh_token||!n.expires_at){this._debug(`#_autoRefreshTokenTick()`,`no session`);return}let r=Math.floor((n.expires_at*1e3-e)/ci);this._debug(`#_autoRefreshTokenTick()`,`access token expires in ${r} ticks, a tick lasts ${ci}ms, refresh threshold is 3 ticks`),r<=3&&await this._callRefreshToken(n.refresh_token)})}catch(e){console.error(`Auto refresh tick failed with error. This is likely a transient error.`,e)}}finally{this._debug(`#_autoRefreshTokenTick()`,`end`)}}async _handleVisibilityChange(){if(this._debug(`#_handleVisibilityChange()`),!z()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug(`#visibilityChangedCallback`,`error`,e)}},window==null||window.addEventListener(`visibilitychange`,this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error(`_handleVisibilityChange`,e)}}async _onVisibilityChanged(e){let t=`#_onVisibilityChanged(${e})`;if(this._debug(t,`visibilityState`,document.visibilityState),document.visibilityState===`visible`){if(this.autoRefreshToken&&this._startAutoRefresh(),!e)if(await this.initializePromise,this.lock!=null)await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!==`visible`){this._debug(t,`acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting`);return}await this._recoverAndRefresh()});else{if(document.visibilityState!==`visible`){this._debug(t,`visibilityState is no longer visible, skipping recovery`);return}await this._recoverAndRefresh()}}else document.visibilityState===`hidden`&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,n){let r=[`provider=${encodeURIComponent(t)}`];if(n?.redirectTo&&r.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n?.scopes&&r.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType===`pkce`){let[e,t]=await la(this.storage,this.storageKey),n=new URLSearchParams({code_challenge:`${encodeURIComponent(e)}`,code_challenge_method:`${encodeURIComponent(t)}`});
1001r.push(n.toString())}if(n?.queryParams){let e=new URLSearchParams(n.queryParams);r.push(e.toString())}return n?.skipBrowserRedirect&&r.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${r.join(`&`)}`}async _unenroll(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;return r?this._returnResult({data:null,error:r}):await V(this.fetch,`DELETE`,`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:n?.session?.access_token})})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _enroll(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType===`phone`?{phone:e.phone}:e.factorType===`totp`?{issuer:e.issuer}:{}),{data:a,error:o}=await V(this.fetch,`POST`,`${this.url}/factors`,{body:i,headers:this.headers,jwt:n?.session?.access_token});return o?this._returnResult({data:null,error:o}):(e.factorType===`totp`&&a.type===`totp`&&a?.totp?.qr_code&&(a.totp.qr_code=`data:image/svg+xml;utf-8,${a.totp.qr_code}`),this._returnResult({data:a,error:null}))})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _verify(e){let t=async()=>{try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=Object.assign({challenge_id:e.challengeId},`webauthn`in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type===`create`?qa(e.webauthn.credential_response):Ja(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:o}=await V(this.fetch,`POST`,`${this.url}/factors/${e.factorId}/verify`,{body:i,headers:this.headers,jwt:n?.session?.access_token});return o?this._returnResult({data:null,error:o}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers(`MFA_CHALLENGE_VERIFIED`,a),this._returnResult({data:a,error:o}))})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}};return this.lock==null?t():this._acquireLock(this.lockAcquireTimeout,t)}async _challenge(e){let t=async()=>{try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=await V(this.fetch,`POST`,`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:n?.session?.access_token});if(i.error)return i;let{data:a}=i;if(a.type!==`webauthn`)return{data:a,error:null};switch(a.webauthn.type){case`create`:return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:Ga(a.webauthn.credential_options.publicKey)})})}),error:null};case`request`:return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:Ka(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}};return this.lock==null?t():this._acquireLock(this.lockAcquireTimeout,t)}async _challengeAndVerify(e){let{data:t,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){let{data:{user:e},error:t}=await this.getUser();if(t)return{data:null,error:t};let n={all:[],phone:[],totp:[],webauthn:[]};for(let t of e?.factors??[])n.all.push(t),t.status===`verified`&&n[t.factor_type].push(t);return{data:n,error:null}}async _getAuthenticatorAssuranceLevel(e){if(e)try{let{payload:t}=na(e),n=null;t.aal&&(n=t.aal);let r=n,{data:{user:i},error:a}=await this.getUser(e);if(a)return this._returnResult({data:null,error:a});((i?.factors)?.filter(e=>e.status===`verified`)??[]).length>0&&(r=`aal2`);let o=t.amr||[];return{data:{currentLevel:n,nextLevel:r,currentAuthenticationMethods:o},error:null}}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}let{data:{session:t},error:n}
1001=await this.getSession();if(n)return this._returnResult({data:null,error:n});if(!t)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:r}=na(t.access_token),i=null;r.aal&&(i=r.aal);let a=i;(t.user.factors?.filter(e=>e.status===`verified`)??[]).length>0&&(a=`aal2`);let o=r.amr||[];return{data:{currentLevel:i,nextLevel:a,currentAuthenticationMethods:o},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?await V(this.fetch,`GET`,`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new Si})})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _approveAuthorization(e,t){try{return await this._useSession(async n=>{let{data:{session:r},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new Si});let a=await V(this.fetch,`POST`,`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:`approve`},xform:e=>({data:e,error:null})});return a.data&&a.data.redirect_url&&z()&&!t?.skipBrowserRedirect&&window.location.assign(a.data.redirect_url),a})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _denyAuthorization(e,t){try{return await this._useSession(async n=>{let{data:{session:r},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new Si});let a=await V(this.fetch,`POST`,`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:`deny`},xform:e=>({data:e,error:null})});return a.data&&a.data.redirect_url&&z()&&!t?.skipBrowserRedirect&&window.location.assign(a.data.redirect_url),a})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _listOAuthGrants(){try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;return n?this._returnResult({data:null,error:n}):t?await V(this.fetch,`GET`,`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new Si})})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?(await V(this.fetch,`DELETE`,`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Si})})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async fetchJwk(e,t={keys:[]}){let n=t.keys.find(t=>t.kid===e);if(n)return n;let r=Date.now();if(n=this.jwks.keys.find(t=>t.kid===e),n&&this.jwks_cached_at+6e5>r)return n;let{data:i,error:a}=await V(this.fetch,`GET`,`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(a)throw a;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=r,n=i.keys.find(t=>t.kid===e),!n)?null:n}async getClaims(e,t={}){try{let n=e;if(!n){let{data:e,error:t}
1001=await this.getSession();if(t||!e.session)return this._returnResult({data:null,error:t});n=e.session.access_token}let{header:r,payload:i,signature:a,raw:{header:o,payload:s}}=na(n);if(!t?.allowExpired)try{fa(i.exp)}catch(e){throw new Fi(e instanceof Error?e.message:`JWT validation failed`)}let c=!r.alg||r.alg.startsWith(`HS`)||!r.kid||!(`crypto`in globalThis&&`subtle`in globalThis.crypto)?null:await this.fetchJwk(r.kid,t?.keys?{keys:t.keys}:t?.jwks);if(!c){let{error:e}=await this.getUser(n);if(e)throw e;return{data:{claims:i,header:r,signature:a},error:null}}let l=pa(r.alg),u=await crypto.subtle.importKey(`jwk`,c,l,!0,[`verify`]);if(!await crypto.subtle.verify(l,u,a,Wi(`${o}.${s}`)))throw new Fi(`Invalid JWT signature`);return{data:{claims:i,header:r,signature:a},error:null}}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async signInWithPasskey(e){ga(this.experimental);try{if(!Xa())return this._returnResult({data:null,error:new bi(`Browser does not support WebAuthn`,null)});let{data:t,error:n}=await this._startPasskeyAuthentication({options:{captchaToken:e?.options?.captchaToken}});if(n||!t)return this._returnResult({data:null,error:n});let{data:r,error:i}=await Qa({publicKey:Ka(t.options),signal:e?.options?.signal??Wa.createNewAbortSignal()});if(i||!r)return this._returnResult({data:null,error:i??new bi(`WebAuthn ceremony failed`,null)});let a=Ja(r);return this._verifyPasskeyAuthentication({challengeId:t.challenge_id,credential:a})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async registerPasskey(e){ga(this.experimental);try{if(!Xa())return this._returnResult({data:null,error:new bi(`Browser does not support WebAuthn`,null)});let{data:t,error:n}=await this._startPasskeyRegistration();if(n||!t)return this._returnResult({data:null,error:n});let{data:r,error:i}=await Za({publicKey:Ga(t.options),signal:e?.options?.signal??Wa.createNewAbortSignal()});if(i||!r)return this._returnResult({data:null,error:i??new bi(`WebAuthn ceremony failed`,null)});let a=qa(r);return this._verifyPasskeyRegistration({challengeId:t.challenge_id,credential:a})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyRegistration(){ga(this.experimental);try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!t)return this._returnResult({data:null,error:new Si});let{data:r,error:i}=await V(this.fetch,`POST`,`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:t.access_token,body:{}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:r,error:null})})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){ga(this.experimental);try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new Si});let{data:i,error:a}=await V(this.fetch,`POST`,`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:n.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyAuthentication(e){ga(this.experimental);try{let{data:t,error:n}=await V(this.fetch,`POST`,`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:e?.options?.captchaToken}}});return n?this._returnResult({data:null,error:n}):this._returnResult({data:t,error:null})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyAuthentication(e){ga(this.experimental);try{let{data:t,error:n}=await V(this.fetch,`POST`,`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:Ta});return n?this._returnResult({data:null,error:n}):(t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers(`SIGNED_IN`,t.session)),this._returnResult({data:t,error:null}))}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _listPasskeys(){ga(this.experimental);try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!t)return this._returnResult({data:null,error:new Si});let{data:r,error:i}=await V(this.fetch,`GET`,`${this.url}/passkeys`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})});return i?this._returnResult({data:null,error:i}):this._returnResult({data:r,error:null})})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){ga(this.experimental);try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new Si});let{data:i,error:a}=await V(this.fetch,`PATCH`,`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,body:{friendly_name:e.friendlyName}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}async _deletePasskey(e){ga(this.experimental);try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new Si});let{error:i}=await V(this.fetch,`DELETE`,`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,noResolveJson:!0});return i?this._returnResult({data:null,error:i}):this._returnResult({data:null,error:null})})}catch(e){if(I(e))return this._returnResult({data:null,error:e});throw e}}};so.nextInstanceID={};var co=so,lo=`modulepreload`,U=function(e){return`/`+e},W={},G=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=U(t,n),t in W)return;W[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:lo,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n
1001)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},uo=`2.110.8`,fo=``,po;if(typeof Deno<`u`)fo=`deno`,po=Deno.version?.deno;else if(typeof document<`u`)fo=`web`;else if(typeof navigator<`u`&&navigator.product===`ReactNative`)fo=`react-native`;else{var mo;fo=`node`;let e=globalThis.process;po=e==null||(mo=e.version)==null?void 0:mo.replace(/^v/,``)}var ho=[`runtime=${fo}`];po&&ho.push(`runtime-version=${po}`);var go={headers:{"X-Client-Info":`supabase-js/${uo}; ${ho.join(`; `)}`}},_o={schema:`public`},vo={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:`implicit`},yo={},bo={enabled:!1,respectSamplingDecision:!0};function xo(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}var So=null,Co=`@opentelemetry/api`;function wo(){return So===null&&(So=G(()=>import(Co),[]).catch(()=>null)),So}function To(){return xo(this,void 0,void 0,function*(){try{let e=yield wo();if(!e||!e.propagation||!e.context)return null;let t={};e.propagation.inject(e.context.active(),t);let n=t.traceparent;return n?{traceparent:n,tracestate:t.tracestate,baggage:t.baggage}:null}catch{return null}})}function Eo(e){if(!e||typeof e!=`string`)return null;let t=e.split(`-`);if(t.length!==4)return null;let[n,r,i,a]=t;if(n.length!==2||r.length!==32||i.length!==16||a.length!==2)return null;let o=/^[0-9a-f]+$/i;return!o.test(n)||!o.test(r)||!o.test(i)||!o.test(a)||r===`00000000000000000000000000000000`||i===`0000000000000000`?null:{version:n,traceId:r,parentId:i,traceFlags:a,isSampled:(parseInt(a,16)&1)==1}}function Do(e,t){if(!e||!t||t.length===0)return!1;let n;if(e instanceof URL)n=e;else try{n=new URL(e)}catch{return!1}for(let e of t)try{if(typeof e==`string`){if(Oo(n.hostname,e))return!0}else if(e instanceof RegExp){if(e.test(n.hostname))return!0}else if(typeof e==`function`&&e(n))return!0}catch{continue}return!1}function Oo(e,t){if(t===e)return!0;if(t.startsWith(`*.`)){let n=t.slice(2);if(e.endsWith(n)&&(e===n||e.endsWith(`.`+n)))return!0}return!1}function ko(e){let t=[];try{let n=new URL(e);t.push(n.hostname)}catch{}return t.push(`*.supabase.co`,`*.supabase.in`),t.push(`localhost`,`127.0.0.1`,`[::1]`),t}function Ao(e){"@babel/helpers - typeof";return Ao=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Ao(e)}function jo(e,t){if(Ao(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Ao(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Mo(e){var t=jo(e,`string`);return Ao(t)==`symbol`?t:t+``}function No(e,t,n){return(t=Mo(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Po(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Fo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Po(Object(n),!0).forEach(function(t){No(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Po(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Io=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),Lo=()=>Headers,Ro=e=>e.startsWith(`sb_publishable_`)||e.startsWith(`sb_secret_`),zo=`sb_temp_`,Bo=new Set,Vo=e=>{if(!e.startsWith(`sb_`)||Ro(e)||e.startsWith(zo))return;let t=e.match(/^sb_[a-zA-Z0-9]+_/)?.[0]??`unknown`;
1001Bo.has(t)||(Bo.add(t),console.warn(`@supabase/supabase-js: Unrecognized Supabase API key format. The client will proceed and send this key as-is; if you see authentication errors you may need to upgrade @supabase/supabase-js to a version that recognizes this key type.`))},Ho=(e,t,n,r,i,a)=>{let o=Io(r),s=Lo(),c=i?.enabled===!0,l=i?.respectSamplingDecision!==!1,u=c?ko(t):null,d=!(a?.omitApiKeyAsBearer&&Ro(e));return async(t,r)=>{let i=await n(),a=new s(r?.headers);if(a.has(`apikey`)||a.set(`apikey`,e),!a.has(`Authorization`)){let t=i??(d?e:null);t&&a.set(`Authorization`,`Bearer ${t}`)}if(u){let e=await Uo(t,u,l);e&&(e.traceparent&&!a.has(`traceparent`)&&a.set(`traceparent`,e.traceparent),e.tracestate&&!a.has(`tracestate`)&&a.set(`tracestate`,e.tracestate),e.baggage&&!a.has(`baggage`)&&a.set(`baggage`,e.baggage))}return o(t,Fo(Fo({},r),{},{headers:a}))}};async function Uo(e,t,n){if(!Do(typeof e==`string`||e instanceof URL?e:e.url,t))return null;let r=await To();if(!r||!r.traceparent)return null;if(n){let e=Eo(r.traceparent);if(e&&!e.isSampled)return null}return r}function Wo(e){return typeof e==`boolean`?{enabled:e}:e}function Go(e){return e.endsWith(`/`)?e:e+`/`}function Ko(e,t){let{db:n,auth:r,realtime:i,global:a}=e,{db:o,auth:s,realtime:c,global:l}=t,u=Wo(e.tracePropagation),d=Wo(t.tracePropagation),f={db:Fo(Fo({},o),n),auth:Fo(Fo({},s),r),realtime:Fo(Fo({},c),i),storage:{},global:Fo(Fo(Fo({},l),a),{},{headers:Fo(Fo({},l?.headers??{}),a?.headers??{})}),tracePropagation:{enabled:u?.enabled??d?.enabled??!1,respectSamplingDecision:u?.respectSamplingDecision??d?.respectSamplingDecision??!0},accessToken:async()=>``};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}function qo(e){let t=e?.trim();if(!t)throw Error(`supabaseUrl is required.`);if(!t.match(/^https?:\/\//i))throw Error(`Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.`);try{return new URL(Go(t))}catch{throw Error(`Invalid supabaseUrl: Provided URL is malformed.`)}}var Jo=class extends co{constructor(e){super(e)}},Yo=class{constructor(e,t,n){this.supabaseUrl=e,this.supabaseKey=t;let r=qo(e);if(!t)throw Error(`supabaseKey is required.`);Vo(t),this.realtimeUrl=new URL(`realtime/v1`,r),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace(`http`,`ws`),this.authUrl=new URL(`auth/v1`,r),this.storageUrl=new URL(`storage/v1`,r),this.functionsUrl=new URL(`functions/v1`,r);let i=`sb-${r.hostname.split(`.`)[0]}-auth-token`,a={db:_o,realtime:yo,auth:Fo(Fo({},vo),{},{storageKey:i}),global:go,tracePropagation:bo},o=Ko(n??{},a);this.settings=o,this.storageKey=o.auth.storageKey??``,this.headers=o.global.headers??{},o.accessToken?(this.accessToken=o.accessToken,this.auth=new Proxy({},{get:(e,t)=>{throw Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(t)} is not possible`)}})):this.auth=this._initSupabaseAuthClient(o.auth??{},this.headers,o.global.fetch),this.fetch=Ho(t,e,this._getSessionToken.bind(this),o.global.fetch,o.tracePropagation),this.functionsFetch=Ho(t,e,this._getSessionToken.bind(this),o.global.fetch,o.tracePropagation,{omitApiKeyAsBearer:!0}),this.realtime=this._initRealtimeClient(Fo({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},o.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(e=>this.realtime.setAuth(e)).catch(e=>console.warn(`Failed to set initial Realtime auth token:`,e)),this.rest=new Vt(new URL(`rest/v1`,r).href,{headers:this.headers,schema:o.db.schema,fetch:this.fetch,timeout:o.db.timeout,urlLengthLimit:o.db.urlLengthLimit}),this.storage=new oi(this.storageUrl.href,this.headers,this.fetch,n?.storage),o.accessToken||this._listenForAuthEvents()}get functions(){return new St(this.functionsUrl.href,{headers:this.headers,customFetch:this.functionsFetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}channel(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 _getSessionToken(){var e=this;if(e.accessToken)return await e.accessToken();let{data:t}=await e.auth.getSession();return t.session?.access_token??null}async _getAccessToken(){var e=this;return await e._getSessionToken()??e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,storageKey:a,flowType:o,lock:s,debug:c,throwOnError:l,experimental:u,lockAcquireTimeout:d,skipAutoInitialize:f},p,m){let h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new Jo({url:this.authUrl.href,headers:Fo(Fo({},h),p),storageKey:a,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,flowType:o,lock:s,debug:c,throwOnError:l,experimental:u,fetch:m,lockAcquireTimeout:d,skipAutoInitialize:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(e=>e.toLowerCase()===`authorization`)})}_initRealtimeClient(e){return new or(this.realtimeUrl.href,Fo(Fo({},e),{},{params:Fo(Fo({},{apikey:this.supabaseKey}),e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,`CLIENT`,t?.access_token)})}_handleTokenChanged(e,t,n){(e===`TOKEN_REFRESHED`||e===`SIGNED_IN`||e===`INITIAL_SESSION`)&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e===`SIGNED_OUT`&&(this.realtime.setAuth(),t==`STORAGE`&&this.auth.signOut(),this.changedAccessToken=void 0)}},Xo=(e,t,n)=>new Yo(e,t,n);function Zo(){if(typeof window<`u`||globalThis.Deno!==void 0)return!1;let e=globalThis.process;if(!e)return!1;let t=e.version;if(t==null)return!1;let n=t.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=20:!1}Zo()&&console.warn(`â ï¸ Node.js 20 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to N
1001ode.js 22 or later. For more information, visit: https://github.com/orgs/supabase/discussions/45715`);var Qo=Xo(`https://vrcuxdhflwbulwvtlbqq.supabase.co`,`sb_publishable_lAaomNpmVzWMvoVrmSpxfQ_Y57pbMPR`);function $o(){let{theme:e}=E(),[t,n]=(0,f.useState)(!0),r=(0,f.useRef)(null);return(0,f.useEffect)(()=>{if(!r.current)return;let n=`/bgm/${e===`productive`?`focus`:e===`rainy`?`rain`:e}.mp3`;r.current.src.endsWith(n)||(r.current.src=n,t||r.current.play().catch(()=>{}))},[e,t]),(0,f.useEffect)(()=>{r.current&&(t?r.current.pause():(r.current.play().catch(()=>{}),window.dispatchEvent(new Event(`bgm-play`))))},[t]),(0,f.useEffect)(()=>{let e=()=>n(!0);return window.addEventListener(`music-play`,e),window.addEventListener(`radio-play`,e),()=>{window.removeEventListener(`music-play`,e),window.removeEventListener(`radio-play`,e)}},[]),(0,x.jsxs)(`div`,{className:`bgm-player-wrapper`,children:[(0,x.jsxs)(`button`,{className:`bgm-toggle-btn ${t?``:`active`}`,onClick:()=>n(!t),title:`Toggle Ambient BGM`,children:[t?(0,x.jsx)(Ze,{size:18}):(0,x.jsx)(Xe,{size:18}),(0,x.jsx)(`span`,{className:`bgm-label`,children:`Ambience`})]}),(0,x.jsx)(`audio`,{ref:r,loop:!0}),(0,x.jsx)(`style`,{children:` 1002 .bgm-player-wrapper { 1003 pointer-events: auto; 1004 } 1005 .bgm-toggle-btn { 1006 display: flex; 1007 align-items: center; 1008 gap: 0; 1009 padding: 0.5rem; 1010 background: transparent; 1011 border: none; 1012 border-radius: 99px; 1013 color: var(--text-muted); 1014 font-family: 'Outfit', sans-serif; 1015 font-weight: 600; 1016 font-size: 0.8rem; 1017 cursor: pointer; 1018 transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 1019 } 1020 .bgm-toggle-btn:hover { 1021 color: var(--text-color); 1022 background: rgba(255,255,255,0.08); 1023 } 1024 .bgm-toggle-btn.active { 1025 color: var(--primary); 1026 background: rgba(255,255,255,0.1); 1027 } 1028 .bgm-toggle-btn.active, .bgm-toggle-btn:hover { 1029 gap: 0.5rem; 1030 padding-left: 1rem; 1031 padding-right: 1rem; 1032 } 1033 .bgm-label { 1034 max-width: 0; 1035 opacity: 0; 1036 overflow: hidden; 1037 white-space: nowrap; 1038 transition: max-width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease; 1039 } 1040 .bgm-toggle-btn.active .bgm-label, .bgm-toggle-btn:hover .bgm-label { 1041 max-width: 80px; 1042 opacity: 1; 1043 } 1044 `})]})}var es=[{id:`lofi-hiphop`,label:`Lofi Hip Hop Radio`,videoId:`rFZHOHl-L8A`},{id:`synthwave`,label:`Synthwave Radio`,videoId:`4xDzrJKXOOY`},{id:`sleep-lofi`,label:`Sleep Lofi Radio`,videoId:`VAlMDl00mYY`},{id:`sleep-ambient`,label:`Sleep Ambient Music`,videoId:`xORCbIptqcc`},{id:`synth-ambient`,label:`Synth Ambient Radio`,videoId:`GSfT7H87zq4`},{id:`jazz-lofi`,label:`Jazz Lofi Radio`,videoId:`E2vONfzoyRI`},{id:`asian-lofi`,label:`Asian Lofi Radio`,videoId:`1Tl2FtV06qo`},{id:`sad-lofi`,label:`Sad Lofi Radio`,videoId:`CwPCy1GLS38`},{id:`bossa-lofi`,label:`Bossa Lofi Radio`,videoId:`56llPN9tS88`},{id:`sleep-hiphop`,label:`Lofi Hip Hop to Sleep`,videoId:`JD-kMIpDfnY`},{id:`relaxing-piano`,label:`Relaxing Piano Radio`,videoId:`N0snMcR6aaA`},{id:`relaxing-jazz`,label:`Relaxing Jazz Music`,videoId:`A8jDx9TLMQc`},{id:`study-with-me`,label:`Study Pomodoro Radio`,videoId:`qGohtGC5Rtk`},{id:`christmas-lofi`,label:`Christmas Lofi Radio`,videoId:`XSXEaikz0Bc`},{id:`halloween-lofi`,label:`Halloween Lofi Radio`,videoId:`3GQY80jyysQ`},{id:`fireplace-ambience`,label:`Fireplace Ambient Radio`,videoId:`q_4KI-ChIIs`},{id:`chill-guitar`,label:`Chill Guitar Radio`,videoId:`E_XmwjgRLz8`},{id:`medieval-lofi`,label:`Medieval Lofi Radio`,videoId:`IxPANmjPaek`},{id:`gentle-rain`,label:`Rain Ambient Music`,videoId:`-OekvEFm1lo`},{id:`dark-ambient`,label:`Dark Ambient Music`,videoId:`S_MOd40zlYU`}];function ts(){let[e,t]=(0,f.useState)(null),[n,r]=(0,f.useState)(!1),[i,a]=(0,f.useState)(!1),[o,s]=(0,f.useState)(es[0].id),[c,l]=(0,f.useState)(!1),[u,d]=(0,f.useState)(!1),[p,m]=(0,f.useState)({top:0,left:0}),[h,g]=(0,f.useState)(!1),_=(0,f.useRef)(null),v=(0,f.useRef)(null),y=(0,f.useRef)(null),b=(0,f.useRef)([]),S=(0,f.useRef)(!1);(0,f.useEffect)(()=>
1044{if(window.YT)window.YT&&window.YT.Player&&n();else{let e=document.createElement(`script`);e.src=`https://www.youtube.com/iframe_api`;let t=document.getElementsByTagName(`script`)[0];t.parentNode.insertBefore(e,t),window.onYouTubeIframeAPIReady=()=>{n()}}function n(){let e=`youtube-radio-player-`+Math.random().toString(36).substr(2,9),n=document.createElement(`div`);n.id=e,_.current.appendChild(n),new window.YT.Player(e,{height:`1`,width:`1`,videoId:es[0].videoId,playerVars:{autoplay:0,controls:0,disablekb:1,fs:0,modestbranding:1},events:{onReady:e=>{t(e.target),a(!0)},onStateChange:e=>{e.data===window.YT.PlayerState.PLAYING?(window.stopLocalMusic&&window.stopLocalMusic(),r(!0),g(!1),window.dispatchEvent(new Event(`radio-play`)),b.current.forEach(e=>{e&&(e.pause(),e.currentTime=0)})):(e.data===window.YT.PlayerState.PAUSED||e.data===window.YT.PlayerState.ENDED)&&r(!1)},onError:()=>{g(!0),r(!1)}}})}return()=>{e&&e.destroy&&e.destroy()}},[]),(0,f.useEffect)(()=>{let t=()=>{e&&n&&e.pauseVideo()};return window.addEventListener(`music-play`,t),window.addEventListener(`bgm-play`,t),()=>{window.removeEventListener(`music-play`,t),window.removeEventListener(`bgm-play`,t)}},[e,n]),(0,f.useEffect)(()=>{let e=e=>{y.current&&!y.current.contains(e.target)&&v.current&&!v.current.contains(e.target)&&O()},t=()=>{if(c&&v.current){let e=v.current.getBoundingClientRect();m({top:e.bottom+12,left:e.left})}};return c&&(document.addEventListener(`mousedown`,e),window.addEventListener(`resize`,t),t()),()=>{document.removeEventListener(`mousedown`,e),window.removeEventListener(`resize`,t)}},[c,n]),window.stopLiveRadio=()=>{e&&n&&e.pauseVideo(),r(!1)};let C=(0,f.useRef)(!1),w=t=>{t.stopPropagation(),!(!e||!i)&&(n?e.pauseVideo():(window.stopLocalMusic&&window.stopLocalMusic(),C.current?e.playVideo():(C.current=!0,e.loadVideoById(T.videoId)),window.dispatchEvent(new Event(`radio-play`))))},T=es.find(e=>e.id===o)||es[0],E=es.findIndex(e=>e.id===o),ee=()=>{S.current=n},D=t=>{let n=es[parseInt(t.target.value,10)];if(n&&n.id!==o&&(s(n.id),e&&i&&(e.pauseVideo(),!b.current.some(e=>e&&!e.paused)))){let e=b.current[Math.floor(Math.random()*b.current.length)];e&&(e.volume=.5,e.play().catch(e=>console.log(`Tuning audio play failed:`,e)))}},te=t=>{let n=es[parseInt(t.target.value,10)];n&&e&&i&&(window.stopLocalMusic&&window.stopLocalMusic(),r(!0),e.loadVideoById(n.videoId),window.dispatchEvent(new Event(`radio-play`))),b.current.forEach(e=>{})},O=()=>{d(!0),setTimeout(()=>{l(!1),d(!1)},200)};return(0,x.jsxs)(`div`,{className:`live-radio-wrapper`,children:[(0,x.jsx)(`div`,{ref:_,style:{position:`absolute`,width:`1px`,height:`1px`,overflow:`hidden`,opacity:0,pointerEvents:`none`}}),(0,x.jsx)(`audio`,{ref:e=>b.current[0]=e,src:`/tuning.mp3`,loop:!0}),(0,x.jsx)(`audio`,{ref:e=>b.current[1]=e,src:`/tuning2.mp3`,loop:!0}),(0,x.jsxs)(`button`,{ref:v,className:`bgm-toggle-btn ${n?`active`:``}`,onClick:()=>{c?O():u||l(!0)},title:`Live Radio`,style:{position:`relative`},children:[(0,x.jsx)(je,{size:18}),(0,x.jsx)(`span`,{className:`bgm-label`,children:`FM Radio`}),h&&(0,x.jsx)(`span`,{style:{position:`absolute`,top:`4px`,right:`4px`,width:`8px`,height:`8px`,borderRadius:`50%`,background:`#f87171`,boxShadow:`0 0 6px #f87171`},title:`Stream broken!`})]}),(c||u)&&(0,et.createPortal)((0,x.jsxs)(`div`,{className:`tuner-popup ${u?`ui-modal-exit`:`ui-modal-enter`} ${n?`tuner-playing-glow`:``}`,ref:y,style:{top:p.top,left:p.left,position:`fixed`},children:[(0,x.jsxs)(`div`,{className:`tuner-header`,children:[(0,x.jsxs)(`span`,{className:`tuner-frequency digital-readout`,children:[`FM `,(88+E*(20/Math.max(1,es.length-1))).toFixed(1)]}),(0,x.jsxs)(`div`,{className:`tuner-title-container`,children:[(0,x.jsx)(`div`,{className:`title-visualizer-bg`,children:[...Array(12)].map((e,t)=>(0,x.jsx)(`div`,{className:`title-vis-bar ${n?`playing`:``}`,style:{animationDelay:`${Math.random()*.5}s`}},t))}),(0,x.jsx)(`span`,{className:`tuner-title`,children:T.label}),h&&(0,x.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:`5px`,fontSize:`0.68rem`,color:`rgba(248,113,113,0.9)`,fontWeight:600,background:`rgba(15, 10, 20, 0.55)`,backdropFilter:`blur(10px)`,WebkitBackdropFilter:`blur(10px)`,border:`1px solid rgba(248,113,113,0.25)`,borderRadius:`8px`,padding:`3px 9px`,marginLeft:`8px`,whiteSpace:`nowrap`,letterSpacing:`0.04em`,textTransform:`uppercase`},children:[(0,x.jsx)(qe,{size:10,strokeWidth:2.5}),`Stream offline`]})]})]}),(0,x.jsxs)(`div`,{className:`tuner-dial-container`,children:[(0,x.jsx)(`div`,{className:`tuner-scale`,children:[...Array(31)].map((e,t)=>(0,x.jsxs)(`div`,{className:`tuner-tick-wrapper`,children:[t%6==0&&(0,x.jsx)(`span`,{className:`tuner-tick-label`,children:88+t/6*4}),(0,x.jsx)(`div`,{className:`tuner-tick ${t%6==0?`major`:``}`})]},t))}),(0,x.jsx)(`div`,{className:`tuner-needle`,style:{left:`${E/Math.max(1,es.length-1)*90+5}%`}})]}
1044),(0,x.jsxs)(`div`,{className:`tuner-controls`,children:[(0,x.jsx)(`button`,{className:`tuner-play-btn ${n?`playing`:``}`,onClick:w,children:n?(0,x.jsx)(Te,{size:20,fill:`currentColor`}):(0,x.jsx)(Oe,{size:20,fill:`currentColor`})}),(0,x.jsx)(`div`,{className:`tuner-slider-wrapper`,children:(0,x.jsx)(`input`,{type:`range`,min:`0`,max:es.length-1,step:`1`,value:E,onMouseDown:ee,onTouchStart:ee,onChange:D,onMouseUp:te,onTouchEnd:te,className:`tuner-knob-slider`,title:`Drag to tune`})})]})]}),document.body),(0,x.jsx)(`style`,{children:` 1045 .live-radio-wrapper { 1046 position: relative; 1047 pointer-events: auto; 1048 } 1049 1050 .tuner-popup { 1051 width: 280px; 1052 padding: 16px; 1053 display: flex; 1054 flex-direction: column; 1055 gap: 16px; 1056 z-index: 9999; 1057 border-radius: 16px; 1058 background: var(--sidebar-bg); 1059 backdrop-filter: blur(28px); 1060 border: 1px solid rgba(255, 255, 255, 0.1); 1061 box-shadow: 0 10px 40px rgba(0,0,0,0.5); 1062 transition: box-shadow 0.5s ease; 1063 } 1064 1065 .tuner-playing-glow { 1066 box-shadow: 0 10px 40px rgba(0,0,0,0.5), 0 0 20px rgba(168, 85, 247, 0.05); 1067 } 1068 1069 .tuner-header { 1070 display: flex; 1071 flex-direction: column; 1072 align-items: center; 1073 gap: 6px; 1074 background: rgba(0,0,0,0.15); 1075 padding: 14px 10px; 1076 border-radius: 8px; 1077 box-shadow: inset 0 2px 8px rgba(0,0,0,0.2); 1078 } 1079 1080 .tuner-frequency { 1081 font-size: 26px; 1082 font-weight: 600; 1083 color: var(--primary); 1084 letter-spacing: 1.5px; 1085 font-family: 'DM Mono', monospace; 1086 opacity: 0.95; 1087 text-shadow: 0 0 10px rgba(168, 85, 247, 0.2); 1088 } 1089 1090 .tuner-title-container { 1091 position: relative; 1092 width: 100%; 1093 display: flex; 1094 justify-content: center; 1095 align-items: center; 1096 padding-top: 6px; 1097 padding-bottom: 2px; 1098 overflow: hidden; 1099 } 1100 1101 .title-visualizer-bg { 1102 position: absolute; 1103 inset: 0; 1104 display: flex; 1105 align-items: flex-end; 1106 justify-content: center; 1107 gap: 4px; 1108 z-index: 0; 1109 pointer-events: none; 1110 filter: blur(1px); 1111 } 1112 1113 .title-vis-bar { 1114 flex: 1; 1115 max-width: 12px; 1116 background: var(--primary); 1117 border-radius: 2px; 1118 height: 2px; 1119 opacity: 0.05; 1120 transition: height 0.2s ease, opacity 0.2s ease; 1121 } 1122 1123 .title-vis-bar.playing { 1124 opacity: 0.15; 1125 animation: ghostEq 1s ease-in-out infinite alternate; 1126 } 1127 1128 @keyframes ghostEq { 1129 0% { height: 2px; } 1130 50% { height: 100%; } 1131 100% { height: 30%; } 1132 } 1133 1134 .tuner-title { 1135 position: relative; 1136 z-index: 1; 1137 font-size: 11px; 1138 font-weight: 600; 1139 color: var(--text-color); 1140 text-transform: uppercase; 1141 letter-spacing: 0.5px; 1142 } 1143 1144 .tuner-dial-container { 1145 position: relative; 1146 height: 60px; 1147 background: rgba(0, 0, 0, 0.35); 1148 border-radius: 8px; 1149 border: 1px solid rgba(255, 255, 255, 0.08); 1150 box-shadow: inset 0 6px 16px rgba(0,0,0,0.6); 1151 overflow: hidden; 1152 margin-bottom: 8px; 1153 } 1154 1155 .tuner-dial-container::after { 1156 content: ''; 1157 position: absolute; 1158 top: 0; 1159 left: 0; 1160 right: 0; 1161 height: 45%; 1162 background: linear-gradient(to bottom, rgba(255,255,255,0.06), transparent); 1163 pointer-events: none; 1164 } 1165 1166 .tuner-scale { 1167 display: flex; 1168 align-items: flex-end; 1169 justify-content: space-between; 1170 height: 100%; 1171 padding: 0 5% 10px 5%; 1172 } 1173 1174 .tuner-tick-wrapper { 1175 display: flex; 1176 flex-direction: column; 1177 align-items: center; 1178 position: relative; 1179 height: 100%; 1180 justify-content: flex-end; 1181 } 1182 1183 .tuner-tick { 1184 width: 2px; 1185 height: 10px; 1186 background: rgba(255,255,255,0.15); 1187 border-radius: 2px; 1188 } 1189 1190 .tuner-tick.major { 1191 height: 18px; 1192 background: rgba(255,255,255,0.4); 1193 } 1194 1195 .tuner-tick-label { 1196 position: absolute; 1197 top: 10px; 1198 font-size: 10px; 1199 font-weight: 600; 1200 color: rgba(255,255,255,0.3); 1201 font-family: 'DM Mono', monospace; 1202 letter-spacing: 0.5px; 1203 } 1204 1205 .tuner-needle { 1206 position: absolute; 1207 bottom: 0; 1208 width: 2px; 1209 height: 100%; 1210 background: #ef4444; 1211 box-shadow: 0 0 4px #ef4444; 1212 transition: left 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); 1213 z-index: 2; 1214 } 1215
1216 .tuner-controls { 1217 display: flex; 1218 align-items: center; 1219 justify-content: space-between; 1220 gap: 12px; 1221 } 1222 1223 .tuner-play-btn { 1224 display: flex; 1225 align-items: center; 1226 justify-content: center; 1227 width: 44px; 1228 height: 44px; 1229 border-radius: 50%; 1230 background: rgba(255,255,255,0.05); 1231 color: var(--text-color); 1232 border: 1px solid rgba(255,255,255,0.1); 1233 cursor: pointer; 1234 transition: all 0.2s; 1235 } 1236 .tuner-play-btn:hover { 1237 background: rgba(255,255,255,0.1); 1238 transform: scale(1.05); 1239 } 1240 .tuner-play-btn.playing { 1241 color: var(--primary); 1242 border-color: var(--primary); 1243 background: rgba(168, 85, 247, 0.1); 1244 } 1245 1246 .tuner-slider-wrapper { 1247 flex: 1; 1248 display: flex; 1249 align-items: center; 1250 padding-left: 8px; 1251 } 1252 1253 .tuner-knob-slider { 1254 -webkit-appearance: none; 1255 width: 100%; 1256 height: 6px; 1257 background: rgba(0,0,0,0.3); 1258 border-radius: 4px; 1259 outline: none; 1260 border: 1px solid rgba(255,255,255,0.05); 1261 cursor: grab; 1262 } 1263 1264 .tuner-knob-slider:active { 1265 cursor: grabbing; 1266 } 1267 1268 .tuner-knob-slider::-webkit-slider-thumb { 1269 -webkit-appearance: none; 1270 appearance: none; 1271 width: 20px; 1272 height: 20px; 1273 border-radius: 50%; 1274 background: #444; 1275 border: 2px solid var(--primary); 1276 box-shadow: inset 0 2px 4px rgba(255,255,255,0.2), 0 0 10px rgba(168,85,247,0.4); 1277 cursor: pointer; 1278 transition: background 0.2s, transform 0.1s; 1279 } 1280 1281 .tuner-knob-slider::-moz-range-thumb { 1282 width: 20px; 1283 height: 20px; 1284 border-radius: 50%; 1285 background: #444; 1286 border: 2px solid var(--primary); 1287 box-shadow: inset 0 2px 4px rgba(255,255,255,0.2), 0 0 10px rgba(168,85,247,0.4); 1288 cursor: pointer; 1289 transition: background 0.2s, transform 0.1s; 1290 } 1291 1292 .tuner-knob-slider::-webkit-slider-thumb:hover { 1293 background: #555; 1294 transform: scale(1.1); 1295 } 1296 1297 .tuner-knob-slider:active::-webkit-slider-thumb { 1298 background: var(--primary); 1299 box-shadow: inset 0 2px 4px rgba(255,255,255,0.4), 0 0 15px rgba(168,85,247,0.8); 1300 } 1301 1302 .pop-in { 1303 animation: popIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; 1304 } 1305 1306 .pop-out { 1307 animation: popOut 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; 1308 } 1309 1310 @keyframes popIn { 1311 0% { opacity: 0; transform: scale(0.95) translateY(-10px); } 1312 100% { opacity: 1; transform: scale(1) translateY(0); } 1313 } 1314 1315 @keyframes popOut { 1316 0% { opacity: 1; transform: scale(1) translateY(0); } 1317 100% { opacity: 0; transform: scale(0.95) translateY(-10px); } 1318 } 1319 1320 .anim-pulse { 1321 animation: iconPulse 1.5s infinite ease-in-out; 1322 } 1323 @keyframes iconPulse { 1324 0%, 100% { transform: scale(1); opacity: 1; } 1325 50% { transform: scale(1.2); opacity: 0.7; } 1326 } 1327 `})]})}var ns=[{text:`You have survived 100% of your bad days. Keep going, you're doing great.`,author:`Reminder`},{text:`It's okay to rest. You are not a machine. Take a breath and start again when you're ready.`,author:`Self-Care`},{text:`Small steps are still progress. Don't be too hard on yourself for not having it all figured out today.`,author:`Encouragement`},{text:`You don't have to be perfect to be amazing. Give yourself permission to just be you today.`,author:`Acceptance`},{text:`Your productivity does not determine your worth. You are allowed to just exist and be happy.`,author:`Mental Health`},{text:`Every day is a fresh start. Leave yesterday's worries behind and focus on the step right in front of you.`,author:`Mindfulness`},{text:`Be kind to yourself. You are doing the best you can with what you have right now.`,author:`Compassion`},{text:`Focus on how far you've come, not just how far you have left to go. Be proud of your journey.`,author:`Perspective`},{text:`You are allowed to protect your peace. Trust your own path and take things one day at a time.`,author:`Boundaries`},{text:`Doubt kills more dreams than failure ever will. Believe in y
1327ourself just a little bit more today.`,author:`Motivation`},{text:`Storms don't last forever. Whatever you're going through, trust that brighter days are ahead.`,author:`Hope`},{text:`It is not the load that breaks you down, it's the way you carry it. Be gentle with your mind.`,author:`Wisdom`},{text:`You don't have to see the whole staircase, just take the first step.`,author:`Martin Luther King Jr.`},{text:`Breathe in peace, exhale stress. You control the energy you let into your life.`,author:`Calm`},{text:`Growth is rarely a straight line. Celebrate the messy, nonlinear journey you are on.`,author:`Growth`},{text:`Sometimes the most productive thing you can do is relax.`,author:`Mark Black`},{text:`You are allowed to say 'no' without explaining yourself. Your energy is precious.`,author:`Boundaries`},{text:`A flower does not think of competing with the flower next to it. It just blooms.`,author:`Zen Proverb`},{text:`You are stronger than your anxious thoughts. You are more than your hardest days.`,author:`Affirmation`},{text:`Don't rush the process. Good things take time, and so does healing.`,author:`Patience`},{text:`Your best is going to look different every day. And that is perfectly okay.`,author:`Grace`},{text:`If you get tired, learn to rest, not to quit.`,author:`Banksy`},{text:`You are entirely up to you. Make choices today that your future self will thank you for.`,author:`Empowerment`},{text:`There is no timeline for your life. You are exactly where you need to be right now.`,author:`Trust`},{text:`Nothing in nature blooms all year. Be patient with yourself when you are in your winter.`,author:`Patience`},{text:`Celebrate the small victories. Getting out of bed is a win. Drinking water is a win.`,author:`Perspective`},{text:`Let go of who you think you're supposed to be; embrace who you are.`,author:`Brené Brown`},{text:`You are a work in progress, and that is a beautiful thing.`,author:`Acceptance`},{text:`Give yourself the same grace you so freely give to others.`,author:`Self-Love`},{text:`Everything will be okay in the end. If it's not okay, it's not the end.`,author:`John Lennon`},{text:`Today is a good day to have a good day. Start with a smile.`,author:`Positivity`}];function rs(){let[e,t]=(0,f.useState)(!1),[n,r]=(0,f.useState)(null),[i,o]=(0,f.useState)(!1),c=(0,f.useRef)(null),[l,u]=a(`moodbyte_dailyQuote`,{date:``,text:``,author:``,isRead:!1});(0,f.useEffect)(()=>{if(i){let e=setTimeout(()=>{o(!1)},3e3);return()=>clearTimeout(e)}},[i]),(0,f.useEffect)(()=>{let e=e=>{c.current&&!c.current.contains(e.target)&&o(!1)};return i&&document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[i]),(0,f.useEffect)(()=>{let e=new Date().toISOString().split(`T`)[0];l.date!==e&&fetch(`https://api.quotable.io/quotes/random?tags=inspirational|motivational`).then(e=>{if(!e.ok)throw Error(`API Network response was not ok`);return e.json()}).then(t=>{if(t&&t.length>0)u({date:e,text:t[0].content,author:t[0].author,isRead:!1});else throw Error(`Empty quote data`)}).catch(t=>{console.log(`Quote API blocked or failed, falling back to local curated list.`,t);let n=ns[Math.floor(Math.random()*ns.length)];u({date:e,text:n.text,author:n.author,isRead:!1})})},[l.date,u]);let d=()=>{r({text:m,author:h}),t(!0),l.isRead||u(e=>({...e,isRead:!0}))},p=()=>{o(e=>!e)},m=l.text||`Your mind is a garden. Your thoughts are the seeds. You can grow flowers or you can grow weeds.`,h=l.author||`Osho`;return(0,x.jsxs)(x.Fragment,{children:[l.isRead?(0,x.jsxs)(`div`,{ref:c,children:[(0,x.jsx)(`button`,{className:`quote-orb pop-in`,onClick:p,title:`Daily Quote`,children:(0,x.jsx)(ze,{size:22,className:`orb-icon`})}),(0,x.jsxs)(`div`,{className:`quote-speech-bubble ${i?`open`:``}`,children:[(0,x.jsx)(Ae,{size:18,className:`bubble-quote-mark`}),(0,x.jsxs)(`div`,{className:`bubble-text`,children:[`"`,m,`"`]}),(0,x.jsxs)(`div`,{className:`bubble-author`,children:[`- `,h]})]})]}):(0,x.jsx)(`div`,{className:`quote-note-center pop-in`,onClick:d,title:`Open your daily quote`,children:(0,x.jsxs)(`div`,{className:`quote-note-body`,children:[(0,x.jsx)(ze,{size:28,className:`quote-note-sparkle`}),(0,x.jsx)(`span`,{children:`Daily Quote`}),(0,x.jsx)(`div`,{className:`quote-note-hint`,children:`Click to open`})]})}),e&&(0,et.createPortal)((0,x.jsx)(`div`,{className:`quote-modal-overlay fade-in`,onClick:()=>t(!1),children:(0,x.jsxs)(`div`,{className:`quote-modal-card pop-in`,onClick:e=>e.stopPropagation(),children:[(0,x.jsx)(`button`,{className:`quote-close-btn`,onClick:()=>t(!1),children:(0,x.jsx)(s,{size:20})}),(0,x.jsxs)(`div`,{className:`quote-content-wrapper`,children:[(0,x.jsx)(Ae,{size:40,className:`quote-mark`}),(0,x.jsxs)(`h2`,{className:`quote-text`,children:[`"`,n?.text||m,`"`]}),(0,x.jsxs)(`p`,{className:`quote-author`,children:[`- `,n?.author||h]})]})]})}),document.body),(0,x.jsx)(`style`,{children:` 1328 /* Centered Quote Note */ 1329 .quote-note-center { 1330 position: absolute; 1331 top: 50%; 1332 left: 50%; 1333 transform: translate(-50%, -50%); 1334 width: 160px; 1335 height: 160px; 1336 background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02)); 1337 backdrop-filter: blur(12px); 1338 border-radius: 4px; /* Note-like corners */ 1339 display: flex; 1340 flex-direction: column; 1341 align-items: center; 1342 justify-content: center; 1343 cursor: pointer; 1344 color: rgba(255,255,255,0.9); 1345 box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 0 20px rgba(255,255,255,0.05); 1346 transition: all 0.3s ease; 1347 z-index: 50; 1348 pointer-events: auto; 1349 } 1350 1351 /* Rainbow edge and glow */ 1352 .quote-note-center::before, .quote-note-center::after { 1353 content: ""; 1354 position: absolute; 1355 inset: -2px; 1356 border-radius: 6px; 1357 padding: 2px; /* Border thickness */ 1358 background: conic-gradient(from var(--border-angle), #00d4ff, #8a2be2, #00d4ff); 1359 -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); 1360 -webkit-mask-composite: xor; 1361 mask-composite: exclude; 1362 pointer-events: none; 1363 animation: spin-border 3s linear infinite; 1364 } 1365 1366 .quote-note-center::after { 1367 filter: blur(8px); 1368 opacity: 0.8; 1369 } 1370 1371 .quote-note-center:hover { 1372 transform: translate(-50%, -50%) scale(1.05); 1373 } 1374 1375 .quote-note-center:hover::before, .quote-note-center:hover::after { 1376 animation-duration: 1.5s; 1377 } 1378 1379 .quote-note-body { 1380 display: flex; 1381 flex-direction: column; 1382 align-items: center; 1383 gap: 12px; 1384 } 1385 1386 .quote-note-body span { 1387 font-family: 'Outfit', sans-serif; 1388 font-weight: 600; 1389 font-size: 0.95rem; 1390 letter-spacing: 0.05em; 1391 text-transform: uppercase; 1392 } 1393 1394 .quote-note-hint { 1395 font-family: 'Outfit', sans-serif; 1396 font-size: 0.7rem; 1397 opacity: 0.6; 1398 margin-top: -4px; 1399 } 1400 1401 .quote-note-sparkle { 1402 color: var(--primary); 1403 opacity: 0.9; 1404 } 1405 1406 @property --border-angle { 1407 syntax: "<angle>"; 1408 inherits: true; 1409 initial-value: 0turn; 1410 } 1411 1412 @keyframes spin-border { 1413 0% { --border-angle: 0turn; } 1414 100% { --border-angle: 1turn; } 1415 } 1416 1417 /* Bottom Left Orb */ 1418 .quote-orb { 1419 position: absolute; 1420 bottom: 1.5rem; 1421 left: 1.5rem; 1422 width: 48px; 1423 height: 48px; 1424 border-radius: 50%; 1425 background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02)); 1426 backdrop-filter: blur(8px); 1427 border: 1px solid rgba(255,255,255,0.2); 1428 display: flex; 1429 align-items: center; 1430 justify-content: center; 1431 cursor: pointer; 1432 color: rgba(255,255,255,0.8); 1433 box-shadow: 0 4px 15px rgba(0,0,0,0.2), inset 0 2px 10px rgba(255,255,255,0.05); 1434 transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 1435 z-index: 40; 1436 pointer-events: auto; 1437 } 1438 1439 .quote-orb:hover { 1440 transform: scale(1.1); 1441 color: white; 1442 border-color: rgba(255,255,255,0.4); 1443 box-shadow: 0 6px 20px rgba(0,0,0,0.3), inset 0 2px 15px rgba(255,255,255,0.1); 1444 } 1445 1446 /* Speech Bubble */ 1447 .quote-speech-bubble { 1448 position: absolute; 1449 bottom: 84px; /* 12px above orb */ 1450 left: 1rem; 1451 background: linear-gradient(135deg, rgba(20,20,30,0.85), rgba(10,10,15,0.95)); 1452 border: 1px solid rgba(255,255,255,0.15); 1453 backdrop-filter: blur(12px); 1454 padding: 1.2rem; 1455 border-radius: 16px; 1456 width: 280px; 1457 box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 2px 10px rgba(255,255,255,0.05); 1458 z-index: 45; 1459 color: white; 1460 1461 /* Animation */ 1462 transform-origin: 32px calc(100% + 10px); /* Origin exactly at tail tip */ 1463 opacity: 0; 1464 transform: scale(0.8) translateY(10px); 1465 pointer-events: none; 1466 transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); 1467 } 1468 1469 .quote-speech-bubble.open { 1470 opacity: 1; 1471 transform: scale(1) translateY(0); 1472 pointer-events: auto; 1473 } 1474 1475 /* Speech Bubble Tail Border */ 1476 .quote-speech-bubble::before { 1477 content: ""; 1478 position: absolute; 1479 bottom: -10px; 1480 left: 32px; /* points exactly to center of orb (16px left + 32px = 48px) */ 1481 border-width: 10px 10px 0 0; 1482 border-style: solid; 1483 border-color: rgba(255,255,255,0.15) transparent transparent transparent; 1484 } 1485 1486 /* Speech Bubble Tail Body */ 1487 .quote-speech-bubble::after { 1488 content: ""; 1489 position: absolute; 1490 bottom: -8px; 1491 left: 33px; 1492 border-width: 8px 8px 0 0; 1493 border-style: solid; 1494 border-color: rgba(12,12,18,0.95) transparent transparent transparent; 1495 } 1496 1497 .bubble-quote-mark { 1498 color: var(--primary); 1499 opacity: 0.8; 1500 margin-bottom: 4px; 1501 } 1502 1503 .bubble-text { 1504 font-family: 'Caveat', cursive; 1505 font-size: 1.3rem; 1506 line-height: 1.3; 1507 color: rgba(255,255,255,0.95); 1508 margin-bottom: 0.5rem; 1509 } 1510 1511 .bubble-author { 1512 font-family: 'Outfit', sans-serif; 1513 font-size: 0.75rem; 1514 color: var(--primary); 1515 opacity: 0.9; 1516 text-transform: uppercase; 1517 letter-spacing: 0.05em; 1518 font-weight: 500; 1519 } 1520 1521 .quote-orb.unread { 1522 animation: orb-pulse 2s infinite; 1523 } 1524 1525 .orb-icon { 1526 transition: transform 0.4s ease; 1527 } 1528 .quote-orb:hover .orb-icon { 1529 transform: rotate(15deg); 1530 } 1531 1532 .orb-badge { 1533 position: absolute; 1534 top: 0px; 1535 right: 2px; 1536 width: 10px; 1537 height: 10px; 1538 background: var(--primary); 1539 border-radius: 50%; 1540 border: 2px solid var(--bg-color); 1541 } 1542 1543 @keyframes orb-pulse { 1544 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.3); } 1545 70% { box-shadow: 0 0 0 12px rgba(255, 255, 255, 0); } 1546 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); } 1547 } 1548 1549 .quote-modal-overlay { 1550 position: fixed; 1551 inset: 0; 1552 background: rgba(0, 0, 0, 0.4); 1553 backdrop-filter: blur(8px); 1554 display: flex; 1555 align-items: center; 1556 justify-content: center; 1557 z-index: 9999; 1558 padding: 1rem; 1559 } 1560 1561 .quote-modal-card { 1562 background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02)); 1563 border: 1px solid rgba(255,255,255,0.3); 1564 border-radius: 4px; /* Note-like corners */ 1565 padding: 3rem 2.5rem; 1566 max-width: 500px; 1567 min-height: 320px; 1568 width: 100%; 1569 position: relative; 1570 box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 25px rgba(255,255,255,0.2), inset 0 0 30px rgba(255,255,255,0.05); 1571 text-align: center; 1572 color: rgba(255,255,255,0.95); 1573 display: flex; 1574 align-items: center; 1575 justify-content: center; 1576 } 1577 1578 .quote-close-btn { 1579 position: absolute; 1580 top: 1rem; 1581 right: 1rem; 1582 background: transparent; 1583 border: none; 1584 color: rgba(255,255,255,0.6); 1585 width: 32px; 1586 height: 32px; 1587 border-radius: 4px; 1588 display: flex; 1589 align-items: center; 1590 justify-content: center; 1591 cursor: pointer; 1592 transition: all 0.2s; 1593 } 1594 .quote-close-btn:hover { 1595 background: rgba(255,255,255,0.1); 1596 color: white; 1597 transform: rotate(90deg); 1598 } 1599 1600 .quote-content-wrapper { 1601 display: flex; 1602 flex-direction: column; 1603 align-items: center; 1604 gap: 1.5rem; 1605 width: 100%; 1606 } 1607 1608 .quote-mark { 1609 color: var(--primary); 1610 opacity: 0.8; 1611 margin-bottom: -10px; 1612 } 1613 1614 .quote-text { 1615 font-family: 'Caveat', cursive; 1616 font-size: 2.2rem; 1617 line-height: 1.4; 1618 color: white; 1619 font-weight: 400; 1620 text-shadow: 0 2px 10px rgba(0,0,0,0.4); 1621 margin: 0; 1622 letter-spacing: 0.02em; 1623 } 1624 1625 .quote-author { 1626 font-family: 'Outfit', sans-serif; 1627 font-size: 0.9rem; 1628 color: var(--primary); 1629 opacity: 0.9; 1630 letter-spacing: 0.05em; 1631 margin: 0; 1632 font-weight: 500; 1633 text-transform: uppercase; 1634 } 1635 1636 @media (max-width: 768px) { 1637 .quote-note-center { 1638 position: fixed; 1639 top: 40%; 1640 left: 50%; 1641 transform: translate(-50%, -50%); 1642 z-index: 8000; 1643 } 1644 .quote-note-center:hover { 1645 transform: translate(-50%, -50%) scale(1.05); 1646 } 1647 .quote-modal-card { 1648 padding: 2.5rem 1.5rem; 1649 } 1650 .quote-text { 1651 font-size: 1.8rem; 1652 } 1653 .quote-speech-bubble { 1654 left: 50%; 1655 width: calc(100vw - 32px); 1656 transform-origin: left bottom; 1657 transform: translateX(-50%) scale(0.8) translateY(10px); 1658 } 1659 .quote-speech-bubble.open { 1660 transform: translateX(-50%) scale(1) translateY(0); 1661 } 1662 .quote-speech-bubble::before { 1663 left: 32px; 1664 } 1665 .quote-speech-bubble::after { 1666 left: 33px; 1667 } 1668 } 1669 `})]})}function is(){let[e,t]=new Date().toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,hour12:!0}).split(` `);
1669return{hhmm:e,ampm:t}}function as({value:e,isColon:t}){return(0,x.jsx)(`span`,{className:t?`clock-colon`:`anim-digit`,children:e})}function os(){let[e,t]=(0,f.useState)(is());return(0,f.useEffect)(()=>{let e=setInterval(()=>t(is()),1e3);return()=>clearInterval(e)},[]),(0,x.jsxs)(`div`,{className:`live-clock-wrap`,children:[(0,x.jsx)(`div`,{className:`live-clock-digits`,children:e.hhmm.split(``).map((e,t)=>(0,x.jsx)(f.Fragment,{children:(0,x.jsx)(as,{value:e,isColon:e===`:`})},t))}),(0,x.jsx)(`span`,{className:`live-clock-ampm`,children:e.ampm}),(0,x.jsx)(`style`,{children:` 1670 .live-clock-wrap { 1671 display: flex; 1672 align-items: baseline; 1673 gap: 0; 1674 user-select: none; 1675 pointer-events: auto; 1676 cursor: default; 1677 } 1678 .live-clock-digits { 1679 display: flex; 1680 align-items: center; 1681 line-height: 1; 1682 } 1683 .anim-digit { 1684 display: inline-block; 1685 font-family: 'Outfit', sans-serif; 1686 font-size: 2.8rem; 1687 font-weight: 700; 1688 color: #fff; 1689 text-shadow: 0 2px 16px rgba(0,0,0,0.5); 1690 line-height: 1; 1691 letter-spacing: -0.02em; 1692 animation: digitSlideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) both; 1693 } 1694 .clock-colon { 1695 display: inline-block; 1696 font-family: 'Outfit', sans-serif; 1697 font-size: 2.8rem; 1698 font-weight: 700; 1699 color: #fff; 1700 text-shadow: 0 2px 16px rgba(0,0,0,0.5); 1701 line-height: 1; 1702 margin: 0 1px; 1703 } 1704 1705 /* AM/PM: hidden, slides out on hover */ 1706 .live-clock-ampm { 1707 font-family: 'Outfit', sans-serif; 1708 font-size: 1rem; 1709 font-weight: 600; 1710 color: rgba(255,255,255,0.7); 1711 text-transform: uppercase; 1712 letter-spacing: 0.1em; 1713 margin-bottom: 5px; 1714 margin-left: 0; 1715 max-width: 0; 1716 overflow: hidden; 1717 opacity: 0; 1718 white-space: nowrap; 1719 transition: max-width 0.35s cubic-bezier(0.22, 1, 0.36, 1), 1720 opacity 0.25s ease, 1721 margin-left 0.35s cubic-bezier(0.22, 1, 0.36, 1); 1722 } 1723 .live-clock-wrap:hover .live-clock-ampm { 1724 max-width: 3rem; 1725 opacity: 1; 1726 margin-left: 8px; 1727 } 1728 1729 @keyframes digitSlideUp { 1730 from { 1731 opacity: 0; 1732 transform: translateY(30%); 1733 } 1734 to { 1735 opacity: 1; 1736 transform: translateY(0%); 1737 } 1738 } 1739 1740 @media (max-width: 768px) { 1741 .anim-digit, .clock-colon { font-size: 2rem; } 1742 .live-clock-ampm { font-size: 0.75rem; } 1743 } 1744 `})]})}var ss=(0,f.lazy)(()=>G(()=>import(`./StatsModal-CNsn7PlC.js`),__vite__mapDeps([0,1,2,3]))),cs=(0,f.lazy)(()=>G(()=>import(`./SettingsModal-DaOiLs9x.js`),__vite__mapDeps([4,1,3]))),ls=(0,f.lazy)(()=>G(()=>import(`./SyncModal-BqG4SYDZ.js`),__vite__mapDeps([5,1,3]))),us=(0,f.lazy)(()=>G(()=>import(`./StudyDesk-BNzQxYkl.js`),__vite__mapDeps([6,1,3,7]))),ds=(0,f.lazy)(()=>G(()=>import(`./CalendarWidget-DTz6WwpM.js`),__vite__mapDeps([8,1,3]))),fs=(0,f.lazy)(()=>G(()=>import(`./CommunityWallModal-CsuJY1TI.js`),__vite__mapDeps([9,1,3]))),ps=[{name:`Lemon`,value:`#fef08a`},{name:`Honey`,value:`#fde68a`},{name:`Peach`,value:`#fed7aa`},{name:`Sand`,value:`#fef3c7`},{name:`Cream`,value:`#fef9c3`},{name:`Blush`,value:`#fecdd3`},{name:`Rose`,value:`#fbcfe8`},{name:`Salmon`,value:`#fca5a5`},{name:`Lavender`,value:`#e9d5ff`},{name:`Lilac`,value:`#d8b4fe`},{name:`Periwinkle`,value:`#c7d2fe`},{name:`Sky`,value:`#bae6fd`},{name:`Ice`,value:`#bfdbfe`},{name:`Baby Blue`,value:`#dbeafe`},{name:`Mint`,value:`#bbf7d0`},{name:`Sage`,value:`#a7f3d0`},{name:`Pistachio`,value:`#d9f99d`},{name:`White`,value:`#f8fafc`},{name:`Slate`,value:`#e2e8f0`},{name:`Blush White`,value:`#fff1f2`}],ms=[{label:`Kalam`,value:`'Kalam', cursive`},{label:`Caveat`,value:`'Caveat', cursive`},{label:`Indie Flower`,value:`'Indie Flower', cursive`},{label:`Shadow`,value:`'Shadows Into Light', cursive`},{label:`Architect`,value:`'Architects Daughter', cursive`},{label:`Marker`,value:`'Permanent Marker', cursive`},{label:`Pacifico`,value:`'Pacifico', cursive`},{label:`Dancing`,value:`'Dancing Script', cursive`},{label:`Lobster`,value:`'Lobster', cursive`}
1744,{label:`Abril`,value:`'Abril Fatface', cursive`},{label:`Rock Salt`,value:`'Rock Salt', cursive`},{label:`Typewriter`,value:`'Special Elite', cursive`},{label:`Courier`,value:`'Courier Prime', monospace`},{label:`Mono`,value:`'DM Mono', monospace`},{label:`8-Bit`,value:`'Press Start 2P', cursive`},{label:`Clean`,value:`'Outfit', sans-serif`}],hs=20;function gs(){let e=at(),[t,n]=a(`stickyNotes`,[]),[r,i]=a(`tasks`,[]),[o,c]=a(`calendarDayNotes`,{}),[l,u]=(0,f.useState)(null),[d,p]=(0,f.useState)(!1),[m,h]=(0,f.useState)(!1),[g,_]=(0,f.useState)(!1),[v,y]=(0,f.useState)(!1),[b,S]=(0,f.useState)(!1),[C,w]=(0,f.useState)(!1),[T,E]=(0,f.useState)(!1),[ee,D]=(0,f.useState)(!1),[re,ie]=(0,f.useState)(!1),[ae,k]=(0,f.useState)([]),[A,se]=(0,f.useState)(null);f.useEffect(()=>{Qo.auth.getSession().then(({data:{session:e}})=>se(e?.user||null));let{data:{subscription:e}}=Qo.auth.onAuthStateChange((e,t)=>se(t?.user||null));return()=>e.unsubscribe()},[]);let ce=e=>{i(r.map(t=>t.id===e?{...t,completed:!t.completed}:t))},le=(e,t)=>{c(n=>{let r={...n};return t.trim()?r[e]=t:delete r[e],r})},ue=f.useCallback(()=>{l&&(p(!0),setTimeout(()=>{u(null),p(!1)},160))},[l]);f.useEffect(()=>{let e=e=>{!e.target.closest(`.sticky-note`)&&!e.target.closest(`.notepad-stack`)&&ue()};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[ue]);let j=(0,f.useRef)(null),M=(0,f.useRef)({}),N=(0,f.useRef)({}),de=()=>{let e=Date.now().toString()+Math.random().toString(36).substr(2,5),t=window.innerWidth<=768,r=t?window.innerWidth:window.innerWidth-360,i=window.innerHeight,a=t?160:200,o=t?160:200,s=Math.max(20,r-a-20),c=Math.max(40,i-o-120),l=Math.floor(Math.random()*s)+10,u=Math.floor(Math.random()*c)+40,d=++hs,f={id:e,text:``,color:ps[0].value,font:ms[0].value,isPinned:!1,x:l,y:u,zIndex:d};N.current[e]={x:l,y:u},n(e=>[...e.filter((e,t,n)=>n.findIndex(t=>t.id===e.id)===t),f])},fe=(e,t)=>{t.x!==void 0&&(N.current[e]={x:t.x,y:t.y}),n(n=>n.map(n=>n.id===e?{...n,...t}:n))},pe=e=>{k(t=>[...t,e]),setTimeout(()=>{delete N.current[e],delete M.current[e],n(t=>t.filter(t=>t.id!==e)),k(t=>t.filter(t=>t!==e)),u(null),p(!1)},200)},me=()=>{t.length>0&&D(!0)},he=()=>{ie(!0),setTimeout(()=>{D(!1),ie(!1)},200)},_e=()=>{ie(!0),k(t.map(e=>e.id)),setTimeout(()=>{n([]),N.current={},D(!1),ie(!1),k([])},200)},ve=e=>{let t=++hs;M.current[e]&&(M.current[e].style.zIndex=t),n(n=>n.map(n=>n.id===e?{...n,zIndex:t}:n))},ye=(e,t,n)=>{if(ve(t),n||e.target.closest(`button`)||e.target.closest(`.popup-bubble`)||e.target.tagName===`TEXTAREA`||e.target.closest(`.task-sync-item`))return;e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId);let r=N.current[t]||{x:0,y:0};j.current={id:t,startMouseX:e.clientX,startMouseY:e.clientY,startNoteX:r.x,startNoteY:r.y,moved:!1},u(null)},be=(t,n)=>{if(!j.current||j.current.id!==n)return;t.preventDefault();let r=t.clientX-j.current.startMouseX,i=t.clientY-j.current.startMouseY,a=j.current.startNoteX+r,o=j.current.startNoteY+i;e&&(a=Math.max(0,Math.min(a,window.innerWidth-160)),o=Math.max(0,Math.min(o,window.innerHeight-160-80))),j.current.currentX=a,j.current.currentY=o,j.current.moved=!0;let s=M.current[n];s&&(s.style.left=`${a}px`,s.style.top=`${o}px`)},xe=(e,t)=>{if(!(!j.current||j.current.id!==t)){if(e.currentTarget.releasePointerCapture(e.pointerId),j.current.moved){let{currentX:e,currentY:r}=j.current;N.current[t]={x:e,y:r},n(n=>n.map(n=>n.id===t?{...n,x:e,y:r}:n))}j.current=null}},Se=(e,t,n)=>{e.stopPropagation(),l&&l.id===t&&l.type===n?ue():(p(!1),u({id:t,type:n}))};return t.forEach(e=>{N.current[e.id]||(N.current[e.id]={x:e.x,y:e.y})}),(0,x.jsxs)(`div`,{className:`sticky-board`,onClick:()=>u(null),children:[(0,x.jsxs)(`div`,{className:`top-left-wrapper`,children:[(0,x.jsxs)(`div`,{className:`top-left-control
1744s`,children:[(0,x.jsx)($o,{}),(0,x.jsx)(ts,{}),(0,x.jsx)(`div`,{className:`nav-separator`}),(0,x.jsxs)(`button`,{className:`stats-btn`,onClick:e=>{e.stopPropagation(),y(!0)},title:`Settings`,children:[(0,x.jsx)(Pe,{size:18}),(0,x.jsx)(`span`,{className:`stats-label`,children:`Settings`})]}),(0,x.jsxs)(`button`,{className:`stats-btn`,onClick:e=>{e.stopPropagation(),h(!0)},title:`Your Stats`,children:[(0,x.jsx)(ne,{size:18}),(0,x.jsx)(`span`,{className:`stats-label`,children:`Stats`})]}),(0,x.jsxs)(`button`,{className:`stats-btn`,onClick:e=>{e.stopPropagation(),_(!0)},title:`Custom Themes`,children:[(0,x.jsx)(ge,{size:18}),(0,x.jsx)(`span`,{className:`stats-label`,children:`Themes`})]}),(0,x.jsxs)(`button`,{className:`stats-btn`,onClick:e=>{e.stopPropagation(),w(!0)},title:`Calendar`,children:[(0,x.jsx)(O,{size:18}),(0,x.jsx)(`span`,{className:`stats-label`,children:`Calendar`})]}),(0,x.jsxs)(`button`,{className:`stats-btn study-btn`,onClick:e=>{e.stopPropagation(),S(!0)},title:`Zen Study Mode`,children:[(0,x.jsx)(te,{size:18}),(0,x.jsx)(`span`,{className:`stats-label`,children:`Study Desk`})]})]}),(0,x.jsx)(`div`,{className:`live-clock-corner`,children:(0,x.jsx)(os,{})})]}),(0,x.jsx)(`button`,{className:`community-wall-btn`,onClick:e=>{e.stopPropagation(),E(!0)},title:`Community Wall`,children:(0,x.jsx)(Ye,{size:20})}),(0,x.jsxs)(f.Suspense,{fallback:null,children:[m&&(0,x.jsx)(ss,{onClose:()=>h(!1)}),g&&(0,x.jsx)(cs,{onClose:()=>_(!1)}),v&&(0,x.jsx)(ls,{onClose:()=>y(!1)}),b&&(0,x.jsx)(us,{onClose:()=>S(!1)}),C&&(0,x.jsx)(ds,{onClose:()=>w(!1)}),T&&(0,x.jsx)(fs,{onClose:()=>E(!1)})]}),ee&&(0,et.createPortal)((0,x.jsx)(`div`,{className:`custom-confirm-overlay ${re?`ui-overlay-exit`:`ui-overlay-enter`}`,onClick:he,children:(0,x.jsxs)(`div`,{className:`custom-confirm-modal ${re?`ui-modal-exit`:`ui-modal-enter`}`,onClick:e=>e.stopPropagation(),children:[(0,x.jsx)(`div`,{className:`confirm-icon-wrap`,children:(0,x.jsx)(Ke,{size:28})}),(0,x.jsx)(`h3`,{children:`Clear All Notes?`}),(0,x.jsx)(`p`,{children:`Are you sure you want to delete all notes? This action cannot be undone.`}),(0,x.jsxs)(`div`,{className:`confirm-actions`,children:[(0,x.jsx)(`button`,{className:`confirm-cancel`,onClick:he,children:`Cancel`}),(0,x.jsx)(`button`,{className:`confirm-danger`,onClick:_e,children:`Yes, Delete All`})]})]})}),document.body),e?(0,x.jsx)(`div`,{className:`mobile-fab-container`,children:(0,x.jsx)(`button`,{className:`mobile-fab add-fab`,onClick:e=>{e.stopPropagation(),de()},children:(0,x.jsx)(Ue,{size:22})})}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`notepad-stack`,onClick:e=>{e.stopPropagation(),de()},title:`New Note`,children:[(0,x.jsx)(`div`,{className:`pad-layer layer3`}),(0,x.jsx)(`div`,{className:`pad-layer layer2`}),(0,x.jsx)(`div`,{className:`pad-layer layer1`,children:(0,x.jsx)(`span`,{className:`pad-text`,children:`+ Write Note`})})]}),(0,x.jsx)(`div`,{className:`trash-stack`,onClick:e=>{e.stopPropagation(),me()},title:`Clear All Notes`,children:(0,x.jsx)(`div`,{className:`trash-layer`,children:(0,x.jsx)(Ke,{size:22})})})]}),(0,x.jsx)(rs,{}),t.map(e=>(N.current[e.id]||(N.current[e.id]={x:e.x,y:e.y}),(0,x.jsxs)(`div`,{ref:t=>{t&&(M.current[e.id]=t)},className:`sticky-note${e.isPinned?` pinned`:``} ${ae.includes(e.id)?`ui-modal-exit`:`ui-modal-enter`}`,style:{left:e.x,top:e.y,background:e.color,zIndex:e.zIndex||10},onPointerDown:t=>ye(t,e.id,e.isPinned),onPointerMove:t=>be(t,e.id),onPointerUp:t=>xe(t,e.id),onPointerCancel:t=>xe(t,e.id),onClick:e=>{e.stopPropagation()},children:[l?.id===e.id&&l.type===`color`&&(0,x.jsxs)(`div`,{className:`popup-bubble${d?` closing`:``}`,onClick:e=>e.stopPropagation(),children:[(0,x.jsx)(`div`,{className:`popup-label`,children:`Color`}),(0,x.jsx)(`div`,{className:`color-grid`,children:ps.map(t=>(0,x.jsx)(`button`,{className:`color-swatch${e.color===t.value?` active`:``}`,style:{background:t.value},onClick:n=>{n.stopPropagation(),fe(e.id,{color:t.value})},title:t.name},t.value))}),(0,x.jsx)(`div`,{className:`popup-tail`})]}),l?.id===e.id&&l.type===`font`&&(0,x.jsxs)(`div`,{className:`popup-bubble font-popup${d?` closing`:``}`,onClick:e=>e.stopPropagation(),children:[(0,x.jsx)(`div`,{className:`popup-label`,children:`Font`}),ms.map(t=>(0,x.jsx)(`button`,{className:`font-choice${e.font===t.value?` active`:``}`,style:{fontFamily:t.value},onClick:n=>{n.stopPropagation(),fe(e.id,{font:t.value})},children:t.label},t.value)),(0,x.jsx)(`div`,{className:`popup-tail`})]}),l?.id===e.id&&l.type===`delete`&&(0,x.jsxs)(`div`,{className:`popup-bubble delete-popup${d?` closing`:``}`,onClick:e=>e.stopPropagation(),children:[(0,x.jsx)(`div`,{className:`popup-label`,children:`Delete note?`}),(0,x.jsxs)(`div`,{className:`delete-actions`,children:[(0,x.jsx)(`button`,{className:`del-confirm`,onClick:t=>{t.stopPropagation(),pe(e.id)},children:`Yes, delete`}),(0,x.jsx)(`button`,{className:`del-cancel`,onClick:e=>{e.stopPropagation(),ue()},children:`Cancel`})]}),(0,x.jsx)(`div`,{className:`popup-tail`})]}),(0,x.jsxs)(`div`,{className:`note-header`,children:[(0,x.jsx)(`button`,{className:`hdr-btn`,onClick:t=>{t.stopPropagation(),fe(e.id,{isPinned:!e.isPinned}),u(null)},title:e.isPinned?`Unpin`:`Pin`,children:e.isPinned?(0,x.jsx)(Ee,{size:14,fill:`currentColor`}):(0,x.jsx)(De,{size:14})}),(0,x.jsxs)(`div`,{className:`hdr-right`,children:[(0,x.jsx)(`button`,{className:`hdr-btn${l?.id===e.id&&l.type===`color`?` on`:``}`,onClick:t=>
1744Se(t,e.id,`color`),children:(0,x.jsx)(we,{size:14})}),(0,x.jsx)(`button`,{className:`hdr-btn${l?.id===e.id&&l.type===`font`?` on`:``}`,onClick:t=>Se(t,e.id,`font`),children:(0,x.jsx)(Je,{size:14})}),(0,x.jsx)(`button`,{className:`hdr-btn del`,onClick:t=>{t.stopPropagation(),Se(t,e.id,`delete`)},children:(0,x.jsx)(s,{size:15})})]})]}),e.type===`task-sync`?(0,x.jsxs)(`div`,{className:`task-sync-content`,style:{fontFamily:e.font||ms[0].value},children:[(0,x.jsx)(`div`,{className:`task-sync-title`,children:`Tasks`}),r.length===0&&(0,x.jsx)(`div`,{className:`task-sync-empty`,children:`No tasks yet.`}),(0,x.jsx)(`div`,{className:`task-sync-list`,children:r.map(e=>(0,x.jsxs)(`div`,{className:`task-sync-item ${e.completed?`completed`:``}`,onClick:t=>{t.stopPropagation(),ce(e.id)},children:[(0,x.jsx)(`div`,{className:`task-sync-check`,children:e.completed&&(0,x.jsx)(oe,{size:12,strokeWidth:3})}),(0,x.jsxs)(`span`,{className:`task-sync-text`,children:[e.text,e.calendarDate&&(0,x.jsxs)(`span`,{className:`task-sync-date`,children:[` `,new Date(e.calendarDate+`T12:00:00`).toLocaleDateString(void 0,{month:`short`,day:`numeric`})]})]})]},e.id))})]}):e.type===`calendar-sync`?(0,x.jsxs)(`div`,{className:`cal-sync-content`,style:{position:`relative`,width:`100%`,height:`100%`},children:[(0,x.jsx)(`textarea`,{value:o[e.dateKey]||``,onChange:t=>le(e.dateKey,t.target.value),placeholder:`type shi...`,style:{fontFamily:e.font||ms[0].value,height:`100%`,paddingBottom:`24px`}}),(0,x.jsx)(`div`,{className:`cal-sync-date-label`,children:new Date(e.dateKey+`T12:00:00`).toLocaleDateString(void 0,{month:`short`,day:`numeric`})})]}):(0,x.jsx)(`textarea`,{value:e.text,onChange:t=>fe(e.id,{text:t.target.value}),placeholder:`type shi...`,style:{fontFamily:e.font||ms[0].value}})]},e.id))),(0,x.jsx)(`style`,{jsx:`true`,children:` 1745 .sticky-board { 1746 position: absolute; inset: 0; 1747 pointer-events: none; 1748 /* No overflow:hidden â notes can peek anywhere */ 1749 } 1750 1751 /* ââ Custom Confirm Modal âââââââââââââââââââââââââââââââââââââââââââ */ 1752 .custom-confirm-overlay { 1753 position: fixed; inset: 0; 1754 background: rgba(0, 0, 0, 0.4); 1755 backdrop-filter: blur(4px); 1756 display: flex; align-items: center; justify-content: center; 1757 z-index: 10000; 1758 } 1759 .custom-confirm-modal { 1760 width: 90%; max-width: 320px; 1761 padding: 2rem; 1762 border-radius: 20px; 1763 display: flex; flex-direction: column; align-items: center; text-align: center; 1764 background: rgba(20, 25, 40, 0.85); 1765 border: 1px solid rgba(255, 255, 255, 0.1); 1766 box-shadow: 0 20px 50px rgba(0,0,0,0.5); 1767 } 1768 .confirm-icon-wrap { 1769 width: 56px; height: 56px; 1770 border-radius: 50%; 1771 background: rgba(239, 68, 68, 0.15); 1772 color: #ef4444; 1773 display: flex; align-items: center; justify-content: center; 1774 margin-bottom: 1rem; 1775 } 1776 .custom-confirm-modal h3 { 1777 margin: 0 0 0.5rem 0; font-size: 1.25rem; font-family: 'Outfit', sans-serif; color: var(--text-color); 1778 } 1779 .custom-confirm-modal p { 1780 margin: 0 0 1.5rem 0; font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; 1781 } 1782 .confirm-actions { 1783 display: flex; gap: 0.8rem; width: 100%; 1784 } 1785 .confirm-actions button { 1786 flex: 1; padding: 0.6rem; border-radius: 12px; font-weight: 600; font-size: 0.85rem; cursor: pointer; transition: all 0.2s; font-family: 'Outfit', sans-serif; 1787 } 1788 .confirm-cancel { 1789 background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: var(--text-muted); 1790 } 1791 .confirm-cancel:hover { 1792 background: rgba(255,255,255,0.1); color: var(--text-color); 1793 } 1794 .confirm-danger { 1795 background: #ef4444; border: none; color: white; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); 1796 } 1797 .confirm-danger:hover { 1798 background: #dc2626; transform: translateY(-2px); box-shadow: 0 6px 15px rgba(239, 68, 68, 0.4); 1799 } 1800 @keyframes popIn { 1801 from { opacity: 0; transform: scale(0.9); } 1802 to { opacity: 1; transform: scale(1); } 1803 } 1804 1805
1806 .top-left-controls { 1807 display: flex; 1808 align-items: center; 1809 gap: 0.2rem; 1810 padding: 0.3rem; 1811 background: rgba(11, 17, 32, 0.6); 1812 backdrop-filter: blur(20px); 1813 border: 1px solid rgba(255,255,255,0.08); 1814 border-radius: 99px; 1815 z-index: 50; 1816 pointer-events: auto; 1817 box-shadow: 0 4px 15px rgba(0,0,0,0.2); 1818 } 1819 1820 .top-left-wrapper { 1821 position: absolute; 1822 top: 1.5rem; 1823 left: 1.5rem; 1824 display: flex; 1825 flex-direction: column; 1826 align-items: flex-start; 1827 gap: 10px; 1828 z-index: 50; 1829 pointer-events: auto; 1830 } 1831 1832 .live-clock-corner { 1833 pointer-events: none; 1834 padding-left: 6px; 1835 } 1836 1837 .nav-separator { 1838 width: 1.5px; 1839 height: 18px; 1840 background: rgba(255,255,255,0.1); 1841 margin: 0 0.2rem; 1842 } 1843 1844 .community-wall-btn { 1845 position: absolute; 1846 top: 74px; 1847 right: calc(var(--sidebar-offset, 360px) + 32px); 1848 width: 44px; 1849 height: 44px; 1850 border-radius: 50%; 1851 background: rgba(15, 23, 42, 0.75); 1852 backdrop-filter: blur(8px); 1853 -webkit-backdrop-filter: blur(8px); 1854 border: 1px solid rgba(255,255,255,0.15); 1855 color: #fff; 1856 display: flex; 1857 align-items: center; 1858 justify-content: center; 1859 cursor: pointer; 1860 pointer-events: auto; 1861 box-shadow: 0 4px 12px rgba(0,0,0,0.3); 1862 transition: all 0.2s, right 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); 1863 z-index: 200; 1864 } 1865 .community-wall-btn:hover { 1866 background: rgba(15, 23, 42, 0.9); 1867 transform: scale(1.05); 1868 } 1869 1870 .stats-btn { 1871 display: flex; 1872 align-items: center; 1873 gap: 0; 1874 padding: 0.5rem; 1875 background: transparent; 1876 border: none; 1877 border-radius: 99px; 1878 color: var(--text-muted); 1879 font-family: 'Outfit', sans-serif; 1880 font-weight: 600; 1881 font-size: 0.8rem; 1882 cursor: pointer; 1883 transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 1884 } 1885 .stats-btn:hover { 1886 color: var(--text-color); 1887 background: rgba(255,255,255,0.08); 1888 } 1889 .stats-btn.active, .stats-btn:hover { 1890 gap: 0.5rem; 1891 padding-left: 1rem; 1892 padding-right: 1rem; 1893 } 1894 .stats-label { 1895 max-width: 0; 1896 opacity: 0; 1897 overflow: hidden; 1898 white-space: nowrap; 1899 transition: max-width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease; 1900 } 1901 .stats-btn.active .stats-label, .stats-btn:hover .stats-label { 1902 max-width: 80px; 1903 opacity: 1; 1904 } 1905 1906 /* ââ Peeking stack âââââââââââââââââââââââââââââââââââââââââââ */ 1907 .notepad-stack { 1908 position: absolute; 1909 bottom: -20px; right: var(--sidebar-offset, 360px); 1910 width: 130px; height: 80px; 1911 cursor: pointer; 1912 pointer-events: auto; 1913 transition: transform .3s cubic-bezier(.34,1.56,.64,1), right 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); 1914 z-index: 200; 1915 } 1916 .notepad-stack:hover { transform: translateY(-14px); } 1917 1918 .pad-layer { 1919 position: absolute; bottom: 0; width: 100%; 1920 border-radius: 3px 3px 0 0; 1921 border: 1px solid rgba(0,0,0,.06); border-bottom: none; 1922 box-shadow: 0 -3px 8px rgba(0,0,0,.08); 1923 padding-bottom: 20px; 1924 } 1925 .layer3 { height: 58px; right: -5px; transform: rotate(3.5deg); background: #fde68a; } 1926 .layer2 { height: 70px; right: -2px; transform: rotate(-2deg); background: #fef9c3; } 1927 .layer1 { 1928 height: 80px; right: 0; 1929 background: #fef08a; 1930 background-image: linear-gradient(to bottom, rgba(255,255,255,.35) 0%, transparent 100%); 1931 display: flex; align-items: flex-start; justify-content: center; 1932 padding-top: 18px; 1933 } 1934 .pad-text { font-family:'Kalam',cursive; font-size:1.05rem; color:#92400e; font-weight:700; } 1935 1936 /* ââ Peeking Trash âââââââââââââââââââââââââââââââââââââââââââ */ 1937 .trash-stack { 1938 position: absolute; 1939 bottom: -20px;
1939 right: calc(var(--sidebar-offset, 360px) + 150px); 1940 width: 50px; height: 80px; 1941 cursor: pointer; 1942 pointer-events: auto; 1943 transition: transform .3s cubic-bezier(.34,1.56,.64,1), right 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); 1944 z-index: 200; 1945 } 1946 .trash-stack:hover { transform: translateY(-14px); } 1947 1948 .trash-layer { 1949 position: absolute; bottom: 0; width: 100%; height: 80px; 1950 border-radius: 4px 4px 0 0; 1951 border: 1px solid rgba(0,0,0,.15); border-bottom: none; 1952 box-shadow: 0 -3px 8px rgba(0,0,0,.15); 1953 background: #ef4444; 1954 background-image: linear-gradient(to bottom, rgba(255,255,255,.2) 0%, transparent 100%); 1955 display: flex; align-items: flex-start; justify-content: center; 1956 padding-top: 16px; 1957 padding-bottom: 20px; 1958 color: #7f1d1d; 1959 } 1960 1961 /* ââ Note card âââââââââââââââââââââââââââââââââââââââââââââââ */ 1962 .sticky-note { 1963 position: absolute; 1964 width: 200px; height: 200px; 1965 padding: 8px 12px 12px; 1966 display: flex; flex-direction: column; 1967 pointer-events: auto; 1968 user-select: none; 1969 touch-action: none; 1970 cursor: grab; 1971 1972 /* Clean paper look */ 1973 border-radius: 1px; 1974 box-shadow: 1975 0 1px 2px rgba(0,0,0,.07), 1976 0 4px 10px rgba(0,0,0,.10), 1977 0 12px 28px rgba(0,0,0,.12); 1978 background-image: linear-gradient(160deg, rgba(255,255,255,.28) 0%, rgba(255,255,255,0) 100%); 1979 1980 /* NO transform here â we only move via left/top */ 1981 } 1982 1983 .sticky-note.pinned { cursor: default; } 1984 1985 .sticky-note:active:not(.pinned) { cursor: grabbing; } 1986 1987 /* ââ Header ââââââââââââââââââââââââââââââââââââââââââââââââââ */ 1988 .note-header { 1989 display: flex; justify-content: space-between; align-items: center; 1990 margin-bottom: 6px; 1991 opacity: 0; 1992 transition: opacity .15s; 1993 flex-shrink: 0; 1994 height: 22px; 1995 } 1996 .sticky-note:hover .note-header { opacity: 1; } 1997 1998 .hdr-right { display: flex; gap: 4px; } 1999 2000 .hdr-btn { 2001 display: flex; align-items: center; justify-content: center; 2002 width: 22px; height: 22px; border-radius: 4px; 2003 border: none; background: transparent; 2004 color: rgba(0,0,0,.45); cursor: pointer; 2005 transition: background .12s, color .12s; 2006 } 2007 .hdr-btn:hover { background: rgba(0,0,0,.08); color: rgba(0,0,0,.8); } 2008 .hdr-btn.on { background: rgba(0,0,0,.1); color: rgba(0,0,0,.9); } 2009 .hdr-btn.del:hover { background: rgba(220,38,38,.12); color: #dc2626; } 2010 2011 /* ââ Textarea ââââââââââââââââââââââââââââââââââââââââââââââââ */ 2012 .sticky-note textarea { 2013 flex: 1; width: 100%; 2014 background: transparent; border: none; resize: none; outline: none; 2015 color: #1c1917; font-size: 1.1rem; line-height: 1.45; 2016 cursor: text; 2017 } 2018 .sticky-note textarea::placeholder { color: rgba(28,25,23,.35); } 2019 2020 /* ââ Popups ââââââââââââââââââââââââââââââââââââââââââââââââââ */ 2021 .popup-bubble { 2022 position: absolute; 2023 top: 0; left: calc(100% + 8px); 2024 background: rgba(255,255,255,.97); 2025 backdrop-filter: blur(12px); 2026 border-radius: 12px; 2027 padding: 10px; 2028 box-shadow: 0 8px 28px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07); 2029 z-index: 300; 2030 animation: popIn .18s cubic-bezier(.34,1.56,.64,1) both; 2031 max-height: 280px; 2032 overflow-y: auto; 2033 } 2034 2035 .popup-bubble.font-popup { 2036 display: flex; flex-direction: column; gap: 2px; width: 148px; 2037 } 2038 2039 .popup-tail { 2040 position: absolute; 2041 left: -5px; top: 14px; 2042 width: 10px; height: 10px; 2043 background: rgba(255,255,255,.97); 2044 transform: rotate(45deg); 2045 border-left: 1px solid rgba(0,0,0,.07); 2046 border-bottom: 1px solid rgba(0,0,0,.07); 2047 } 2048 2049 @keyframes popIn { 2050 from { opacity:0; transform: translateX(-8px) scale(.92); } 2051 to { opacity:1; transform: translateX(0) scale(1); } 2052 } 2053 2054 @keyframes popOut { 2055 from { opacity:1; transform: translateX(0) scale(1); } 2056 to { opacity:0; transform: translateX(-8px) scale(.92); } 2057 } 2058 2059 .popup-bubble.closing { 2060 animation: popOut .16s cubic-bezier(0.4, 0, 1, 1) both; 2061 } 2062 2063 .popup-label { 2064 font-family: 'Outfit', sans-serif; 2065 font-size: .6rem; font-weight: 700; 2066 text-transform: uppercase; letter-spacing: .08em; 2067 color: #9ca3af; margin-bottom: 8px; 2068 } 2069 2070 /* Color grid */ 2071 .color-grid { display: flex; flex-wrap: wrap; gap: 6px; width: 120px; } 2072 2073 .color-swatch { 2074 width: 24px; height: 24px; border-radius: 50%; 2075 border: 2px solid transparent; cursor: pointer; flex-shrink: 0; 2076 box-shadow: 0 1px 3px rgba(0,0,0,.15); 2077 transition: transform .12s; 2078 } 2079 .color-swatch:hover { transform: scale(1.15); } 2080 .color-swatch.active { 2081 border-color: #3b82f6; 2082 box-shadow: 0 0 0 3px rgba(59,130,246,.22); 2083 transform: scale(1.15); 2084 } 2085 2086 /* Font list */ 2087 .font-choice { 2088 background: transparent; border: none; border-radius: 7px; 2089 padding: 6px 10px; text-align: left; cursor: pointer; 2090 font-size: 1rem; color: #374151; 2091 transition: background .1s; 2092 white-space: nowrap; 2093 } 2094 .font-choice:hover { background: rgba(0,0,0,.05); } 2095 /* Delete confirm */ 2096 .delete-popup { width: 148px; } 2097 .delete-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; } 2098 .del-confirm { 2099 background: #fef2f2; border: 1px solid #fecaca; 2100 color: #dc2626; font-size: 0.85rem; font-weight: 600; 2101 padding: 7px 10px; border-radius: 8px; cursor: pointer; 2102 transition: background .12s; 2103 font-family: 'Outfit', sans-serif; 2104 } 2105 .del-confirm:hover { background: #fee2e2; } 2106 .del-cancel { 2107 background: transparent; border: 1px solid rgba(0,0,0,.08); 2108 color: #6b7280; font-size: 0.85rem; 2109 padding: 6px 10px; border-radius: 8px; cursor: pointer; 2110 transition: background .12s; 2111 font-family: 'Outfit', sans-serif; 2112 } 2113 .del-cancel:hover { background: rgba(0,0,0,.04); } 2114 2115 /* ââ Mobile Overrides âââââââââââââââââââââââââââââââââââââââââââ */ 2116 @media (max-width: 768px) { 2117 .sticky-note { 2118 width: 160px !important; 2119 height: 160px !important; 2120 min-height: 160px !important; 2121 box-sizing: border-box !important; 2122 box-shadow: 0 4px 10px rgba(0,0,0,0.1); 2123 } 2124 .mobile-fab-container { 2125 position: fixed; 2126 bottom: 96px; /* above mobile nav */ 2127 right: 20px; 2128 display: flex; 2129 flex-direction: column; 2130 gap: 16px; 2131 z-index: 9999; 2132 } 2133 .mobile-fab { 2134 width: 56px; height: 56px; 2135 border-radius: 50%; 2136 display: flex; align-items: center; justify-content: center; 2137 border: none; 2138 box-shadow: 0 4px 20px rgba(0,0,0,0.4); 2139 color: white; 2140 cursor: pointer; 2141 } 2142 .mobile-fab.add-fab { 2143 background: #a855f7; /* Theme purple */ 2144 } 2145 .mobile-fab.trash-fab { 2146 background: #ef4444; /* Danger red */ 2147 } 2148 .notepad-stack, .trash-stack { 2149 display: none !important; 2150 }
2151 .top-left-controls { 2152 display: none !important; 2153 } 2154 .top-left-wrapper { 2155 display: none !important; 2156 } 2157 .note-header { 2158 opacity: 1 !important; 2159 } 2160 } 2161 /* ââ Task Sync Note âââââââââââââââââââââââââââââââââââââââââââ */ 2162 .task-sync-content { 2163 padding: 8px 10px; 2164 display: flex; 2165 flex-direction: column; 2166 height: calc(100% - 28px); 2167 box-sizing: border-box; 2168 color: rgba(0,0,0,0.85); 2169 cursor: default; 2170 } 2171 .task-sync-title { 2172 font-weight: bold; 2173 margin-bottom: 8px; 2174 font-size: 1.1em; 2175 border-bottom: 1px solid rgba(0,0,0,0.1); 2176 padding-bottom: 4px; 2177 } 2178 .task-sync-list { 2179 display: flex; 2180 flex-direction: column; 2181 gap: 6px; 2182 overflow-y: auto; 2183 flex: 1; 2184 scrollbar-width: thin; 2185 scrollbar-color: transparent transparent; 2186 } 2187 .task-sync-list:hover { 2188 scrollbar-color: rgba(0,0,0,0.2) transparent; 2189 } 2190 .task-sync-list::-webkit-scrollbar { width: 4px; } 2191 .task-sync-list::-webkit-scrollbar-thumb { background: transparent; border-radius: 4px; transition: background 0.3s ease; } 2192 .task-sync-list:hover::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); } 2193 .task-sync-empty { 2194 color: rgba(0,0,0,0.4); 2195 font-style: italic; 2196 font-size: 0.9em; 2197 } 2198 .task-sync-item { 2199 display: flex; 2200 align-items: flex-start; 2201 gap: 6px; 2202 cursor: pointer; 2203 font-size: 0.95em; 2204 line-height: 1.3; 2205 transition: opacity 0.2s; 2206 } 2207 .task-sync-item:hover { 2208 opacity: 0.8; 2209 } 2210 .task-sync-item.completed { 2211 opacity: 0.5; 2212 text-decoration: line-through; 2213 } 2214 .task-sync-check { 2215 width: 14px; 2216 height: 14px; 2217 border-radius: 3px; 2218 border: 1.5px solid rgba(0,0,0,0.3); 2219 margin-top: 2px; 2220 flex-shrink: 0; 2221 display: flex; 2222 align-items: center; 2223 justify-content: center; 2224 color: rgba(0,0,0,0.6); 2225 } 2226 .task-sync-item.completed .task-sync-check { 2227 border-color: rgba(0,0,0,0.6); 2228 } 2229 .task-sync-text { 2230 flex: 1; 2231 word-break: break-word; 2232 } 2233 .task-sync-date { 2234 font-size: 0.8em; 2235 opacity: 0.6; 2236 } 2237 2238 /* ââ Calendar Sync Note âââââââââââââââââââââââââââââââââââââââââââ */ 2239 .cal-sync-date-label { 2240 position: absolute; 2241 bottom: 5px; 2242 right: 5px; 2243 font-size: 0.8rem; 2244 opacity: 0.4; 2245 color: #000; 2246 pointer-events: none; 2247 font-family: 'Outfit', sans-serif; 2248 font-weight: 500; 2249 } 2250 2251 `})]})}var _s=`moodbyte-audio`,vs=`tracks`,ys=1;function bs(){return new Promise((e,t)=>{let n=indexedDB.open(_s,ys);n.onupgradeneeded=e=>{e.target.result.createObjectStore(vs,{keyPath:`id`})},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)})}async function xs(e,t){let n=await bs();return new Promise((r,i)=>{let a=n.transaction(vs,`readwrite`);a.objectStore(vs).put({id:e,blob:t}),a.oncomplete=r,a.onerror=i})}async function Ss(e){let t=await bs();return new Promise((n,r)=>{let i=t.transaction(vs,`readonly`).objectStore(vs).get(e);i.onsuccess=()=>n(i.result?.blob||null),i.onerror=r})}async function Cs(e){let t=await bs();return new Promise((n,r)=>{let i=t.transaction(vs,`readwrite`);i.objectStore(vs).delete(e),i.oncomplete=n,i.onerror=r})}var ws=({size:e=14})=>(0,x.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,x.jsx)(`path`,{d:`M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.419.12-.84-.12-.96-.54-.12-.42.12-.84.54-.96 4.56-1.02 8.52-.6 11.76 1.38.36.18.48.66.24 1.02zm1.44-3.3c-.301.42-.84.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.48.12-1.02-.12-1.14-.6-.12-.48.12-1.02.6-1.14 4.32-1.38 9.72-.72 13.439 1.56.42.24.6.84.301 1.26zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.18-1.2-.12-1.38-.72-.18-.6.12-1.2.72-1.38 4.2-1.26 11.28-1.02 15.721 1.62.539.3.719 1.02.42 1.56-.24.54-.9.72-1.56.3z`})});function Ts(e){return!e||isNaN(e)?`0:00`:`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,`0`)}`}function Es({isMobile:e=!1}){let t=(0,f.useRef)(null),n=(0,f.useRef)(null),r=(0,f.useRef)(null),[i,o]=a(`player_queue_meta`,[]),[c,l]=a(`player_currentIdx`,0),[u,d]=a(`player_volume`,.8),[p,m]=a(`player_shuffle`,!1),[h,g]=a(`player_repeat`,!1),[_,v]=(0,f.useState)(!1),[y,b]=(0,f.useState)(0),[S,C]=(0,f.useState)(0),[w,T]=(0,f.useState)(!1),[E,ee]=(0,f.useState)(!1),[D,te]=(0,f.useState)(!1),[O,ne]=(0,f.useState)(!1),[re,ie]=(0,f.useState)(!1),[ae,oe]=(0,f.useState)(``),[k,A]=(0,f.useState)(null),[se,ce]=a(`spotify_history`,[]),[le,ue]=(0,f.useState)(!1),[M,N]=(0,f.useState)(!1),[de,fe]=(0,f.useState)(!1),[me,he]=(0,f.useState)(null),[ge,_e]=(0,f.useState)(``),[ve,ye]=(0,f.useState)({}),be=(0,f.useRef)(null),xe=(0,f.useRef)(null),Ce=(0,f.useRef)(null),we=(0,f.useRef)(null),Ee=(0,f.useRef)(!1),[De,Ae]=(0,f.useState)(null),[je,Ne]=(0,f.useState)(null),Pe=i[c]||null,Re=Pe?{...Pe,url:ve[Pe.id]||``}:null;(0,f.useEffect)(()=>{i.length!==0&&(async()=>{let e={};for(let t of i){let n=await Ss(t.id);n&&(e[t.id]=URL.createObjectURL(n))}ye(e)})()},[]),(0,f.useEffect)(()=>{let e=t.current,n=Re?.url;!e||!n||(e.src=n,e.load(),Ee.current&&=(e.play().catch(()=>{}),!1))},[Re?.url]),(0,f.useEffect)(()=>
2251{if(Ce.current){let e=Ce.current.parentElement,t=Ce.current.children[0];e&&t&&fe(t.scrollWidth>e.clientWidth)}},[Re?.name]),(0,f.useEffect)(()=>{let e=t.current;if(!e)return;let n=()=>b(e.currentTime),r=()=>C(e.duration),i=()=>Be(!0),a=()=>v(!0),o=()=>v(!1);return e.addEventListener(`timeupdate`,n),e.addEventListener(`durationchange`,r),e.addEventListener(`ended`,i),e.addEventListener(`play`,a),e.addEventListener(`pause`,o),()=>{e.removeEventListener(`timeupdate`,n),e.removeEventListener(`durationchange`,r),e.removeEventListener(`ended`,i),e.removeEventListener(`play`,a),e.removeEventListener(`pause`,o)}},[i,p,h,c]),(0,f.useEffect)(()=>{t.current&&(t.current.volume=w?0:u)},[u,w]),window.stopLocalMusic=()=>{t.current&&t.current.pause(),v(!1),Ee.current=!1,A(e=>e&&(setTimeout(()=>A({...e}),50),null))};let ze=()=>{!t.current||!Re||(_?t.current.pause():(window.stopLiveRadio&&window.stopLiveRadio(),t.current.play().catch(()=>{}),window.dispatchEvent(new Event(`music-play`))))};(0,f.useEffect)(()=>{let e=()=>{t.current&&t.current.pause(),v(!1),Ee.current=!1,A(e=>{if(e){let t={...e};return setTimeout(()=>A(t),50),null}return e})};return window.addEventListener(`bgm-play`,e),window.addEventListener(`radio-play`,e),()=>{window.removeEventListener(`bgm-play`,e),window.removeEventListener(`radio-play`,e)}},[]),(0,f.useEffect)(()=>{let e=()=>{document.activeElement&&document.activeElement.tagName===`IFRAME`&&window.dispatchEvent(new Event(`music-play`))};return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[]);let Be=(0,f.useCallback)((e=!1)=>{if(i.length===0)return;if(h===`one`){t.current.currentTime=0,t.current.play().catch(()=>{});return}let n;if(p)n=Math.floor(Math.random()*i.length);else if(n=(c+1)%i.length,n===0&&e&&h!==`all`){t.current.pause(),v(!1);return}Ee.current=!0,l(n)},[i,c,p,h]),Ve=()=>{let e=t.current;if(e){if(e.currentTime>3){e.currentTime=0;return}Ee.current=!0,l(e=>(e-1+i.length)%i.length)}},He=e=>{let n=r.current.getBoundingClientRect(),i=Math.max(0,Math.min(1,(e.clientX-n.left)/n.width));t.current.currentTime=i*S};(0,f.useEffect)(()=>{let e=e=>{let{action:t}=e.detail;t===`play`&&(_||ze()),t===`pause`&&_&&ze(),t===`next`&&Be(!1),t===`prev`&&Ve()},t=()=>{window.dispatchEvent(new CustomEvent(`zen-player-state`,{detail:{isPlaying:_,currentTrack:Re?.name,isSpotify:!!k}}))};return window.addEventListener(`zen-player-command`,e),window.addEventListener(`zen-player-request-state`,t),()=>{window.removeEventListener(`zen-player-command`,e),window.removeEventListener(`zen-player-request-state`,t)}},[_,Re,Be,k]),(0,f.useEffect)(()=>{window.dispatchEvent(new CustomEvent(`zen-player-state`,{detail:{isPlaying:_,currentTrack:Re?.name,isSpotify:!!k}}))},[_,Re?.name,k]);let Ue=async e=>{let t=Array.from(e.target.files);if(!t.length)return;let n=t.map(e=>({id:`${e.name}-${Date.now()}`,name:e.name.replace(/\.[^.]+$/,``)})),r={};await Promise.all(t.map(async(e,t)=>{await xs(n[t].id,e),r[n[t].id]=URL.createObjectURL(e)})),ye(e=>({...e,...r})),o(e=>(e.length===0&&(Ee.current=!0,l(0)),[...e,...n])),e.target.value=``},We=e=>{Cs(e),ye(t=>{let n={...t};return delete n[e],n}),o(n=>{let r=n.findIndex(t=>t.id===e),i=n.filter(t=>t.id!==e);return i.length===0?(l(0),v(!1),t.current?.pause()):r<=c&&l(e=>Math.max(0,e-1)),i})},Ge=(e,t)=>{Ae(t),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t)},qe=(e,t)=>{e.preventDefault(),!(De===null||De===t)&&Ne(t)},Je=()=>{if(De!==null&&je!==null&&De!==je){let e=[...i],[t]=e.splice(De,1);e.splice(je,0,t);let n=c;De===c?n=je:De<c&&je>=c?n=c-1:De>c&&je<=c&&(n=c+1),l(n),o(e)}Ae(null),Ne(null)},Ye=e=>{try{let t=(e||ae).trim();if(!t)return;let n,r;if(t.startsWith(`spotify:`)){let e=t.split(`:`);n=e[1],r=e[2]}else{t.startsWith(`http`)||(t=`https://`+t);let e=new URL(t);if(!e.hostname.includes(`spotify`))throw Error();let i=e.pathname.split(`/`).filter(Boolean),a=[`track`,`playlist`,`album`,`episode`,`show`],o=i.findIndex(e=>a.includes(e));if(o===-1||!i[o+1])throw Error();n=i[o],r=i[o+1].split(`?`)[0]}if(!n||!r)throw Error();A({type:n,id:r}),oe(``),window.stopLiveRadio&&window.stopLiveRadio(),window.dispatchEvent(new Event(`music-play`)),ce(e=>{let n=t,r=e.find(e=>(typeof e==`string`?e:e.url)===n),i=e.filter(e=>(typeof e==`string`?e:e.url)!==n),a;return a=r&&typeof r==`object`?r:{url:n,label:n.replace(`https://open.spotify.com/`,``).split(`?`)[0]},[a,...i].slice(0,5)})}catch{alert(`Please paste a valid Spotify link (e.g., https://open.spotify.com/track/...)`)}},Qe=S?y/S*100:0,$e=()=>g(e=>e===!1?`all`:e===`all`?`one`:!1);(0,f.useEffect)(()=>
2251{if(!O&&!E)return;let e=be.current?.closest(`.sidebar-content`);if(!e)return;let t=()=>{if(!be.current||!xe.current)return;let t=be.current.getBoundingClientRect(),n=xe.current.getBoundingClientRect(),r=be.current.closest(`.sidebar`),i=r?r.getBoundingClientRect():null,a=e.getBoundingClientRect();if(t.bottom<a.top||t.top>a.bottom){E&&(te(!0),setTimeout(()=>{ee(!1),te(!1)},180)),O&&(ie(!0),setTimeout(()=>{ne(!1),ie(!1)},180));return}setPopupPos({top:n.top+n.height/2,left:i?i.left-260:t.left-280})};return e.addEventListener(`scroll`,t,{passive:!0}),window.addEventListener(`resize`,t),t(),()=>{e.removeEventListener(`scroll`,t),window.removeEventListener(`resize`,t)}},[O,E]),(0,f.useEffect)(()=>{if(!E)return;let e=e=>{let t=we.current?.contains(e.target),n=xe.current?.contains(e.target);!t&&!n&&!D&&(te(!0),setTimeout(()=>{ee(!1),te(!1)},180))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[E,D]);let tt=e=>{e===`spotify`?(ie(!0),setTimeout(()=>{ne(!1),ie(!1)},180)):(te(!0),setTimeout(()=>{ee(!1),te(!1)},180))},nt=e=>{e===`spotify`?O?tt(`spotify`):(ne(!0),E&&tt(`queue`)):E?tt(`queue`):(ee(!0),O&&tt(`spotify`))},rt=e=>{let n=t.current;if(!n||n.paused){e?.();return}let r=n.volume,i=0,a=setInterval(()=>{i++,n.volume=Math.max(0,r*(1-i/20)),i>=20&&(clearInterval(a),n.pause(),n.volume=r,v(!1),e?.())},30)};return(0,x.jsxs)(`div`,{className:e?`player ${O||k?`is-spotify`:`is-local`}
2251`:`player inner-glass`,style:e&&(O||k)?{display:`flex`,flexDirection:`column`,padding:`8px`,gap:0,background:`#0f172a`,borderRadius:`20px`,border:`1px solid rgba(255,255,255,0.08)`,boxShadow:`0 4px 24px rgba(0,0,0,0.5)`,overflow:`hidden`,height:`fit-content`,minHeight:0}:{},ref:xe,children:[(0,x.jsx)(`audio`,{ref:t,preload:`metadata`}),(0,x.jsxs)(`div`,{className:`mode-tabs`,children:[(0,x.jsxs)(`button`,{className:`mode-tab ${!O&&!k?`active`:``}`,onClick:()=>{ne(!1),A(null)},children:[(0,x.jsx)(Se,{size:12}),` Local`]}),(0,x.jsxs)(`button`,{className:`mode-tab ${O||k?`active`:``}`,onClick:()=>{t.current&&!t.current.paused?rt(()=>ne(!0)):ne(e=>!e)},children:[(0,x.jsx)(ws,{size:12}),` Spotify`]})]}),O&&!k&&(0,x.jsxs)(`div`,{className:`spotify-import-view ${re?`closing`:``}`,children:[(0,x.jsxs)(`div`,{className:`spotify-input-wrap`,children:[(0,x.jsx)(`input`,{type:`text`,placeholder:`Paste Spotify link...`,value:ae,onChange:e=>oe(e.target.value),onKeyDown:e=>e.key===`Enter`&&Ye(),className:`spotify-input`,autoFocus:!0}),ae.trim()!==``&&(0,x.jsx)(`button`,{className:`go-btn`,onClick:()=>Ye(),children:`Load`})]}),(0,x.jsx)(`p`,{className:`spotify-hint`,children:`Paste a track, album, or playlist link`}),se.length>0&&(0,x.jsxs)(`div`,{className:`spotify-history`,children:[(0,x.jsx)(`span`,{className:`history-label`,children:`Recent Links`}),(0,x.jsx)(`div`,{className:`history-list`,children:se.map((e,t)=>{let n=typeof e==`string`?e:e.url,r=typeof e==`string`?e.replace(`https://open.spotify.com/`,``).split(`?`)[0]:e.label,i=me===t,a=()=>{ge.trim()&&ce(e=>{let r=[...e];return r[t]={url:n,label:ge.trim()},r}),he(null)};return(0,x.jsxs)(`div`,{className:`history-item-wrap`,children:[i?(0,x.jsx)(`input`,{autoFocus:!0,className:`history-edit-input`,placeholder:r,value:ge,onChange:e=>_e(e.target.value),onKeyDown:e=>{e.key===`Enter`?a():e.key===`Escape`&&he(null)},onBlur:()=>he(null)}):(0,x.jsx)(`div`,{className:`history-item-content`,onClick:()=>Ye(n),children:r}),(0,x.jsx)(`button`,{className:`history-btn ${i?`editing`:``}`,onMouseDown:e=>e.preventDefault(),onClick:e=>{e.stopPropagation(),i?a():(he(t),_e(``))},children:i?`Done`:`Edit`})]},t)})})]})]}),k&&(0,x.jsx)(`div`,{className:`spotify-view`,style:e?{gap:0,flex:`none`,height:`auto`,padding:`16px 12px`}:{},children:e?(0,x.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:`8px`,color:`#1DB954`,width:`100%`,fontFamily:`'Outfit', sans-serif`,fontSize:`0.9rem`,fontWeight:500},children:[(0,x.jsx)(ws,{size:16}),(0,x.jsx)(`span`,{children:`Listening on Spotify`}),(0,x.jsxs)(`div`,{className:`info-wrapper`,style:{marginLeft:0},children:[(0,x.jsx)(Info,{size:14,className:`info-icon`}),(0,x.jsx)(`div`,{className:`info-tooltip`,style:{bottom:`150%`,top:`auto`,left:`50%`,transform:`translateX(-50%)`},children:`Spotify is playing. Tap the pill below to pause/play, or use the desktop player to change tracks.`})]})]}):(0,x.jsxs)(f.Fragment,{children:[(0,x.jsx)(`div`,{className:`spotify-scroll-wrap`,children:(0,x.jsx)(`iframe`,{src:`https://open.spotify.com/embed/${k.type}/${k.id}?utm_source=generator&theme=0`,width:`100%`,height:`352`,frameBorder:`0`,allow:`autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture`,loading:`lazy`,style:{borderRadius:`12px`,minWidth:`320px`,display:`block`},title:`Spotify`})}),(0,x.jsx)(`div`,{style:{textAlign:`center`,fontSize:`0.75rem`,color:`rgba(255,255,255,0.4)`,marginTop:`8px`},children:`Log in on this browser to hear full song`}),(0,x.jsx)(`div`,{className:`spotify-action-row`,children:(0,x.jsx)(`button`,{className:`icon-btn close-btn`,title:`Close Spotify`,onClick:()=>ue(!0),children:(0,x.jsx)(s,{size:16})})})]})}),le&&(0,et.createPortal)((0,x.jsx)(`div`,{className:`spotify-modal-overlay`,onClick:()=>ue(!1),children:(0,x.jsxs)(`div`,{className:`spotify-modal`,onClick:e=>e.stopPropagation(),children:[(0,x.jsx)(`h3`,{className:`font-pixel`,children:`Close Spotify?`}),(0,x.jsx)(`p`,{children:`Are you sure you want to stop the Spotify player?`}),(0,x.jsxs)(`div`,{className:`spotify-modal-actions`,children:[(0,x.jsx)(`button`,{className:`cancel-btn`,onClick:()=>ue(!1),children:`Cancel`}),(0,x.jsx)(`button`,{className:`confirm-btn`,onClick:()=>{A(null),ne(!1),ue(!1)},children:`Close`})]})]})}),document.body),!O&&!k&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`track-info`,children:[(0,x.jsx)(`div`,{className:`track-name-wrap`,children:(0,x.jsxs)(`div`,{ref:Ce,className:`track-name ${de?`scrolling`:``}`,children:[(0,x.jsx)(`span`,{className:`track-name-text`,children:Re?.name||`No track selected`}),de&&(0,x.jsx)(`span`,{className:`track-name-text`,children:Re?.name})]})}),(0,x.jsxs)(`div`,{className:`track-time`,children:[Ts(y),` / `,Ts(S)]})]}),(0,x.jsxs)(`div`,{className:`progress-wrap`,ref:r,onClick:He,children:[(0,x.jsx)(`div`,{className:`progress-bg`,children:(0,x.jsx)(`div`,{className:`progress-fill`,style:{width:`${Qe}%`}})}),(0,x.jsx)(`div`,{className:`progress-thumb`,style:{left:`${Qe}%`}})]}),(0,x.jsxs)(`div`,{className:`main-controls`,children:[(0,x.jsx)(`button`,{className:`ctrl sm`,onClick:Ve,disabled:!Re,children:(0,x.jsx)(Ie,{size:16,fill:`currentColor`})}),(0,x.jsx)(`button`,{className:`ctrl lg`,onClick:ze,disabled:!Re,children:_?(0,x.jsx)(Te,{size:22,fill:`currentColor`}):(0,x.jsx)(Oe,{size:22,fill:`currentColor`})}),(0,x.jsx)(`button`,{className:`ctrl sm`,onClick:()=>Be(!1),disabled:!Re,children:(0,x.jsx)(Le,{size:16,fill:`currentColor`})})]}),(0,x.jsxs)(`div`,{className:`secondary-controls`,children:[(0,x.jsx)(`button`,{className:`ctrl xs ${p?`active`:``}`,onClick:()=>m(e=>!e),children:(0,x.jsx)(Fe,{size:13})}),(0,x.jsxs)(`button`,{className:`ctrl xs ${h?`active`:``}`,onClick:$e,children:[(0,x.jsx)(Me,{size:13}),h===`one`&&(0,x.jsx)(`span`,{className:`repeat-badge`,children:`1`})]})]}),(0,x.jsxs)(`div`,{className:`volume-row`,children:[(0,x.jsx)(`button`,{className:`icon-btn`,onClick:()=>T(e=>!e),children:w||u===0?(0,x.jsx)(Ze,{size:15}):(0,x.jsx)(Xe,{size:15})}),(0,x.jsxs)(`div`,{className:`vol-track`,children:[(0,x.jsx)(`div`,{className:`vol-fill`,style:{width:`${w?0:u*100}%`}}),(0,x.jsx)(`input`,{type:`range`,min:`0`,max:`1`,step:`0.02`,value:w?0:u,onChange:e=>{d(+e.target.value),T(!1)}})]})]})]}),!O&&!k&&(0,x.jsx)(`div`,{className:`action-row`,ref:be,children:(0,x.jsxs)(`div`,{className:`action-top-row`,children:[!e&&(0,x.jsxs)(`button`,{className:`pill-btn primary`,onClick:()=>n.current.click(),children:[(0,x.jsx)(ke,{size:14}),` Add Local`]}),e&&(0,x.jsx)(`button`,{className:`pill-btn`,onClick:()=>{N(!0),E&&tt(`queue`)},children:(0,x.jsx)(j,{size:14})}),(0,x.jsx)(`input`,{ref:n,type:`file`,accept:`audio/*`,multiple:!0,hidden:!0,onChange:Ue}),!e&&i.length>0&&(0,x.jsxs)(`button`,{className:`pill-btn`,onClick:()=>nt(`queue`),children:[(0,x.jsx)(Se,{size:14}),` Queue (`,i.length,`)`]}),e&&(0,x.jsx)(`button`,{className:`pill-btn`,onClick:()=>{t.current&&!t.current.paused?rt(()=>ne(!0)):ne(!0)},children:(0,x.jsx)(ws,{size:14})})]})}),M&&(0,et.createPortal)((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{style:{position:`fixed`,inset:0,zIndex:9999,touchAction:`none`},onPointerDown:()=>N(!1)}),(0,x.jsx)(`div`,{className:`player-portal-popup mobile-menu-popup`,style:{zIndex:1e4,...e?{bottom:`calc(160px + env(safe-area-inset-bottom, 0px))`,right:16,left:`auto`,top:`auto`,transform:`none`,width:`max-content`,minWidth:200,padding:12}:{}},children:(0,x.jsxs)(`div`,{className:`queue-list`,style:{gap:`8px`},children:[(0,x.jsxs)(`button`,{className:`queue-item`,onClick:()=>{N(!1),nt(`queue`)},children:[(0,x.jsx)(Se,{size:16}),` Open Queue`]}),(0,x.jsxs)(`button`,{className:`queue-item`,onClick:()=>{N(!1),n.current.click()},children:[(0,x.jsx)(ke,{size:16}),` Add Local Music`]})]})})]}),document.body),(E||D)&&i.length>0&&(0,et.createPortal)((0,x.jsxs)(`div`,{ref:we,className:`player-portal-popup ${D?`closing`:``}
2251`,style:{top:e?`auto`:`${popupPos.top}px`,left:e?`50%`:`${popupPos.left}px`,...e?{bottom:`calc(160px + env(safe-area-inset-bottom, 0px))`,transform:`translateX(-50%)`,width:`calc(100% - 32px)`,maxWidth:420}:{}},children:[(0,x.jsxs)(`div`,{className:`player-popup-content`,children:[(0,x.jsx)(`div`,{className:`popup-label`,children:`Up Next`}),(0,x.jsx)(`div`,{className:`queue-list`,children:i.map((e,n)=>(0,x.jsxs)(`div`,{className:`queue-item ${n===c?`current`:``} ${De===n?`dragging`:``} ${je===n?`drag-over`:``}`,draggable:!0,onDragStart:e=>Ge(e,n),onDragOver:e=>qe(e,n),onDragEnd:Je,onClick:()=>{c===n?(t.current?.play().catch(()=>{}),v(!0)):(Ee.current=!0,l(n))},children:[(0,x.jsx)(`div`,{className:`drag-handle`,children:(0,x.jsx)(pe,{size:12})}),(0,x.jsx)(`span`,{className:`q-name`,children:e.name}),(0,x.jsx)(`button`,{className:`q-del`,onClick:t=>{t.stopPropagation(),We(e.id)},children:(0,x.jsx)(Ke,{size:12})})]},e.id))})]}),(0,x.jsx)(`div`,{className:`player-popup-tail`})]}),document.body),(0,x.jsx)(`style`,{jsx:`true`,children:` 2252 .show-on-mobile { 2253 display: none; 2254 } 2255 2256 .player { 2257 display: flex; 2258 flex-direction: column; 2259 gap: 1.25rem; 2260 padding: 1.25rem; 2261 } 2262 2263 .mode-tabs { 2264 display: flex; 2265 gap: 8px; 2266 margin-bottom: 0.5rem; 2267 } 2268 .mode-tab { 2269 flex: 1; 2270 padding: 8px; 2271 border-radius: 8px; 2272 background: rgba(255,255,255,0.03); 2273 border: 1px solid rgba(255,255,255,0.05); 2274 color: var(--text-muted); 2275 font-family: 'Outfit', sans-serif; 2276 font-size: 0.85rem; 2277 font-weight: 500; 2278 cursor: pointer; 2279 transition: all 0.2s; 2280 display: flex; 2281 align-items: center; 2282 justify-content: center; 2283 gap: 6px; 2284 } 2285 .mode-tab:hover { 2286 background: rgba(255,255,255,0.08); 2287 color: var(--text-light); 2288 } 2289 .mode-tab.active { 2290 background: rgba(var(--primary-rgb), 0.15); 2291 border-color: rgba(var(--primary-rgb), 0.3); 2292 color: var(--primary); 2293 } 2294 2295 .spotify-import-view { 2296 display: flex; 2297 flex-direction: column; 2298 gap: 12px; 2299 opacity: 1; 2300 transition: opacity 0.18s ease; 2301 } 2302 .spotify-import-view.closing { 2303 opacity: 0; 2304 } 2305 .spotify-input-wrap { 2306 display: flex; 2307 position: relative; 2308 } 2309 .spotify-input { 2310 flex: 1; 2311 min-width: 0; 2312 background: rgba(0,0,0,0.2); 2313 border: 1px solid rgba(255,255,255,0.1); 2314 border-radius: 8px; 2315 padding: 8px 76px 8px 12px; 2316 color: #fff; 2317 font-family: 'Outfit', sans-serif; 2318 font-size: 0.9rem; 2319 outline: none; 2320 transition: border-color 0.2s; 2321 } 2322 .spotify-input:focus { 2323 border-color: var(--primary); 2324 } 2325 .go-btn { 2326 position: absolute; 2327 right: 4px; 2328 top: 4px; 2329 bottom: 4px; 2330 background: var(--primary); 2331 color: #fff; 2332 border: none; 2333 border-radius: 6px; 2334 padding: 0 14px; 2335 font-family: 'Outfit', sans-serif; 2336 font-weight: 600; 2337 cursor: pointer; 2338 transition: transform 0.2s; 2339 } 2340 .go-btn:hover { 2341 transform: translateY(-1px); 2342 } 2343 .spotify-hint { 2344 margin: 0; 2345 color: var(--text-muted); 2346 font-size: 0.8rem; 2347 } 2348 .spotify-history { 2349 margin-top: 8px; 2350 } 2351 .history-label { 2352 display: block; 2353 font-size: 0.75rem; 2354 color: var(--text-muted); 2355 margin-bottom: 8px; 2356 text-transform: uppercase; 2357 letter-spacing: 0.05em; 2358 } 2359 .history-list { 2360 display: flex; 2361 flex-direction: column; 2362 gap: 6px; 2363 } 2364 .history-item-wrap { 2365 display: flex; 2366 align-items: center; 2367 background: rgba(255,255,255,0.03); 2368 border: 1px solid rgba(255,255,255,0.05); 2369 border-radius: 6px; 2370 transition: all 0.2s; 2371 position: relative; 2372 overflow: hidden; 2373 } 2374 .history-item-wrap:hover { 2375 background: rgba(255,255,255,0.08); 2376 border-color: var(--primary); 2377 } 2378 .history-item-content { 2379 flex: 1; 2380 padding: 8px 12px; 2381 color: var(--text-light); 2382 font-size: 0.8rem; 2383 cursor: pointer; 2384 white-space: nowrap; 2385 overflow: hidden; 2386 text-overflow: ellipsis; 2387 } 2388 .history-edit-input { 2389 flex: 1; 2390 background: transparent; 2391 border: none; 2392 outline: none; 2393 color: #fff; 2394 font-family: 'Outfit', sans-serif; 2395 font-size: 0.8rem; 2396 padding: 8px 12px; 2397 } 2398 .history-btn { 2399 position: absolute; 2400 right: 4px; 2401 top: 4px; 2402 bottom: 4px; 2403 background: var(--primary); 2404 color: #fff; 2405 border: none; 2406 border-radius: 4px; 2407 padding: 0 12px; 2408 font-family: 'Outfit', sans-serif; 2409 font-size: 0.75rem; 2410 font-weight: 600; 2411 cursor: pointer; 2412 transition: all 0.2s; 2413 opacity: 0; 2414 pointer-events: none; 2415 display: flex; 2416 align-items: center; 2417 justify-content: center; 2418 } 2419 .history-btn:hover { 2420 transform: translateY(-1px); 2421 } 2422 .history-item-wrap:hover .history-btn, 2423 .history-btn.editing { 2424 opacity: 1; 2425 pointer-events: auto; 2426 } 2427 2428 .spotify-view { 2429 display: flex; 2430 flex-direction: column; 2431 gap: 12px; 2432 } 2433 .spotify-scroll-wrap { 2434 overflow-x: auto; 2435 overflow-y: hidden; 2436 border-radius: 12px; 2437 -webkit-overflow-scrolling: touch; 2438 scrollbar-width: thin; 2439 scrollbar-color: rgba(255,255,255,0.2) rgba(255,255,255,0.05); 2440 padding-bottom: 4px; 2441 } 2442 .spotify-scroll-wrap::-webkit-scrollbar { 2443 height: 6px; 2444 } 2445 .spotify-scroll-wrap::-webkit-scrollbar-track { 2446 background: rgba(255, 255, 255, 0.05); 2447 border-radius: 4px; 2448 } 2449 .spotify-scroll-wrap::-webkit-scrollbar-thumb { 2450 background: rgba(255, 255, 255, 0.2); 2451 border-radius: 4px; 2452 } 2453 .spotify-scroll-wrap::-webkit-scrollbar-thumb:hover { 2454 background: rgba(255, 255, 255, 0.3); 2455 } 2456 .spotify-action-row { 2457 display: flex; 2458 justify-content: flex-end; 2459 } 2460 .icon-btn.close-btn { 2461 color: #ef4444; 2462 background: rgba(239, 68, 68, 0.1); 2463 } 2464 .icon-btn.close-btn:hover { 2465 background: rgba(239, 68, 68, 0.2); 2466 } 2467 2468 /* Spotify Modal */ 2469 .spotify-modal-overlay { 2470 position: fixed; inset: 0; 2471 background: rgba(0, 0, 0, 0.6); 2472 backdrop-filter: blur(4px); 2473 z-index: 10002; 2474 display: flex; align-items: center; justify-content: center; 2475 } 2476 .spotify-modal { 2477 background: #1e293b; 2478 border: 1px solid rgba(255, 255, 255, 0.1); 2479 border-radius: 16px; 2480 padding: 24px; width: 340px; text-align: center; 2481 box-shadow: 0 10px 40px rgba(0,0,0,0.5); 2482 animation: popIn 0.2s ease-out forwards; 2483 } 2484 @keyframes popIn { 2485 from { opacity: 0; transform: scale(0.95) translateY(10px); } 2486 to { opacity: 1; transform: scale(1) translateY(0); } 2487 } 2488 .spotify-modal h3 { 2489 margin: 0 0 12px 0; color: #ef4444; font-size: 1.2rem; 2490 } 2491 .spotify-modal p { 2492 margin: 0 0 24px 0; color: #94a3b8; font-size: 0.95rem; line-height: 1.4; 2493 } 2494 .spotify-modal-actions { 2495 display: flex; gap: 12px; 2496 } 2497 .spotify-modal-actions button { 2498 flex: 1; padding: 10px; border-radius: 8px; 2499 font-family: 'Outfit', sans-serif; font-weight: 600; 2500 cursor: pointer; transition: all 0.2s; 2501 } 2502 .cancel-btn { 2503 background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #fff; 2504 } 2505 .cancel-btn:hover { background: rgba(255,255,255,0.1); } 2506 .confirm-btn { 2507 background: rgba(239, 68, 68, 0.2); border: 1px solid rgba(239, 68, 68, 0.4); color: #ef4444; 2508 } 2509 .confirm-btn:hover { background: rgba(239, 68, 68, 0.3); } 2510 2511 .track-info { 2512 text-align: center; 2513 } 2514 2515 .track-name-wrap { 2516 width: 100%; 2517 overflow: hidden; 2518 position: relative; 2519 mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent); 2520 -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent); 2521 margin-bottom: 4px; 2522 } 2523 .track-name { 2524 font-family: 'Outfit', sans-serif; 2525 font-weight: 500; 2526 font-size: 1rem; 2527 color: #fff; 2528 white-space: nowrap; 2529 display: inline-flex; 2530 gap: 2rem; 2531 } 2532 .track-name.scrolling { 2533 animation: marquee 10s linear infinite; 2534 } 2535 .track-name-text { 2536 display: inline-block; 2537 } 2538 2539 @keyframes marquee { 2540 0% { transform: translateX(0); } 2541 100% { transform: translateX(calc(-50% - 1rem)); } 2542 } 2543 2544 .track-time { 2545 font-size: 0.75rem; 2546 color: var(--text-muted); 2547 font-variant-numeric: tabular-nums; 2548 } 2549 2550 .progress-wrap { 2551 height: 20px; 2552 display: flex; 2553 align-items: center; 2554 cursor: pointer; 2555 position: relative; 2556 } 2557 .progress-bg { 2558 width: 100%; 2559 height: 4px; 2560 background: rgba(255,255,255,0.1); 2561 border-radius: 2px; 2562 overflow: hidden; 2563 } 2564 .progress-fill { 2565 height: 100%; 2566 background: var(--primary); 2567 transition: width 0.1s linear; 2568 } 2569 .progress-thumb { 2570 position: absolute; 2571 width: 12px; 2572 height: 12px; 2573 background: #fff; 2574 border-radius: 50%; 2575 top: 50%; 2576 transform: translate(-50%, -50%); 2577 box-shadow: 0 2px 4px rgba(0,0,0,0.3); 2578 opacity: 0; 2579 transition: opacity 0.2s; 2580 } 2581 .progress-wrap:hover .progress-thumb { 2582 opacity: 1; 2583 } 2584 2585 .main-controls { 2586 display: flex; 2587 align-items: center; 2588 justify-content: center; 2589 gap: 16px; 2590 } 2591 .ctrl { 2592 background: none; 2593 border: none; 2594 color: var(--text-muted); 2595 cursor: pointer; 2596 display: flex; 2597 align-items: center; 2598 justify-content: center; 2599 transition: all 0.2s; 2600 border-radius: 50%; 2601 } 2602 .ctrl:disabled { 2603 opacity: 0.3;
2604 cursor: not-allowed; 2605 } 2606 .ctrl:not(:disabled):hover { 2607 filter: brightness(1.3); 2608 transform: scale(1.1); 2609 } 2610 .ctrl.active { 2611 color: var(--primary); 2612 } 2613 .ctrl.sm { width: 32px; height: 32px; } 2614 .ctrl.lg { 2615 width: 42px; height: 42px; 2616 background: rgba(255,255,255,0.1); 2617 color: #fff; 2618 } 2619 .ctrl.lg:not(:disabled):hover { 2620 background: var(--primary); 2621 transform: scale(1.05); 2622 } 2623 .ctrl.xs { width: 28px; height: 28px; position: relative; } 2624 2625 .repeat-badge { 2626 position: absolute; 2627 top: 0px; 2628 right: 0px; 2629 background: var(--primary); 2630 color: #000; 2631 font-size: 0.5rem; 2632 font-weight: bold; 2633 width: 12px; 2634 height: 12px; 2635 border-radius: 50%; 2636 display: flex; 2637 align-items: center; 2638 justify-content: center; 2639 } 2640 2641 .secondary-controls { 2642 display: flex; 2643 justify-content: center; 2644 gap: 12px; 2645 } 2646 2647 .volume-row { 2648 display: flex; 2649 align-items: center; 2650 justify-content: center; 2651 gap: 10px; 2652 padding: 4px 1rem; 2653 } 2654 .icon-btn { 2655 background: none; 2656 border: none; 2657 color: var(--text-muted); 2658 cursor: pointer; 2659 display: flex; 2660 align-items: center; 2661 justify-content: center; 2662 transition: color 0.2s; 2663 padding: 0; 2664 } 2665 .icon-btn:hover { 2666 color: #fff; 2667 } 2668 .vol-track { 2669 flex: 1; 2670 max-width: 160px; 2671 height: 4px; 2672 background: rgba(255,255,255,0.12); 2673 border-radius: 2px; 2674 position: relative; 2675 cursor: pointer; 2676 } 2677 .vol-fill { 2678 position: absolute; left: 0; top: 0; height: 100%; 2679 background: var(--primary); border-radius: 2px; 2680 pointer-events: none; 2681 } 2682 .vol-track input[type=range] { 2683 position: absolute; inset: -8px 0; 2684 width: 100%; height: 20px; 2685 opacity: 0; cursor: pointer; margin: 0; 2686 } 2687 2688 /* Actions */ 2689 .action-row { display: flex; flex-direction: column; gap: 0.6rem; } 2690 .action-top-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; } 2691 .pill-btn { 2692 background: transparent; border: 1px solid rgba(255, 255, 255, 0.12); 2693 color: var(--text-muted); padding: 0.45rem 0.8rem; border-radius: 10px; 2694 font-size: 0.75rem; font-weight: 500; cursor: pointer; 2695 display: flex; align-items: center; justify-content: center; gap: 0.4rem; 2696 transition: all 0.2s; white-space: nowrap; width: 100%; 2697 box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); 2698 } 2699 .pill-btn.primary { 2700 background: var(--primary); 2701 border: 1px solid rgba(255, 255, 255, 0.2); 2702 box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 2px 8px rgba(168, 85, 247, 0.25); 2703 color: white; font-weight: 600; 2704 } 2705 .pill-btn.active { 2706 background: rgba(168, 85, 247, 0.15); 2707 border-color: rgba(168, 85, 247, 0.4); 2708 color: var(--primary-hover); 2709 } 2710 .pill-btn:hover:not(.primary) { border-color: rgba(255,255,255,0.2); color: var(--text-color); } 2711 .pill-btn.primary:hover { opacity: 0.9; } 2712 2713 /* Portal Popups */ 2714 .player-portal-popup { 2715 position: fixed; 2716 transform: translateY(-50%); 2717 width: 260px; 2718 background: rgba(30, 30, 35, 0.6); 2719 backdrop-filter: blur(20px); 2720 border: 1px solid rgba(255, 255, 255, 0.15); 2721 border-radius: 16px; 2722 padding: 1.2rem; 2723 box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1); 2724 animation: popInLeft 0.2s cubic-bezier(0.4, 0, 0.2, 1); 2725 z-index: 99999; 2726 } 2727 2728 .player-popup-content { 2729 display: flex; 2730 flex-direction: column; 2731 gap: 1rem; 2732 } 2733 2734 .player-popup-tail { 2735 position: absolute; 2736 right: -6px; 2737 top: 50%; 2738 margin-top: -6px; 2739 width: 12px; height: 12px; 2740 background: rgba(45, 45, 55, 0.65); 2741 border-top: 1px solid rgba(255, 255, 255, 0.15); 2742 border-right: 1px solid rgba(255, 255, 255, 0.15); 2743 backdrop-filter: blur(16px); 2744 transform: rotate(45deg); 2745 border-radius: 2px; 2746 z-index: -1; 2747 } 2748 2749 @keyframes popInLeft { 2750 from { opacity: 0; transform: translate(10px, -50%) scale(0.95); } 2751 to { opacity: 1; transform: translate(0, -50%) scale(1); } 2752 } 2753 @keyframes popOutLeft { 2754 from { opacity: 1; transform: translate(0, -50%) scale(1); } 2755 to { opacity: 0; transform: translate(10px, -50%) scale(0.95); } 2756 } 2757 .player-portal-popup.closing { 2758 animation: popOutLeft 0.18s cubic-bezier(0.4, 0, 1, 1) forwards; 2759 } 2760 2761 .player-portal-popup .popup-label { 2762 font-family: 'Outfit', sans-serif; 2763 font-size: 0.75rem; font-weight: 700; 2764 text-transform: uppercase; letter-spacing: 0.08em; 2765 color: var(--text-color); 2766 opacity: 0.9; 2767 } 2768 2769 /* Spotify input inside popup */ 2770 .player-portal-popup .spotify-input-wrap { 2771 display: flex; gap: 0.4rem; align-items: center; 2772 background: rgba(0, 0, 0, 0.25); 2773 border: 1px solid rgba(255, 255, 255, 0.08); 2774 border-radius: 24px; 2775 padding: 4px 4px 4px 12px; 2776 animation: fadeIn 0.2s ease; 2777 box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1); 2778 } 2779 .player-portal-popup .spotify-input { 2780 flex: 1; background: transparent; border: none; outline: none; 2781 color: var(--text-color); font-size: 0.8rem; 2782 font-family: 'Outfit', sans-serif; 2783 min-width: 0; 2784 } 2785 .player-portal-popup .spotify-input::placeholder { color: rgba(255, 255, 255, 0.4); } 2786 .player-portal-popup .go-btn { 2787 background: #1db954; color: white; border: none; 2788 border-radius: 20px; padding: 0.4rem 1rem; 2789 font-size: 0.75rem; font-weight: 700; cursor: pointer; 2790 font-family: 'Outfit', sans-serif; 2791 transition: all 0.2s; 2792 display: flex; align-items: center; justify-content: center; 2793 line-height: 1; 2794 } 2795 .player-portal-popup .go-btn:hover { 2796 background: #1ed760; 2797 transform: scale(1.05); 2798 } 2799 .player-portal-popup .clear-btn { 2800 background: transparent; border: none; color: var(--text-muted); 2801 cursor: pointer; display: flex; align-items: center; 2802 transition: color 0.2s; 2803 } 2804 .player-portal-popup .clear-btn:hover { color: #f87171; } 2805 2806 /* Spotify embed */ 2807 .player-portal-popup .spotify-embed { border-radius: 10px; overflow: hidden; } 2808 2809 /* Queue inside popup */ 2810 .player-portal-popup .queue-list { 2811 display: flex; flex-direction: column; gap: 2px; 2812 max-height: 220px; overflow-y: auto; 2813 padding-right: 0.4rem; margin-right: -0.4rem; 2814 } 2815 .player-portal-popup .queue-list::-webkit-scrollbar { width: 4px; } 2816 .player-portal-popup .queue-list::-webkit-scrollbar-track { background: transparent; } 2817 .player-portal-popup .queue-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; } 2818 .player-portal-popup .queue-item { 2819 display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; 2820 padding: 0.4rem 0.6rem; border-radius: 8px; 2821 cursor: pointer; transition: background 0.15s; 2822 } 2823 .player-portal-popup .queue-item:hover { background: rgba(255,255,255,0.05); } 2824 .player-portal-popup .queue-item.current { background: rgba(168,85,247,0.12); } 2825 2826 /* Drag & Drop styles */ 2827 .player-portal-popup .queue-item.dragging { 2828 opacity: 0.5; 2829 background: rgba(255,255,255,0.02); 2830 } 2831 .player-portal-popup .queue-item.drag-over { 2832 border-top: 2px solid var(--primary); 2833 border-top-left-radius: 0; 2834 border-top-right-radius: 0; 2835 } 2836 .player-portal-popup .drag-handle { 2837 color: rgba(255,255,255,0.4); 2838 cursor: grab; 2839 display: flex; align-items: center; 2840 transition: color 0.2s; 2841 } 2842 .player-portal-popup .drag-handle:active { cursor: grabbing; } 2843 .player-portal-popup .queue-item:hover .drag-handle { color: rgba(255,255,255,0.7); } 2844 2845 .player-portal-popup .q-name { 2846 font-size: 0.85rem; font-weight: 500; 2847 color: #ffffff; 2848 text-shadow: 0 1px 3px rgba(0,0,0,0.6); 2849 white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 2850 flex: 1; 2851 } 2852 .player-portal-popup .queue-item.current .q-name { color: var(--primary-hover); font-weight: 500; } 2853 .player-portal-popup .q-del { 2854 background: transparent; border: none; color: var(--text-muted); 2855 cursor: pointer; opacity: 0; transition: opacity 0.2s, color 0.2s; 2856 display: flex; align-items: center; flex-shrink: 0; 2857 padding: 2px; 2858 } 2859 .player-portal-popup .queue-item:hover .q-del { opacity: 1; } 2860 .player-portal-popup .q-del:hover { color: #f87171; } 2861 2862 @keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } } 2863 2864 2865 /* ââ Mobile floating pill styles (only inside .mobile-player
2865-wrapper) ââ */ 2866 .mobile-player-wrapper .player.is-local { 2867 flex-direction: row !important; 2868 align-items: center !important; 2869 padding: 8px 16px !important; 2870 border-radius: 40px !important; 2871 gap: 12px !important; 2872 background: #0f172a !important; 2873 backdrop-filter: none !important; 2874 border: 1px solid rgba(255,255,255,0.08) !important; 2875 box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important; 2876 } 2877 2878 .mobile-player-wrapper .player.is-spotify { 2879 background: #0f172a !important; 2880 backdrop-filter: none !important; 2881 border: 1px solid rgba(255,255,255,0.08) !important; 2882 box-shadow: 0 4px 24px rgba(0,0,0,0.5) !important; 2883 border-radius: 20px !important; 2884 padding: 8px !important; 2885 height: fit-content !important; 2886 max-height: fit-content !important; 2887 min-height: 0 !important; 2888 gap: 0 !important; 2889 overflow: hidden !important; 2890 } 2891 2892 .mobile-player-wrapper .player.is-spotify .spotify-view { 2893 gap: 0 !important; 2894 flex: none !important; 2895 height: auto !important; 2896 } 2897 2898 .mobile-player-wrapper .player.is-spotify .spotify-scroll-wrap { 2899 padding: 0 !important; 2900 margin: 0 !important; 2901 flex: none !important; 2902 overflow: hidden !important; 2903 } 2904 2905 .mobile-player-wrapper .player.is-spotify .spotify-action-row { 2906 display: none !important; 2907 height: 0 !important; 2908 overflow: hidden !important; 2909 margin: 0 !important; 2910 padding: 0 !important; 2911 } 2912 2913 .mobile-player-wrapper .player.is-spotify iframe { 2914 min-width: 0 !important; 2915 width: 100% !important; 2916 display: block !important; 2917 pointer-events: auto !important; 2918 position: relative !important; 2919 z-index: 10 !important; 2920 } 2921 2922 .mobile-player-wrapper .player.is-spotify .mode-tabs { 2923 display: none !important; 2924 height: 0 !important; 2925 margin: 0 !important; 2926 padding: 0 !important; 2927 overflow: hidden !important; 2928 } 2929 2930 .mobile-player-wrapper .show-on-mobile { display: flex !important; } 2931 .mobile-player-wrapper .hide-on-mobile { display: none !important; } 2932 2933 .mobile-player-wrapper .player.is-local .mode-tabs, 2934 .mobile-player-wrapper .player.is-local .progress-wrap, 2935 .mobile-player-wrapper .player.is-local .secondary-controls, 2936 .mobile-player-wrapper .player.is-local .volume-row, 2937 .mobile-player-wrapper .player.is-local .track-time { 2938 display: none !important; 2939 } 2940 2941 .mobile-player-wrapper .player.is-local .track-info { 2942 flex: 1 !important; 2943 min-width: 0 !important; 2944 margin: 0 !important; 2945 display: flex !important; 2946 align-items: center !important; 2947 } 2948 2949 .mobile-player-wrapper .player.is-local .track-name-wrap { 2950 font-size: 0.85rem !important; 2951 } 2952 2953 .mobile-player-wrapper .player.is-local .main-controls { 2954 flex-shrink: 0 !important; 2955 margin: 0 !important; 2956 gap: 8px !important; 2957 } 2958 2959 .mobile-player-wrapper .player.is-local .action-row { 2960 flex-shrink: 0 !important; 2961 margin: 0 !important; 2962 padding: 0 !important; 2963 border: none !important; 2964 } 2965 2966 .mobile-player-wrapper .player.is-local .action-top-row { 2967 gap: 6px !important; 2968 } 2969 2970 .mobile-player-wrapper .player.is-local .action-top-row .pill-btn { 2971 padding: 0 !important; 2972 border-radius: 50% !important; 2973 width: 32px !important; 2974 height: 32px !important; 2975 justify-content: center !important; 2976 font-size: 0 !important; 2977 } 2978 2979 .mobile-player-wrapper .player.is-local .action-top-row .pill-btn svg { 2980 margin: 0 !important; 2981 width: 14px !important; 2982 height: 14px !important; 2983 } 2984 2985 /* ââ Mobile portal popups (rendered via Portal, outside .mobile-player
2985-wrapper) ââ */ 2986 @media (max-width: 768px) { 2987 .player-portal-popup { 2988 top: auto !important; 2989 bottom: calc(160px + env(safe-area-inset-bottom, 0px)) !important; 2990 left: 50% !important; 2991 transform: translateX(-50%) !important; 2992 width: calc(100% - 32px) !important; 2993 max-width: 420px !important; 2994 box-shadow: 0 10px 48px rgba(0,0,0,0.8), inset 0 2px 4px rgba(255,255,255,0.1); 2995 } 2996 .player-popup-tail { 2997 display: none !important; 2998 } 2999 .mobile-menu-popup { 3000 width: max-content !important; 3001 min-width: 200px !important; 3002 bottom: calc(160px + env(safe-area-inset-bottom, 0px)) !important; 3003 left: auto !important; 3004 right: 16px !important; 3005 top: auto !important; 3006 transform: none !important; 3007 padding: 12px !important; 3008 } 3009 .mobile-menu-popup .queue-item { 3010 justify-content: flex-start !important; 3011 gap: 12px !important; 3012 padding: 12px 16px !important; 3013 } 3014 } 3015 3016 `})]})}var Ds=[`/bg/night1.gif`,`/bg/night2.gif`,`/bg/night3.gif`,`/bg/rain1.gif`,`/bg/rain2.gif`,`/bg/rain3.gif`,`/bg/chill1.gif`,`/bg/chill2.gif`,`/bg/chill3.gif`,`/bg/focus1.gif`,`/bg/focus2.gif`,`/bg/focus3.gif`];function Os({onComplete:e,bgImage:t}){let[n,r]=(0,f.useState)(!1),i=(0,f.useRef)(e),a=(0,f.useRef)(t||Ds[0]);return(0,f.useEffect)(()=>{i.current=e},[e]),(0,f.useEffect)(()=>{let e=!1,t=!1,n=!1,o,s=()=>{n||(n=!0,r(!0),o=setTimeout(()=>{window.dispatchEvent(new Event(`app-ready`)),i.current()},800))},c=()=>{e&&t&&s()},l=new Image;l.onload=l.onerror=()=>{t=!0,c()},l.src=a.current,Ds.forEach(e=>{if(e!==a.current){let t=new Image;t.src=e}});let u=setTimeout(()=>{e=!0,c()},3e3),d=setTimeout(s,6e3);return()=>{clearTimeout(u),clearTimeout(d),clearTimeout(o)}},[]),(0,x.jsxs)(`div`,{className:`loading-screen ${n?`fade-out`:``}`,children:[(0,x.jsxs)(`div`,{className:`retro-container`,children:[(0,x.jsxs)(`div`,{className:`title-container`,children:[(0,x.jsx)(`h1`,{className:`retro-title`,children:`MOODBYTE`}),(0,x.jsx)(`div`,{className:`eraser-block`,children:(0,x.jsx)(`div`,{className:`pacman`})})]}),(0,x.jsx)(`p`,{className:`loading-text`,children:`LOADING...`})]}),(0,x.jsx)(`style`,{children:` 3017 .loading-screen { 3018 position: fixed; 3019 inset: 0; 3020 background: #0b1120; 3021 z-index: 999999; 3022 display: flex; 3023 align-items: center; 3024 justify-content: center; 3025 transition: opacity 0.8s ease-in-out, visibility 0.8s; 3026 } 3027 3028 .loading-screen.fade-out { 3029 opacity: 0; 3030 visibility: hidden; 3031 } 3032 3033 .retro-container { 3034 display: flex; 3035 flex-direction: column; 3036 align-items: center; 3037 gap: 4rem; 3038 } 3039 3040 .title-container { 3041 position: relative; 3042 display: inline-block; 3043 padding: 10px 40px; /* Padding allows pacman to start before and end after text */ 3044 } 3045 3046 .retro-title { 3047 font-family: 'Press Start 2P', monospace; 3048 color: #00d4ff; 3049 font-size: 3.5rem; 3050 margin: 0; 3051 text-shadow: 4px 4px 0 #8a2be2; 3052 letter-spacing: 4px; 3053 } 3054 3055 .eraser-block { 3056 position: absolute; 3057 top: -20px; 3058 bottom: -20px; 3059 left: 0; 3060 width: 0%; 3061 background: #0b1120; /* perfectly matches background */ 3062 z-index: 10; 3063 animation: eat-text 2.2s linear forwards; 3064 animation-delay: 0.3s; 3065 } 3066 3067 .pacman { 3068 position: absolute; 3069 right: -30px; /* Centers Pacman perfectly on the moving edge of the eraser */ 3070 top: 50%; 3071 transform: translateY(-50%); 3072 width: 60px; 3073 height: 60px; 3074 background: #ffcc00; 3075 border-radius: 50%; 3076 z-index: 10; 3077 animation: chomp 0.18s linear infinite alternate; 3078 } 3079 3080 /* Pacman's Eye */ 3081 .pacman::after { 3082 content: ""; 3083 position: absolute; 3084 top: 12px; 3085 left: 32px; 3086 width: 8px; 3087 height: 8px; 3088 background: #0b1120; 3089 border-radius: 50%; 3090 } 3091 3092 .loading-text { 3093 font-family: 'Press Start 2P', monospace; 3094 color: #ffb8ff; 3095 font-size: 1rem; 3096 letter-spacing: 2px; 3097 animation: blink 1s steps(2, start) infinite; 3098 text-shadow: 0 0 10px rgba(255, 184, 255, 0.5); 3099 } 3100 3101 @keyframes eat-text { 3102 0% { width: 0%; } 3103 100% { width: 100%; } 3104 } 3105 3106 @keyframes chomp { 3107 0% { clip-path: polygon(100% 75%, 100% 100%, 0 100%, 0 0, 100% 0, 100% 25%, 50% 50%); } 3108 100% { clip-path: polygon(100% 50%, 100% 100%, 0 100%, 0 0, 100% 0, 100% 50%, 50% 50%); } 3109 } 3110 3111 @keyframes blink { 3112 0%, 100% { opacity: 1; } 3113 50% { opacity: 0; } 3114 } 3115
3116 /* Responsive adjustments */ 3117 @media (max-width: 768px) { 3118 .retro-title { 3119 font-size: 2rem; 3120 } 3121 .title-container { 3122 padding: 10px 30px; 3123 } 3124 .pacman { 3125 width: 40px; 3126 height: 40px; 3127 border-width: 20px; 3128 right: -20px; 3129 } 3130 } 3131 `})]})}function ks({title:e,message:t,onGotIt:n}){return(0,x.jsxs)(`div`,{className:`welcome-modal-overlay`,children:[(0,x.jsxs)(`div`,{className:`welcome-modal`,children:[(0,x.jsx)(`h2`,{className:`font-pixel`,children:e}),(0,x.jsx)(`div`,{className:`welcome-modal-body`,dangerouslySetInnerHTML:{__html:t}}),(0,x.jsx)(`button`,{className:`got-it-btn`,onClick:n,children:`Got it!`})]}),(0,x.jsx)(`style`,{children:` 3132 .welcome-modal-overlay { 3133 position: fixed; 3134 inset: 0; 3135 background: rgba(0, 0, 0, 0.6); 3136 backdrop-filter: blur(4px); 3137 z-index: 100000; 3138 display: flex; 3139 align-items: center; 3140 justify-content: center; 3141 animation: fadeIn 0.3s ease; 3142 } 3143 3144 .welcome-modal { 3145 background: rgba(15, 23, 42, 0.95); 3146 border: 1px solid rgba(255, 255, 255, 0.1); 3147 border-radius: 16px; 3148 padding: 24px; 3149 width: 90%; 3150 max-width: 400px; 3151 color: white; 3152 box-shadow: 0 20px 40px rgba(0,0,0,0.5); 3153 display: flex; 3154 flex-direction: column; 3155 gap: 16px; 3156 animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 3157 } 3158 3159 .welcome-modal h2 { 3160 margin: 0; 3161 color: #fbbf24; 3162 text-align: center; 3163 font-size: 1.4rem; 3164 } 3165 3166 .welcome-modal-body { 3167 font-size: 0.95rem; 3168 color: #e2e8f0; 3169 line-height: 1.5; 3170 } 3171 3172 .welcome-modal-body p { 3173 margin-top: 0; 3174 margin-bottom: 12px; 3175 } 3176 3177 .welcome-modal-body strong { 3178 color: #8b5cf6; 3179 } 3180 3181 .got-it-btn { 3182 width: 100%; 3183 padding: 12px; 3184 background: #8b5cf6; 3185 color: white; 3186 border: none; 3187 border-radius: 8px; 3188 font-family: 'Outfit', sans-serif; 3189 font-weight: 600; 3190 font-size: 1rem; 3191 cursor: pointer; 3192 transition: background 0.2s; 3193 margin-top: 8px; 3194 } 3195 3196 .got-it-btn:hover { 3197 background: #7c3aed; 3198 } 3199 3200 @keyframes fadeIn { 3201 from { opacity: 0; } 3202 to { opacity: 1; } 3203 } 3204 3205 @keyframes popIn { 3206 from { transform: scale(0.9); opacity: 0; } 3207 to { transform: scale(1); opacity: 1; } 3208 } 3209 `})]})}var As=[{id:`task_1`,title:`First Step`,desc:`Complete 1 task`,icon:He,color:`#facc15`,req:e=>e.tasks>=1},{id:`task_10`,title:`Task Master`,desc:`Complete 10 tasks`,icon:Be,color:`#34d399`,req:e=>e.tasks>=10},{id:`task_50`,title:`Unstoppable`,desc:`Complete 50 tasks`,icon:de,color:`#f97316`,req:e=>e.tasks>=50},{id:`focus_1`,title:`Getting Started`,desc:`Finish 1 Pomodoro`,icon:We,color:`#a78bfa`,req:e=>e.focus>=1},{id:`focus_5`,title:`Deep Focus`,desc:`Finish 5 Pomodoros`,icon:Ge,color:`#38bdf8`,req:e=>e.focus>=5},{id:`focus_20`,title:`Zen Master`,desc:`Finish 20 Pomodoros`,icon:ue,color:`#c084fc`,req:e=>e.focus>=20},{id:`mood_1`,title:`In Touch`,desc:`Log your first mood`,icon:Re,color:`#fbbf24`,req:e=>e.moods>=1},{id:`mood_7`,title:`Self Aware`,desc:`Log 7 moods`,icon:me,color:`#f43f5e`,req:e=>e.moods>=7},{id:`mood_30`,title:`Emotional Guru`,desc:`Log 30 moods`,icon:D,color:`#ec4899`,req:e=>e.moods>=30}];function js(){let[e]=a(`taskHistory`,[]),[t]=a(`tasks`,[]),[n]=a(`pomodoroStats`,{sessions:0}),[r]=a(`moodHistory`,[]),[i,o]=a(`unlockedAchievements`,[]),[s,c]=(0,f.useState)(null),[l,u]=(0,f.useState)([]);if((0,f.useEffect)(()=>{let a={tasks:e.length+t.filter(e=>e.completed).length,focus:n.sessions||0,moods:r.length},s=[];As.forEach(e=>{!i.includes(e.id)&&e.req(a)&&s.push(e)}),s.length>0&&(o([...i,...s.map(e=>e.id)]),u(e=>[...e,...s]))},[e,t,n,r]),(0,f.useEffect)(()=>
3209{if(l.length>0&&!s){let e=l[0];c(e);let t=new Audio(`/animals/notif.mp3`);t.volume=.5,t.play().catch(e=>console.error(`Audio play blocked`,e)),setTimeout(()=>{c(null),u(e=>e.slice(1))},4e3)}},[l,s]),!s)return null;let d=s.icon;return(0,et.createPortal)((0,x.jsxs)(`div`,{className:`achievement-popup slide-in-top`,children:[(0,x.jsx)(`div`,{className:`ach-icon-box`,style:{background:`${s.color}20`,color:s.color},children:(0,x.jsx)(d,{size:28})}),(0,x.jsxs)(`div`,{className:`ach-text`,children:[(0,x.jsx)(`span`,{className:`ach-label`,children:`Achievement Unlocked!`}),(0,x.jsx)(`h4`,{className:`ach-title`,children:s.title}),(0,x.jsx)(`p`,{className:`ach-desc`,children:s.desc})]}),(0,x.jsx)(`style`,{children:` 3210 .achievement-popup { 3211 position: fixed; 3212 top: 40px; 3213 left: 50%; 3214 transform: translateX(-50%); 3215 background: rgba(15, 23, 42, 0.95); 3216 backdrop-filter: blur(10px); 3217 border: 1px solid rgba(255, 255, 255, 0.1); 3218 border-left: 4px solid ${s.color}; 3219 padding: 16px; 3220 border-radius: 12px; 3221 box-shadow: 0 10px 30px rgba(0,0,0,0.5); 3222 display: flex; 3223 align-items: center; 3224 gap: 16px; 3225 z-index: 100000; 3226 min-width: 300px; 3227 } 3228 3229 .ach-icon-box { 3230 width: 48px; 3231 height: 48px; 3232 border-radius: 12px; 3233 display: flex; 3234 align-items: center; 3235 justify-content: center; 3236 box-shadow: inset 0 0 10px rgba(255,255,255,0.05); 3237 animation: pulseIcon 2s infinite; 3238 } 3239 3240 .ach-text { 3241 display: flex; 3242 flex-direction: column; 3243 } 3244 3245 .ach-label { 3246 font-size: 0.7rem; 3247 text-transform: uppercase; 3248 letter-spacing: 0.05em; 3249 color: ${s.color}; 3250 font-weight: 700; 3251 margin-bottom: 2px; 3252 } 3253 3254 .ach-title { 3255 margin: 0; 3256 color: #fff; 3257 font-family: 'Outfit', sans-serif; 3258 font-size: 1.1rem; 3259 } 3260 3261 .ach-desc { 3262 margin: 4px 0 0 0; 3263 font-size: 0.85rem; 3264 color: #94a3b8; 3265 } 3266 3267 .slide-in-top { 3268 animation: dropIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards, fadeOutUp 0.5s ease-in 3.5s forwards; 3269 } 3270 3271 @keyframes dropIn { 3272 from { transform: translate(-50%, -100px); opacity: 0; } 3273 to { transform: translate(-50%, 0); opacity: 1; } 3274 } 3275 3276 @keyframes fadeOutUp { 3277 from { transform: translate(-50%, 0); opacity: 1; } 3278 to { transform: translate(-50%, -100px); opacity: 0; } 3279 } 3280 3281 @keyframes pulseIcon { 3282 0% { box-shadow: 0 0 0 0 ${s.color}40; } 3283 70% { box-shadow: 0 0 0 10px ${s.color}00; } 3284 100% { box-shadow: 0 0 0 0 ${s.color}00; } 3285 } 3286 `})]}),document.body)}function Ms({moodHistory:e,taskHistory:t,tasks:n,todayStr:r}){let i=e.some(e=>e.timestamp.startsWith(r)),a=t.some(e=>e.archivedAt&&e.archivedAt.startsWith(r)),o=n.some(e=>e.completed);return i||a||o}function Ns(e,{activityToday:t,todayStr:n,yesterdayStr:r}){let i=e.currentStreak,a,o=e.lastActiveDate;return t?(e.lastActiveDate===r?i=e.currentStreak+1:e.lastActiveDate!==n&&(i=1),o=n,a=!0):e.lastActiveDate!==n&&e.lastActiveDate!==r?(i=0,a=!1):a=e.lastActiveDate===n,{currentStreak:i,lastActiveDate:o,isActiveToday:a}}function Ps(){let e=at(),[t]=a(`taskHistory`,[]),[n]=a(`tasks`,[]),[r]=a(`pomodoroStats`,{sessions:0}),[i]=a(`moodHistory`,[]),[o,s]=a(`streakStats`,{currentStreak:0,lastActiveDate:null,isActiveToday:!1});(0,f.useEffect)(()=>{let e=new Date().toISOString().split(`T`)[0],r=new Date(Date.now()-864e5).toISOString().split(`T`)[0],a=Ms({moodHistory:i,taskHistory:t,tasks:n,todayStr:e});s(t=>{let n=Ns(t,{activityToday:a,todayStr:e,yesterdayStr:r});return n.currentStreak!==t.currentStreak||n.isActiveToday!==t.isActiveToday||n.lastActiveDate!==t.lastActiveDate?n:t})},[t,n,i,s]);let[c,l]=f.useState(!1),u=o.isActiveToday,d=o.currentStreak;return(0,x.jsxs)(`div`,{style:{position:`fixed`,...e?{top:`72px`,right:`14px`}:{top:`24px`,right:`calc(var(--sidebar-offset, 360px) + 32px)`,transition:`right 0.3s cubic-bezier(0.4, 0, 0.2, 1)`},display:`flex`,alignItems:`center`,gap:`6px`,background:`rgba(15, 23, 42, 0.55)`,backdropFilter:`blur(8px)`,WebkitBackdropFilter:`blur(8px)`,padding:`5px 12px`,borderRadius:`20px`,border:`1px solid rgba(255,255,255,0.12)`,zIndex:1e3,cursor:`default`},onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[(0,x.jsx)(`div`,{style:{width:`28px`,height:`28px`,minWidth:`28px`,minHeight:`28px`,overflow:`hidden`,flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`,filter:u?`none`:`grayscale(1) brightness(0.5)`,transition:`filter 0.3s ease`},children:(0,x.jsx)(`img`,{src:`/streak.gif`,alt:`Streak Fire`,style:{width:`28px`,height:`28px`,display:`block`,flexShrink:0}})}),(0,x.jsx)(`span`,{style:{fontFamily:`'Outfit', sans-serif`,fontWeight:700,fontSize:`1.1rem`,color:u?`#fff`:`#94a3b8`,transition:`color 0.3s ease`},children:d}),c&&(0,x.jsx)(`div`,{style:{position:`absolute`,top:`calc(100% + 12px)`,right:0,background:`rgba(15, 23, 42, 0.95)`,color:`#fff`,fontSize:`0.85rem`,padding:`8px 12px`,borderRadius:`8px`,whiteSpace:`nowrap`,pointerEvents:`none`,border:`1px solid rgba(255,255,255,0.1)`,boxShadow:`0 4px 12px rgba(0,0,0,0.3)`,zIndex:1001},children:u?`You're on a ${d} day streak!`:`Complete a task or log a mood to keep your streak alive!`})]})}var Fs=[{icon:(0,x.jsx)(je,{size:36,className:`text-pink-400`}),title:`FM Radio / Live BGM`,desc:`Tune in to curated lo-fi, jazz, and chillhop internet radio stations directly inside the app. One tap and the music never stops.`},{icon:(0,x.jsx)(A,{size:36,className:`text-blue-400`}),title:`Live Animated Clock`,desc:`A sleek real-time clock now lives on the board with smooth digit animations and a hover-reveal AM/PM indicator.`},{icon:(0,x.jsx)(ce,{size:36,className:`text-purple-400`}),title:`Cross-Platform Cloud Sync`,desc:`Sign in with Google to sync your tasks, stats, and settings across all your devices â PC, tablet, and mobile â instantly.`},{icon:(0,x.jsx)(ve,{size:36,className:`text-emerald-400`}),title:`Live Sync Notes`,desc:`Send tasks or calendar notes straight to the Sticky Note Board. Edits on the note sync back to the source in real time.`}];function Is({onClose:e}){let[t,n]=(0,f.useState)(0),[r,i]=f.useState(!1),a=()=>{i(!0),setTimeout(()=>{e&&e()},200)};f.useEffect(()=>{let e=e=>{e.key===`Escape`&&a()};
3286return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[e]);let o=()=>{t<Fs.length-1?n(e=>e+1):a()},s=()=>{t>0&&n(e=>e-1)},c=Fs[t];return(0,et.createPortal)((0,x.jsxs)(`div`,{className:`modal-overlay ${r?`ui-overlay-exit`:`ui-overlay-enter`}`,onClick:a,style:{zIndex:1e5},children:[(0,x.jsxs)(`div`,{className:`floating-container ${r?`ui-modal-exit`:`ui-modal-enter`}`,onClick:e=>e.stopPropagation(),children:[(0,x.jsxs)(`div`,{className:`floating-header`,children:[(0,x.jsx)(ze,{size:24,className:`floating-header-icon`}),(0,x.jsx)(`h1`,{className:`floating-title`,children:`What's New in v1.2.0`})]}),(0,x.jsxs)(`div`,{className:`card-stack-wrap`,children:[(0,x.jsx)(`div`,{className:`stack-card-bg stack-card-bg-2`}),(0,x.jsx)(`div`,{className:`stack-card-bg stack-card-bg-1`}),(0,x.jsxs)(`div`,{className:`glass-card`,children:[(0,x.jsx)(`div`,{className:`glass-card-icon-wrap`,children:c.icon}),(0,x.jsx)(`h2`,{className:`glass-card-title`,children:c.title}),(0,x.jsx)(`p`,{className:`glass-card-desc`,children:c.desc})]},t)]}),(0,x.jsxs)(`div`,{className:`floating-controls`,children:[(0,x.jsx)(`button`,{className:`float-btn-icon ${t===0?`disabled`:``}`,onClick:s,disabled:t===0,children:(0,x.jsx)(ie,{size:24})}),(0,x.jsx)(`div`,{className:`float-dots`,children:Fs.map((e,n)=>(0,x.jsx)(`div`,{className:`float-dot ${n===t?`active`:``}`},n))}),(0,x.jsxs)(`button`,{className:`float-btn-next`,onClick:o,children:[t===Fs.length-1?`Let's Go!`:`Next`,t<Fs.length-1&&(0,x.jsx)(ae,{size:20,style:{marginLeft:`4px`}})]})]})]}),(0,x.jsx)(`style`,{children:`
3287 .modal-overlay { 3288 position: fixed; 3289 top: 0; 3290 left: 0; 3291 right: 0; 3292 bottom: 0; 3293 background: rgba(10, 15, 30, 0.6); 3294 backdrop-filter: blur(16px); 3295 display: flex; 3296 align-items: center; 3297 justify-content: center; 3298 z-index: 100000; 3299 animation: fadeIn 0.3s ease-out forwards; 3300 } 3301 3302 .floating-container { 3303 position: relative; 3304 width: 100%; 3305 max-width: 500px; 3306 display: flex; 3307 flex-direction: column; 3308 align-items: center; 3309 justify-content: center; 3310 padding: 20px; 3311 } 3312 3313 .floating-close { 3314 position: absolute; 3315 top: 32px; 3316 right: 32px; 3317 background: rgba(255, 255, 255, 0.05); 3318 backdrop-filter: blur(8px); 3319 border: 1px solid rgba(255, 255, 255, 0.1); 3320 color: rgba(255, 255, 255, 0.7); 3321 cursor: pointer; 3322 transition: all 0.2s; 3323 padding: 12px; 3324 border-radius: 50%; 3325 display: flex; 3326 align-items: center; 3327 justify-content: center; 3328 z-index: 10; 3329 } 3330 3331 .floating-close:hover { 3332 color: white; 3333 background: rgba(255, 255, 255, 0.15); 3334 transform: scale(1.1) rotate(90deg); 3335 } 3336 3337 .floating-header { 3338 display: flex; 3339 align-items: center; 3340 gap: 12px; 3341 margin-bottom: 40px; 3342 animation: popDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; 3343 } 3344 3345 .floating-header-icon { 3346 color: #a78bfa; 3347 animation: pulseIcon 2s infinite ease-in-out; 3348 } 3349 3350 @keyframes pulseIcon { 3351 0%, 100% { transform: scale(1); opacity: 0.8; } 3352 50% { transform: scale(1.2); opacity: 1; text-shadow: 0 0 10px #a78bfa; } 3353 } 3354 3355 .floating-title { 3356 font-size: 1.6rem; 3357 font-weight: 800; 3358 color: #fff; 3359 margin: 0; 3360 text-shadow: 0 4px 20px rgba(0,0,0,0.5); 3361 letter-spacing: 0.02em; 3362 } 3363 3364 /* âââ STACKED CARDS WRAPPER âââ */ 3365 .card-stack-wrap { 3366 position: relative; 3367 width: 100%; 3368 height: 300px; 3369 perspective: 1000px; 3370 margin-bottom: 20px; 3371 } 3372 3373 .stack-card-bg { 3374 position: absolute; 3375 top: 0; 3376 left: 0; 3377 right: 0; 3378 bottom: 0; 3379 background: rgba(255, 255, 255, 0.015); 3380 border: 1px solid rgba(255, 255, 255, 0.05); 3381 border-radius: 32px; 3382 pointer-events: none; 3383 } 3384 3385 .stack-card-bg-1 { 3386 transform: translateY(-16px) scale(0.93); 3387 z-index: 1; 3388 } 3389 3390 .stack-card-bg-2 { 3391 transform: translateY(-32px) scale(0.86); 3392 z-index: 0; 3393 opacity: 0.5; 3394 } 3395 3396 .glass-card { 3397 position: absolute; 3398 top: 0; 3399 left: 0; 3400 right: 0; 3401 bottom: 0; 3402 padding: 36px 28px; 3403 background: rgba(255, 255, 255, 0.03); 3404 backdrop-filter: blur(40px); 3405 border: 1px solid rgba(255, 255, 255, 0.15); 3406 border-radius: 32px; 3407 display: flex; 3408 flex-direction: column; 3409 align-items: center; 3410 justify-content: center; 3411 text-align: center; 3412 box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255,255,255,0.2); 3413 z-index: 2; 3414 animation: slideInCard 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; 3415 transform-origin: bottom center; 3416 } 3417 3418 @keyframes slideInCard { 3419 from { opacity: 0; transform: translateY(40px) scale(0.95); } 3420 to { opacity: 1; transform: translateY(0) scale(1); } 3421 } 3422 3423 @keyframes popDown { 3424 from { opacity: 0; transform: translateY(-20px); } 3425 to { opacity: 1; transform: translateY(0); } 3426 } 3427 3428 .glass-card-icon-wrap { 3429 display: flex; 3430 align-items: center; 3431 justify-content: center; 3432 width: 72px; 3433 height: 72px; 3434 border-radius: 20px; 3435 background: rgba(255, 255, 255, 0.05); 3436 border: 1px solid rgba(255, 255, 255, 0.1); 3437 margin-bottom: 24px; 3438 box-shadow: 0 15px 35px -10px rgba(0,0,0,0.4); 3439 } 3440 3441 .text-pink-400 { color: #f472b6; } 3442 .text-blue-400 { color: #60a5fa; } 3443 .text-purple-400 { color: #c084fc; } 3444 .text-emerald-400 { color: #34d399; } 3445 3446 .glass-card-title { 3447 font-size: 1.5rem; 3448 font-weight: 700; 3449 color: #f8fafc; 3450 margin: 0 0 16px 0; 3451 text-shadow: 0 2px 10px rgba(0,0,0,0.3); 3452 } 3453 3454 .glass-card-desc { 3455 font-size: 1.05rem; 3456 color: #cbd5e1; 3457 margin: 0; 3458 line-height: 1.6; 3459 } 3460 3461 /* âââ FIXED CONTROLS âââ */
3462 .floating-controls { 3463 display: flex; 3464 align-items: center; 3465 justify-content: space-between; 3466 width: 100%; 3467 height: 60px; /* Fixed height */ 3468 margin-top: 10px; 3469 animation: popUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards 0.1s; 3470 opacity: 0; 3471 } 3472 3473 @keyframes popUp { 3474 from { opacity: 0; transform: translateY(20px); } 3475 to { opacity: 1; transform: translateY(0); } 3476 } 3477 3478 .float-dots { 3479 display: flex; 3480 gap: 8px; 3481 } 3482 3483 .float-dot { 3484 width: 8px; 3485 height: 8px; 3486 border-radius: 4px; 3487 background: rgba(255, 255, 255, 0.2); 3488 transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 3489 } 3490 3491 .float-dot.active { 3492 width: 24px; 3493 background: #8b5cf6; 3494 box-shadow: 0 0 10px rgba(139, 92, 246, 0.5); 3495 } 3496 3497 .float-btn-icon { 3498 display: flex; 3499 align-items: center; 3500 justify-content: center; 3501 width: 48px; 3502 height: 48px; 3503 border-radius: 24px; 3504 background: rgba(255, 255, 255, 0.05); 3505 backdrop-filter: blur(10px); 3506 border: 1px solid rgba(255, 255, 255, 0.1); 3507 color: white; 3508 cursor: pointer; 3509 transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 3510 } 3511 3512 .float-btn-icon:hover:not(.disabled) { 3513 background: rgba(255, 255, 255, 0.15); 3514 transform: translateX(-4px); 3515 } 3516 3517 .float-btn-icon.disabled { 3518 opacity: 0.3; 3519 cursor: default; 3520 } 3521 3522 .float-btn-next { 3523 display: flex; 3524 align-items: center; 3525 padding: 12px 28px; 3526 font-weight: 700; 3527 font-family: 'Outfit', sans-serif; 3528 background: linear-gradient(135deg, #8b5cf6, #d946ef); 3529 color: white; 3530 border: none; 3531 border-radius: 24px; 3532 font-size: 1rem; 3533 cursor: pointer; 3534 transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 3535 box-shadow: 0 10px 20px -5px rgba(139, 92, 246, 0.5); 3536 } 3537 3538 .float-btn-next:hover { 3539 transform: translateY(-4px) scale(1.05); 3540 box-shadow: 0 15px 25px -5px rgba(139, 92, 246, 0.6); 3541 } 3542 `})]}),document.body)}function Ls({onClose:e}){let[t,n]=(0,f.useState)(!1),r=()=>{n(!0),setTimeout(()=>{e&&e()},200)};return f.useEffect(()=>{let e=e=>{e.key===`Escape`&&r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,et.createPortal)((0,x.jsx)(`div`,{className:`about-overlay ${t?`ui-overlay-exit`:`ui-overlay-enter`}`,onClick:r,children:(0,x.jsxs)(`div`,{className:`about-modal ${t?`ui-modal-exit`:`ui-modal-enter`}`,onClick:e=>e.stopPropagation(),children:[(0,x.jsx)(`h2`,{className:`about-modal-title`,children:`About MoodByte`}),(0,x.jsx)(`p`,{className:`about-modal-text`,children:`MoodByte started as a random thought in 2025 â what if a sticky note board had themes, a Pomodoro t
3542imer, and a music player?`}),(0,x.jsx)(`p`,{className:`about-modal-text`,children:`It slowly grew into something more: a cozy digital space for your thoughts, whether it's schoolwork or personal stuff. No productivity pressure, just a place to think, focus, and breathe.`}),(0,x.jsx)(`p`,{className:`about-modal-text`,children:`This is a complete rebuild of the original MoodByte. I shelved it for a while because I hit the limits of what I knew at the time. Instead of forcing it, I kept learning.`}),(0,x.jsx)(`p`,{className:`about-modal-text`,children:`Now it's back â rebuilt from the ground up. The original MoodByte was built by a student who didn't know enough yet. This version was built by the same person, just a little older and a lot more experienced, still driven by a love for pixel art, retro aesthetics, and creating a workspace I'd actually enjoy using every day.`}),(0,x.jsxs)(`p`,{className:`about-modal-footer`,children:[`Made with `,(0,x.jsx)(`span`,{style:{color:`#ef4444`,animation:`pulse 2s ease-in-out infinite`},children:`â¤`}),`. Hope y'all like it.`]})]})}),document.body)}function Rs({bgImage:e}){let[t,n]=(0,f.useState)([]),[r,i]=(0,f.useState)(!0);return(0,f.useEffect)(()=>{let t=!1;i(!0);let r=new Image;return r.onload=()=>{t||(i(!1),n(t=>t.length>0&&t[t.length-1].src===e?t:[...t,{id:Date.now(),src:e}]),setTimeout(()=>{t||n(e=>e.slice(-1))},1500))},r.src=e,()=>{t=!0}},[e]),(0,x.jsxs)(`div`,{className:`bg-manager`,children:[t.length===0&&(0,x.jsx)(`div`,{className:`bg-skeleton-pulse`}),t.map((e,n)=>(0,x.jsx)(`div`,{className:`bg-layer`,style:{backgroundImage:`url('${e.src}')`,opacity:+(n===t.length-1)}},e.id)),t.length>0&&r&&(0,x.jsx)(`div`,{className:`bg-loading-indicator fade-in`,children:(0,x.jsx)(ye,{size:16,className:`spin-slow`})})]})}var zs=[`moodbyte_welcome_main`,`moodbyte_welcome_desk`,`moodbyte_dailyQuote`,`calendarNotes`,`tasks`,`taskHistory`,`moodHistory`,`stickyNotes`,`pomodoroStats`,`pomodoroCustom`,`unlockedAchievements`,`streakStats`,`zenStudyNotes`,`studyPetSettings`,`studyPetTreats`,`theme`,`customBgsV2`,`player_volume`,`player_shuffle`,`player_repeat`,`spotify_history`];function Bs(e){return zs.includes(e)||e.startsWith(`moodbyte_`)}function Vs(e,t){return e>t}function Hs({onlyIfNewer:e,localTs:t,cloudTs:n}){return e&&t>n?`pushLocalInstead`:`apply`}function Us(e){let t={};for(let n=0;n<e.length;n++){let r=e.key(n);if(!Bs(r))continue;let i=e.getItem(r);try{t[r]=JSON.parse(i)}catch{t[r]=i}}return t}var Ws=`moodbyte_local_last_modified`;function Gs(){return parseInt(localStorage.getItem(Ws)||`0`,10)}function Ks(){let e=Date.now();return localStorage.setItem(Ws,String(e)),e}function qs(){let[e,t]=(0,f.useState)(null),[n,r]=(0,f.useState)(`idle`),[i,a]=(0,f.useState)(null),o=(0,f.useRef)(null),s=(0,f.useRef)(!1);(0,f.useEffect)(()=>{Qo.auth.getSession().then(({data:{session:e}})=>{t(e?.user||null)});let{data:{subscription:e}}=Qo.auth.onAuthStateChange((e,n)=>{t(n?.user||null),e===`SIGNED_IN`&&sessionStorage.getItem(`moodbyte_expecting_login`)&&(sessionStorage.removeItem(`moodbyte_expecting_login`),window.dispatchEvent(new CustomEvent(`sync-toast`,{detail:`Cloud Sync Activated!`})))});return()=>e.unsubscribe()},[]),(0,f.useEffect)(()=>{e&&c({onlyIfNewer:!0})},[e]),(0,f.useEffect)(()=>{if(!e)return;let t=e=>{s.current||e.detail?.fromCloud||e.detail&&typeof e.detail.key==`string`&&Bs(e.detail.ke
3542y)&&(Ks(),o.current&&clearTimeout(o.current),r(`syncing`),o.current=setTimeout(()=>{l()},500))};return window.addEventListener(`local-storage`,t),()=>window.removeEventListener(`local-storage`,t)},[e]),(0,f.useEffect)(()=>{if(!e)return;let t=Qo.channel(`user-sync-changes`).on(`postgres_changes`,{event:`*`,schema:`public`,table:`user_sync_data`,filter:`user_id=eq.${e.id}`},e=>{if(!Vs(e.new?.updated_at?new Date(e.new.updated_at).getTime():0,Gs()))return;let t=e.new?.data;t&&(s.current=!0,Object.entries(t).forEach(([e,t])=>{if(Bs(e)){let n=window.localStorage.getItem(e),r=JSON.stringify(t);n!==r&&(window.localStorage.setItem(e,r),window.dispatchEvent(new CustomEvent(`local-storage`,{detail:{key:e,value:t,fromCloud:!0}})))}}),s.current=!1,e.new.updated_at&&a(new Date(e.new.updated_at)))}).subscribe();return()=>{Qo.removeChannel(t)}},[e]);let c=async({onlyIfNewer:t=!1}={})=>{try{r(`syncing`);let{data:n,error:i}=await Qo.from(`user_sync_data`).select(`data, updated_at`).eq(`user_id`,e.id).single();if(i&&i.code!==`PGRST116`)throw i;if(n&&n.data){let e=n.updated_at?new Date(n.updated_at).getTime():0;if(Hs({onlyIfNewer:t,localTs:Gs(),cloudTs:e})===`pushLocalInstead`){r(`success`),l();return}let i=n.data;s.current=!0,Object.entries(i).forEach(([e,t])=>{Bs(e)&&(window.localStorage.setItem(e,JSON.stringify(t)),window.dispatchEvent(new CustomEvent(`local-storage`,{detail:{key:e,value:t,fromCloud:!0}})))}),s.current=!1,n.updated_at&&a(new Date(n.updated_at))}else l();r(`success`)}catch(e){console.error(`Error pulling from cloud:`,e),r(`error`)}},l=async()=>{if(e)try{r(`syncing`);let t=Us(window.localStorage),{error:n}=await Qo.from(`user_sync_data`).upsert({user_id:e.id,data:t,updated_at:new Date().toISOString()});if(n)throw n;a(new Date),r(`success`)}catch(e){console.error(`Error pushing to cloud:`,e),r(`error`)}};return{user:e,syncStatus:n,lastSyncTime:i,pullFromCloud:c,pushToCloud:l}}function Js(){let e=`moodbyte_anon_session_id`,t=localStorage.getItem(e);return t||(t=crypto.randomUUID(),localStorage.setItem(e,t)),t}var Ys=`[email protected]`;function Xs(e){(0,f.useEffect)(()=>{(async()=>{try{let t=Js(),n=`moodbyte_visit_logged_${new Date().toDateString()}`;if(sessionStorage.getItem(n))return;let{data:{session:r}}=await Qo.auth.getSession(),i=r?.user?.id||null;if(r?.user?.email===Ys)return;await Qo.from(`page_visits`).insert({session_id:t,user_id:i,theme:e||`chill`,visited_at:new Date().toISOString()}),sessionStorage.setItem(n,`1`)}catch(e){console.warn(`Analytics log failed:`,e.message)}})()},[])}function Zs(e){let t=(0,f.useRef)(null),[n,r]=(0,f.useState)(e[0]?.id);return(0,f.useEffect)(()=>{let n=t.current;if(!n)return;let i=()=>{let t=e[0].id,i=1/0;e.forEach(({id:e})=>{let r=document.getElementById(`sec-`+e);if(!r)return;let a=Math.abs(r.offsetTop-n.scrollTop-24);a<i&&(i=a,t=e)}),r(t)};return n.addEventListener(`scroll`,i),()=>n.removeEventListener(`scroll`,i)},[]),{sidebarScrollRef:t,activeSection:n,scrollToSection:e=>{let n=document.getElementById(`sec-`+e),r=t.current;if(!n||!r)return;let i=n.offsetTop;r.scrollTo({top:i-24,behavior:`smooth`})}}}function Qs(){(0,f.useEffect)(()=>{history.pushState({moodbyte:!0},``);let e=()=>{history.pushState({moodbyte:!0},``)};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[])}function $s(e){(0,f.useEffect)(()=>{let t=setTimeout(()=>{e.forEach(e=>{let t=new Image;t.src=e})},3e3);return()=>clearTimeout(t)},[])}function ec(){let[e,t]=(0,f.useState)(null),[n,r]=(0,f.useState)(`success`),[i,a]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{let e=null,n=null,i=null,o=e=>{let o=e&&typeof e==`object`;t(o?e.message:e),r(o&&e.type===`error`?`error`:`success`),a(!1),n&&clearTimeout(n),i&&clearTimeout(i),n=setTimeout(()=>{a(!0),i=setTimeout(()=>{t(null),a(!1)},300)},3500)},s=t=>{document.querySelector(`.loading-screen`)?e=t.detail:o(t.detail)},c=()=>{e&&=(o(e),null)};return window.addEventListener(`sync-toast`,s),window.addEventListener(`app-ready`,c),()=>{window.removeEventListener(`sync-toast`,s),window.removeEventListener(`app-ready`,c),n&&clearTimeout(n),i&&clearTimeout(i)}},[]),!e&&!i?null:(0,et.createPortal)((0,x.jsxs)(`div`,{className:`sync-toast-container ${i?`exiting`:``}`,children:[(0,x.jsxs)(`div`,{className:`sync-toast-content ${n===`error`?`error`:``}`,children:[n===`error`?(0,x.jsx)(qe,{size:18,className:`sync-toast-icon`}):(0,x.jsx)(oe,{size:18,className:`sync-toast-icon`}),(0,x.jsx)(`span`,{className:`sync-toast-text`,children:e})]}),(0,x.jsx)(`style`,{jsx:`true`,children:` 3543 .sync-toast-container { 3544 position: fixed; 3545 top: 32px; 3546 left: 50%; 3547 transform: translateX(-50%); 3548 z-index: 9999; 3549 animation: slideDownFadeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; 3550 } 3551 3552 .sync-toast-container.exiting { 3553 animation: slideUpFadeOut 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; 3554 } 3555 3556 .sync-toast-content { 3557 display: flex; 3558 align-items: center; 3559 gap: 10px; 3560 background: rgba(34, 197, 94, 0.15); 3561 backdrop-filter: blur(20px); 3562 border: 1px solid rgba(34, 197, 94, 0.3); 3563 border-radius: 100px; 3564 padding: 10px 20px; 3565 box-shadow: 0 10px 30px rgba(0,0,0,0.3); 3566 } 3567 3568 .sync-toast-content.error { 3569 background: rgba(239, 68, 68, 0.15); 3570 border-color: rgba(239, 68, 68, 0.3); 3571 } 3572 3573 .sync-toast-icon { 3574 color: #22c55e; 3575 } 3576 3577 .sync-toast-content.error .sync-toast-icon { 3578 color: #ef4444; 3579 } 3580 3581 .sync-toast-text { 3582 color: #fff; 3583 font-family: 'Outfit', sans-serif; 3584 font-size: 0.95rem; 3585 font-weight: 500; 3586 } 3587 3588 @keyframes slideDownFadeIn { 3589 from { 3590 opacity: 0; 3591 transform: translate(-50%, -20px) scale(0.9); 3592 } 3593 to { 3594 opacity: 1; 3595 transform: translate(-50%, 0) scale(1); 3596 } 3597 } 3598 3599 @keyframes slideUpFadeOut { 3600 from { 3601 opacity: 1; 3602 transform: translate(-50%, 0) scale(1); 3603 } 3604 to { 3605 opacity: 0; 3606 transform: translate(-50%, -20px) scale(0.9); 3607 } 3608 } 3609 `})]}),document.body)}function tc({activeTab:e,onTabChange:t,items:n}){return(0,x.jsxs)(`nav`,{className:`mob-bottom-nav`,children:[[...n,{id:`more`,Icon:j,label:`More`}].map(({id:e,Icon:n,label:r})=>(0,x.jsxs)(`button`,{className:`mob-tab-btn`,onClick:()=>t(e),children:[(0,x.jsx)(`span`,{className:`mob-tab-icon`,children:(0,x.jsx)(n,{size:20,strokeWidth:1.6})}),(0,x.jsx)(`span`,{className:`mob-tab-label`,children:r})]},e)),(0,x.jsx)(`style`,{children:` 3610 .mob-bottom-nav { 3611 position: fixed; 3612 bottom: calc(16px + env(safe-area-inset-bottom, 0px)); 3613 left: 50%; 3614 transform: translateX(-50%); 3615 width: calc(100% - 48px); 3616 max-width: 420px; 3617 height: 60px; 3618 display: flex; 3619 align-items: stretch; 3620 padding: 0 10px; 3621 background: rgba(10, 14, 30, 0.82); 3622 backdrop-filter: blur(28px); 3623 border: 1px solid rgba(255,255,255,0.12); 3624 border-radius: 24px; 3625 box-shadow: 0 8px 32px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.06); 3626 z-index: 9000; 3627 overflow: hidden; 3628 } 3629 .mob-tab-btn { 3630 flex: 1; 3631 display: flex; 3632 flex-direction: column; 3633 align-items: center; 3634 justify-content: center; 3635 gap: 3px; 3636 background: none; 3637 border: none; 3638 cursor: pointer; 3639 color: rgba(255,255,255,0.35); 3640 transition: color 0.2s ease; 3641 -webkit-tap-highlight-color: transparent; 3642 touch-action: manipulation; 3643 position: relative; 3644 min-height: 60px; 3645 } 3646 .mob-tab-icon { 3647 position: relative; 3648 display: flex; 3649 align-items: center; 3650 justify-content: center; 3651 } 3652 .mob-tab-label { 3653 font-family: 'Outfit', sans-serif; 3654 font-size: 0.6rem; 3655 font-weight: 500; 3656 letter-spacing: 0.03em; 3657 } 3658 `})]})}var nc=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],rc=[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`];function ic(e,t,n){return`${e}-${String(t+1).padStart(2,`0`)}-${String(n).padStart(2,`0`)}`}function ac(){let e=new Date,[t,n]=(0,f.useState)(new Date(e.getFullYear(),e.getMonth(),1)),[r,i]=(0,f.useState)(null),[o,s]=a(`calendarNotes`,{}),[c]=a(`tasks`,[]),[l,u]=(0,f.useState)(``),d=t.getFullYear(),p=t.getMonth(),m=new Date(d,p+1,0).getDate(),h=new Date(d,p,1).getDay(),g=ic(e.getFullYear(),e.getMonth(),e.getDate());(0,f.useEffect)(()=>{r&&u(typeof o[r]==`string`?o[r]:``)},[r]);let _=e=>{u(e),s(t=>({...t,[r]:e}))},v=[];for(let e=0;e<h;e++)v.push(null);for(let e=1;e<=m;e++)v.push(e);for(;v.length%7!=0;)v.push(null);let y=[];for(let e=0;e<v.length;e+=7)y.push(v.slice(e,e+7));let b=r?y.findIndex(e=>e.some(e=>e&&ic(d,p,e)===r)):-1,S=e=>{let t=c.filter(t=>t.calendarDate===e&&!t.completed).length;return t===0?``:t<=2?`dot-purple`:t<=5?`dot-orange`:`dot-red`},C=e=>o[e]&&(typeof o[e]==`string`?o[e].trim().length>0:!1),w=r?c.filter(e=>e.calendarDate===r):[],T=r?new Date(r+`T12:00:00`).toLocaleDateString(void 0,{weekday:`long`,month:`long`,day:`numeric`}):``;return(0,x.jsxs)(`div`,{className:`mob-calendar`,children:[(0,x.jsxs)(`div`,{className:`mob-cal-nav`,children:[(0,x.jsx)(`button`,{className:`mob-cal-nav-btn`,onClick:()=>{i(null),n(new Date(d,p-1,1))},children:(0,x.jsx)(ie,{size:18})}),(0,x.jsxs)(`span`,{className:`mob-cal-month font-pixel`,children:[nc[p],` `,d]}),(0,x.jsx)(`button`,{className:`mob-cal-nav-btn`,onClick:()=>{i(null),n(new Date(d,p+1,1))},children:(0,x.jsx)(ae,{size:18})})]}),(0,x.jsx)(`div`,{className:`mob-cal-day-names`,children:rc.map(e=>(0,x.jsx)(`div`,{className:`mob-cal-dn`,children:e},e))}),(0,x.jsx)(`div`,{className:`mob-cal-weeks`,children:y.map((e,t)=>(0,x.jsxs)(f.Fragment,{children:[(0,x.jsx)(`div`,{className:`mob-cal-week`,children:e.map((e,t)=>{let n=e?ic(d,p,e):null,a=n===g,o=n===r,s=n?S(n):``,c=n?C(n):!1;return(0,x.jsxs)(`div`,{className:`mob-cal-day ${e?`active`:`empty`} ${a?`today`:``} ${o?`selected`:``}`,onClick:()=>{e&&i(o?null:n)}
3658,children:[e||``,(0,x.jsxs)(`span`,{className:`mob-day-dots`,children:[c&&(0,x.jsx)(`span`,{className:`mob-dot dot-white`}),s&&(0,x.jsx)(`span`,{className:`mob-dot ${s}`})]})]},t)})}),b===t&&r&&(0,x.jsxs)(`div`,{className:`mob-day-panel`,children:[(0,x.jsxs)(`div`,{className:`mob-day-panel-header`,children:[(0,x.jsx)(O,{size:13}),(0,x.jsx)(`span`,{children:T})]}),(0,x.jsxs)(`div`,{className:`mob-panel-section`,children:[(0,x.jsx)(`div`,{className:`mob-panel-label`,children:`Note`}),(0,x.jsx)(`textarea`,{className:`mob-panel-textarea`,placeholder:`Write anything...`,value:l,onChange:e=>_(e.target.value),rows:3})]}),w.length>0&&(0,x.jsxs)(`div`,{className:`mob-panel-section`,children:[(0,x.jsx)(`div`,{className:`mob-panel-label`,children:`Tasks`}),(0,x.jsx)(`ul`,{className:`mob-panel-tasks`,children:w.map(e=>(0,x.jsxs)(`li`,{className:`mob-panel-task ${e.completed?`done`:``}`,children:[e.completed?(0,x.jsx)(Be,{size:13,className:`mob-task-icon done`}):(0,x.jsx)(Ve,{size:13,className:`mob-task-icon`}),(0,x.jsx)(`span`,{children:e.text})]},e.id))})]})]})]},t))}),(0,x.jsx)(`style`,{children:` 3659 .mob-calendar { 3660 width: 100%; 3661 padding: 16px 14px; 3662 box-sizing: border-box; 3663 user-select: none; 3664 -webkit-user-select: none; 3665 } 3666 .mob-cal-nav { 3667 display: flex; 3668 align-items: center; 3669 justify-content: space-between; 3670 margin-bottom: 14px; 3671 } 3672 .mob-cal-nav-btn { 3673 width: 34px; height: 34px; 3674 border-radius: 10px; 3675 background: rgba(255,255,255,0.06); 3676 border: 1px solid rgba(255,255,255,0.1); 3677 color: #fff; 3678 display: flex; align-items: center; justify-content: center; 3679 cursor: pointer; 3680 } 3681 .mob-cal-nav-btn:hover { background: var(--primary); border-color: var(--primary); } 3682 .mob-cal-month { font-size: 0.7rem; color: #fff; } 3683 3684 .mob-cal-day-names { 3685 display: grid; 3686 grid-template-columns: repeat(7, 1fr); 3687 text-align: center; 3688 margin-bottom: 6px; 3689 } 3690 .mob-cal-dn { 3691 font-family: 'Outfit', sans-serif; 3692 font-size: 0.62rem; 3693 color: rgba(255,255,255,0.35); 3694 padding: 4px 0; 3695 } 3696 3697 .mob-cal-weeks { display: flex; flex-direction: column; gap: 3px; } 3698 .mob-cal-week { 3699 display: grid; 3700 grid-template-columns: repeat(7, 1fr); 3701 gap: 3px; 3702 } 3703 .mob-cal-day { 3704 position: relative; 3705 aspect-ratio: 1; 3706 display: flex; flex-direction: column; 3707 align-items: center; justify-content: center; 3708 font-family: 'Outfit', sans-serif; 3709 font-size: 0.85rem; color: #fff; 3710 border-radius: 10px; 3711 gap: 2px; 3712 } 3713 .mob-cal-day.active { 3714 background: rgba(255,255,255,0.04); 3715 border: 1px solid rgba(255,255,255,0.06); 3716 cursor: pointer; 3717 } 3718 .mob-cal-day.active:active { opacity: 0.7; } 3719 .mob-cal-day.today { 3720 background: var(--primary) !important; 3721 border: none !important; 3722 font-weight: 700; 3723 box-shadow: 0 0 12px var(--primary); 3724 } 3725 .mob-cal-day.selected { 3726 background: rgba(168,85,247,0.25) !important; 3727 border-color: rgba(168,85,247,0.6) !important; 3728 } 3729 .mob-cal-day.empty { cursor: default; } 3730 .mob-day-dots { 3731 display: flex; gap: 2px; justify-content: center; align-items: center; 3732 min-height: 5px; 3733 } 3734 .mob-dot { 3735 width: 4px; height: 4px; border-radius: 50%; flex-shrink: 0; 3736 } 3737 .dot-white { background: rgba(255,255,255,0.4); } 3738 .dot-purple { background: #a855f7; box-shadow: 0 0 4px rgba(168,85,247,0.8); } 3739 .dot-orange { background: #f97316; box-shadow: 0 0 4px rgba(249,115,22,0.8); } 3740 .dot-red { background: #ef4444; box-shadow: 0 0 5px rgba(239,68,68,0.8); } 3741 3742 /* Accordion panel */ 3743 .mob-day-panel { 3744 background: rgba(20, 27, 50, 0.85); 3745 backdrop-filter: blur(16px); 3746 border: 1px solid rgba(168,85,247,0.2); 3747 border-radius: 14px; 3748 padding: 14px; 3749 display: flex; flex-direction: column; gap: 12px;
3750 animation: panelSlide 0.22s cubic-bezier(0.34,1.56,0.64,1); 3751 margin: 2px 0; 3752 } 3753 @keyframes panelSlide { 3754 from { opacity: 0; transform: translateY(-8px) scale(0.98); } 3755 to { opacity: 1; transform: translateY(0) scale(1); } 3756 } 3757 .mob-day-panel-header { 3758 display: flex; align-items: center; gap: 6px; 3759 font-family: 'Outfit', sans-serif; 3760 font-size: 0.78rem; font-weight: 600; 3761 color: var(--primary); 3762 } 3763 .mob-panel-section { display: flex; flex-direction: column; gap: 6px; } 3764 .mob-panel-label { 3765 font-family: 'Outfit', sans-serif; 3766 font-size: 0.65rem; font-weight: 600; 3767 text-transform: uppercase; letter-spacing: 0.08em; 3768 color: rgba(255,255,255,0.35); 3769 } 3770 .mob-panel-textarea { 3771 width: 100%; box-sizing: border-box; 3772 background: rgba(255,255,255,0.05); 3773 border: 1px solid rgba(255,255,255,0.1); 3774 border-radius: 10px; 3775 padding: 10px 12px; 3776 color: #fff; 3777 font-family: 'Outfit', sans-serif; 3778 font-size: 0.85rem; 3779 line-height: 1.5; 3780 resize: none; 3781 outline: none; 3782 } 3783 .mob-panel-textarea:focus { 3784 border-color: rgba(168,85,247,0.5); 3785 box-shadow: 0 0 0 3px rgba(168,85,247,0.08); 3786 } 3787 .mob-panel-textarea::placeholder { color: rgba(255,255,255,0.25); } 3788 .mob-panel-tasks { 3789 list-style: none; padding: 0; margin: 0; 3790 display: flex; flex-direction: column; gap: 6px; 3791 } 3792 .mob-panel-task { 3793 display: flex; align-items: center; gap: 8px; 3794 font-family: 'Outfit', sans-serif; 3795 font-size: 0.82rem; color: rgba(255,255,255,0.85); 3796 } 3797 .mob-panel-task.done { 3798 opacity: 0.45; 3799 text-decoration: line-through; 3800 } 3801 .mob-task-icon { color: rgba(255,255,255,0.4); flex-shrink: 0; } 3802 .mob-task-icon.done { color: #4ade80; } 3803 `})]})}function oc({title:e,onClose:t,children:n,heightVh:r=52}){return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{className:`mft-backdrop`,onPointerDown:t,style:{touchAction:`none`}}),(0,x.jsxs)(`div`,{className:`mft-tray`,style:{maxHeight:`${r}vh`},children:[(0,x.jsxs)(`div`,{className:`mft-header`,children:[(0,x.jsx)(`span`,{className:`mft-title font-pixel`,children:e}),(0,x.jsx)(`button`,{className:`mft-close`,onClick:t,children:(0,x.jsx)(s,{size:15})})]}),(0,x.jsx)(`div`,{className:`mft-body`,children:n})]}),(0,x.jsx)(`style`,{children:` 3804 .mft-backdrop { 3805 position: fixed; inset: 0; 3806 z-index: 8100; 3807 } 3808 3809 .mft-tray { 3810 position: fixed; 3811 bottom: calc(84px + env(safe-area-inset-bottom, 0px)); 3812 left: 50%; 3813 transform: translateX(-50%); 3814 width: calc(100% - 32px); 3815 max-width: 480px; 3816 background: rgba(10, 14, 30, 0.94); 3817 backdrop-filter: blur(28px); 3818 border: 1px solid rgba(255,255,255,0.12); 3819 border-radius: 22px; 3820 box-shadow: 0 10px 48px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.07); 3821 z-index: 8200; 3822 display: flex; 3823 flex-direction: column; 3824 overflow: hidden; 3825 animation: mftSlideUp 0.24s cubic-bezier(0.34, 1.3, 0.64, 1); 3826 } 3827 @keyframes mftSlideUp { 3828 from { opacity: 0; transform: translateX(-50%) translateY(20px) scale(0.97); } 3829 to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } 3830 } 3831 3832 .mft-header { 3833 display: flex; align-items: center; justify-content: space-between; 3834 padding: 14px 16px 12px; 3835 border-bottom: 1px solid rgba(255,255,255,0.07); 3836 flex-shrink: 0; 3837 } 3838 .mft-title { 3839 font-size: 0.6rem; 3840 color: var(--primary, #a855f7); 3841 letter-spacing: 0.08em; 3842 } 3843 .mft-close { 3844 width: 26px; height: 26px; 3845 border-radius: 50%; 3846 background: rgba(255,255,255,0.07); 3847 border: 1px solid rgba(255,255,255,0.1); 3848 color: rgba(255,255,255,0.5); 3849 display: flex; align-items: center; justify-content: center; 3850 cursor: pointer; 3851 touch-action: manipulation; 3852 -webkit-tap-highlight-color: transparent; 3853 } 3854 .mft-close:active { background: rgba(255,255,255,0.15); } 3855 3856 .mft-body { 3857 flex: 1; 3858 overflow-y: auto; 3859 -webkit-overflow-scrolling: touch; 3860 padding: 10px 12px; 3861 } 3862 3863 /* ââ Compact task overrides inside the mobile tray ââ */ 3864 .mft-body .task-container { 3865 gap: 0.5rem; 3866 } 3867 .mft-body .task-header { 3868 gap: 0.3rem; 3869 } 3870 .mft-body .task-stat-label { 3871 font-size: 0.72rem; 3872 } 3873 .mft-body .task-input-form { 3874 padding: 4px 4px 4px 10px; 3875 border-radius: 10px; 3876 } 3877 .mft-body .task-input { 3878 font-size: 0.8rem; 3879 } 3880 .mft-body .filter-tabs { 3881 gap: 0.3rem; 3882 } 3883 .mft-body .filter-tab { 3884 padding: 0.2rem 0.4rem; 3885 font-size: 0.67rem; 3886 border-radius: 7px; 3887 } 3888 .mft-body .task-list { 3889 max-height: none; 3890 } 3891 .mft-body .task-item { 3892 padding: 0.45rem 0.65rem; 3893 margin-bottom: 0.3rem; 3894 border-radius: 10px; 3895 gap: 0.55rem; 3896 } 3897 .mft-body .checkbox { 3898 width: 18px; 3899 height: 18px; 3900 border-radius: 5px; 3901 } 3902 .mft-body .task-name { 3903 font-size: 0.8rem; 3904 } 3905 .mft-body .task-date { 3906 font-size: 0.65rem; 3907 } 3908 .mft-body .clear-done-btn { 3909 font-size: 0.72rem; 3910 padding: 6px 0; 3911 } 3912 `})]})}function sc({items:e,onSelect:t,onClose:n}){return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{className:`mmp-backdrop`,onPointerDown:n,style:{touchAction:`none`}}),(0,x.jsx)(`div`,{className:`mmp-card`,children:(0,x.jsx)(`div`,{className:`mmp-grid`,children:e.map(({id:e,Icon:r,label:i})=>(0,x.jsxs)(`button`,{className:`mmp-tile`,onClick:()=>{t(e),n()},children:[(0,x.jsx)(`span`,{className:`mmp-tile-icon`,children:(0,x.jsx)(r,{size:20,strokeWidth:1.8})}),(0,x.jsx)(`span`,{className:`mmp-tile-label`,children:i})]},e))})}),(0,x.jsx)(`style`,{children:` 3913 .mmp-backdrop { 3914 position: fixed; inset: 0; 3915 z-index: 8900; 3916 } 3917 3918 .mmp-card { 3919 position: fixed; 3920 bottom: calc(84px + env(safe-area-inset-bottom, 0px)); 3921 left: 50%; 3922 transform: translateX(-50%); 3923 width: calc(100% - 64px); 3924 max-width: 280px; 3925 background: rgba(10, 14, 30, 0.94); 3926 backdrop-filter: blur(28px); 3927 border: 1px solid rgba(255,255,255,0.12); 3928 border-radius: 20px; 3929 box-shadow: 0 8px 40px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.07); 3930 z-index: 8950; 3931 overflow: hidden; 3932 animation: mmpSlideUp 0.2s cubic-bezier(0.34,1.56,0.64,1); 3933 padding: 10px; 3934 } 3935 @keyframes mmpSlideUp { 3936 from { opacity: 0; transform: translateX(-50%) translateY(14px) scale(0.95); } 3937 to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } 3938 } 3939 3940 .mmp-grid { 3941 display: grid; 3942 grid-template-columns: 1fr 1fr; 3943 gap: 8px; 3944 } 3945 3946 .mmp-tile { 3947 display: flex; flex-direction: column; 3948 align-items: center; justify-content: center; 3949 gap: 7px; 3950 padding: 14px 8px; 3951 background: rgba(255,255,255,0.05); 3952 border: 1px solid rgba(255,255,255,0.08); 3953 border-radius: 14px; 3954 color: rgba(255,255,255,0.75); 3955 font-family: 'Outfit', sans-serif; 3956 font-size: 0.78rem; font-weight: 500; 3957 cursor: pointer; 3958 -webkit-tap-highlight-color: transparent; 3959 touch-action: manipulation; 3960 transition: background 0.12s, color 0.12s; 3961 min-height: 72px; 3962 } 3963 .mmp-tile:active { 3964 background: rgba(168,85,247,0.18); 3965 border-color: rgba(168,85,247,0.4); 3966 color: var(--primary, #a855f7); 3967 } 3968 3969 .mmp-tile-icon { 3970 width: 36px; height: 36px; 3971 display: flex; align-items: center; justify-content: center; 3972 background: rgba(255,255,255,0.06); 3973 border: 1px solid rgba(255,255,255,0.08); 3974 border-radius: 10px; 3975 color: rgba(255,255,255,0.5); 3976 } 3977 .mmp-tile:active .mmp-tile-icon { 3978 background: rgba(168,85,247,0.2); 3979 border-color: rgba(168,85,247,0.4); 3980 color: var(--primary, #a855f7); 3981 } 3982 3983 .mmp-tile-label { line-height: 1; } 3984 `})]})}function cc({title:e,onClose:t,children:n,maxHeight:r=`82vh`}){return(0,f.useEffect)(()=>(document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=``}),[]),(0,et.createPortal)((0,x.jsxs)(`div`,{className:`mob-sheet-backdrop`,onClick:t,children:[(0,x.jsxs)(`div`,{className:`mob-sheet`,style:{maxHeight:r},onClick:e=>e.stopPropagation(),children:[(0,x.jsx)(`div`,{className:`mob-sheet-handle-row`,children:(0,x.jsx)(`div`,{className:`mob-sheet-handle`})}),(0,x.jsxs)(`div`,{className:`mob-sheet-header`,children:[(0,x.jsx)(`span`,{className:`mob-sheet-title font-pixel`,children:e}),(0,x.jsx)(`button`,{className:`mob-sheet-close`,onClick:t,children:(0,x.jsx)(s,{size:16})})]}),(0,x.jsx)(`div`,{className:`mob-sheet-body`,children:n})]}),(0,x.jsx)(`style`,{children:` 3985 .mob-sheet-backdrop { 3986 position: fixed; 3987 inset: 0; 3988 z-index: 99000; 3989 background: rgba(0,0,0,0.55); 3990 backdrop-filter: blur(4px); 3991 display: flex; 3992 align-items: flex-end; 3993 animation: sheetFadeIn 0.2s ease; 3994 } 3995 @keyframes sheetFadeIn { 3996 from { opacity: 0; } 3997 to { opacity: 1; } 3998 } 3999 4000 .mob-sheet { 4001 width: 100%; 4002 background: rgba(10, 14, 30, 0.96); 4003 backdrop-filter: blur(30px); 4004 border: 1px solid rgba(255,255,255,0.1); 4005 border-bottom: none; 4006 border-radius: 24px 24px 0 0; 4007 display: flex; 4008 flex-direction: column; 4009 overflow: hidden; 4010 animation: sheetSlideUp 0.28s cubic-bezier(0.34, 1.56, 0.64, 1); 4011 box-shadow: 0 -12px 48px rgba(0,0,0,0.5); 4012 } 4013 @keyframes sheetSlideUp { 4014 from { transform: translateY(100%); opacity: 0.6; } 4015 to { transform: translateY(0); opacity: 1; } 4016 } 4017 4018 .mob-sheet-handle-row { 4019 display: flex; justify-content: center; 4020 padding: 10px 0 4px; 4021 flex-shrink: 0; 4022 } 4023 .mob-sheet-handle { 4024 width: 36px; height: 4px; 4025 background: rgba(255,255,255,0.2); 4026 border-radius: 2px; 4027 } 4028 4029 .mob-sheet-header { 4030 display: flex; align-items: center; justify-content: space-between; 4031 padding: 4px 20px 12px; 4032 border-bottom: 1px solid rgba(255,255,255,0.07); 4033 flex-shrink: 0; 4034 } 4035 .mob-sheet-title { 4036 font-size: 0.6rem; 4037 color: var(--primary, #a855f7); 4038 letter-spacing: 0.08em; 4039 } 4040 .mob-sheet-close { 4041 width: 28px; height: 28px; 4042 border-radius: 50%; 4043 background: rgba(255,255,255,0.07); 4044 border: 1px solid rgba(255,255,255,0.1); 4045 color: rgba(255,255,255,0.6); 4046 display: flex; align-items: center; justify-content: center; 4047 cursor: pointer; 4048 }
4049 .mob-sheet-close:active { background: rgba(255,255,255,0.15); } 4050 4051 .mob-sheet-body { 4052 flex: 1; 4053 overflow-y: auto; 4054 -webkit-overflow-scrolling: touch; 4055 padding: 16px 0 calc(16px + env(safe-area-inset-bottom, 0px)); 4056 } 4057 4058 /* Suppress the desktop modal's own full-screen overlay when inside a sheet */ 4059 .mob-sheet-body .stats-overlay, 4060 .mob-sheet-body .settings-overlay, 4061 .mob-sheet-body .about-overlay { 4062 position: static !important; 4063 background: none !important; 4064 backdrop-filter: none !important; 4065 display: block !important; 4066 animation: none !important; 4067 } 4068 .mob-sheet-body .stats-modal, 4069 .mob-sheet-body .settings-modal { 4070 box-shadow: none !important; 4071 border: none !important; 4072 background: transparent !important; 4073 max-height: none !important; 4074 max-width: 100% !important; 4075 width: 100% !important; 4076 border-radius: 0 !important; 4077 padding: 0 20px !important; 4078 animation: none !important; 4079 } 4080 `})]}),document.body)}var lc=[{id:`themes`,Icon:xe,label:`Themes`,kind:`sheet`},{id:`tasks`,Icon:k,label:`Tasks`,kind:`tray`},{id:`calendar`,Icon:O,label:`Calendar`,kind:`tray`},{id:`study`,Icon:te,label:`Study`,kind:`study`},{id:`stats`,Icon:ne,label:`Stats`,kind:`sheet`},{id:`settings`,Icon:ge,label:`Wallpapers`,kind:`sheet`},{id:`sync`,Icon:Pe,label:`Settings`,kind:`sheet`},{id:`music`,Icon:Ce,label:`Music`,kind:`sheet`},{id:`pomodoro`,Icon:Ge,label:`Pomodoro`,kind:`sheet`},{id:`mood`,Icon:Re,label:`Mood`,kind:`sheet`},{id:`community`,Icon:Ye,label:`Wall`,kind:`sheet`}],uc=[`themes`,`tasks`,`calendar`,`study`],dc=(0,f.lazy)(()=>G(()=>import(`./StudyDesk-BNzQxYkl.js`),__vite__mapDeps([6,1,3,7]))),fc=(0,f.lazy)(()=>G(()=>import(`./StatsModal-CNsn7PlC.js`),__vite__mapDeps([0,1,2,3]))),pc=(0,f.lazy)(()=>G(()=>import(`./SettingsModal-DaOiLs9x.js`),__vite__mapDeps([4,1,3]))),mc=(0,f.lazy)(()=>G(()=>import(`./SyncModal-BqG4SYDZ.js`),__vite__mapDeps([5,1,3]))),hc=(0,f.lazy)(()=>G(()=>import(`./CommunityWallModal-CsuJY1TI.js`),__vite__mapDeps([9,1,3]))),gc=[{id:`night`,label:`Night`,Icon:xe,color:`#a855f7`},{id:`rainy`,label:`Rain`,Icon:se,color:`#38bdf8`},{id:`chill`,label:`Chill`,Icon:Qe,color:`#fb923c`},{id:`productive`,label:`Focus`,Icon:$e,color:`#22c55e`}];function _c({bgImage:e}){let[t,n]=(0,f.useState)([{id:Date.now()+Math.random().toString(36).substring(7),src:e}]);return(0,f.useEffect)(()=>{n(t=>t[t.length-1].src===e?t:[...t,{id:Date.now()+Math.random().toString(36).substring(7),src:e}]);let t=setTimeout(()=>{n(e=>e.slice(-1))},1500);return()=>clearTimeout(t)},[e]),(0,x.jsx)(x.Fragment,{children:t.map((e,n)=>(0,x.jsx)(`div`,{style:{position:`fixed`,inset:0,zIndex:0,backgroundImage:`url('${e.src}')`,backgroundSize:`cover`,backgroundPosition:`center`,opacity:+(n===t.length-1),transition:`opacity 1.5s ease`}},e.id))})}function vc(){let{bgImage:e,theme:t,changeTheme:n}=E(),[r,i]=(0,f.useState)(`home`),[o,s]=(0,f.useState)(!1),[c,l]=(0,f.useState)(()=>!sessionStorage.getItem(`moodbyte_session_started_mobile`)),[u,d]=a(`moodbyte_welcome_main`,!1),[p,m]=(0,f.useState)(!1),[h,g]=(0,f.useState)(null),[_,v]=(0,f.useState)(null),[y]=a(`moodbyte_mobile_nav_items`,uc),b=y.filter(e=>lc.some(t=>t.id===e)),S=(b.length?b:uc).map(e=>lc.find(t=>t.id===e)).filter(Boolean),C=lc.filter(e=>!S.some(t=>t.id===e.id)),w=e=>{if(e===`more`){let e=!p;m(e),e&&(g(null),v(null));return}m(!1);let t=lc.find(t=>t.id===e)?.kind;if(t===`study`){s(!0),i(`study`),g(null),v(null);return}if(t===`tray`){h===e?g(null):(i(e),g(e),v(null));return}i(e),g(null),v(_===e?null:e)};return(0,x.jsxs)(`div`,{className:`mob-layout`,children:[(0,x.jsx)(js,{}),(0,x.jsx)(Ps,{}),c&&(0,x.jsx)(Os,{bgImage:e,onComplete:()=>{sessionStorage.setItem(`moodbyte_session_started_mobile`,`true`),l(!1)}}),!c&&!u&&(0,x.jsx)(ks,{title:`Welcome to MoodByte!`,message:`<p>
4080Hi there! MoodByte is your personal aesthetic space to relax, focus, and get things done.</p><p>Everything is designed to help you stay in the zone. Enjoy your stay!</p>`,onGotIt:()=>d(!0)}),(0,x.jsx)(_c,{bgImage:e}),(0,x.jsx)(`div`,{className:`mob-bgm-float`,children:(0,x.jsx)($o,{})}),(0,x.jsx)(`div`,{className:`mob-content`,children:(0,x.jsx)(`div`,{className:`mob-board-canvas`,children:(0,x.jsx)(gs,{})})}),h===`tasks`&&(0,x.jsx)(oc,{title:`Tasks`,onClose:()=>g(null),heightVh:58,children:(0,x.jsx)(dt,{})}),h===`calendar`&&(0,x.jsx)(oc,{title:`Calendar`,onClose:()=>g(null),heightVh:70,children:(0,x.jsx)(ac,{})}),(0,x.jsx)(f.Suspense,{fallback:null,children:o&&(0,x.jsx)(dc,{onClose:()=>s(!1)})}),p&&(0,x.jsx)(sc,{items:C,onSelect:e=>w(e),onClose:()=>m(!1)}),(0,x.jsxs)(f.Suspense,{fallback:null,children:[_===`stats`&&(0,x.jsx)(fc,{onClose:()=>v(null)}),_===`settings`&&(0,x.jsx)(pc,{onClose:()=>v(null)}),_===`sync`&&(0,x.jsx)(mc,{onClose:()=>v(null)}),_===`community`&&(0,x.jsx)(hc,{onClose:()=>v(null)})]}),_===`themes`&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{style:{position:`fixed`,inset:0,zIndex:8900,touchAction:`none`},onPointerDown:()=>v(null)}),(0,x.jsx)(`div`,{style:{position:`fixed`,bottom:`calc(84px + env(safe-area-inset-bottom, 0px))`,left:16,right:16,margin:`0 auto`,width:`calc(100% - 32px)`,maxWidth:380,background:`rgba(10,14,30,0.94)`,backdropFilter:`blur(28px)`,WebkitBackdropFilter:`blur(28px)`,border:`1px solid rgba(255,255,255,0.12)`,borderRadius:20,boxShadow:`0 8px 40px rgba(0,0,0,0.55)`,zIndex:8950,padding:12,display:`flex`,gap:8,animation:`mobSheetSlideUp 0.2s cubic-bezier(0.34,1.56,0.64,1)`},children:gc.map(({id:e,label:r,Icon:i,color:a})=>(0,x.jsxs)(`button`,{onClick:()=>{n(e)},style:{flex:1,display:`flex`,flexDirection:`column`,alignItems:`center`,gap:6,padding:`12px 4px`,borderRadius:14,background:t===e?`color-mix(in srgb, ${a} 20%, transparent)`:`rgba(255,255,255,0.05)`,border:`1px solid ${t===e?a+`80`:`rgba(255,255,255,0.08)`}`,color:t===e?a:`rgba(255,255,255,0.6)`,fontFamily:`'Outfit', sans-serif`,fontSize:`0.68rem`,fontWeight:500,cursor:`pointer`,touchAction:`manipulation`,WebkitTapHighlightColor:`transparent`,transition:`all 0.15s`},children:[(0,x.jsx)(i,{size:22,strokeWidth:1.7}),(0,x.jsx)(`span`,{children:r})]},e))})]}),(0,x.jsxs)(`div`,{style:{display:_===`music`?`block`:`none`,position:`fixed`,inset:0,zIndex:8900,pointerEvents:_===`music`?`auto`:`none`},children:[_===`music`&&(0,x.jsx)(`div`,{style:{position:`absolute`,inset:0,zIndex:0},onPointerDown:()=>v(null)}),(0,x.jsx)(`div`,{className:`mobile-player-wrapper`,style:{position:`fixed`,bottom:`calc(84px + env(safe-area-inset-bottom, 0px))`,left:16,right:16,margin:`0 auto`,maxWidth:420,zIndex:8950,animation:_===`music`?`mobSheetSlideUp 0.2s cubic-bezier(0.34,1.56,0.64,1)`:`none`},children:(0,x.jsx)(Es,{isMobile:!0})})]}),_===`pomodoro`&&(0,x.jsx)(cc,{title:`Pomodoro`,onClose:()=>v(null),children:(0,x.jsx)(`div`,{style:{padding:`0 16px`},children:(0,x.jsx)(pt,{})})}),_===`mood`&&(0,x.jsx)(cc,{title:`Mood`,onClose:()=>v(null),children:(0,x.jsx)(`div`,{style:{padding:`0 16px`},children:(0,x.jsx)(ot,{})})}),(0,x.jsx)(tc,{activeTab:r,onTabChange:w,items:S}),(0,x.jsx)(`style`,{children:` 4081 @keyframes mobSheetSlideUp { 4082 from { transform: translateY(15px); opacity: 0; } 4083 to { transform: translateY(0); opacity: 1; } 4084 } 4085 4086 .mob-layout { 4087 width: 100vw; 4088 height: 100vh; 4089 height: 100dvh; 4090 overflow: hidden; 4091 position: relative; 4092 display: flex; 4093 flex-direction: column; 4094 } 4095 4096 /* Hide desktop-only elements inside StickyNoteBoard */
4097 .mob-layout .top-left-controls { display: none !important; } 4098 .mob-layout .daily-quote-widget { display: none !important; } 4099 .mob-layout .community-wall-btn { display: none !important; } 4100 4101 /* Floating BGM */ 4102 .mob-bgm-float { 4103 position: fixed; 4104 top: 14px; right: 14px; 4105 z-index: 8500; 4106 } 4107 /* Make BGM button compact on mobile */ 4108 .mob-bgm-float .bgm-label { display: none; } 4109 .mob-bgm-float .bgm-player-wrapper { 4110 background: rgba(8,12,26,0.7); 4111 backdrop-filter: blur(12px); 4112 border: 1px solid rgba(255,255,255,0.12); 4113 border-radius: 50%; 4114 padding: 0; 4115 } 4116 .mob-bgm-float .bgm-toggle-btn { 4117 width: 40px; height: 40px; 4118 border-radius: 50%; 4119 padding: 0; 4120 display: flex; align-items: center; justify-content: center; 4121 } 4122 4123 /* Content area */ 4124 .mob-content { 4125 flex: 1; 4126 position: relative; 4127 overflow: hidden; 4128 z-index: 1; 4129 } 4130 4131 .mob-tab-pane { 4132 position: absolute; 4133 inset: 0; 4134 opacity: 0; 4135 pointer-events: none; 4136 transition: opacity 0.22s ease; 4137 } 4138 .mob-tab-pane.visible { 4139 opacity: 1; 4140 pointer-events: all; 4141 } 4142 4143 /* Home board â pannable canvas */ 4144 .mob-board-canvas { 4145 width: 100%; 4146 height: 100%; 4147 overflow: auto; 4148 -webkit-overflow-scrolling: touch; 4149 } 4150 .mob-board-canvas .sticky-board { 4151 width: 200vw; 4152 min-height: 180vh; 4153 pointer-events: auto !important; 4154 } 4155 4156 /* Regular scrollable pages */ 4157 .mob-scroll-page { 4158 width: 100%; 4159 height: 100%; 4160 overflow-y: auto; 4161 -webkit-overflow-scrolling: touch; 4162 padding: 16px 14px calc(96px + env(safe-area-inset-bottom)) 14px; 4163 box-sizing: border-box; 4164 display: flex; 4165 flex-direction: column; 4166 gap: 14px; 4167 } 4168 4169 .mob-page-title { 4170 font-family: 'Outfit', sans-serif; 4171 font-size: 1.5rem; 4172 margin: 0; 4173 padding-top: 4px; 4174 } 4175 4176 .mob-inner-glass { 4177 background: rgba(255,255,255,0.04); 4178 backdrop-filter: blur(16px); 4179 border: 1px solid rgba(255,255,255,0.08); 4180 border-radius: 18px; 4181 padding: 16px; 4182 box-sizing: border-box; 4183 } 4184 `})]})}var yc=[{id:`night`,label:`Night`,Icon:xe,color:`#a855f7`},{id:`rainy`,label:`Rain`,Icon:se,color:`#38bdf8`},{id:`chill`,label:`Chill`,Icon:Qe,color:`#fb923c`},{id:`productive`,label:`Focus`,Icon:$e,color:`#22c55e`}],bc=[{id:`themes`,Icon:we,label:`Themes`},{id:`music`,Icon:Se,label:`Music`},{id:`pomodoro`,Icon:Ge,label:`Pomodoro`},{id:`tasks`,Icon:Be,label:`Tasks`},{id:`mood`,Icon:Re,label:`Mood`}],xc=[`/bg/night1.gif`,`/bg/night2.gif`,`/bg/night3.gif`,`/bg/rain1.gif`,`/bg/rain2.gif`,`/bg/rain3.gif`,`/bg/chill1.gif`,`/bg/chill2.gif`,`/bg/chill3.gif`,`/bg/focus1.gif`,`/bg/focus2.gif`,`/bg/focus3.gif`];function Sc(){qs();let{theme:e,bgImage:t,changeTheme:n}=E();Xs(e);let r=at(),[i,o]=(0,f.useState)({}),[s,c]=(0,f.useState)(!1),[l,u]=(0,f.useState)(!1),[d,p]=(0,f.useState)(()=>!sessionStorage.getItem(`moodbyte_session_started`));$s(xc),Qs();let[m,h]=a(`moodbyte_welcome_main`,!1),[g,_]=(0,f.useState)(!1),[v,y]=(0,f.useState)(!1),[b]=a(`moodbyte_show_nav_rail`,!0),{sidebarScrollRef:S,activeSection:C,scrollToSection:w}=Zs(bc),T=e=>o(t=>({...t,[e]:!t[e]}));return r?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(vc,{}),(0,x.jsx)(ec,{})]}):(0,x.jsxs)(`div`,{className:`app-container ${l?`zen-mode-active`:``}`,style:{"--sidebar-offset":s?`40px`:`360px`},children:[(0,x.jsx)(ec,{}),(0,x.jsx)(js,{}),(0,x.jsx)(Ps,{}),d&&(0,x.jsx)(Os,{bgImage:t,onComplete:()=>{sessionStorage.setItem(`moodbyte_session_started`,`true`),p(!1)}}),!d&&!m&&(0,x.jsx)(ks,{title:`Welcome to MoodByte!`,message:`<p>
4184Hi there! MoodByte is your personal aesthetic space to relax, focus, and get things done.</p><p>You can <strong>pin notes</strong> to the board, change the <strong>dynamic background themes</strong>, listen to <strong>Spotify playlists or local music</strong>, and track your tasks.</p><p>Everything is designed to help you stay in the zone. Enjoy your stay!</p>`,onGotIt:()=>h(!0)}),(0,x.jsx)(Rs,{bgImage:t}),(0,x.jsx)(`main`,{className:`main-content`,children:(0,x.jsx)(`div`,{className:`wall-content`,children:(0,x.jsx)(gs,{})})}),(0,x.jsxs)(`aside`,{className:`glass-panel sidebar ${s?`hidden`:``}`,children:[(0,x.jsx)(`button`,{className:`sidebar-toggle-btn`,onClick:()=>{c(!s),s||u(!1)},title:s?`Show Sidebar`:`Hide Sidebar`,children:s?(0,x.jsx)(ie,{size:20}):(0,x.jsx)(ae,{size:20})}),b&&(()=>{let e=bc.findIndex(e=>e.id===C),t=bc.slice(0,e),n=bc.slice(e+1);return(0,x.jsxs)(`div`,{className:`section-nav-rail`,children:[(0,x.jsx)(`div`,{className:`snr-group`,children:t.map(({id:e,Icon:t,label:n})=>(0,x.jsx)(`button`,{className:`snr-btn snr-above`,onClick:()=>w(e),title:n,children:(0,x.jsx)(t,{size:14,strokeWidth:1.8})},e))}),(0,x.jsx)(`div`,{className:`snr-group`,children:n.map(({id:e,Icon:t,label:n})=>(0,x.jsx)(`button`,{className:`snr-btn snr-below`,onClick:()=>w(e),title:n,children:(0,x.jsx)(t,{size:14,strokeWidth:1.8})},e))})]})})(),(0,x.jsxs)(`div`,{className:`sidebar-content`,ref:S,children:[(0,x.jsxs)(`div`,{className:`tool-section`,id:`sec-themes`,children:[(0,x.jsxs)(`div`,{className:`section-header`,onClick:()=>T(`themes`),children:[(0,x.jsx)(`h3`,{className:`font-pixel`,children:`Themes`}),(0,x.jsx)(`span`,{className:`minimize-icon`,children:i.themes?`+`:`â`})]}),(0,x.jsx)(`div`,{className:`section-body ${i.themes?`collapsed`:``}`,children:(0,x.jsx)(`div`,{className:`theme-options inner-glass`,children:yc.map(({id:t,label:r,Icon:i,color:a})=>(0,x.jsxs)(`button`,{className:`theme-btn ${e===t?`active`:``}`,onClick:e=>{e.stopPropagation(),n(t)},title:r,style:{"--theme-color":a},children:[(0,x.jsx)(i,{size:20,strokeWidth:1.8}),(0,x.jsx)(`span`,{className:`theme-label`,children:r})]},t))})})]}),(0,x.jsxs)(`div`,{className:`tool-section`,id:`sec-music`,children:[(0,x.jsxs)(`div`,{className:`section-header`,onClick:()=>T(`music`),children:[(0,x.jsx)(`h3`,{className:`font-pixel`,children:`Music`}),(0,x.jsx)(`span`,{className:`minimize-icon`,children:i.music?`+`:`â`})]}),(0,x.jsx)(`div`,{className:`section-body ${i.music?`collapsed`:``}`,children:(0,x.jsx)(Es,{})})]}),(0,x.jsxs)(`div`,{className:`tool-section`,id:`sec-pomodoro`,children:[(0,x.jsxs)(`div`,{className:`section-header`,onClick:()=>T(`pomodoro`),children:[(0,x.jsx)(`h3`,{className:`font-pixel`,children:`Pomodoro`}),(0,x.jsx)(`span`,{className:`minimize-icon`,children:i.pomodoro?`+`:`â`})]}),(0,x.jsx)(`div`,{className:`section-body ${i.pomodoro?`collapsed`:``}`,children:(0,x.jsx)(`div`,{className:`inner-glass`,children:(0,x.jsx)(pt,{})})})]}),(0,x.jsxs)(`div`,{className:`tool-section`,id:`sec-tasks`,children:[(0,x.jsxs)(`div`,{className:`section-header`,onClick:()=>T(`tasks`),children:[(0,x.jsx)(`h3`,{className:`font-pixel`,children:`Tasks`}),(0,x.jsx)(`span`,{className:`minimize-icon`,children:i.tasks?`+`:`â`})]}),(0,x.jsx)(`div`,{className:`section-body ${i.tasks?`collapsed`:``}`,children:(0,x.jsx)(`div`,{className:`inner-glass`,children:(0,x.jsx)(dt,{})})})]}),(0,x.jsxs)(`div`,{className:`tool-section`,id:`sec-mood`,children:[(0,x.jsxs)(`div`,{className:`section-header`,onClick:()=>T(`mood`),children:[(0,x.jsx)(`h3`,{className:`font-pixel`,children:`Mood`}),(0,x.jsx)(`span`,{className:`minimize-icon`,children:i.mood?`+`:`â`})]}),(0,x.jsx)(`div`,{className:`section-body ${i.mood?`collapsed`:``}`,children:(0,x.jsx)(`div`,{className:`inner-glass`,children:(0,x.jsx)(ot,{})})})]}),(0,x.jsxs)(`div`,{style:{display:`flex`,gap:`8px`,justifyContent:`center`},children:[(0,x.jsx)(`button`,{className:`about-btn`,onClick:()=>y(!0),children:`What's New`}),(0,x.jsx)(`button`,{className:`about-btn`,onClick:()=>_(!0),children:`About`})]})]})]}),v&&(0,x.jsx)(Is,{onClose:()=>y(!1)}),g&&(0,x.jsx)(Ls,{onClose:()=>_(!1)}),!r&&(0,x.jsx)(`button`,{className:`zen-toggle-btn ${s?`visible`:`hidden`}`,onClick:()=>u(!l),title:l?`Exit Zen Mode`:`Enter Zen Mode`,children:l?(0,x.jsx)(M,{size:18}):(0,x.jsx)(N,{size:18})})]})}var Cc=(0,f.createContext)();function wc({children:e}){let t=(0,f.useRef)(null),n=(0,f.useRef)(null),[r,i]=(0,f.useState)(!1),[a,o]=(0,f.useState)(.5),[s,c]=(0,f.useState)(.5);return(0,f.useEffect)(()=>{t.current||=new Audio,n.current||=new Audio,t.current.volume=a,n.current.volume=s},[]),(0,x.jsx)(Cc.Provider,{value:{isPlaying:r,togglePlay:()=>{i(!r)},musicVolume:a,updateMusicVolume:e=>{o(e),t.current&&(t.current.volume=e)},ambientVolume:s,updateAmbientVolume:e=>{c(e),n.current&&(n.current.volume=e)}},children:e})}var Tc=(0,f.lazy)(()=>G(()=>import(`./AdminDashboard-COxCs6Jj.js`),__vite__mapDeps([10,1,2]))),Ec=window.location.pathname===`/admin`;p.createRoot(document.getElementById(`root`)).render((0,x.jsx)(f.StrictMode,{children:Ec?(0,x.jsx)(f.Suspense,{fallback:null,children:(0,x.jsx)(Tc,{})}):(0,x.jsx)(T,{children:(0,x.jsx)(wc,{children:(0,x.jsx)(Sc,{})})})}));export{ie as A,Se as C,A as D,ce as E,y as F,O as M,D as N,oe as O,E as P,we as S,ge as T,Pe as _,ps as a,Oe as b,tt as c,Ke as d,Ue as f,Ie as g,Le as h,ks as i,re as j,ae as k,Ye as l,Re as m,lc as n,Qo as o,Be as p,As as r,at as s,uc as t,qe as u,Ne as v,_e as w,Te as x,ke as y};
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.