livedesk 0.1.24 → 0.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,38 @@
1
+ (function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))l(u);new MutationObserver(u=>{for(const d of u)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&l(h)}).observe(document,{childList:!0,subtree:!0});function r(u){const d={};return u.integrity&&(d.integrity=u.integrity),u.referrerPolicy&&(d.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?d.credentials="include":u.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function l(u){if(u.ep)return;u.ep=!0;const d=r(u);fetch(u.href,d)}})();var Xc={exports:{}},ks={};var mg;function Xv(){if(mg)return ks;mg=1;var i=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(l,u,d){var h=null;if(d!==void 0&&(h=""+d),u.key!==void 0&&(h=""+u.key),"key"in u){d={};for(var m in u)m!=="key"&&(d[m]=u[m])}else d=u;return u=d.ref,{$$typeof:i,type:l,key:h,ref:u!==void 0?u:null,props:d}}return ks.Fragment=n,ks.jsx=r,ks.jsxs=r,ks}var gg;function Qv(){return gg||(gg=1,Xc.exports=Xv()),Xc.exports}var y=Qv(),Qc={exports:{}},de={};var pg;function Wv(){if(pg)return de;pg=1;var i=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),k=Symbol.iterator;function S(A){return A===null||typeof A!="object"?null:(A=k&&A[k]||A["@@iterator"],typeof A=="function"?A:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,I={};function H(A,U,Y){this.props=A,this.context=U,this.refs=I,this.updater=Y||C}H.prototype.isReactComponent={},H.prototype.setState=function(A,U){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,U,"setState")},H.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function q(){}q.prototype=H.prototype;function P(A,U,Y){this.props=A,this.context=U,this.refs=I,this.updater=Y||C}var Q=P.prototype=new q;Q.constructor=P,D(Q,H.prototype),Q.isPureReactComponent=!0;var K=Array.isArray;function ae(){}var J={H:null,A:null,T:null,S:null},_e=Object.prototype.hasOwnProperty;function we(A,U,Y){var W=Y.ref;return{$$typeof:i,type:A,key:U,ref:W!==void 0?W:null,props:Y}}function Dt(A,U){return we(A.type,U,A.props)}function gt(A){return typeof A=="object"&&A!==null&&A.$$typeof===i}function Le(A){var U={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(Y){return U[Y]})}var pt=/\/+/g;function vt(A,U){return typeof A=="object"&&A!==null&&A.key!=null?Le(""+A.key):U.toString(36)}function Pe(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(ae,ae):(A.status="pending",A.then(function(U){A.status==="pending"&&(A.status="fulfilled",A.value=U)},function(U){A.status==="pending"&&(A.status="rejected",A.reason=U)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function L(A,U,Y,W,ce){var he=typeof A;(he==="undefined"||he==="boolean")&&(A=null);var Ee=!1;if(A===null)Ee=!0;else switch(he){case"bigint":case"string":case"number":Ee=!0;break;case"object":switch(A.$$typeof){case i:case n:Ee=!0;break;case w:return Ee=A._init,L(Ee(A._payload),U,Y,W,ce)}}if(Ee)return ce=ce(A),Ee=W===""?"."+vt(A,0):W,K(ce)?(Y="",Ee!=null&&(Y=Ee.replace(pt,"$&/")+"/"),L(ce,U,Y,"",function(kn){return kn})):ce!=null&&(gt(ce)&&(ce=Dt(ce,Y+(ce.key==null||A&&A.key===ce.key?"":(""+ce.key).replace(pt,"$&/")+"/")+Ee)),U.push(ce)),1;Ee=0;var Ve=W===""?".":W+":";if(K(A))for(var Ke=0;Ke<A.length;Ke++)W=A[Ke],he=Ve+vt(W,Ke),Ee+=L(W,U,Y,he,ce);else if(Ke=S(A),typeof Ke=="function")for(A=Ke.call(A),Ke=0;!(W=A.next()).done;)W=W.value,he=Ve+vt(W,Ke++),Ee+=L(W,U,Y,he,ce);else if(he==="object"){if(typeof A.then=="function")return L(Pe(A),U,Y,W,ce);throw U=String(A),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return Ee}function G(A,U,Y){if(A==null)return A;var W=[],ce=0;return L(A,W,"","",function(he){return U.call(Y,he,ce++)}),W}function ie(A){if(A._status===-1){var U=A._result;U=U(),U.then(function(Y){(A._status===0||A._status===-1)&&(A._status=1,A._result=Y)},function(Y){(A._status===0||A._status===-1)&&(A._status=2,A._result=Y)}),A._status===-1&&(A._status=0,A._result=U)}if(A._status===1)return A._result.default;throw A._result}var ee=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},Te={map:G,forEach:function(A,U,Y){G(A,function(){U.apply(this,arguments)},Y)},count:function(A){var U=0;return G(A,function(){U++}),U},toArray:function(A){return G(A,function(U){return U})||[]},only:function(A){if(!gt(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return de.Activity=b,de.Children=Te,de.Component=H,de.Fragment=r,de.Profiler=u,de.PureComponent=P,de.StrictMode=l,de.Suspense=g,de.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=J,de.__COMPILER_RUNTIME={__proto__:null,c:function(A){return J.H.useMemoCache(A)}},de.cache=function(A){return function(){return A.apply(null,arguments)}},de.cacheSignal=function(){return null},de.cloneElement=function(A,U,Y){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var W=D({},A.props),ce=A.key;if(U!=null)for(he in U.key!==void 0&&(ce=""+U.key),U)!_e.call(U,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&U.ref===void 0||(W[he]=U[he]);var he=arguments.length-2;if(he===1)W.children=Y;else if(1<he){for(var Ee=Array(he),Ve=0;Ve<he;Ve++)Ee[Ve]=arguments[Ve+2];W.children=Ee}return we(A.type,ce,W)},de.createContext=function(A){return A={$$typeof:h,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:d,_context:A},A},de.createElement=function(A,U,Y){var W,ce={},he=null;if(U!=null)for(W in U.key!==void 0&&(he=""+U.key),U)_e.call(U,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(ce[W]=U[W]);var Ee=arguments.length-2;if(Ee===1)ce.children=Y;else if(1<Ee){for(var Ve=Array(Ee),Ke=0;Ke<Ee;Ke++)Ve[Ke]=arguments[Ke+2];ce.children=Ve}if(A&&A.defaultProps)for(W in Ee=A.defaultProps,Ee)ce[W]===void 0&&(ce[W]=Ee[W]);return we(A,he,ce)},de.createRef=function(){return{current:null}},de.forwardRef=function(A){return{$$typeof:m,render:A}},de.isValidElement=gt,de.lazy=function(A){return{$$typeof:w,_payload:{_status:-1,_result:A},_init:ie}},de.memo=function(A,U){return{$$typeof:p,type:A,compare:U===void 0?null:U}},de.startTransition=function(A){var U=J.T,Y={};J.T=Y;try{var W=A(),ce=J.S;ce!==null&&ce(Y,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(ae,ee)}catch(he){ee(he)}finally{U!==null&&Y.types!==null&&(U.types=Y.types),J.T=U}},de.unstable_useCacheRefresh=function(){return J.H.useCacheRefresh()},de.use=function(A){return J.H.use(A)},de.useActionState=function(A,U,Y){return J.H.useActionState(A,U,Y)},de.useCallback=function(A,U){return J.H.useCallback(A,U)},de.useContext=function(A){return J.H.useContext(A)},de.useDebugValue=function(){},de.useDeferredValue=function(A,U){return J.H.useDeferredValue(A,U)},de.useEffect=function(A,U){return J.H.useEffect(A,U)},de.useEffectEvent=function(A){return J.H.useEffectEvent(A)},de.useId=function(){return J.H.useId()},de.useImperativeHandle=function(A,U,Y){return J.H.useImperativeHandle(A,U,Y)},de.useInsertionEffect=function(A,U){return J.H.useInsertionEffect(A,U)},de.useLayoutEffect=function(A,U){return J.H.useLayoutEffect(A,U)},de.useMemo=function(A,U){return J.H.useMemo(A,U)},de.useOptimistic=function(A,U){return J.H.useOptimistic(A,U)},de.useReducer=function(A,U,Y){return J.H.useReducer(A,U,Y)},de.useRef=function(A){return J.H.useRef(A)},de.useState=function(A){return J.H.useState(A)},de.useSyncExternalStore=function(A,U,Y){return J.H.useSyncExternalStore(A,U,Y)},de.useTransition=function(){return J.H.useTransition()},de.version="19.2.7",de}var yg;function Ld(){return yg||(yg=1,Qc.exports=Wv()),Qc.exports}var $=Ld(),Wc={exports:{}},Es={},Zc={exports:{}},Fc={};var vg;function Zv(){return vg||(vg=1,(function(i){function n(L,G){var ie=L.length;L.push(G);e:for(;0<ie;){var ee=ie-1>>>1,Te=L[ee];if(0<u(Te,G))L[ee]=G,L[ie]=Te,ie=ee;else break e}}function r(L){return L.length===0?null:L[0]}function l(L){if(L.length===0)return null;var G=L[0],ie=L.pop();if(ie!==G){L[0]=ie;e:for(var ee=0,Te=L.length,A=Te>>>1;ee<A;){var U=2*(ee+1)-1,Y=L[U],W=U+1,ce=L[W];if(0>u(Y,ie))W<Te&&0>u(ce,Y)?(L[ee]=ce,L[W]=ie,ee=W):(L[ee]=Y,L[U]=ie,ee=U);else if(W<Te&&0>u(ce,ie))L[ee]=ce,L[W]=ie,ee=W;else break e}}return G}function u(L,G){var ie=L.sortIndex-G.sortIndex;return ie!==0?ie:L.id-G.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;i.unstable_now=function(){return d.now()}}else{var h=Date,m=h.now();i.unstable_now=function(){return h.now()-m}}var g=[],p=[],w=1,b=null,k=3,S=!1,C=!1,D=!1,I=!1,H=typeof setTimeout=="function"?setTimeout:null,q=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;function Q(L){for(var G=r(p);G!==null;){if(G.callback===null)l(p);else if(G.startTime<=L)l(p),G.sortIndex=G.expirationTime,n(g,G);else break;G=r(p)}}function K(L){if(D=!1,Q(L),!C)if(r(g)!==null)C=!0,ae||(ae=!0,Le());else{var G=r(p);G!==null&&Pe(K,G.startTime-L)}}var ae=!1,J=-1,_e=5,we=-1;function Dt(){return I?!0:!(i.unstable_now()-we<_e)}function gt(){if(I=!1,ae){var L=i.unstable_now();we=L;var G=!0;try{e:{C=!1,D&&(D=!1,q(J),J=-1),S=!0;var ie=k;try{t:{for(Q(L),b=r(g);b!==null&&!(b.expirationTime>L&&Dt());){var ee=b.callback;if(typeof ee=="function"){b.callback=null,k=b.priorityLevel;var Te=ee(b.expirationTime<=L);if(L=i.unstable_now(),typeof Te=="function"){b.callback=Te,Q(L),G=!0;break t}b===r(g)&&l(g),Q(L)}else l(g);b=r(g)}if(b!==null)G=!0;else{var A=r(p);A!==null&&Pe(K,A.startTime-L),G=!1}}break e}finally{b=null,k=ie,S=!1}G=void 0}}finally{G?Le():ae=!1}}}var Le;if(typeof P=="function")Le=function(){P(gt)};else if(typeof MessageChannel<"u"){var pt=new MessageChannel,vt=pt.port2;pt.port1.onmessage=gt,Le=function(){vt.postMessage(null)}}else Le=function(){H(gt,0)};function Pe(L,G){J=H(function(){L(i.unstable_now())},G)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(L){L.callback=null},i.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_e=0<L?Math.floor(1e3/L):5},i.unstable_getCurrentPriorityLevel=function(){return k},i.unstable_next=function(L){switch(k){case 1:case 2:case 3:var G=3;break;default:G=k}var ie=k;k=G;try{return L()}finally{k=ie}},i.unstable_requestPaint=function(){I=!0},i.unstable_runWithPriority=function(L,G){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var ie=k;k=L;try{return G()}finally{k=ie}},i.unstable_scheduleCallback=function(L,G,ie){var ee=i.unstable_now();switch(typeof ie=="object"&&ie!==null?(ie=ie.delay,ie=typeof ie=="number"&&0<ie?ee+ie:ee):ie=ee,L){case 1:var Te=-1;break;case 2:Te=250;break;case 5:Te=1073741823;break;case 4:Te=1e4;break;default:Te=5e3}return Te=ie+Te,L={id:w++,callback:G,priorityLevel:L,startTime:ie,expirationTime:Te,sortIndex:-1},ie>ee?(L.sortIndex=ie,n(p,L),r(g)===null&&L===r(p)&&(D?(q(J),J=-1):D=!0,Pe(K,ie-ee))):(L.sortIndex=Te,n(g,L),C||S||(C=!0,ae||(ae=!0,Le()))),L},i.unstable_shouldYield=Dt,i.unstable_wrapCallback=function(L){var G=k;return function(){var ie=k;k=G;try{return L.apply(this,arguments)}finally{k=ie}}}})(Fc)),Fc}var bg;function Fv(){return bg||(bg=1,Zc.exports=Zv()),Zc.exports}var ed={exports:{}},Ct={};var wg;function e0(){if(wg)return Ct;wg=1;var i=Ld();function n(g){var p="https://react.dev/errors/"+g;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var w=2;w<arguments.length;w++)p+="&args[]="+encodeURIComponent(arguments[w])}return"Minified React error #"+g+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var l={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},u=Symbol.for("react.portal");function d(g,p,w){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:b==null?null:""+b,children:g,containerInfo:p,implementation:w}}var h=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,p){if(g==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Ct.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Ct.createPortal=function(g,p){var w=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(n(299));return d(g,p,null,w)},Ct.flushSync=function(g){var p=h.T,w=l.p;try{if(h.T=null,l.p=2,g)return g()}finally{h.T=p,l.p=w,l.d.f()}},Ct.preconnect=function(g,p){typeof g=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,l.d.C(g,p))},Ct.prefetchDNS=function(g){typeof g=="string"&&l.d.D(g)},Ct.preinit=function(g,p){if(typeof g=="string"&&p&&typeof p.as=="string"){var w=p.as,b=m(w,p.crossOrigin),k=typeof p.integrity=="string"?p.integrity:void 0,S=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;w==="style"?l.d.S(g,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:b,integrity:k,fetchPriority:S}):w==="script"&&l.d.X(g,{crossOrigin:b,integrity:k,fetchPriority:S,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Ct.preinitModule=function(g,p){if(typeof g=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var w=m(p.as,p.crossOrigin);l.d.M(g,{crossOrigin:w,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&l.d.M(g)},Ct.preload=function(g,p){if(typeof g=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var w=p.as,b=m(w,p.crossOrigin);l.d.L(g,w,{crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Ct.preloadModule=function(g,p){if(typeof g=="string")if(p){var w=m(p.as,p.crossOrigin);l.d.m(g,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:w,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else l.d.m(g)},Ct.requestFormReset=function(g){l.d.r(g)},Ct.unstable_batchedUpdates=function(g,p){return g(p)},Ct.useFormState=function(g,p,w){return h.H.useFormState(g,p,w)},Ct.useFormStatus=function(){return h.H.useHostTransitionStatus()},Ct.version="19.2.7",Ct}var Sg;function t0(){if(Sg)return ed.exports;Sg=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(n){console.error(n)}}return i(),ed.exports=e0(),ed.exports}var _g;function n0(){if(_g)return Es;_g=1;var i=Fv(),n=Ld(),r=t0();function l(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}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 u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function h(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 m(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 g(e){if(d(e)!==e)throw Error(l(188))}function p(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(l(188));return t!==e?null:e}for(var a=e,s=t;;){var o=a.return;if(o===null)break;var c=o.alternate;if(c===null){if(s=o.return,s!==null){a=s;continue}break}if(o.child===c.child){for(c=o.child;c;){if(c===a)return g(o),e;if(c===s)return g(o),t;c=c.sibling}throw Error(l(188))}if(a.return!==s.return)a=o,s=c;else{for(var f=!1,v=o.child;v;){if(v===a){f=!0,a=o,s=c;break}if(v===s){f=!0,s=o,a=c;break}v=v.sibling}if(!f){for(v=c.child;v;){if(v===a){f=!0,a=c,s=o;break}if(v===s){f=!0,s=c,a=o;break}v=v.sibling}if(!f)throw Error(l(189))}}if(a.alternate!==s)throw Error(l(190))}if(a.tag!==3)throw Error(l(188));return a.stateNode.current===a?e:t}function w(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=w(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,k=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),q=Symbol.for("react.consumer"),P=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),ae=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),_e=Symbol.for("react.lazy"),we=Symbol.for("react.activity"),Dt=Symbol.for("react.memo_cache_sentinel"),gt=Symbol.iterator;function Le(e){return e===null||typeof e!="object"?null:(e=gt&&e[gt]||e["@@iterator"],typeof e=="function"?e:null)}var pt=Symbol.for("react.client.reference");function vt(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===pt?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case D:return"Fragment";case H:return"Profiler";case I:return"StrictMode";case K:return"Suspense";case ae:return"SuspenseList";case we:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case P:return e.displayName||"Context";case q:return(e._context.displayName||"Context")+".Consumer";case Q:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case J:return t=e.displayName||null,t!==null?t:vt(e.type)||"Memo";case _e:t=e._payload,e=e._init;try{return vt(e(t))}catch{}}return null}var Pe=Array.isArray,L=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie={pending:!1,data:null,method:null,action:null},ee=[],Te=-1;function A(e){return{current:e}}function U(e){0>Te||(e.current=ee[Te],ee[Te]=null,Te--)}function Y(e,t){Te++,ee[Te]=e.current,e.current=t}var W=A(null),ce=A(null),he=A(null),Ee=A(null);function Ve(e,t){switch(Y(he,t),Y(ce,e),Y(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?zm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=zm(t),e=Bm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(W),Y(W,e)}function Ke(){U(W),U(ce),U(he)}function kn(e){e.memoizedState!==null&&Y(Ee,e);var t=W.current,a=Bm(t,e.type);t!==a&&(Y(ce,e),Y(W,a))}function dn(e){ce.current===e&&(U(W),U(ce)),Ee.current===e&&(U(Ee),ws._currentValue=ie)}var vi,bi;function Un(e){if(vi===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);vi=t&&t[1]||"",bi=-1<a.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+vi+e+bi}var Sr=!1;function oa(e,t){if(!e||Sr)return"";Sr=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var B=function(){throw Error()};if(Object.defineProperty(B.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(B,[])}catch(N){var j=N}Reflect.construct(e,[],B)}else{try{B.call()}catch(N){j=N}e.call(B.prototype)}}else{try{throw Error()}catch(N){j=N}(B=e())&&typeof B.catch=="function"&&B.catch(function(){})}}catch(N){if(N&&j&&typeof N.stack=="string")return[N.stack,j.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=s.DetermineComponentFrameRoot(),f=c[0],v=c[1];if(f&&v){var T=f.split(`
4
+ `),R=v.split(`
5
+ `);for(o=s=0;s<T.length&&!T[s].includes("DetermineComponentFrameRoot");)s++;for(;o<R.length&&!R[o].includes("DetermineComponentFrameRoot");)o++;if(s===T.length||o===R.length)for(s=T.length-1,o=R.length-1;1<=s&&0<=o&&T[s]!==R[o];)o--;for(;1<=s&&0<=o;s--,o--)if(T[s]!==R[o]){if(s!==1||o!==1)do if(s--,o--,0>o||T[s]!==R[o]){var M=`
6
+ `+T[s].replace(" at new "," at ");return e.displayName&&M.includes("<anonymous>")&&(M=M.replace("<anonymous>",e.displayName)),M}while(1<=s&&0<=o);break}}}finally{Sr=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Un(a):""}function Po(e,t){switch(e.tag){case 26:case 27:case 5:return Un(e.type);case 16:return Un("Lazy");case 13:return e.child!==t&&t!==null?Un("Suspense Fallback"):Un("Suspense");case 19:return Un("SuspenseList");case 0:case 15:return oa(e.type,!1);case 11:return oa(e.type.render,!1);case 1:return oa(e.type,!0);case 31:return Un("Activity");default:return""}}function Ce(e){try{var t="",a=null;do t+=Po(e,a),a=e,e=e.return;while(e);return t}catch(s){return`
7
+ Error generating stack: `+s.message+`
8
+ `+s.stack}}var wi=Object.prototype.hasOwnProperty,ua=i.unstable_scheduleCallback,hn=i.unstable_cancelCallback,Io=i.unstable_shouldYield,_r=i.unstable_requestPaint,At=i.unstable_now,Tr=i.unstable_getCurrentPriorityLevel,kr=i.unstable_ImmediatePriority,Ye=i.unstable_UserBlockingPriority,Si=i.unstable_NormalPriority,Ft=i.unstable_LowPriority,Qs=i.unstable_IdlePriority,Ws=i.log,Er=i.unstable_setDisableYieldValue,fn=null,it=null;function re(e){if(typeof Ws=="function"&&Er(e),it&&typeof it.setStrictMode=="function")try{it.setStrictMode(fn,e)}catch{}}var Ie=Math.clz32?Math.clz32:Zs,Go=Math.log,Ar=Math.LN2;function Zs(e){return e>>>=0,e===0?32:31-(Go(e)/Ar|0)|0}var rt=256,mn=262144,ca=4194304;function en(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 Ga(e,t,a){var s=e.pendingLanes;if(s===0)return 0;var o=0,c=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var v=s&134217727;return v!==0?(s=v&~c,s!==0?o=en(s):(f&=v,f!==0?o=en(f):a||(a=v&~e,a!==0&&(o=en(a))))):(v=s&~c,v!==0?o=en(v):f!==0?o=en(f):a||(a=s&~e,a!==0&&(o=en(a)))),o===0?0:t!==0&&t!==o&&(t&c)===0&&(c=o&-o,a=t&-t,c>=a||c===32&&(a&4194048)!==0)?t:o}function da(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Vo(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 _i(){var e=ca;return ca<<=1,(ca&62914560)===0&&(ca=4194304),e}function xr(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function ha(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Fs(e,t,a,s,o,c){var f=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var v=e.entanglements,T=e.expirationTimes,R=e.hiddenUpdates;for(a=f&~a;0<a;){var M=31-Ie(a),B=1<<M;v[M]=0,T[M]=-1;var j=R[M];if(j!==null)for(R[M]=null,M=0;M<j.length;M++){var N=j[M];N!==null&&(N.lane&=-536870913)}a&=~B}s!==0&&Cr(e,s,0),c!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=c&~(f&~t))}function Cr(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-Ie(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|a&261930}function Or(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var s=31-Ie(a),o=1<<s;o&t|e[s]&t&&(e[s]|=t),a&=~o}}function Ti(e,t){var a=t&-t;return a=(a&42)!==0?1:ki(a),(a&(e.suspendedLanes|t))!==0?0:a}function ki(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 Rr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Va(){var e=G.p;return e!==0?e:(e=window.event,e===void 0?32:lg(e.type))}function Ka(e,t){var a=G.p;try{return G.p=e,t()}finally{G.p=a}}var gn=Math.random().toString(36).slice(2),st="__reactFiber$"+gn,lt="__reactProps$"+gn,Mn="__reactContainer$"+gn,zn="__reactEvents$"+gn,el="__reactListeners$"+gn,Ko="__reactHandles$"+gn,jr="__reactResources$"+gn,Ya="__reactMarker$"+gn;function Nr(e){delete e[st],delete e[lt],delete e[zn],delete e[el],delete e[Ko]}function Bn(e){var t=e[st];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Mn]||a[st]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Vm(e);e!==null;){if(a=e[st])return a;e=Vm(e)}return t}e=a,a=e.parentNode}return null}function Ut(e){if(e=e[st]||e[Mn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function fa(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(l(33))}function ma(e){var t=e[jr];return t||(t=e[jr]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ot(e){e[Ya]=!0}var Lr=new Set,Dr={};function En(e,t){Hn(e,t),Hn(e+"Capture",t)}function Hn(e,t){for(Dr[e]=t,e=0;e<t.length;e++)Lr.add(t[e])}var tl=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),nl={},Ja={};function Yo(e){return wi.call(Ja,e)?!0:wi.call(nl,e)?!1:tl.test(e)?Ja[e]=!0:(nl[e]=!0,!1)}function Ei(e,t,a){if(Yo(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function ut(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Mt(e,t,a,s){if(s===null)e.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+s)}}function xt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function al(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Md(e,t,a){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var o=s.get,c=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(f){a=""+f,c.call(this,f)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return a},setValue:function(f){a=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ur(e){if(!e._valueTracker){var t=al(e)?"checked":"value";e._valueTracker=Md(e,t,""+e[t])}}function il(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),s="";return e&&(s=al(e)?e.checked?"true":"false":e.value),e=s,e!==a?(t.setValue(e),!0):!1}function Xa(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Ai=/[\n"\\]/g;function bt(e){return e.replace(Ai,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function xi(e,t,a,s,o,c,f,v){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+xt(t)):e.value!==""+xt(t)&&(e.value=""+xt(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?Mr(e,f,xt(t)):a!=null?Mr(e,f,xt(a)):s!=null&&e.removeAttribute("value"),o==null&&c!=null&&(e.defaultChecked=!!c),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.name=""+xt(v):e.removeAttribute("name")}function rl(e,t,a,s,o,c,f,v){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||a!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){Ur(e);return}a=a!=null?""+xt(a):"",t=t!=null?""+xt(t):a,v||t===e.value||(e.value=t),e.defaultValue=t}s=s??o,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=v?e.checked:!!s,e.defaultChecked=!!s,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),Ur(e)}function Mr(e,t,a){t==="number"&&Xa(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function ga(e,t,a,s){if(e=e.options,t){t={};for(var o=0;o<a.length;o++)t["$"+a[o]]=!0;for(a=0;a<e.length;a++)o=t.hasOwnProperty("$"+e[a].value),e[a].selected!==o&&(e[a].selected=o),o&&s&&(e[a].defaultSelected=!0)}else{for(a=""+xt(a),t=null,o=0;o<e.length;o++){if(e[o].value===a){e[o].selected=!0,s&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function sl(e,t,a){if(t!=null&&(t=""+xt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+xt(a):""}function pa(e,t,a,s){if(t==null){if(s!=null){if(a!=null)throw Error(l(92));if(Pe(s)){if(1<s.length)throw Error(l(93));s=s[0]}a=s}a==null&&(a=""),t=a}a=xt(t),e.defaultValue=a,s=e.textContent,s===a&&s!==""&&s!==null&&(e.value=s),Ur(e)}function ya(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Jo=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 _(e,t,a){var s=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,a):typeof a!="number"||a===0||Jo.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function V(e,t,a){if(t!=null&&typeof t!="object")throw Error(l(62));if(e=e.style,a!=null){for(var s in a)!a.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var o in t)s=t[o],t.hasOwnProperty(o)&&a[o]!==s&&_(e,o,s)}else for(var c in t)t.hasOwnProperty(c)&&_(e,c,t[c])}function te(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 ue=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"]]),Oe=/^[\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 ge(e){return Oe.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ke(){}var jt=null;function Xe(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fe=null,va=null;function ll(e){var t=Ut(e);if(t&&(e=t.stateNode)){var a=e[lt]||null;e:switch(e=t.stateNode,t.type){case"input":if(xi(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+bt(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var s=a[t];if(s!==e&&s.form===e.form){var o=s[lt]||null;if(!o)throw Error(l(90));xi(s,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<a.length;t++)s=a[t],s.form===e.form&&il(s)}break e;case"textarea":sl(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&ga(e,!!a.multiple,t,!1)}}}var Qa=!1;function zr(e,t,a){if(Qa)return e(t,a);Qa=!0;try{var s=e(t);return s}finally{if(Qa=!1,(Fe!==null||va!==null)&&(Jl(),Fe&&(t=Fe,e=va,va=Fe=null,ll(t),e)))for(t=0;t<e.length;t++)ll(e[t])}}function qn(e,t){var a=e.stateNode;if(a===null)return null;var s=a[lt]||null;if(s===null)return null;a=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(l(231,t,typeof a));return a}var $n=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xo=!1;if($n)try{var Br={};Object.defineProperty(Br,"passive",{get:function(){Xo=!0}}),window.addEventListener("test",Br,Br),window.removeEventListener("test",Br,Br)}catch{Xo=!1}var ba=null,Qo=null,ol=null;function zd(){if(ol)return ol;var e,t=Qo,a=t.length,s,o="value"in ba?ba.value:ba.textContent,c=o.length;for(e=0;e<a&&t[e]===o[e];e++);var f=a-e;for(s=1;s<=f&&t[a-s]===o[c-s];s++);return ol=o.slice(e,1<s?1-s:void 0)}function ul(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 cl(){return!0}function Bd(){return!1}function zt(e){function t(a,s,o,c,f){this._reactName=a,this._targetInst=o,this.type=s,this.nativeEvent=c,this.target=f,this.currentTarget=null;for(var v in e)e.hasOwnProperty(v)&&(a=e[v],this[v]=a?a(c):c[v]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?cl:Bd,this.isPropagationStopped=Bd,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=cl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=cl)},persist:function(){},isPersistent:cl}),t}var Wa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dl=zt(Wa),Hr=b({},Wa,{view:0,detail:0}),Yp=zt(Hr),Wo,Zo,qr,hl=b({},Hr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:eu,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!==qr&&(qr&&e.type==="mousemove"?(Wo=e.screenX-qr.screenX,Zo=e.screenY-qr.screenY):Zo=Wo=0,qr=e),Wo)},movementY:function(e){return"movementY"in e?e.movementY:Zo}}),Hd=zt(hl),Jp=b({},hl,{dataTransfer:0}),Xp=zt(Jp),Qp=b({},Hr,{relatedTarget:0}),Fo=zt(Qp),Wp=b({},Wa,{animationName:0,elapsedTime:0,pseudoElement:0}),Zp=zt(Wp),Fp=b({},Wa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ey=zt(Fp),ty=b({},Wa,{data:0}),qd=zt(ty),ny={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ay={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},iy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ry(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=iy[e])?!!t[e]:!1}function eu(){return ry}var sy=b({},Hr,{key:function(e){if(e.key){var t=ny[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ul(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ay[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:eu,charCode:function(e){return e.type==="keypress"?ul(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ul(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ly=zt(sy),oy=b({},hl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$d=zt(oy),uy=b({},Hr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:eu}),cy=zt(uy),dy=b({},Wa,{propertyName:0,elapsedTime:0,pseudoElement:0}),hy=zt(dy),fy=b({},hl,{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}),my=zt(fy),gy=b({},Wa,{newState:0,oldState:0}),py=zt(gy),yy=[9,13,27,32],tu=$n&&"CompositionEvent"in window,$r=null;$n&&"documentMode"in document&&($r=document.documentMode);var vy=$n&&"TextEvent"in window&&!$r,Pd=$n&&(!tu||$r&&8<$r&&11>=$r),Id=" ",Gd=!1;function Vd(e,t){switch(e){case"keyup":return yy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ci=!1;function by(e,t){switch(e){case"compositionend":return Kd(t);case"keypress":return t.which!==32?null:(Gd=!0,Id);case"textInput":return e=t.data,e===Id&&Gd?null:e;default:return null}}function wy(e,t){if(Ci)return e==="compositionend"||!tu&&Vd(e,t)?(e=zd(),ol=Qo=ba=null,Ci=!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 Pd&&t.locale!=="ko"?null:t.data;default:return null}}var Sy={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 Yd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Sy[e.type]:t==="textarea"}function Jd(e,t,a,s){Fe?va?va.push(s):va=[s]:Fe=s,t=to(t,"onChange"),0<t.length&&(a=new dl("onChange","change",null,a,s),e.push({event:a,listeners:t}))}var Pr=null,Ir=null;function _y(e){jm(e,0)}function fl(e){var t=fa(e);if(il(t))return e}function Xd(e,t){if(e==="change")return t}var Qd=!1;if($n){var nu;if($n){var au="oninput"in document;if(!au){var Wd=document.createElement("div");Wd.setAttribute("oninput","return;"),au=typeof Wd.oninput=="function"}nu=au}else nu=!1;Qd=nu&&(!document.documentMode||9<document.documentMode)}function Zd(){Pr&&(Pr.detachEvent("onpropertychange",Fd),Ir=Pr=null)}function Fd(e){if(e.propertyName==="value"&&fl(Ir)){var t=[];Jd(t,Ir,e,Xe(e)),zr(_y,t)}}function Ty(e,t,a){e==="focusin"?(Zd(),Pr=t,Ir=a,Pr.attachEvent("onpropertychange",Fd)):e==="focusout"&&Zd()}function ky(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return fl(Ir)}function Ey(e,t){if(e==="click")return fl(t)}function Ay(e,t){if(e==="input"||e==="change")return fl(t)}function xy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Vt=typeof Object.is=="function"?Object.is:xy;function Gr(e,t){if(Vt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),s=Object.keys(t);if(a.length!==s.length)return!1;for(s=0;s<a.length;s++){var o=a[s];if(!wi.call(t,o)||!Vt(e[o],t[o]))return!1}return!0}function eh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function th(e,t){var a=eh(e);e=0;for(var s;a;){if(a.nodeType===3){if(s=e+a.textContent.length,e<=t&&s>=t)return{node:a,offset:t-e};e=s}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=eh(a)}}function nh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?nh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ah(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Xa(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Xa(e.document)}return t}function iu(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 Cy=$n&&"documentMode"in document&&11>=document.documentMode,Oi=null,ru=null,Vr=null,su=!1;function ih(e,t,a){var s=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;su||Oi==null||Oi!==Xa(s)||(s=Oi,"selectionStart"in s&&iu(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Vr&&Gr(Vr,s)||(Vr=s,s=to(ru,"onSelect"),0<s.length&&(t=new dl("onSelect","select",null,t,a),e.push({event:t,listeners:s}),t.target=Oi)))}function Za(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Ri={animationend:Za("Animation","AnimationEnd"),animationiteration:Za("Animation","AnimationIteration"),animationstart:Za("Animation","AnimationStart"),transitionrun:Za("Transition","TransitionRun"),transitionstart:Za("Transition","TransitionStart"),transitioncancel:Za("Transition","TransitionCancel"),transitionend:Za("Transition","TransitionEnd")},lu={},rh={};$n&&(rh=document.createElement("div").style,"AnimationEvent"in window||(delete Ri.animationend.animation,delete Ri.animationiteration.animation,delete Ri.animationstart.animation),"TransitionEvent"in window||delete Ri.transitionend.transition);function Fa(e){if(lu[e])return lu[e];if(!Ri[e])return e;var t=Ri[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in rh)return lu[e]=t[a];return e}var sh=Fa("animationend"),lh=Fa("animationiteration"),oh=Fa("animationstart"),Oy=Fa("transitionrun"),Ry=Fa("transitionstart"),jy=Fa("transitioncancel"),uh=Fa("transitionend"),ch=new Map,ou="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(" ");ou.push("scrollEnd");function pn(e,t){ch.set(e,t),En(t,[e])}var ml=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!==null&&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)},tn=[],ji=0,uu=0;function gl(){for(var e=ji,t=uu=ji=0;t<e;){var a=tn[t];tn[t++]=null;var s=tn[t];tn[t++]=null;var o=tn[t];tn[t++]=null;var c=tn[t];if(tn[t++]=null,s!==null&&o!==null){var f=s.pending;f===null?o.next=o:(o.next=f.next,f.next=o),s.pending=o}c!==0&&dh(a,o,c)}}function pl(e,t,a,s){tn[ji++]=e,tn[ji++]=t,tn[ji++]=a,tn[ji++]=s,uu|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function cu(e,t,a,s){return pl(e,t,a,s),yl(e)}function ei(e,t){return pl(e,null,null,t),yl(e)}function dh(e,t,a){e.lanes|=a;var s=e.alternate;s!==null&&(s.lanes|=a);for(var o=!1,c=e.return;c!==null;)c.childLanes|=a,s=c.alternate,s!==null&&(s.childLanes|=a),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(o=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,o&&t!==null&&(o=31-Ie(a),e=c.hiddenUpdates,s=e[o],s===null?e[o]=[t]:s.push(t),t.lane=a|536870912),c):null}function yl(e){if(50<fs)throw fs=0,bc=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ni={};function Ny(e,t,a,s){this.tag=e,this.key=a,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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kt(e,t,a,s){return new Ny(e,t,a,s)}function du(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Pn(e,t){var a=e.alternate;return a===null?(a=Kt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function hh(e,t){e.flags&=65011714;var a=e.alternate;return a===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=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function vl(e,t,a,s,o,c){var f=0;if(s=e,typeof e=="function")du(e)&&(f=1);else if(typeof e=="string")f=zv(e,a,W.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case we:return e=Kt(31,a,t,o),e.elementType=we,e.lanes=c,e;case D:return ti(a.children,o,c,t);case I:f=8,o|=24;break;case H:return e=Kt(12,a,t,o|2),e.elementType=H,e.lanes=c,e;case K:return e=Kt(13,a,t,o),e.elementType=K,e.lanes=c,e;case ae:return e=Kt(19,a,t,o),e.elementType=ae,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case P:f=10;break e;case q:f=9;break e;case Q:f=11;break e;case J:f=14;break e;case _e:f=16,s=null;break e}f=29,a=Error(l(130,e===null?"null":typeof e,"")),s=null}return t=Kt(f,a,t,o),t.elementType=e,t.type=s,t.lanes=c,t}function ti(e,t,a,s){return e=Kt(7,e,s,t),e.lanes=a,e}function hu(e,t,a){return e=Kt(6,e,null,t),e.lanes=a,e}function fh(e){var t=Kt(18,null,null,0);return t.stateNode=e,t}function fu(e,t,a){return t=Kt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var mh=new WeakMap;function nn(e,t){if(typeof e=="object"&&e!==null){var a=mh.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Ce(t)},mh.set(e,t),t)}return{value:e,source:t,stack:Ce(t)}}var Li=[],Di=0,bl=null,Kr=0,an=[],rn=0,wa=null,An=1,xn="";function In(e,t){Li[Di++]=Kr,Li[Di++]=bl,bl=e,Kr=t}function gh(e,t,a){an[rn++]=An,an[rn++]=xn,an[rn++]=wa,wa=e;var s=An;e=xn;var o=32-Ie(s)-1;s&=~(1<<o),a+=1;var c=32-Ie(t)+o;if(30<c){var f=o-o%5;c=(s&(1<<f)-1).toString(32),s>>=f,o-=f,An=1<<32-Ie(t)+o|a<<o|s,xn=c+e}else An=1<<c|a<<o|s,xn=e}function mu(e){e.return!==null&&(In(e,1),gh(e,1,0))}function gu(e){for(;e===bl;)bl=Li[--Di],Li[Di]=null,Kr=Li[--Di],Li[Di]=null;for(;e===wa;)wa=an[--rn],an[rn]=null,xn=an[--rn],an[rn]=null,An=an[--rn],an[rn]=null}function ph(e,t){an[rn++]=An,an[rn++]=xn,an[rn++]=wa,An=t.id,xn=t.overflow,wa=e}var _t=null,qe=null,Se=!1,Sa=null,sn=!1,pu=Error(l(519));function _a(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Yr(nn(t,e)),pu}function yh(e){var t=e.stateNode,a=e.type,s=e.memoizedProps;switch(t[st]=e,t[lt]=s,a){case"dialog":ye("cancel",t),ye("close",t);break;case"iframe":case"object":case"embed":ye("load",t);break;case"video":case"audio":for(a=0;a<gs.length;a++)ye(gs[a],t);break;case"source":ye("error",t);break;case"img":case"image":case"link":ye("error",t),ye("load",t);break;case"details":ye("toggle",t);break;case"input":ye("invalid",t),rl(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":ye("invalid",t);break;case"textarea":ye("invalid",t),pa(t,s.value,s.defaultValue,s.children)}a=s.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||s.suppressHydrationWarning===!0||Um(t.textContent,a)?(s.popover!=null&&(ye("beforetoggle",t),ye("toggle",t)),s.onScroll!=null&&ye("scroll",t),s.onScrollEnd!=null&&ye("scrollend",t),s.onClick!=null&&(t.onclick=ke),t=!0):t=!1,t||_a(e,!0)}function vh(e){for(_t=e.return;_t;)switch(_t.tag){case 5:case 31:case 13:sn=!1;return;case 27:case 3:sn=!0;return;default:_t=_t.return}}function Ui(e){if(e!==_t)return!1;if(!Se)return vh(e),Se=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Dc(e.type,e.memoizedProps)),a=!a),a&&qe&&_a(e),vh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));qe=Gm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));qe=Gm(e)}else t===27?(t=qe,Ma(e.type)?(e=Hc,Hc=null,qe=e):qe=t):qe=_t?on(e.stateNode.nextSibling):null;return!0}function ni(){qe=_t=null,Se=!1}function yu(){var e=Sa;return e!==null&&($t===null?$t=e:$t.push.apply($t,e),Sa=null),e}function Yr(e){Sa===null?Sa=[e]:Sa.push(e)}var vu=A(null),ai=null,Gn=null;function Ta(e,t,a){Y(vu,t._currentValue),t._currentValue=a}function Vn(e){e._currentValue=vu.current,U(vu)}function bu(e,t,a){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===a)break;e=e.return}}function wu(e,t,a,s){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var c=o.dependencies;if(c!==null){var f=o.child;c=c.firstContext;e:for(;c!==null;){var v=c;c=o;for(var T=0;T<t.length;T++)if(v.context===t[T]){c.lanes|=a,v=c.alternate,v!==null&&(v.lanes|=a),bu(c.return,a,e),s||(f=null);break e}c=v.next}}else if(o.tag===18){if(f=o.return,f===null)throw Error(l(341));f.lanes|=a,c=f.alternate,c!==null&&(c.lanes|=a),bu(f,a,e),f=null}else f=o.child;if(f!==null)f.return=o;else for(f=o;f!==null;){if(f===e){f=null;break}if(o=f.sibling,o!==null){o.return=f.return,f=o;break}f=f.return}o=f}}function Mi(e,t,a,s){e=null;for(var o=t,c=!1;o!==null;){if(!c){if((o.flags&524288)!==0)c=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var f=o.alternate;if(f===null)throw Error(l(387));if(f=f.memoizedProps,f!==null){var v=o.type;Vt(o.pendingProps.value,f.value)||(e!==null?e.push(v):e=[v])}}else if(o===Ee.current){if(f=o.alternate,f===null)throw Error(l(387));f.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(ws):e=[ws])}o=o.return}e!==null&&wu(t,e,a,s),t.flags|=262144}function wl(e){for(e=e.firstContext;e!==null;){if(!Vt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ii(e){ai=e,Gn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Tt(e){return bh(ai,e)}function Sl(e,t){return ai===null&&ii(e),bh(e,t)}function bh(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Gn===null){if(e===null)throw Error(l(308));Gn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Gn=Gn.next=t;return a}var Ly=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Dy=i.unstable_scheduleCallback,Uy=i.unstable_NormalPriority,ct={$$typeof:P,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Su(){return{controller:new Ly,data:new Map,refCount:0}}function Jr(e){e.refCount--,e.refCount===0&&Dy(Uy,function(){e.controller.abort()})}var Xr=null,_u=0,zi=0,Bi=null;function My(e,t){if(Xr===null){var a=Xr=[];_u=0,zi=Ec(),Bi={status:"pending",value:void 0,then:function(s){a.push(s)}}}return _u++,t.then(wh,wh),t}function wh(){if(--_u===0&&Xr!==null){Bi!==null&&(Bi.status="fulfilled");var e=Xr;Xr=null,zi=0,Bi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function zy(e,t){var a=[],s={status:"pending",value:null,reason:null,then:function(o){a.push(o)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var o=0;o<a.length;o++)(0,a[o])(t)},function(o){for(s.status="rejected",s.reason=o,o=0;o<a.length;o++)(0,a[o])(void 0)}),s}var Sh=L.S;L.S=function(e,t){rm=At(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&My(e,t),Sh!==null&&Sh(e,t)};var ri=A(null);function Tu(){var e=ri.current;return e!==null?e:Be.pooledCache}function _l(e,t){t===null?Y(ri,ri.current):Y(ri,t.pool)}function _h(){var e=Tu();return e===null?null:{parent:ct._currentValue,pool:e}}var Hi=Error(l(460)),ku=Error(l(474)),Tl=Error(l(542)),kl={then:function(){}};function Th(e){return e=e.status,e==="fulfilled"||e==="rejected"}function kh(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(ke,ke),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ah(e),e;default:if(typeof t.status=="string")t.then(ke,ke);else{if(e=Be,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=s}},function(s){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ah(e),e}throw li=t,Hi}}function si(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(li=a,Hi):a}}var li=null;function Eh(){if(li===null)throw Error(l(459));var e=li;return li=null,e}function Ah(e){if(e===Hi||e===Tl)throw Error(l(483))}var qi=null,Qr=0;function El(e){var t=Qr;return Qr+=1,qi===null&&(qi=[]),kh(qi,e,t)}function Wr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Al(e,t){throw t.$$typeof===k?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function xh(e){function t(x,E){if(e){var O=x.deletions;O===null?(x.deletions=[E],x.flags|=16):O.push(E)}}function a(x,E){if(!e)return null;for(;E!==null;)t(x,E),E=E.sibling;return null}function s(x){for(var E=new Map;x!==null;)x.key!==null?E.set(x.key,x):E.set(x.index,x),x=x.sibling;return E}function o(x,E){return x=Pn(x,E),x.index=0,x.sibling=null,x}function c(x,E,O){return x.index=O,e?(O=x.alternate,O!==null?(O=O.index,O<E?(x.flags|=67108866,E):O):(x.flags|=67108866,E)):(x.flags|=1048576,E)}function f(x){return e&&x.alternate===null&&(x.flags|=67108866),x}function v(x,E,O,z){return E===null||E.tag!==6?(E=hu(O,x.mode,z),E.return=x,E):(E=o(E,O),E.return=x,E)}function T(x,E,O,z){var se=O.type;return se===D?M(x,E,O.props.children,z,O.key):E!==null&&(E.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===_e&&si(se)===E.type)?(E=o(E,O.props),Wr(E,O),E.return=x,E):(E=vl(O.type,O.key,O.props,null,x.mode,z),Wr(E,O),E.return=x,E)}function R(x,E,O,z){return E===null||E.tag!==4||E.stateNode.containerInfo!==O.containerInfo||E.stateNode.implementation!==O.implementation?(E=fu(O,x.mode,z),E.return=x,E):(E=o(E,O.children||[]),E.return=x,E)}function M(x,E,O,z,se){return E===null||E.tag!==7?(E=ti(O,x.mode,z,se),E.return=x,E):(E=o(E,O),E.return=x,E)}function B(x,E,O){if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return E=hu(""+E,x.mode,O),E.return=x,E;if(typeof E=="object"&&E!==null){switch(E.$$typeof){case S:return O=vl(E.type,E.key,E.props,null,x.mode,O),Wr(O,E),O.return=x,O;case C:return E=fu(E,x.mode,O),E.return=x,E;case _e:return E=si(E),B(x,E,O)}if(Pe(E)||Le(E))return E=ti(E,x.mode,O,null),E.return=x,E;if(typeof E.then=="function")return B(x,El(E),O);if(E.$$typeof===P)return B(x,Sl(x,E),O);Al(x,E)}return null}function j(x,E,O,z){var se=E!==null?E.key:null;if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return se!==null?null:v(x,E,""+O,z);if(typeof O=="object"&&O!==null){switch(O.$$typeof){case S:return O.key===se?T(x,E,O,z):null;case C:return O.key===se?R(x,E,O,z):null;case _e:return O=si(O),j(x,E,O,z)}if(Pe(O)||Le(O))return se!==null?null:M(x,E,O,z,null);if(typeof O.then=="function")return j(x,E,El(O),z);if(O.$$typeof===P)return j(x,E,Sl(x,O),z);Al(x,O)}return null}function N(x,E,O,z,se){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return x=x.get(O)||null,v(E,x,""+z,se);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case S:return x=x.get(z.key===null?O:z.key)||null,T(E,x,z,se);case C:return x=x.get(z.key===null?O:z.key)||null,R(E,x,z,se);case _e:return z=si(z),N(x,E,O,z,se)}if(Pe(z)||Le(z))return x=x.get(O)||null,M(E,x,z,se,null);if(typeof z.then=="function")return N(x,E,O,El(z),se);if(z.$$typeof===P)return N(x,E,O,Sl(E,z),se);Al(E,z)}return null}function Z(x,E,O,z){for(var se=null,Ae=null,ne=E,me=E=0,be=null;ne!==null&&me<O.length;me++){ne.index>me?(be=ne,ne=null):be=ne.sibling;var xe=j(x,ne,O[me],z);if(xe===null){ne===null&&(ne=be);break}e&&ne&&xe.alternate===null&&t(x,ne),E=c(xe,E,me),Ae===null?se=xe:Ae.sibling=xe,Ae=xe,ne=be}if(me===O.length)return a(x,ne),Se&&In(x,me),se;if(ne===null){for(;me<O.length;me++)ne=B(x,O[me],z),ne!==null&&(E=c(ne,E,me),Ae===null?se=ne:Ae.sibling=ne,Ae=ne);return Se&&In(x,me),se}for(ne=s(ne);me<O.length;me++)be=N(ne,x,me,O[me],z),be!==null&&(e&&be.alternate!==null&&ne.delete(be.key===null?me:be.key),E=c(be,E,me),Ae===null?se=be:Ae.sibling=be,Ae=be);return e&&ne.forEach(function($a){return t(x,$a)}),Se&&In(x,me),se}function oe(x,E,O,z){if(O==null)throw Error(l(151));for(var se=null,Ae=null,ne=E,me=E=0,be=null,xe=O.next();ne!==null&&!xe.done;me++,xe=O.next()){ne.index>me?(be=ne,ne=null):be=ne.sibling;var $a=j(x,ne,xe.value,z);if($a===null){ne===null&&(ne=be);break}e&&ne&&$a.alternate===null&&t(x,ne),E=c($a,E,me),Ae===null?se=$a:Ae.sibling=$a,Ae=$a,ne=be}if(xe.done)return a(x,ne),Se&&In(x,me),se;if(ne===null){for(;!xe.done;me++,xe=O.next())xe=B(x,xe.value,z),xe!==null&&(E=c(xe,E,me),Ae===null?se=xe:Ae.sibling=xe,Ae=xe);return Se&&In(x,me),se}for(ne=s(ne);!xe.done;me++,xe=O.next())xe=N(ne,x,me,xe.value,z),xe!==null&&(e&&xe.alternate!==null&&ne.delete(xe.key===null?me:xe.key),E=c(xe,E,me),Ae===null?se=xe:Ae.sibling=xe,Ae=xe);return e&&ne.forEach(function(Jv){return t(x,Jv)}),Se&&In(x,me),se}function Me(x,E,O,z){if(typeof O=="object"&&O!==null&&O.type===D&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case S:e:{for(var se=O.key;E!==null;){if(E.key===se){if(se=O.type,se===D){if(E.tag===7){a(x,E.sibling),z=o(E,O.props.children),z.return=x,x=z;break e}}else if(E.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===_e&&si(se)===E.type){a(x,E.sibling),z=o(E,O.props),Wr(z,O),z.return=x,x=z;break e}a(x,E);break}else t(x,E);E=E.sibling}O.type===D?(z=ti(O.props.children,x.mode,z,O.key),z.return=x,x=z):(z=vl(O.type,O.key,O.props,null,x.mode,z),Wr(z,O),z.return=x,x=z)}return f(x);case C:e:{for(se=O.key;E!==null;){if(E.key===se)if(E.tag===4&&E.stateNode.containerInfo===O.containerInfo&&E.stateNode.implementation===O.implementation){a(x,E.sibling),z=o(E,O.children||[]),z.return=x,x=z;break e}else{a(x,E);break}else t(x,E);E=E.sibling}z=fu(O,x.mode,z),z.return=x,x=z}return f(x);case _e:return O=si(O),Me(x,E,O,z)}if(Pe(O))return Z(x,E,O,z);if(Le(O)){if(se=Le(O),typeof se!="function")throw Error(l(150));return O=se.call(O),oe(x,E,O,z)}if(typeof O.then=="function")return Me(x,E,El(O),z);if(O.$$typeof===P)return Me(x,E,Sl(x,O),z);Al(x,O)}return typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint"?(O=""+O,E!==null&&E.tag===6?(a(x,E.sibling),z=o(E,O),z.return=x,x=z):(a(x,E),z=hu(O,x.mode,z),z.return=x,x=z),f(x)):a(x,E)}return function(x,E,O,z){try{Qr=0;var se=Me(x,E,O,z);return qi=null,se}catch(ne){if(ne===Hi||ne===Tl)throw ne;var Ae=Kt(29,ne,null,x.mode);return Ae.lanes=z,Ae.return=x,Ae}}}var oi=xh(!0),Ch=xh(!1),ka=!1;function Eu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Au(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 Ea(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Aa(e,t,a){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Re&2)!==0){var o=s.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),s.pending=t,t=yl(e),dh(e,null,a),t}return pl(e,s,t,a),yl(e)}function Zr(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,a|=s,t.lanes=a,Or(e,a)}}function xu(e,t){var a=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,a===s)){var o=null,c=null;if(a=a.firstBaseUpdate,a!==null){do{var f={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};c===null?o=c=f:c=c.next=f,a=a.next}while(a!==null);c===null?o=c=t:c=c.next=t}else o=c=t;a={baseState:s.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:s.shared,callbacks:s.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Cu=!1;function Fr(){if(Cu){var e=Bi;if(e!==null)throw e}}function es(e,t,a,s){Cu=!1;var o=e.updateQueue;ka=!1;var c=o.firstBaseUpdate,f=o.lastBaseUpdate,v=o.shared.pending;if(v!==null){o.shared.pending=null;var T=v,R=T.next;T.next=null,f===null?c=R:f.next=R,f=T;var M=e.alternate;M!==null&&(M=M.updateQueue,v=M.lastBaseUpdate,v!==f&&(v===null?M.firstBaseUpdate=R:v.next=R,M.lastBaseUpdate=T))}if(c!==null){var B=o.baseState;f=0,M=R=T=null,v=c;do{var j=v.lane&-536870913,N=j!==v.lane;if(N?(ve&j)===j:(s&j)===j){j!==0&&j===zi&&(Cu=!0),M!==null&&(M=M.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});e:{var Z=e,oe=v;j=t;var Me=a;switch(oe.tag){case 1:if(Z=oe.payload,typeof Z=="function"){B=Z.call(Me,B,j);break e}B=Z;break e;case 3:Z.flags=Z.flags&-65537|128;case 0:if(Z=oe.payload,j=typeof Z=="function"?Z.call(Me,B,j):Z,j==null)break e;B=b({},B,j);break e;case 2:ka=!0}}j=v.callback,j!==null&&(e.flags|=64,N&&(e.flags|=8192),N=o.callbacks,N===null?o.callbacks=[j]:N.push(j))}else N={lane:j,tag:v.tag,payload:v.payload,callback:v.callback,next:null},M===null?(R=M=N,T=B):M=M.next=N,f|=j;if(v=v.next,v===null){if(v=o.shared.pending,v===null)break;N=v,v=N.next,N.next=null,o.lastBaseUpdate=N,o.shared.pending=null}}while(!0);M===null&&(T=B),o.baseState=T,o.firstBaseUpdate=R,o.lastBaseUpdate=M,c===null&&(o.shared.lanes=0),ja|=f,e.lanes=f,e.memoizedState=B}}function Oh(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function Rh(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Oh(a[e],t)}var $i=A(null),xl=A(0);function jh(e,t){e=ea,Y(xl,e),Y($i,t),ea=e|t.baseLanes}function Ou(){Y(xl,ea),Y($i,$i.current)}function Ru(){ea=xl.current,U($i),U(xl)}var Yt=A(null),ln=null;function xa(e){var t=e.alternate;Y(et,et.current&1),Y(Yt,e),ln===null&&(t===null||$i.current!==null||t.memoizedState!==null)&&(ln=e)}function ju(e){Y(et,et.current),Y(Yt,e),ln===null&&(ln=e)}function Nh(e){e.tag===22?(Y(et,et.current),Y(Yt,e),ln===null&&(ln=e)):Ca()}function Ca(){Y(et,et.current),Y(Yt,Yt.current)}function Jt(e){U(Yt),ln===e&&(ln=null),U(et)}var et=A(0);function Cl(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||zc(a)||Bc(a)))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)!==0)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 Kn=0,fe=null,De=null,dt=null,Ol=!1,Pi=!1,ui=!1,Rl=0,ts=0,Ii=null,By=0;function Qe(){throw Error(l(321))}function Nu(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Vt(e[a],t[a]))return!1;return!0}function Lu(e,t,a,s,o,c){return Kn=c,fe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,L.H=e===null||e.memoizedState===null?pf:Ju,ui=!1,c=a(s,o),ui=!1,Pi&&(c=Dh(t,a,s,o)),Lh(e),c}function Lh(e){L.H=is;var t=De!==null&&De.next!==null;if(Kn=0,dt=De=fe=null,Ol=!1,ts=0,Ii=null,t)throw Error(l(300));e===null||ht||(e=e.dependencies,e!==null&&wl(e)&&(ht=!0))}function Dh(e,t,a,s){fe=e;var o=0;do{if(Pi&&(Ii=null),ts=0,Pi=!1,25<=o)throw Error(l(301));if(o+=1,dt=De=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}L.H=yf,c=t(a,s)}while(Pi);return c}function Hy(){var e=L.H,t=e.useState()[0];return t=typeof t.then=="function"?ns(t):t,e=e.useState()[0],(De!==null?De.memoizedState:null)!==e&&(fe.flags|=1024),t}function Du(){var e=Rl!==0;return Rl=0,e}function Uu(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Mu(e){if(Ol){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ol=!1}Kn=0,dt=De=fe=null,Pi=!1,ts=Rl=0,Ii=null}function Nt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dt===null?fe.memoizedState=dt=e:dt=dt.next=e,dt}function tt(){if(De===null){var e=fe.alternate;e=e!==null?e.memoizedState:null}else e=De.next;var t=dt===null?fe.memoizedState:dt.next;if(t!==null)dt=t,De=e;else{if(e===null)throw fe.alternate===null?Error(l(467)):Error(l(310));De=e,e={memoizedState:De.memoizedState,baseState:De.baseState,baseQueue:De.baseQueue,queue:De.queue,next:null},dt===null?fe.memoizedState=dt=e:dt=dt.next=e}return dt}function jl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ns(e){var t=ts;return ts+=1,Ii===null&&(Ii=[]),e=kh(Ii,e,t),t=fe,(dt===null?t.memoizedState:dt.next)===null&&(t=t.alternate,L.H=t===null||t.memoizedState===null?pf:Ju),e}function Nl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ns(e);if(e.$$typeof===P)return Tt(e)}throw Error(l(438,String(e)))}function zu(e){var t=null,a=fe.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var s=fe.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=jl(),fe.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),s=0;s<e;s++)a[s]=Dt;return t.index++,a}function Yn(e,t){return typeof t=="function"?t(e):t}function Ll(e){var t=tt();return Bu(t,De,e)}function Bu(e,t,a){var s=e.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=a;var o=e.baseQueue,c=s.pending;if(c!==null){if(o!==null){var f=o.next;o.next=c.next,c.next=f}t.baseQueue=o=c,s.pending=null}if(c=e.baseState,o===null)e.memoizedState=c;else{t=o.next;var v=f=null,T=null,R=t,M=!1;do{var B=R.lane&-536870913;if(B!==R.lane?(ve&B)===B:(Kn&B)===B){var j=R.revertLane;if(j===0)T!==null&&(T=T.next={lane:0,revertLane:0,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null}),B===zi&&(M=!0);else if((Kn&j)===j){R=R.next,j===zi&&(M=!0);continue}else B={lane:0,revertLane:R.revertLane,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},T===null?(v=T=B,f=c):T=T.next=B,fe.lanes|=j,ja|=j;B=R.action,ui&&a(c,B),c=R.hasEagerState?R.eagerState:a(c,B)}else j={lane:B,revertLane:R.revertLane,gesture:R.gesture,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},T===null?(v=T=j,f=c):T=T.next=j,fe.lanes|=B,ja|=B;R=R.next}while(R!==null&&R!==t);if(T===null?f=c:T.next=v,!Vt(c,e.memoizedState)&&(ht=!0,M&&(a=Bi,a!==null)))throw a;e.memoizedState=c,e.baseState=f,e.baseQueue=T,s.lastRenderedState=c}return o===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Hu(e){var t=tt(),a=t.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=e;var s=a.dispatch,o=a.pending,c=t.memoizedState;if(o!==null){a.pending=null;var f=o=o.next;do c=e(c,f.action),f=f.next;while(f!==o);Vt(c,t.memoizedState)||(ht=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),a.lastRenderedState=c}return[c,s]}function Uh(e,t,a){var s=fe,o=tt(),c=Se;if(c){if(a===void 0)throw Error(l(407));a=a()}else a=t();var f=!Vt((De||o).memoizedState,a);if(f&&(o.memoizedState=a,ht=!0),o=o.queue,Pu(Bh.bind(null,s,o,e),[e]),o.getSnapshot!==t||f||dt!==null&&dt.memoizedState.tag&1){if(s.flags|=2048,Gi(9,{destroy:void 0},zh.bind(null,s,o,a,t),null),Be===null)throw Error(l(349));c||(Kn&127)!==0||Mh(s,t,a)}return a}function Mh(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=fe.updateQueue,t===null?(t=jl(),fe.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function zh(e,t,a,s){t.value=a,t.getSnapshot=s,Hh(t)&&qh(e)}function Bh(e,t,a){return a(function(){Hh(t)&&qh(e)})}function Hh(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Vt(e,a)}catch{return!0}}function qh(e){var t=ei(e,2);t!==null&&Pt(t,e,2)}function qu(e){var t=Nt();if(typeof e=="function"){var a=e;if(e=a(),ui){re(!0);try{a()}finally{re(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yn,lastRenderedState:e},t}function $h(e,t,a,s){return e.baseState=a,Bu(e,De,typeof s=="function"?s:Yn)}function qy(e,t,a,s,o){if(Ml(e))throw Error(l(485));if(e=t.action,e!==null){var c={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){c.listeners.push(f)}};L.T!==null?a(!0):c.isTransition=!1,s(c),a=t.pending,a===null?(c.next=t.pending=c,Ph(t,c)):(c.next=a.next,t.pending=a.next=c)}}function Ph(e,t){var a=t.action,s=t.payload,o=e.state;if(t.isTransition){var c=L.T,f={};L.T=f;try{var v=a(o,s),T=L.S;T!==null&&T(f,v),Ih(e,t,v)}catch(R){$u(e,t,R)}finally{c!==null&&f.types!==null&&(c.types=f.types),L.T=c}}else try{c=a(o,s),Ih(e,t,c)}catch(R){$u(e,t,R)}}function Ih(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(s){Gh(e,t,s)},function(s){return $u(e,t,s)}):Gh(e,t,a)}function Gh(e,t,a){t.status="fulfilled",t.value=a,Vh(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Ph(e,a)))}function $u(e,t,a){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=a,Vh(t),t=t.next;while(t!==s)}e.action=null}function Vh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Kh(e,t){return t}function Yh(e,t){if(Se){var a=Be.formState;if(a!==null){e:{var s=fe;if(Se){if(qe){t:{for(var o=qe,c=sn;o.nodeType!==8;){if(!c){o=null;break t}if(o=on(o.nextSibling),o===null){o=null;break t}}c=o.data,o=c==="F!"||c==="F"?o:null}if(o){qe=on(o.nextSibling),s=o.data==="F!";break e}}_a(s)}s=!1}s&&(t=a[0])}}return a=Nt(),a.memoizedState=a.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kh,lastRenderedState:t},a.queue=s,a=ff.bind(null,fe,s),s.dispatch=a,s=qu(!1),c=Yu.bind(null,fe,!1,s.queue),s=Nt(),o={state:t,dispatch:null,action:e,pending:null},s.queue=o,a=qy.bind(null,fe,o,c,a),o.dispatch=a,s.memoizedState=e,[t,a,!1]}function Jh(e){var t=tt();return Xh(t,De,e)}function Xh(e,t,a){if(t=Bu(e,t,Kh)[0],e=Ll(Yn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=ns(t)}catch(f){throw f===Hi?Tl:f}else s=t;t=tt();var o=t.queue,c=o.dispatch;return a!==t.memoizedState&&(fe.flags|=2048,Gi(9,{destroy:void 0},$y.bind(null,o,a),null)),[s,c,e]}function $y(e,t){e.action=t}function Qh(e){var t=tt(),a=De;if(a!==null)return Xh(t,a,e);tt(),t=t.memoizedState,a=tt();var s=a.queue.dispatch;return a.memoizedState=e,[t,s,!1]}function Gi(e,t,a,s){return e={tag:e,create:a,deps:s,inst:t,next:null},t=fe.updateQueue,t===null&&(t=jl(),fe.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(s=a.next,a.next=e,e.next=s,t.lastEffect=e),e}function Wh(){return tt().memoizedState}function Dl(e,t,a,s){var o=Nt();fe.flags|=e,o.memoizedState=Gi(1|t,{destroy:void 0},a,s===void 0?null:s)}function Ul(e,t,a,s){var o=tt();s=s===void 0?null:s;var c=o.memoizedState.inst;De!==null&&s!==null&&Nu(s,De.memoizedState.deps)?o.memoizedState=Gi(t,c,a,s):(fe.flags|=e,o.memoizedState=Gi(1|t,c,a,s))}function Zh(e,t){Dl(8390656,8,e,t)}function Pu(e,t){Ul(2048,8,e,t)}function Py(e){fe.flags|=4;var t=fe.updateQueue;if(t===null)t=jl(),fe.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Fh(e){var t=tt().memoizedState;return Py({ref:t,nextImpl:e}),function(){if((Re&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function ef(e,t){return Ul(4,2,e,t)}function tf(e,t){return Ul(4,4,e,t)}function nf(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function af(e,t,a){a=a!=null?a.concat([e]):null,Ul(4,4,nf.bind(null,t,e),a)}function Iu(){}function rf(e,t){var a=tt();t=t===void 0?null:t;var s=a.memoizedState;return t!==null&&Nu(t,s[1])?s[0]:(a.memoizedState=[e,t],e)}function sf(e,t){var a=tt();t=t===void 0?null:t;var s=a.memoizedState;if(t!==null&&Nu(t,s[1]))return s[0];if(s=e(),ui){re(!0);try{e()}finally{re(!1)}}return a.memoizedState=[s,t],s}function Gu(e,t,a){return a===void 0||(Kn&1073741824)!==0&&(ve&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=lm(),fe.lanes|=e,ja|=e,a)}function lf(e,t,a,s){return Vt(a,t)?a:$i.current!==null?(e=Gu(e,a,s),Vt(e,t)||(ht=!0),e):(Kn&42)===0||(Kn&1073741824)!==0&&(ve&261930)===0?(ht=!0,e.memoizedState=a):(e=lm(),fe.lanes|=e,ja|=e,t)}function of(e,t,a,s,o){var c=G.p;G.p=c!==0&&8>c?c:8;var f=L.T,v={};L.T=v,Yu(e,!1,t,a);try{var T=o(),R=L.S;if(R!==null&&R(v,T),T!==null&&typeof T=="object"&&typeof T.then=="function"){var M=zy(T,s);as(e,t,M,Wt(e))}else as(e,t,s,Wt(e))}catch(B){as(e,t,{then:function(){},status:"rejected",reason:B},Wt())}finally{G.p=c,f!==null&&v.types!==null&&(f.types=v.types),L.T=f}}function Iy(){}function Vu(e,t,a,s){if(e.tag!==5)throw Error(l(476));var o=uf(e).queue;of(e,o,t,ie,a===null?Iy:function(){return cf(e),a(s)})}function uf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yn,lastRenderedState:ie},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function cf(e){var t=uf(e);t.next===null&&(t=e.alternate.memoizedState),as(e,t.next.queue,{},Wt())}function Ku(){return Tt(ws)}function df(){return tt().memoizedState}function hf(){return tt().memoizedState}function Gy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Wt();e=Ea(a);var s=Aa(t,e,a);s!==null&&(Pt(s,t,a),Zr(s,t,a)),t={cache:Su()},e.payload=t;return}t=t.return}}function Vy(e,t,a){var s=Wt();a={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Ml(e)?mf(t,a):(a=cu(e,t,a,s),a!==null&&(Pt(a,e,s),gf(a,t,s)))}function ff(e,t,a){var s=Wt();as(e,t,a,s)}function as(e,t,a,s){var o={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Ml(e))mf(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var f=t.lastRenderedState,v=c(f,a);if(o.hasEagerState=!0,o.eagerState=v,Vt(v,f))return pl(e,t,o,0),Be===null&&gl(),!1}catch{}if(a=cu(e,t,o,s),a!==null)return Pt(a,e,s),gf(a,t,s),!0}return!1}function Yu(e,t,a,s){if(s={lane:2,revertLane:Ec(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Ml(e)){if(t)throw Error(l(479))}else t=cu(e,a,s,2),t!==null&&Pt(t,e,2)}function Ml(e){var t=e.alternate;return e===fe||t!==null&&t===fe}function mf(e,t){Pi=Ol=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function gf(e,t,a){if((a&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,a|=s,t.lanes=a,Or(e,a)}}var is={readContext:Tt,use:Nl,useCallback:Qe,useContext:Qe,useEffect:Qe,useImperativeHandle:Qe,useLayoutEffect:Qe,useInsertionEffect:Qe,useMemo:Qe,useReducer:Qe,useRef:Qe,useState:Qe,useDebugValue:Qe,useDeferredValue:Qe,useTransition:Qe,useSyncExternalStore:Qe,useId:Qe,useHostTransitionStatus:Qe,useFormState:Qe,useActionState:Qe,useOptimistic:Qe,useMemoCache:Qe,useCacheRefresh:Qe};is.useEffectEvent=Qe;var pf={readContext:Tt,use:Nl,useCallback:function(e,t){return Nt().memoizedState=[e,t===void 0?null:t],e},useContext:Tt,useEffect:Zh,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Dl(4194308,4,nf.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Dl(4194308,4,e,t)},useInsertionEffect:function(e,t){Dl(4,2,e,t)},useMemo:function(e,t){var a=Nt();t=t===void 0?null:t;var s=e();if(ui){re(!0);try{e()}finally{re(!1)}}return a.memoizedState=[s,t],s},useReducer:function(e,t,a){var s=Nt();if(a!==void 0){var o=a(t);if(ui){re(!0);try{a(t)}finally{re(!1)}}}else o=t;return s.memoizedState=s.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},s.queue=e,e=e.dispatch=Vy.bind(null,fe,e),[s.memoizedState,e]},useRef:function(e){var t=Nt();return e={current:e},t.memoizedState=e},useState:function(e){e=qu(e);var t=e.queue,a=ff.bind(null,fe,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Iu,useDeferredValue:function(e,t){var a=Nt();return Gu(a,e,t)},useTransition:function(){var e=qu(!1);return e=of.bind(null,fe,e.queue,!0,!1),Nt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var s=fe,o=Nt();if(Se){if(a===void 0)throw Error(l(407));a=a()}else{if(a=t(),Be===null)throw Error(l(349));(ve&127)!==0||Mh(s,t,a)}o.memoizedState=a;var c={value:a,getSnapshot:t};return o.queue=c,Zh(Bh.bind(null,s,c,e),[e]),s.flags|=2048,Gi(9,{destroy:void 0},zh.bind(null,s,c,a,t),null),a},useId:function(){var e=Nt(),t=Be.identifierPrefix;if(Se){var a=xn,s=An;a=(s&~(1<<32-Ie(s)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Rl++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=By++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ku,useFormState:Yh,useActionState:Yh,useOptimistic:function(e){var t=Nt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Yu.bind(null,fe,!0,a),a.dispatch=t,[e,t]},useMemoCache:zu,useCacheRefresh:function(){return Nt().memoizedState=Gy.bind(null,fe)},useEffectEvent:function(e){var t=Nt(),a={impl:e};return t.memoizedState=a,function(){if((Re&2)!==0)throw Error(l(440));return a.impl.apply(void 0,arguments)}}},Ju={readContext:Tt,use:Nl,useCallback:rf,useContext:Tt,useEffect:Pu,useImperativeHandle:af,useInsertionEffect:ef,useLayoutEffect:tf,useMemo:sf,useReducer:Ll,useRef:Wh,useState:function(){return Ll(Yn)},useDebugValue:Iu,useDeferredValue:function(e,t){var a=tt();return lf(a,De.memoizedState,e,t)},useTransition:function(){var e=Ll(Yn)[0],t=tt().memoizedState;return[typeof e=="boolean"?e:ns(e),t]},useSyncExternalStore:Uh,useId:df,useHostTransitionStatus:Ku,useFormState:Jh,useActionState:Jh,useOptimistic:function(e,t){var a=tt();return $h(a,De,e,t)},useMemoCache:zu,useCacheRefresh:hf};Ju.useEffectEvent=Fh;var yf={readContext:Tt,use:Nl,useCallback:rf,useContext:Tt,useEffect:Pu,useImperativeHandle:af,useInsertionEffect:ef,useLayoutEffect:tf,useMemo:sf,useReducer:Hu,useRef:Wh,useState:function(){return Hu(Yn)},useDebugValue:Iu,useDeferredValue:function(e,t){var a=tt();return De===null?Gu(a,e,t):lf(a,De.memoizedState,e,t)},useTransition:function(){var e=Hu(Yn)[0],t=tt().memoizedState;return[typeof e=="boolean"?e:ns(e),t]},useSyncExternalStore:Uh,useId:df,useHostTransitionStatus:Ku,useFormState:Qh,useActionState:Qh,useOptimistic:function(e,t){var a=tt();return De!==null?$h(a,De,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:zu,useCacheRefresh:hf};yf.useEffectEvent=Fh;function Xu(e,t,a,s){t=e.memoizedState,a=a(s,t),a=a==null?t:b({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Qu={enqueueSetState:function(e,t,a){e=e._reactInternals;var s=Wt(),o=Ea(s);o.payload=t,a!=null&&(o.callback=a),t=Aa(e,o,s),t!==null&&(Pt(t,e,s),Zr(t,e,s))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var s=Wt(),o=Ea(s);o.tag=1,o.payload=t,a!=null&&(o.callback=a),t=Aa(e,o,s),t!==null&&(Pt(t,e,s),Zr(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Wt(),s=Ea(a);s.tag=2,t!=null&&(s.callback=t),t=Aa(e,s,a),t!==null&&(Pt(t,e,a),Zr(t,e,a))}};function vf(e,t,a,s,o,c,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,c,f):t.prototype&&t.prototype.isPureReactComponent?!Gr(a,s)||!Gr(o,c):!0}function bf(e,t,a,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,s),t.state!==e&&Qu.enqueueReplaceState(t,t.state,null)}function ci(e,t){var a=t;if("ref"in t){a={};for(var s in t)s!=="ref"&&(a[s]=t[s])}if(e=e.defaultProps){a===t&&(a=b({},a));for(var o in e)a[o]===void 0&&(a[o]=e[o])}return a}function wf(e){ml(e)}function Sf(e){console.error(e)}function _f(e){ml(e)}function zl(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Tf(e,t,a){try{var s=e.onCaughtError;s(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function Wu(e,t,a){return a=Ea(a),a.tag=3,a.payload={element:null},a.callback=function(){zl(e,t)},a}function kf(e){return e=Ea(e),e.tag=3,e}function Ef(e,t,a,s){var o=a.type.getDerivedStateFromError;if(typeof o=="function"){var c=s.value;e.payload=function(){return o(c)},e.callback=function(){Tf(t,a,s)}}var f=a.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){Tf(t,a,s),typeof o!="function"&&(Na===null?Na=new Set([this]):Na.add(this));var v=s.stack;this.componentDidCatch(s.value,{componentStack:v!==null?v:""})})}function Ky(e,t,a,s,o){if(a.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=a.alternate,t!==null&&Mi(t,a,o,!0),a=Yt.current,a!==null){switch(a.tag){case 31:case 13:return ln===null?Xl():a.alternate===null&&We===0&&(We=3),a.flags&=-257,a.flags|=65536,a.lanes=o,s===kl?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([s]):t.add(s),_c(e,s,o)),!1;case 22:return a.flags|=65536,s===kl?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([s]):a.add(s)),_c(e,s,o)),!1}throw Error(l(435,a.tag))}return _c(e,s,o),Xl(),!1}if(Se)return t=Yt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,s!==pu&&(e=Error(l(422),{cause:s}),Yr(nn(e,a)))):(s!==pu&&(t=Error(l(423),{cause:s}),Yr(nn(t,a))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,s=nn(s,a),o=Wu(e.stateNode,s,o),xu(e,o),We!==4&&(We=2)),!1;var c=Error(l(520),{cause:s});if(c=nn(c,a),hs===null?hs=[c]:hs.push(c),We!==4&&(We=2),t===null)return!0;s=nn(s,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=o&-o,a.lanes|=e,e=Wu(a.stateNode,s,e),xu(a,e),!1;case 1:if(t=a.type,c=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(Na===null||!Na.has(c))))return a.flags|=65536,o&=-o,a.lanes|=o,o=kf(o),Ef(o,e,a,s),xu(a,o),!1}a=a.return}while(a!==null);return!1}var Zu=Error(l(461)),ht=!1;function kt(e,t,a,s){t.child=e===null?Ch(t,null,a,s):oi(t,e.child,a,s)}function Af(e,t,a,s,o){a=a.render;var c=t.ref;if("ref"in s){var f={};for(var v in s)v!=="ref"&&(f[v]=s[v])}else f=s;return ii(t),s=Lu(e,t,a,f,c,o),v=Du(),e!==null&&!ht?(Uu(e,t,o),Jn(e,t,o)):(Se&&v&&mu(t),t.flags|=1,kt(e,t,s,o),t.child)}function xf(e,t,a,s,o){if(e===null){var c=a.type;return typeof c=="function"&&!du(c)&&c.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=c,Cf(e,t,c,s,o)):(e=vl(a.type,null,s,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!sc(e,o)){var f=c.memoizedProps;if(a=a.compare,a=a!==null?a:Gr,a(f,s)&&e.ref===t.ref)return Jn(e,t,o)}return t.flags|=1,e=Pn(c,s),e.ref=t.ref,e.return=t,t.child=e}function Cf(e,t,a,s,o){if(e!==null){var c=e.memoizedProps;if(Gr(c,s)&&e.ref===t.ref)if(ht=!1,t.pendingProps=s=c,sc(e,o))(e.flags&131072)!==0&&(ht=!0);else return t.lanes=e.lanes,Jn(e,t,o)}return Fu(e,t,a,s,o)}function Of(e,t,a,s){var o=s.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|a:a,e!==null){for(s=t.child=e.child,o=0;s!==null;)o=o|s.lanes|s.childLanes,s=s.sibling;s=o&~c}else s=0,t.child=null;return Rf(e,t,c,a,s)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&_l(t,c!==null?c.cachePool:null),c!==null?jh(t,c):Ou(),Nh(t);else return s=t.lanes=536870912,Rf(e,t,c!==null?c.baseLanes|a:a,a,s)}else c!==null?(_l(t,c.cachePool),jh(t,c),Ca(),t.memoizedState=null):(e!==null&&_l(t,null),Ou(),Ca());return kt(e,t,o,a),t.child}function rs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Rf(e,t,a,s,o){var c=Tu();return c=c===null?null:{parent:ct._currentValue,pool:c},t.memoizedState={baseLanes:a,cachePool:c},e!==null&&_l(t,null),Ou(),Nh(t),e!==null&&Mi(e,t,s,!0),t.childLanes=o,null}function Bl(e,t){return t=ql({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function jf(e,t,a){return oi(t,e.child,null,a),e=Bl(t,t.pendingProps),e.flags|=2,Jt(t),t.memoizedState=null,e}function Yy(e,t,a){var s=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Se){if(s.mode==="hidden")return e=Bl(t,s),t.lanes=536870912,rs(null,e);if(ju(t),(e=qe)?(e=Im(e,sn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wa!==null?{id:An,overflow:xn}:null,retryLane:536870912,hydrationErrors:null},a=fh(e),a.return=t,t.child=a,_t=t,qe=null)):e=null,e===null)throw _a(t);return t.lanes=536870912,null}return Bl(t,s)}var c=e.memoizedState;if(c!==null){var f=c.dehydrated;if(ju(t),o)if(t.flags&256)t.flags&=-257,t=jf(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(ht||Mi(e,t,a,!1),o=(a&e.childLanes)!==0,ht||o){if(s=Be,s!==null&&(f=Ti(s,a),f!==0&&f!==c.retryLane))throw c.retryLane=f,ei(e,f),Pt(s,e,f),Zu;Xl(),t=jf(e,t,a)}else e=c.treeContext,qe=on(f.nextSibling),_t=t,Se=!0,Sa=null,sn=!1,e!==null&&ph(t,e),t=Bl(t,s),t.flags|=4096;return t}return e=Pn(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Hl(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(l(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Fu(e,t,a,s,o){return ii(t),a=Lu(e,t,a,s,void 0,o),s=Du(),e!==null&&!ht?(Uu(e,t,o),Jn(e,t,o)):(Se&&s&&mu(t),t.flags|=1,kt(e,t,a,o),t.child)}function Nf(e,t,a,s,o,c){return ii(t),t.updateQueue=null,a=Dh(t,s,a,o),Lh(e),s=Du(),e!==null&&!ht?(Uu(e,t,c),Jn(e,t,c)):(Se&&s&&mu(t),t.flags|=1,kt(e,t,a,c),t.child)}function Lf(e,t,a,s,o){if(ii(t),t.stateNode===null){var c=Ni,f=a.contextType;typeof f=="object"&&f!==null&&(c=Tt(f)),c=new a(s,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Qu,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=s,c.state=t.memoizedState,c.refs={},Eu(t),f=a.contextType,c.context=typeof f=="object"&&f!==null?Tt(f):Ni,c.state=t.memoizedState,f=a.getDerivedStateFromProps,typeof f=="function"&&(Xu(t,a,f,s),c.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(f=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),f!==c.state&&Qu.enqueueReplaceState(c,c.state,null),es(t,s,c,o),Fr(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){c=t.stateNode;var v=t.memoizedProps,T=ci(a,v);c.props=T;var R=c.context,M=a.contextType;f=Ni,typeof M=="object"&&M!==null&&(f=Tt(M));var B=a.getDerivedStateFromProps;M=typeof B=="function"||typeof c.getSnapshotBeforeUpdate=="function",v=t.pendingProps!==v,M||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(v||R!==f)&&bf(t,c,s,f),ka=!1;var j=t.memoizedState;c.state=j,es(t,s,c,o),Fr(),R=t.memoizedState,v||j!==R||ka?(typeof B=="function"&&(Xu(t,a,B,s),R=t.memoizedState),(T=ka||vf(t,a,T,s,j,R,f))?(M||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=R),c.props=s,c.state=R,c.context=f,s=T):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{c=t.stateNode,Au(e,t),f=t.memoizedProps,M=ci(a,f),c.props=M,B=t.pendingProps,j=c.context,R=a.contextType,T=Ni,typeof R=="object"&&R!==null&&(T=Tt(R)),v=a.getDerivedStateFromProps,(R=typeof v=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(f!==B||j!==T)&&bf(t,c,s,T),ka=!1,j=t.memoizedState,c.state=j,es(t,s,c,o),Fr();var N=t.memoizedState;f!==B||j!==N||ka||e!==null&&e.dependencies!==null&&wl(e.dependencies)?(typeof v=="function"&&(Xu(t,a,v,s),N=t.memoizedState),(M=ka||vf(t,a,M,s,j,N,T)||e!==null&&e.dependencies!==null&&wl(e.dependencies))?(R||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(s,N,T),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(s,N,T)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||f===e.memoizedProps&&j===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&j===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=N),c.props=s,c.state=N,c.context=T,s=M):(typeof c.componentDidUpdate!="function"||f===e.memoizedProps&&j===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&j===e.memoizedState||(t.flags|=1024),s=!1)}return c=s,Hl(e,t),s=(t.flags&128)!==0,c||s?(c=t.stateNode,a=s&&typeof a.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&s?(t.child=oi(t,e.child,null,o),t.child=oi(t,null,a,o)):kt(e,t,a,o),t.memoizedState=c.state,e=t.child):e=Jn(e,t,o),e}function Df(e,t,a,s){return ni(),t.flags|=256,kt(e,t,a,s),t.child}var ec={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tc(e){return{baseLanes:e,cachePool:_h()}}function nc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Qt),e}function Uf(e,t,a){var s=t.pendingProps,o=!1,c=(t.flags&128)!==0,f;if((f=c)||(f=e!==null&&e.memoizedState===null?!1:(et.current&2)!==0),f&&(o=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(Se){if(o?xa(t):Ca(),(e=qe)?(e=Im(e,sn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wa!==null?{id:An,overflow:xn}:null,retryLane:536870912,hydrationErrors:null},a=fh(e),a.return=t,t.child=a,_t=t,qe=null)):e=null,e===null)throw _a(t);return Bc(e)?t.lanes=32:t.lanes=536870912,null}var v=s.children;return s=s.fallback,o?(Ca(),o=t.mode,v=ql({mode:"hidden",children:v},o),s=ti(s,o,a,null),v.return=t,s.return=t,v.sibling=s,t.child=v,s=t.child,s.memoizedState=tc(a),s.childLanes=nc(e,f,a),t.memoizedState=ec,rs(null,s)):(xa(t),ac(t,v))}var T=e.memoizedState;if(T!==null&&(v=T.dehydrated,v!==null)){if(c)t.flags&256?(xa(t),t.flags&=-257,t=ic(e,t,a)):t.memoizedState!==null?(Ca(),t.child=e.child,t.flags|=128,t=null):(Ca(),v=s.fallback,o=t.mode,s=ql({mode:"visible",children:s.children},o),v=ti(v,o,a,null),v.flags|=2,s.return=t,v.return=t,s.sibling=v,t.child=s,oi(t,e.child,null,a),s=t.child,s.memoizedState=tc(a),s.childLanes=nc(e,f,a),t.memoizedState=ec,t=rs(null,s));else if(xa(t),Bc(v)){if(f=v.nextSibling&&v.nextSibling.dataset,f)var R=f.dgst;f=R,s=Error(l(419)),s.stack="",s.digest=f,Yr({value:s,source:null,stack:null}),t=ic(e,t,a)}else if(ht||Mi(e,t,a,!1),f=(a&e.childLanes)!==0,ht||f){if(f=Be,f!==null&&(s=Ti(f,a),s!==0&&s!==T.retryLane))throw T.retryLane=s,ei(e,s),Pt(f,e,s),Zu;zc(v)||Xl(),t=ic(e,t,a)}else zc(v)?(t.flags|=192,t.child=e.child,t=null):(e=T.treeContext,qe=on(v.nextSibling),_t=t,Se=!0,Sa=null,sn=!1,e!==null&&ph(t,e),t=ac(t,s.children),t.flags|=4096);return t}return o?(Ca(),v=s.fallback,o=t.mode,T=e.child,R=T.sibling,s=Pn(T,{mode:"hidden",children:s.children}),s.subtreeFlags=T.subtreeFlags&65011712,R!==null?v=Pn(R,v):(v=ti(v,o,a,null),v.flags|=2),v.return=t,s.return=t,s.sibling=v,t.child=s,rs(null,s),s=t.child,v=e.child.memoizedState,v===null?v=tc(a):(o=v.cachePool,o!==null?(T=ct._currentValue,o=o.parent!==T?{parent:T,pool:T}:o):o=_h(),v={baseLanes:v.baseLanes|a,cachePool:o}),s.memoizedState=v,s.childLanes=nc(e,f,a),t.memoizedState=ec,rs(e.child,s)):(xa(t),a=e.child,e=a.sibling,a=Pn(a,{mode:"visible",children:s.children}),a.return=t,a.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=a,t.memoizedState=null,a)}function ac(e,t){return t=ql({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ql(e,t){return e=Kt(22,e,null,t),e.lanes=0,e}function ic(e,t,a){return oi(t,e.child,null,a),e=ac(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Mf(e,t,a){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),bu(e.return,t,a)}function rc(e,t,a,s,o,c){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:a,tailMode:o,treeForkCount:c}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=s,f.tail=a,f.tailMode=o,f.treeForkCount=c)}function zf(e,t,a){var s=t.pendingProps,o=s.revealOrder,c=s.tail;s=s.children;var f=et.current,v=(f&2)!==0;if(v?(f=f&1|2,t.flags|=128):f&=1,Y(et,f),kt(e,t,s,a),s=Se?Kr:0,!v&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Mf(e,a,t);else if(e.tag===19)Mf(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(o){case"forwards":for(a=t.child,o=null;a!==null;)e=a.alternate,e!==null&&Cl(e)===null&&(o=a),a=a.sibling;a=o,a===null?(o=t.child,t.child=null):(o=a.sibling,a.sibling=null),rc(t,!1,o,a,c,s);break;case"backwards":case"unstable_legacy-backwards":for(a=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Cl(e)===null){t.child=o;break}e=o.sibling,o.sibling=a,a=o,o=e}rc(t,!0,a,null,c,s);break;case"together":rc(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function Jn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),ja|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Mi(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,a=Pn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Pn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function sc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&wl(e)))}function Jy(e,t,a){switch(t.tag){case 3:Ve(t,t.stateNode.containerInfo),Ta(t,ct,e.memoizedState.cache),ni();break;case 27:case 5:kn(t);break;case 4:Ve(t,t.stateNode.containerInfo);break;case 10:Ta(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ju(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(xa(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Uf(e,t,a):(xa(t),e=Jn(e,t,a),e!==null?e.sibling:null);xa(t);break;case 19:var o=(e.flags&128)!==0;if(s=(a&t.childLanes)!==0,s||(Mi(e,t,a,!1),s=(a&t.childLanes)!==0),o){if(s)return zf(e,t,a);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Y(et,et.current),s)break;return null;case 22:return t.lanes=0,Of(e,t,a,t.pendingProps);case 24:Ta(t,ct,e.memoizedState.cache)}return Jn(e,t,a)}function Bf(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)ht=!0;else{if(!sc(e,a)&&(t.flags&128)===0)return ht=!1,Jy(e,t,a);ht=(e.flags&131072)!==0}else ht=!1,Se&&(t.flags&1048576)!==0&&gh(t,Kr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=si(t.elementType),t.type=e,typeof e=="function")du(e)?(s=ci(e,s),t.tag=1,t=Lf(null,t,e,s,a)):(t.tag=0,t=Fu(null,t,e,s,a));else{if(e!=null){var o=e.$$typeof;if(o===Q){t.tag=11,t=Af(null,t,e,s,a);break e}else if(o===J){t.tag=14,t=xf(null,t,e,s,a);break e}}throw t=vt(e)||e,Error(l(306,t,""))}}return t;case 0:return Fu(e,t,t.type,t.pendingProps,a);case 1:return s=t.type,o=ci(s,t.pendingProps),Lf(e,t,s,o,a);case 3:e:{if(Ve(t,t.stateNode.containerInfo),e===null)throw Error(l(387));s=t.pendingProps;var c=t.memoizedState;o=c.element,Au(e,t),es(t,s,null,a);var f=t.memoizedState;if(s=f.cache,Ta(t,ct,s),s!==c.cache&&wu(t,[ct],a,!0),Fr(),s=f.element,c.isDehydrated)if(c={element:s,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=Df(e,t,s,a);break e}else if(s!==o){o=nn(Error(l(424)),t),Yr(o),t=Df(e,t,s,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,qe=on(e.firstChild),_t=t,Se=!0,Sa=null,sn=!0,a=Ch(t,null,s,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(ni(),s===o){t=Jn(e,t,a);break e}kt(e,t,s,a)}t=t.child}return t;case 26:return Hl(e,t),e===null?(a=Xm(t.type,null,t.pendingProps,null))?t.memoizedState=a:Se||(a=t.type,e=t.pendingProps,s=no(he.current).createElement(a),s[st]=t,s[lt]=e,Et(s,a,e),ot(s),t.stateNode=s):t.memoizedState=Xm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return kn(t),e===null&&Se&&(s=t.stateNode=Km(t.type,t.pendingProps,he.current),_t=t,sn=!0,o=qe,Ma(t.type)?(Hc=o,qe=on(s.firstChild)):qe=o),kt(e,t,t.pendingProps.children,a),Hl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Se&&((o=s=qe)&&(s=kv(s,t.type,t.pendingProps,sn),s!==null?(t.stateNode=s,_t=t,qe=on(s.firstChild),sn=!1,o=!0):o=!1),o||_a(t)),kn(t),o=t.type,c=t.pendingProps,f=e!==null?e.memoizedProps:null,s=c.children,Dc(o,c)?s=null:f!==null&&Dc(o,f)&&(t.flags|=32),t.memoizedState!==null&&(o=Lu(e,t,Hy,null,null,a),ws._currentValue=o),Hl(e,t),kt(e,t,s,a),t.child;case 6:return e===null&&Se&&((e=a=qe)&&(a=Ev(a,t.pendingProps,sn),a!==null?(t.stateNode=a,_t=t,qe=null,e=!0):e=!1),e||_a(t)),null;case 13:return Uf(e,t,a);case 4:return Ve(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=oi(t,null,s,a):kt(e,t,s,a),t.child;case 11:return Af(e,t,t.type,t.pendingProps,a);case 7:return kt(e,t,t.pendingProps,a),t.child;case 8:return kt(e,t,t.pendingProps.children,a),t.child;case 12:return kt(e,t,t.pendingProps.children,a),t.child;case 10:return s=t.pendingProps,Ta(t,t.type,s.value),kt(e,t,s.children,a),t.child;case 9:return o=t.type._context,s=t.pendingProps.children,ii(t),o=Tt(o),s=s(o),t.flags|=1,kt(e,t,s,a),t.child;case 14:return xf(e,t,t.type,t.pendingProps,a);case 15:return Cf(e,t,t.type,t.pendingProps,a);case 19:return zf(e,t,a);case 31:return Yy(e,t,a);case 22:return Of(e,t,a,t.pendingProps);case 24:return ii(t),s=Tt(ct),e===null?(o=Tu(),o===null&&(o=Be,c=Su(),o.pooledCache=c,c.refCount++,c!==null&&(o.pooledCacheLanes|=a),o=c),t.memoizedState={parent:s,cache:o},Eu(t),Ta(t,ct,o)):((e.lanes&a)!==0&&(Au(e,t),es(t,null,null,a),Fr()),o=e.memoizedState,c=t.memoizedState,o.parent!==s?(o={parent:s,cache:s},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),Ta(t,ct,s)):(s=c.cache,Ta(t,ct,s),s!==o.cache&&wu(t,[ct],a,!0))),kt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function Xn(e){e.flags|=4}function lc(e,t,a,s,o){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(dm())e.flags|=8192;else throw li=kl,ku}else e.flags&=-16777217}function Hf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!eg(t))if(dm())e.flags|=8192;else throw li=kl,ku}function $l(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?_i():536870912,e.lanes|=t,Ji|=t)}function ss(e,t){if(!Se)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function $e(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,s=0;if(t)for(var o=e.child;o!==null;)a|=o.lanes|o.childLanes,s|=o.subtreeFlags&65011712,s|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)a|=o.lanes|o.childLanes,s|=o.subtreeFlags,s|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=s,e.childLanes=a,t}function Xy(e,t,a){var s=t.pendingProps;switch(gu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $e(t),null;case 1:return $e(t),null;case 3:return a=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Vn(ct),Ke(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Ui(t)?Xn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,yu())),$e(t),null;case 26:var o=t.type,c=t.memoizedState;return e===null?(Xn(t),c!==null?($e(t),Hf(t,c)):($e(t),lc(t,o,null,s,a))):c?c!==e.memoizedState?(Xn(t),$e(t),Hf(t,c)):($e(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Xn(t),$e(t),lc(t,o,e,s,a)),null;case 27:if(dn(t),a=he.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Xn(t);else{if(!s){if(t.stateNode===null)throw Error(l(166));return $e(t),null}e=W.current,Ui(t)?yh(t):(e=Km(o,s,a),t.stateNode=e,Xn(t))}return $e(t),null;case 5:if(dn(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Xn(t);else{if(!s){if(t.stateNode===null)throw Error(l(166));return $e(t),null}if(c=W.current,Ui(t))yh(t);else{var f=no(he.current);switch(c){case 1:c=f.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:c=f.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":c=f.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":c=f.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":c=f.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof s.is=="string"?f.createElement("select",{is:s.is}):f.createElement("select"),s.multiple?c.multiple=!0:s.size&&(c.size=s.size);break;default:c=typeof s.is=="string"?f.createElement(o,{is:s.is}):f.createElement(o)}}c[st]=t,c[lt]=s;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)c.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=c;e:switch(Et(c,o,s),o){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Xn(t)}}return $e(t),lc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Xn(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(l(166));if(e=he.current,Ui(t)){if(e=t.stateNode,a=t.memoizedProps,s=null,o=_t,o!==null)switch(o.tag){case 27:case 5:s=o.memoizedProps}e[st]=t,e=!!(e.nodeValue===a||s!==null&&s.suppressHydrationWarning===!0||Um(e.nodeValue,a)),e||_a(t,!0)}else e=no(e).createTextNode(s),e[st]=t,t.stateNode=e}return $e(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(s=Ui(t),a!==null){if(e===null){if(!s)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[st]=t}else ni(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;$e(t),e=!1}else a=yu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Jt(t),t):(Jt(t),null);if((t.flags&128)!==0)throw Error(l(558))}return $e(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=Ui(t),s!==null&&s.dehydrated!==null){if(e===null){if(!o)throw Error(l(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(l(317));o[st]=t}else ni(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;$e(t),o=!1}else o=yu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Jt(t),t):(Jt(t),null)}return Jt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=s!==null,e=e!==null&&e.memoizedState!==null,a&&(s=t.child,o=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(o=s.alternate.memoizedState.cachePool.pool),c=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),c!==o&&(s.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),$l(t,t.updateQueue),$e(t),null);case 4:return Ke(),e===null&&Oc(t.stateNode.containerInfo),$e(t),null;case 10:return Vn(t.type),$e(t),null;case 19:if(U(et),s=t.memoizedState,s===null)return $e(t),null;if(o=(t.flags&128)!==0,c=s.rendering,c===null)if(o)ss(s,!1);else{if(We!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=Cl(e),c!==null){for(t.flags|=128,ss(s,!1),e=c.updateQueue,t.updateQueue=e,$l(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)hh(a,e),a=a.sibling;return Y(et,et.current&1|2),Se&&In(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&At()>Kl&&(t.flags|=128,o=!0,ss(s,!1),t.lanes=4194304)}else{if(!o)if(e=Cl(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,$l(t,e),ss(s,!0),s.tail===null&&s.tailMode==="hidden"&&!c.alternate&&!Se)return $e(t),null}else 2*At()-s.renderingStartTime>Kl&&a!==536870912&&(t.flags|=128,o=!0,ss(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(e=s.last,e!==null?e.sibling=c:t.child=c,s.last=c)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=At(),e.sibling=null,a=et.current,Y(et,o?a&1|2:a&1),Se&&In(t,s.treeForkCount),e):($e(t),null);case 22:case 23:return Jt(t),Ru(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(a&536870912)!==0&&(t.flags&128)===0&&($e(t),t.subtreeFlags&6&&(t.flags|=8192)):$e(t),a=t.updateQueue,a!==null&&$l(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==a&&(t.flags|=2048),e!==null&&U(ri),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Vn(ct),$e(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function Qy(e,t){switch(gu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vn(ct),Ke(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return dn(t),null;case 31:if(t.memoizedState!==null){if(Jt(t),t.alternate===null)throw Error(l(340));ni()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Jt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));ni()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(et),null;case 4:return Ke(),null;case 10:return Vn(t.type),null;case 22:case 23:return Jt(t),Ru(),e!==null&&U(ri),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Vn(ct),null;case 25:return null;default:return null}}function qf(e,t){switch(gu(t),t.tag){case 3:Vn(ct),Ke();break;case 26:case 27:case 5:dn(t);break;case 4:Ke();break;case 31:t.memoizedState!==null&&Jt(t);break;case 13:Jt(t);break;case 19:U(et);break;case 10:Vn(t.type);break;case 22:case 23:Jt(t),Ru(),e!==null&&U(ri);break;case 24:Vn(ct)}}function ls(e,t){try{var a=t.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var o=s.next;a=o;do{if((a.tag&e)===e){s=void 0;var c=a.create,f=a.inst;s=c(),f.destroy=s}a=a.next}while(a!==o)}}catch(v){Ne(t,t.return,v)}}function Oa(e,t,a){try{var s=t.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var c=o.next;s=c;do{if((s.tag&e)===e){var f=s.inst,v=f.destroy;if(v!==void 0){f.destroy=void 0,o=t;var T=a,R=v;try{R()}catch(M){Ne(o,T,M)}}}s=s.next}while(s!==c)}}catch(M){Ne(t,t.return,M)}}function $f(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Rh(t,a)}catch(s){Ne(e,e.return,s)}}}function Pf(e,t,a){a.props=ci(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(s){Ne(e,t,s)}}function os(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof a=="function"?e.refCleanup=a(s):a.current=s}}catch(o){Ne(e,t,o)}}function Cn(e,t){var a=e.ref,s=e.refCleanup;if(a!==null)if(typeof s=="function")try{s()}catch(o){Ne(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(o){Ne(e,t,o)}else a.current=null}function If(e){var t=e.type,a=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&s.focus();break e;case"img":a.src?s.src=a.src:a.srcSet&&(s.srcset=a.srcSet)}}catch(o){Ne(e,e.return,o)}}function oc(e,t,a){try{var s=e.stateNode;vv(s,e.type,a,t),s[lt]=t}catch(o){Ne(e,e.return,o)}}function Gf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ma(e.type)||e.tag===4}function uc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Gf(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&&Ma(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function cc(e,t,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=ke));else if(s!==4&&(s===27&&Ma(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(cc(e,t,a),e=e.sibling;e!==null;)cc(e,t,a),e=e.sibling}function Pl(e,t,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(s!==4&&(s===27&&Ma(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Pl(e,t,a),e=e.sibling;e!==null;)Pl(e,t,a),e=e.sibling}function Vf(e){var t=e.stateNode,a=e.memoizedProps;try{for(var s=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);Et(t,s,a),t[st]=e,t[lt]=a}catch(c){Ne(e,e.return,c)}}var Qn=!1,ft=!1,dc=!1,Kf=typeof WeakSet=="function"?WeakSet:Set,wt=null;function Wy(e,t){if(e=e.containerInfo,Nc=uo,e=ah(e),iu(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var s=a.getSelection&&a.getSelection();if(s&&s.rangeCount!==0){a=s.anchorNode;var o=s.anchorOffset,c=s.focusNode;s=s.focusOffset;try{a.nodeType,c.nodeType}catch{a=null;break e}var f=0,v=-1,T=-1,R=0,M=0,B=e,j=null;t:for(;;){for(var N;B!==a||o!==0&&B.nodeType!==3||(v=f+o),B!==c||s!==0&&B.nodeType!==3||(T=f+s),B.nodeType===3&&(f+=B.nodeValue.length),(N=B.firstChild)!==null;)j=B,B=N;for(;;){if(B===e)break t;if(j===a&&++R===o&&(v=f),j===c&&++M===s&&(T=f),(N=B.nextSibling)!==null)break;B=j,j=B.parentNode}B=N}a=v===-1||T===-1?null:{start:v,end:T}}else a=null}a=a||{start:0,end:0}}else a=null;for(Lc={focusedElem:e,selectionRange:a},uo=!1,wt=t;wt!==null;)if(t=wt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,wt=e;else for(;wt!==null;){switch(t=wt,c=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)o=e[a],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,a=t,o=c.memoizedProps,c=c.memoizedState,s=a.stateNode;try{var Z=ci(a.type,o);e=s.getSnapshotBeforeUpdate(Z,c),s.__reactInternalSnapshotBeforeUpdate=e}catch(oe){Ne(a,a.return,oe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Mc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Mc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(l(163))}if(e=t.sibling,e!==null){e.return=t.return,wt=e;break}wt=t.return}}function Yf(e,t,a){var s=a.flags;switch(a.tag){case 0:case 11:case 15:Zn(e,a),s&4&&ls(5,a);break;case 1:if(Zn(e,a),s&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(f){Ne(a,a.return,f)}else{var o=ci(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){Ne(a,a.return,f)}}s&64&&$f(a),s&512&&os(a,a.return);break;case 3:if(Zn(e,a),s&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Rh(e,t)}catch(f){Ne(a,a.return,f)}}break;case 27:t===null&&s&4&&Vf(a);case 26:case 5:Zn(e,a),t===null&&s&4&&If(a),s&512&&os(a,a.return);break;case 12:Zn(e,a);break;case 31:Zn(e,a),s&4&&Qf(e,a);break;case 13:Zn(e,a),s&4&&Wf(e,a),s&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=sv.bind(null,a),Av(e,a))));break;case 22:if(s=a.memoizedState!==null||Qn,!s){t=t!==null&&t.memoizedState!==null||ft,o=Qn;var c=ft;Qn=s,(ft=t)&&!c?Fn(e,a,(a.subtreeFlags&8772)!==0):Zn(e,a),Qn=o,ft=c}break;case 30:break;default:Zn(e,a)}}function Jf(e){var t=e.alternate;t!==null&&(e.alternate=null,Jf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Nr(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 Ge=null,Bt=!1;function Wn(e,t,a){for(a=a.child;a!==null;)Xf(e,t,a),a=a.sibling}function Xf(e,t,a){if(it&&typeof it.onCommitFiberUnmount=="function")try{it.onCommitFiberUnmount(fn,a)}catch{}switch(a.tag){case 26:ft||Cn(a,t),Wn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:ft||Cn(a,t);var s=Ge,o=Bt;Ma(a.type)&&(Ge=a.stateNode,Bt=!1),Wn(e,t,a),ys(a.stateNode),Ge=s,Bt=o;break;case 5:ft||Cn(a,t);case 6:if(s=Ge,o=Bt,Ge=null,Wn(e,t,a),Ge=s,Bt=o,Ge!==null)if(Bt)try{(Ge.nodeType===9?Ge.body:Ge.nodeName==="HTML"?Ge.ownerDocument.body:Ge).removeChild(a.stateNode)}catch(c){Ne(a,t,c)}else try{Ge.removeChild(a.stateNode)}catch(c){Ne(a,t,c)}break;case 18:Ge!==null&&(Bt?(e=Ge,$m(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),nr(e)):$m(Ge,a.stateNode));break;case 4:s=Ge,o=Bt,Ge=a.stateNode.containerInfo,Bt=!0,Wn(e,t,a),Ge=s,Bt=o;break;case 0:case 11:case 14:case 15:Oa(2,a,t),ft||Oa(4,a,t),Wn(e,t,a);break;case 1:ft||(Cn(a,t),s=a.stateNode,typeof s.componentWillUnmount=="function"&&Pf(a,t,s)),Wn(e,t,a);break;case 21:Wn(e,t,a);break;case 22:ft=(s=ft)||a.memoizedState!==null,Wn(e,t,a),ft=s;break;default:Wn(e,t,a)}}function Qf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{nr(e)}catch(a){Ne(t,t.return,a)}}}function Wf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{nr(e)}catch(a){Ne(t,t.return,a)}}function Zy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Kf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Kf),t;default:throw Error(l(435,e.tag))}}function Il(e,t){var a=Zy(e);t.forEach(function(s){if(!a.has(s)){a.add(s);var o=lv.bind(null,e,s);s.then(o,o)}})}function Ht(e,t){var a=t.deletions;if(a!==null)for(var s=0;s<a.length;s++){var o=a[s],c=e,f=t,v=f;e:for(;v!==null;){switch(v.tag){case 27:if(Ma(v.type)){Ge=v.stateNode,Bt=!1;break e}break;case 5:Ge=v.stateNode,Bt=!1;break e;case 3:case 4:Ge=v.stateNode.containerInfo,Bt=!0;break e}v=v.return}if(Ge===null)throw Error(l(160));Xf(c,f,o),Ge=null,Bt=!1,c=o.alternate,c!==null&&(c.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Zf(t,e),t=t.sibling}var yn=null;function Zf(e,t){var a=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ht(t,e),qt(e),s&4&&(Oa(3,e,e.return),ls(3,e),Oa(5,e,e.return));break;case 1:Ht(t,e),qt(e),s&512&&(ft||a===null||Cn(a,a.return)),s&64&&Qn&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?s:a.concat(s))));break;case 26:var o=yn;if(Ht(t,e),qt(e),s&512&&(ft||a===null||Cn(a,a.return)),s&4){var c=a!==null?a.memoizedState:null;if(s=e.memoizedState,a===null)if(s===null)if(e.stateNode===null){e:{s=e.type,a=e.memoizedProps,o=o.ownerDocument||o;t:switch(s){case"title":c=o.getElementsByTagName("title")[0],(!c||c[Ya]||c[st]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=o.createElement(s),o.head.insertBefore(c,o.querySelector("head > title"))),Et(c,s,a),c[st]=e,ot(c),s=c;break e;case"link":var f=Zm("link","href",o).get(s+(a.href||""));if(f){for(var v=0;v<f.length;v++)if(c=f[v],c.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&c.getAttribute("rel")===(a.rel==null?null:a.rel)&&c.getAttribute("title")===(a.title==null?null:a.title)&&c.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){f.splice(v,1);break t}}c=o.createElement(s),Et(c,s,a),o.head.appendChild(c);break;case"meta":if(f=Zm("meta","content",o).get(s+(a.content||""))){for(v=0;v<f.length;v++)if(c=f[v],c.getAttribute("content")===(a.content==null?null:""+a.content)&&c.getAttribute("name")===(a.name==null?null:a.name)&&c.getAttribute("property")===(a.property==null?null:a.property)&&c.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&c.getAttribute("charset")===(a.charSet==null?null:a.charSet)){f.splice(v,1);break t}}c=o.createElement(s),Et(c,s,a),o.head.appendChild(c);break;default:throw Error(l(468,s))}c[st]=e,ot(c),s=c}e.stateNode=s}else Fm(o,e.type,e.stateNode);else e.stateNode=Wm(o,s,e.memoizedProps);else c!==s?(c===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):c.count--,s===null?Fm(o,e.type,e.stateNode):Wm(o,s,e.memoizedProps)):s===null&&e.stateNode!==null&&oc(e,e.memoizedProps,a.memoizedProps)}break;case 27:Ht(t,e),qt(e),s&512&&(ft||a===null||Cn(a,a.return)),a!==null&&s&4&&oc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Ht(t,e),qt(e),s&512&&(ft||a===null||Cn(a,a.return)),e.flags&32){o=e.stateNode;try{ya(o,"")}catch(Z){Ne(e,e.return,Z)}}s&4&&e.stateNode!=null&&(o=e.memoizedProps,oc(e,o,a!==null?a.memoizedProps:o)),s&1024&&(dc=!0);break;case 6:if(Ht(t,e),qt(e),s&4){if(e.stateNode===null)throw Error(l(162));s=e.memoizedProps,a=e.stateNode;try{a.nodeValue=s}catch(Z){Ne(e,e.return,Z)}}break;case 3:if(ro=null,o=yn,yn=ao(t.containerInfo),Ht(t,e),yn=o,qt(e),s&4&&a!==null&&a.memoizedState.isDehydrated)try{nr(t.containerInfo)}catch(Z){Ne(e,e.return,Z)}dc&&(dc=!1,Ff(e));break;case 4:s=yn,yn=ao(e.stateNode.containerInfo),Ht(t,e),qt(e),yn=s;break;case 12:Ht(t,e),qt(e);break;case 31:Ht(t,e),qt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Il(e,s)));break;case 13:Ht(t,e),qt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Vl=At()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Il(e,s)));break;case 22:o=e.memoizedState!==null;var T=a!==null&&a.memoizedState!==null,R=Qn,M=ft;if(Qn=R||o,ft=M||T,Ht(t,e),ft=M,Qn=R,qt(e),s&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(a===null||T||Qn||ft||di(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){T=a=t;try{if(c=T.stateNode,o)f=c.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none";else{v=T.stateNode;var B=T.memoizedProps.style,j=B!=null&&B.hasOwnProperty("display")?B.display:null;v.style.display=j==null||typeof j=="boolean"?"":(""+j).trim()}}catch(Z){Ne(T,T.return,Z)}}}else if(t.tag===6){if(a===null){T=t;try{T.stateNode.nodeValue=o?"":T.memoizedProps}catch(Z){Ne(T,T.return,Z)}}}else if(t.tag===18){if(a===null){T=t;try{var N=T.stateNode;o?Pm(N,!0):Pm(T.stateNode,!1)}catch(Z){Ne(T,T.return,Z)}}}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 e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(a=s.retryQueue,a!==null&&(s.retryQueue=null,Il(e,a))));break;case 19:Ht(t,e),qt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Il(e,s)));break;case 30:break;case 21:break;default:Ht(t,e),qt(e)}}function qt(e){var t=e.flags;if(t&2){try{for(var a,s=e.return;s!==null;){if(Gf(s)){a=s;break}s=s.return}if(a==null)throw Error(l(160));switch(a.tag){case 27:var o=a.stateNode,c=uc(e);Pl(e,c,o);break;case 5:var f=a.stateNode;a.flags&32&&(ya(f,""),a.flags&=-33);var v=uc(e);Pl(e,v,f);break;case 3:case 4:var T=a.stateNode.containerInfo,R=uc(e);cc(e,R,T);break;default:throw Error(l(161))}}catch(M){Ne(e,e.return,M)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ff(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ff(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Zn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Yf(e,t.alternate,t),t=t.sibling}function di(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Oa(4,t,t.return),di(t);break;case 1:Cn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Pf(t,t.return,a),di(t);break;case 27:ys(t.stateNode);case 26:case 5:Cn(t,t.return),di(t);break;case 22:t.memoizedState===null&&di(t);break;case 30:di(t);break;default:di(t)}e=e.sibling}}function Fn(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,o=e,c=t,f=c.flags;switch(c.tag){case 0:case 11:case 15:Fn(o,c,a),ls(4,c);break;case 1:if(Fn(o,c,a),s=c,o=s.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(R){Ne(s,s.return,R)}if(s=c,o=s.updateQueue,o!==null){var v=s.stateNode;try{var T=o.shared.hiddenCallbacks;if(T!==null)for(o.shared.hiddenCallbacks=null,o=0;o<T.length;o++)Oh(T[o],v)}catch(R){Ne(s,s.return,R)}}a&&f&64&&$f(c),os(c,c.return);break;case 27:Vf(c);case 26:case 5:Fn(o,c,a),a&&s===null&&f&4&&If(c),os(c,c.return);break;case 12:Fn(o,c,a);break;case 31:Fn(o,c,a),a&&f&4&&Qf(o,c);break;case 13:Fn(o,c,a),a&&f&4&&Wf(o,c);break;case 22:c.memoizedState===null&&Fn(o,c,a),os(c,c.return);break;case 30:break;default:Fn(o,c,a)}t=t.sibling}}function hc(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Jr(a))}function fc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Jr(e))}function vn(e,t,a,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)em(e,t,a,s),t=t.sibling}function em(e,t,a,s){var o=t.flags;switch(t.tag){case 0:case 11:case 15:vn(e,t,a,s),o&2048&&ls(9,t);break;case 1:vn(e,t,a,s);break;case 3:vn(e,t,a,s),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Jr(e)));break;case 12:if(o&2048){vn(e,t,a,s),e=t.stateNode;try{var c=t.memoizedProps,f=c.id,v=c.onPostCommit;typeof v=="function"&&v(f,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(T){Ne(t,t.return,T)}}else vn(e,t,a,s);break;case 31:vn(e,t,a,s);break;case 13:vn(e,t,a,s);break;case 23:break;case 22:c=t.stateNode,f=t.alternate,t.memoizedState!==null?c._visibility&2?vn(e,t,a,s):us(e,t):c._visibility&2?vn(e,t,a,s):(c._visibility|=2,Vi(e,t,a,s,(t.subtreeFlags&10256)!==0||!1)),o&2048&&hc(f,t);break;case 24:vn(e,t,a,s),o&2048&&fc(t.alternate,t);break;default:vn(e,t,a,s)}}function Vi(e,t,a,s,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,f=t,v=a,T=s,R=f.flags;switch(f.tag){case 0:case 11:case 15:Vi(c,f,v,T,o),ls(8,f);break;case 23:break;case 22:var M=f.stateNode;f.memoizedState!==null?M._visibility&2?Vi(c,f,v,T,o):us(c,f):(M._visibility|=2,Vi(c,f,v,T,o)),o&&R&2048&&hc(f.alternate,f);break;case 24:Vi(c,f,v,T,o),o&&R&2048&&fc(f.alternate,f);break;default:Vi(c,f,v,T,o)}t=t.sibling}}function us(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,s=t,o=s.flags;switch(s.tag){case 22:us(a,s),o&2048&&hc(s.alternate,s);break;case 24:us(a,s),o&2048&&fc(s.alternate,s);break;default:us(a,s)}t=t.sibling}}var cs=8192;function Ki(e,t,a){if(e.subtreeFlags&cs)for(e=e.child;e!==null;)tm(e,t,a),e=e.sibling}function tm(e,t,a){switch(e.tag){case 26:Ki(e,t,a),e.flags&cs&&e.memoizedState!==null&&Bv(a,yn,e.memoizedState,e.memoizedProps);break;case 5:Ki(e,t,a);break;case 3:case 4:var s=yn;yn=ao(e.stateNode.containerInfo),Ki(e,t,a),yn=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=cs,cs=16777216,Ki(e,t,a),cs=s):Ki(e,t,a));break;default:Ki(e,t,a)}}function nm(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 ds(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var s=t[a];wt=s,im(s,e)}nm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)am(e),e=e.sibling}function am(e){switch(e.tag){case 0:case 11:case 15:ds(e),e.flags&2048&&Oa(9,e,e.return);break;case 3:ds(e);break;case 12:ds(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Gl(e)):ds(e);break;default:ds(e)}}function Gl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var s=t[a];wt=s,im(s,e)}nm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Oa(8,t,t.return),Gl(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Gl(t));break;default:Gl(t)}e=e.sibling}}function im(e,t){for(;wt!==null;){var a=wt;switch(a.tag){case 0:case 11:case 15:Oa(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var s=a.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Jr(a.memoizedState.cache)}if(s=a.child,s!==null)s.return=a,wt=s;else e:for(a=e;wt!==null;){s=wt;var o=s.sibling,c=s.return;if(Jf(s),s===a){wt=null;break e}if(o!==null){o.return=c,wt=o;break e}wt=c}}}var Fy={getCacheForType:function(e){var t=Tt(ct),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Tt(ct).controller.signal}},ev=typeof WeakMap=="function"?WeakMap:Map,Re=0,Be=null,pe=null,ve=0,je=0,Xt=null,Ra=!1,Yi=!1,mc=!1,ea=0,We=0,ja=0,hi=0,gc=0,Qt=0,Ji=0,hs=null,$t=null,pc=!1,Vl=0,rm=0,Kl=1/0,Yl=null,Na=null,yt=0,La=null,Xi=null,ta=0,yc=0,vc=null,sm=null,fs=0,bc=null;function Wt(){return(Re&2)!==0&&ve!==0?ve&-ve:L.T!==null?Ec():Va()}function lm(){if(Qt===0)if((ve&536870912)===0||Se){var e=mn;mn<<=1,(mn&3932160)===0&&(mn=262144),Qt=e}else Qt=536870912;return e=Yt.current,e!==null&&(e.flags|=32),Qt}function Pt(e,t,a){(e===Be&&(je===2||je===9)||e.cancelPendingCommit!==null)&&(Qi(e,0),Da(e,ve,Qt,!1)),ha(e,a),((Re&2)===0||e!==Be)&&(e===Be&&((Re&2)===0&&(hi|=a),We===4&&Da(e,ve,Qt,!1)),On(e))}function om(e,t,a){if((Re&6)!==0)throw Error(l(327));var s=!a&&(t&127)===0&&(t&e.expiredLanes)===0||da(e,t),o=s?av(e,t):Sc(e,t,!0),c=s;do{if(o===0){Yi&&!s&&Da(e,t,0,!1);break}else{if(a=e.current.alternate,c&&!tv(a)){o=Sc(e,t,!1),c=!1;continue}if(o===2){if(c=t,e.errorRecoveryDisabledLanes&c)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var v=e;o=hs;var T=v.current.memoizedState.isDehydrated;if(T&&(Qi(v,f).flags|=256),f=Sc(v,f,!1),f!==2){if(mc&&!T){v.errorRecoveryDisabledLanes|=c,hi|=c,o=4;break e}c=$t,$t=o,c!==null&&($t===null?$t=c:$t.push.apply($t,c))}o=f}if(c=!1,o!==2)continue}}if(o===1){Qi(e,0),Da(e,t,0,!0);break}e:{switch(s=e,c=o,c){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:Da(s,t,Qt,!Ra);break e;case 2:$t=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(o=Vl+300-At(),10<o)){if(Da(s,t,Qt,!Ra),Ga(s,0,!0)!==0)break e;ta=t,s.timeoutHandle=Hm(um.bind(null,s,a,$t,Yl,pc,t,Qt,hi,Ji,Ra,c,"Throttled",-0,0),o);break e}um(s,a,$t,Yl,pc,t,Qt,hi,Ji,Ra,c,null,-0,0)}}break}while(!0);On(e)}function um(e,t,a,s,o,c,f,v,T,R,M,B,j,N){if(e.timeoutHandle=-1,B=t.subtreeFlags,B&8192||(B&16785408)===16785408){B={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ke},tm(t,c,B);var Z=(c&62914560)===c?Vl-At():(c&4194048)===c?rm-At():0;if(Z=Hv(B,Z),Z!==null){ta=c,e.cancelPendingCommit=Z(ym.bind(null,e,t,c,a,s,o,f,v,T,M,B,null,j,N)),Da(e,c,f,!R);return}}ym(e,t,c,a,s,o,f,v,T)}function tv(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var s=0;s<a.length;s++){var o=a[s],c=o.getSnapshot;o=o.value;try{if(!Vt(c(),o))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;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 Da(e,t,a,s){t&=~gc,t&=~hi,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var o=t;0<o;){var c=31-Ie(o),f=1<<c;s[c]=-1,o&=~f}a!==0&&Cr(e,a,t)}function Jl(){return(Re&6)===0?(ms(0),!1):!0}function wc(){if(pe!==null){if(je===0)var e=pe.return;else e=pe,Gn=ai=null,Mu(e),qi=null,Qr=0,e=pe;for(;e!==null;)qf(e.alternate,e),e=e.return;pe=null}}function Qi(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Sv(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),ta=0,wc(),Be=e,pe=a=Pn(e.current,null),ve=t,je=0,Xt=null,Ra=!1,Yi=da(e,t),mc=!1,Ji=Qt=gc=hi=ja=We=0,$t=hs=null,pc=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var o=31-Ie(s),c=1<<o;t|=e[o],s&=~c}return ea=t,gl(),a}function cm(e,t){fe=null,L.H=is,t===Hi||t===Tl?(t=Eh(),je=3):t===ku?(t=Eh(),je=4):je=t===Zu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Xt=t,pe===null&&(We=1,zl(e,nn(t,e.current)))}function dm(){var e=Yt.current;return e===null?!0:(ve&4194048)===ve?ln===null:(ve&62914560)===ve||(ve&536870912)!==0?e===ln:!1}function hm(){var e=L.H;return L.H=is,e===null?is:e}function fm(){var e=L.A;return L.A=Fy,e}function Xl(){We=4,Ra||(ve&4194048)!==ve&&Yt.current!==null||(Yi=!0),(ja&134217727)===0&&(hi&134217727)===0||Be===null||Da(Be,ve,Qt,!1)}function Sc(e,t,a){var s=Re;Re|=2;var o=hm(),c=fm();(Be!==e||ve!==t)&&(Yl=null,Qi(e,t)),t=!1;var f=We;e:do try{if(je!==0&&pe!==null){var v=pe,T=Xt;switch(je){case 8:wc(),f=6;break e;case 3:case 2:case 9:case 6:Yt.current===null&&(t=!0);var R=je;if(je=0,Xt=null,Wi(e,v,T,R),a&&Yi){f=0;break e}break;default:R=je,je=0,Xt=null,Wi(e,v,T,R)}}nv(),f=We;break}catch(M){cm(e,M)}while(!0);return t&&e.shellSuspendCounter++,Gn=ai=null,Re=s,L.H=o,L.A=c,pe===null&&(Be=null,ve=0,gl()),f}function nv(){for(;pe!==null;)mm(pe)}function av(e,t){var a=Re;Re|=2;var s=hm(),o=fm();Be!==e||ve!==t?(Yl=null,Kl=At()+500,Qi(e,t)):Yi=da(e,t);e:do try{if(je!==0&&pe!==null){t=pe;var c=Xt;t:switch(je){case 1:je=0,Xt=null,Wi(e,t,c,1);break;case 2:case 9:if(Th(c)){je=0,Xt=null,gm(t);break}t=function(){je!==2&&je!==9||Be!==e||(je=7),On(e)},c.then(t,t);break e;case 3:je=7;break e;case 4:je=5;break e;case 7:Th(c)?(je=0,Xt=null,gm(t)):(je=0,Xt=null,Wi(e,t,c,7));break;case 5:var f=null;switch(pe.tag){case 26:f=pe.memoizedState;case 5:case 27:var v=pe;if(f?eg(f):v.stateNode.complete){je=0,Xt=null;var T=v.sibling;if(T!==null)pe=T;else{var R=v.return;R!==null?(pe=R,Ql(R)):pe=null}break t}}je=0,Xt=null,Wi(e,t,c,5);break;case 6:je=0,Xt=null,Wi(e,t,c,6);break;case 8:wc(),We=6;break e;default:throw Error(l(462))}}iv();break}catch(M){cm(e,M)}while(!0);return Gn=ai=null,L.H=s,L.A=o,Re=a,pe!==null?0:(Be=null,ve=0,gl(),We)}function iv(){for(;pe!==null&&!Io();)mm(pe)}function mm(e){var t=Bf(e.alternate,e,ea);e.memoizedProps=e.pendingProps,t===null?Ql(e):pe=t}function gm(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Nf(a,t,t.pendingProps,t.type,void 0,ve);break;case 11:t=Nf(a,t,t.pendingProps,t.type.render,t.ref,ve);break;case 5:Mu(t);default:qf(a,t),t=pe=hh(t,ea),t=Bf(a,t,ea)}e.memoizedProps=e.pendingProps,t===null?Ql(e):pe=t}function Wi(e,t,a,s){Gn=ai=null,Mu(t),qi=null,Qr=0;var o=t.return;try{if(Ky(e,o,t,a,ve)){We=1,zl(e,nn(a,e.current)),pe=null;return}}catch(c){if(o!==null)throw pe=o,c;We=1,zl(e,nn(a,e.current)),pe=null;return}t.flags&32768?(Se||s===1?e=!0:Yi||(ve&536870912)!==0?e=!1:(Ra=e=!0,(s===2||s===9||s===3||s===6)&&(s=Yt.current,s!==null&&s.tag===13&&(s.flags|=16384))),pm(t,e)):Ql(t)}function Ql(e){var t=e;do{if((t.flags&32768)!==0){pm(t,Ra);return}e=t.return;var a=Xy(t.alternate,t,ea);if(a!==null){pe=a;return}if(t=t.sibling,t!==null){pe=t;return}pe=t=e}while(t!==null);We===0&&(We=5)}function pm(e,t){do{var a=Qy(e.alternate,e);if(a!==null){a.flags&=32767,pe=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){pe=e;return}pe=e=a}while(e!==null);We=6,pe=null}function ym(e,t,a,s,o,c,f,v,T){e.cancelPendingCommit=null;do Wl();while(yt!==0);if((Re&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(c=t.lanes|t.childLanes,c|=uu,Fs(e,a,c,f,v,T),e===Be&&(pe=Be=null,ve=0),Xi=t,La=e,ta=a,yc=c,vc=o,sm=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,ov(Si,function(){return _m(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=L.T,L.T=null,o=G.p,G.p=2,f=Re,Re|=4;try{Wy(e,t,a)}finally{Re=f,G.p=o,L.T=s}}yt=1,vm(),bm(),wm()}}function vm(){if(yt===1){yt=0;var e=La,t=Xi,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=L.T,L.T=null;var s=G.p;G.p=2;var o=Re;Re|=4;try{Zf(t,e);var c=Lc,f=ah(e.containerInfo),v=c.focusedElem,T=c.selectionRange;if(f!==v&&v&&v.ownerDocument&&nh(v.ownerDocument.documentElement,v)){if(T!==null&&iu(v)){var R=T.start,M=T.end;if(M===void 0&&(M=R),"selectionStart"in v)v.selectionStart=R,v.selectionEnd=Math.min(M,v.value.length);else{var B=v.ownerDocument||document,j=B&&B.defaultView||window;if(j.getSelection){var N=j.getSelection(),Z=v.textContent.length,oe=Math.min(T.start,Z),Me=T.end===void 0?oe:Math.min(T.end,Z);!N.extend&&oe>Me&&(f=Me,Me=oe,oe=f);var x=th(v,oe),E=th(v,Me);if(x&&E&&(N.rangeCount!==1||N.anchorNode!==x.node||N.anchorOffset!==x.offset||N.focusNode!==E.node||N.focusOffset!==E.offset)){var O=B.createRange();O.setStart(x.node,x.offset),N.removeAllRanges(),oe>Me?(N.addRange(O),N.extend(E.node,E.offset)):(O.setEnd(E.node,E.offset),N.addRange(O))}}}}for(B=[],N=v;N=N.parentNode;)N.nodeType===1&&B.push({element:N,left:N.scrollLeft,top:N.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<B.length;v++){var z=B[v];z.element.scrollLeft=z.left,z.element.scrollTop=z.top}}uo=!!Nc,Lc=Nc=null}finally{Re=o,G.p=s,L.T=a}}e.current=t,yt=2}}function bm(){if(yt===2){yt=0;var e=La,t=Xi,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=L.T,L.T=null;var s=G.p;G.p=2;var o=Re;Re|=4;try{Yf(e,t.alternate,t)}finally{Re=o,G.p=s,L.T=a}}yt=3}}function wm(){if(yt===4||yt===3){yt=0,_r();var e=La,t=Xi,a=ta,s=sm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?yt=5:(yt=0,Xi=La=null,Sm(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(Na=null),Rr(a),t=t.stateNode,it&&typeof it.onCommitFiberRoot=="function")try{it.onCommitFiberRoot(fn,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=L.T,o=G.p,G.p=2,L.T=null;try{for(var c=e.onRecoverableError,f=0;f<s.length;f++){var v=s[f];c(v.value,{componentStack:v.stack})}}finally{L.T=t,G.p=o}}(ta&3)!==0&&Wl(),On(e),o=e.pendingLanes,(a&261930)!==0&&(o&42)!==0?e===bc?fs++:(fs=0,bc=e):fs=0,ms(0)}}function Sm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Jr(t)))}function Wl(){return vm(),bm(),wm(),_m()}function _m(){if(yt!==5)return!1;var e=La,t=yc;yc=0;var a=Rr(ta),s=L.T,o=G.p;try{G.p=32>a?32:a,L.T=null,a=vc,vc=null;var c=La,f=ta;if(yt=0,Xi=La=null,ta=0,(Re&6)!==0)throw Error(l(331));var v=Re;if(Re|=4,am(c.current),em(c,c.current,f,a),Re=v,ms(0,!1),it&&typeof it.onPostCommitFiberRoot=="function")try{it.onPostCommitFiberRoot(fn,c)}catch{}return!0}finally{G.p=o,L.T=s,Sm(e,t)}}function Tm(e,t,a){t=nn(a,t),t=Wu(e.stateNode,t,2),e=Aa(e,t,2),e!==null&&(ha(e,2),On(e))}function Ne(e,t,a){if(e.tag===3)Tm(e,e,a);else for(;t!==null;){if(t.tag===3){Tm(t,e,a);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Na===null||!Na.has(s))){e=nn(a,e),a=kf(2),s=Aa(t,a,2),s!==null&&(Ef(a,s,t,e),ha(s,2),On(s));break}}t=t.return}}function _c(e,t,a){var s=e.pingCache;if(s===null){s=e.pingCache=new ev;var o=new Set;s.set(t,o)}else o=s.get(t),o===void 0&&(o=new Set,s.set(t,o));o.has(a)||(mc=!0,o.add(a),e=rv.bind(null,e,t,a),t.then(e,e))}function rv(e,t,a){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Be===e&&(ve&a)===a&&(We===4||We===3&&(ve&62914560)===ve&&300>At()-Vl?(Re&2)===0&&Qi(e,0):gc|=a,Ji===ve&&(Ji=0)),On(e)}function km(e,t){t===0&&(t=_i()),e=ei(e,t),e!==null&&(ha(e,t),On(e))}function sv(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),km(e,a)}function lv(e,t){var a=0;switch(e.tag){case 31:case 13:var s=e.stateNode,o=e.memoizedState;o!==null&&(a=o.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(l(314))}s!==null&&s.delete(t),km(e,a)}function ov(e,t){return ua(e,t)}var Zl=null,Zi=null,Tc=!1,Fl=!1,kc=!1,Ua=0;function On(e){e!==Zi&&e.next===null&&(Zi===null?Zl=Zi=e:Zi=Zi.next=e),Fl=!0,Tc||(Tc=!0,cv())}function ms(e,t){if(!kc&&Fl){kc=!0;do for(var a=!1,s=Zl;s!==null;){if(e!==0){var o=s.pendingLanes;if(o===0)var c=0;else{var f=s.suspendedLanes,v=s.pingedLanes;c=(1<<31-Ie(42|e)+1)-1,c&=o&~(f&~v),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(a=!0,Cm(s,c))}else c=ve,c=Ga(s,s===Be?c:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(c&3)===0||da(s,c)||(a=!0,Cm(s,c));s=s.next}while(a);kc=!1}}function uv(){Em()}function Em(){Fl=Tc=!1;var e=0;Ua!==0&&wv()&&(e=Ua);for(var t=At(),a=null,s=Zl;s!==null;){var o=s.next,c=Am(s,t);c===0?(s.next=null,a===null?Zl=o:a.next=o,o===null&&(Zi=a)):(a=s,(e!==0||(c&3)!==0)&&(Fl=!0)),s=o}yt!==0&&yt!==5||ms(e),Ua!==0&&(Ua=0)}function Am(e,t){for(var a=e.suspendedLanes,s=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var f=31-Ie(c),v=1<<f,T=o[f];T===-1?((v&a)===0||(v&s)!==0)&&(o[f]=Vo(v,t)):T<=t&&(e.expiredLanes|=v),c&=~v}if(t=Be,a=ve,a=Ga(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,a===0||e===t&&(je===2||je===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&hn(s),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||da(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(s!==null&&hn(s),Rr(a)){case 2:case 8:a=Ye;break;case 32:a=Si;break;case 268435456:a=Qs;break;default:a=Si}return s=xm.bind(null,e),a=ua(a,s),e.callbackPriority=t,e.callbackNode=a,t}return s!==null&&s!==null&&hn(s),e.callbackPriority=2,e.callbackNode=null,2}function xm(e,t){if(yt!==0&&yt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Wl()&&e.callbackNode!==a)return null;var s=ve;return s=Ga(e,e===Be?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(om(e,s,t),Am(e,At()),e.callbackNode!=null&&e.callbackNode===a?xm.bind(null,e):null)}function Cm(e,t){if(Wl())return null;om(e,t,!0)}function cv(){_v(function(){(Re&6)!==0?ua(kr,uv):Em()})}function Ec(){if(Ua===0){var e=zi;e===0&&(e=rt,rt<<=1,(rt&261888)===0&&(rt=256)),Ua=e}return Ua}function Om(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ge(""+e)}function Rm(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function dv(e,t,a,s,o){if(t==="submit"&&a&&a.stateNode===o){var c=Om((o[lt]||null).action),f=s.submitter;f&&(t=(t=f[lt]||null)?Om(t.formAction):f.getAttribute("formAction"),t!==null&&(c=t,f=null));var v=new dl("action","action",null,s,o);e.push({event:v,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Ua!==0){var T=f?Rm(o,f):new FormData(o);Vu(a,{pending:!0,data:T,method:o.method,action:c},null,T)}}else typeof c=="function"&&(v.preventDefault(),T=f?Rm(o,f):new FormData(o),Vu(a,{pending:!0,data:T,method:o.method,action:c},c,T))},currentTarget:o}]})}}for(var Ac=0;Ac<ou.length;Ac++){var xc=ou[Ac],hv=xc.toLowerCase(),fv=xc[0].toUpperCase()+xc.slice(1);pn(hv,"on"+fv)}pn(sh,"onAnimationEnd"),pn(lh,"onAnimationIteration"),pn(oh,"onAnimationStart"),pn("dblclick","onDoubleClick"),pn("focusin","onFocus"),pn("focusout","onBlur"),pn(Oy,"onTransitionRun"),pn(Ry,"onTransitionStart"),pn(jy,"onTransitionCancel"),pn(uh,"onTransitionEnd"),Hn("onMouseEnter",["mouseout","mouseover"]),Hn("onMouseLeave",["mouseout","mouseover"]),Hn("onPointerEnter",["pointerout","pointerover"]),Hn("onPointerLeave",["pointerout","pointerover"]),En("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),En("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),En("onBeforeInput",["compositionend","keypress","textInput","paste"]),En("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),En("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),En("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var gs="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(" "),mv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(gs));function jm(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var s=e[a],o=s.event;s=s.listeners;e:{var c=void 0;if(t)for(var f=s.length-1;0<=f;f--){var v=s[f],T=v.instance,R=v.currentTarget;if(v=v.listener,T!==c&&o.isPropagationStopped())break e;c=v,o.currentTarget=R;try{c(o)}catch(M){ml(M)}o.currentTarget=null,c=T}else for(f=0;f<s.length;f++){if(v=s[f],T=v.instance,R=v.currentTarget,v=v.listener,T!==c&&o.isPropagationStopped())break e;c=v,o.currentTarget=R;try{c(o)}catch(M){ml(M)}o.currentTarget=null,c=T}}}}function ye(e,t){var a=t[zn];a===void 0&&(a=t[zn]=new Set);var s=e+"__bubble";a.has(s)||(Nm(t,e,2,!1),a.add(s))}function Cc(e,t,a){var s=0;t&&(s|=4),Nm(a,e,s,t)}var eo="_reactListening"+Math.random().toString(36).slice(2);function Oc(e){if(!e[eo]){e[eo]=!0,Lr.forEach(function(a){a!=="selectionchange"&&(mv.has(a)||Cc(a,!1,e),Cc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[eo]||(t[eo]=!0,Cc("selectionchange",!1,t))}}function Nm(e,t,a,s){switch(lg(t)){case 2:var o=Pv;break;case 8:o=Iv;break;default:o=Gc}a=o.bind(null,t,a,e),o=void 0,!Xo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),s?o!==void 0?e.addEventListener(t,a,{capture:!0,passive:o}):e.addEventListener(t,a,!0):o!==void 0?e.addEventListener(t,a,{passive:o}):e.addEventListener(t,a,!1)}function Rc(e,t,a,s,o){var c=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var f=s.tag;if(f===3||f===4){var v=s.stateNode.containerInfo;if(v===o)break;if(f===4)for(f=s.return;f!==null;){var T=f.tag;if((T===3||T===4)&&f.stateNode.containerInfo===o)return;f=f.return}for(;v!==null;){if(f=Bn(v),f===null)return;if(T=f.tag,T===5||T===6||T===26||T===27){s=c=f;continue e}v=v.parentNode}}s=s.return}zr(function(){var R=c,M=Xe(a),B=[];e:{var j=ch.get(e);if(j!==void 0){var N=dl,Z=e;switch(e){case"keypress":if(ul(a)===0)break e;case"keydown":case"keyup":N=ly;break;case"focusin":Z="focus",N=Fo;break;case"focusout":Z="blur",N=Fo;break;case"beforeblur":case"afterblur":N=Fo;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":N=Hd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":N=Xp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":N=cy;break;case sh:case lh:case oh:N=Zp;break;case uh:N=hy;break;case"scroll":case"scrollend":N=Yp;break;case"wheel":N=my;break;case"copy":case"cut":case"paste":N=ey;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":N=$d;break;case"toggle":case"beforetoggle":N=py}var oe=(t&4)!==0,Me=!oe&&(e==="scroll"||e==="scrollend"),x=oe?j!==null?j+"Capture":null:j;oe=[];for(var E=R,O;E!==null;){var z=E;if(O=z.stateNode,z=z.tag,z!==5&&z!==26&&z!==27||O===null||x===null||(z=qn(E,x),z!=null&&oe.push(ps(E,z,O))),Me)break;E=E.return}0<oe.length&&(j=new N(j,Z,null,a,M),B.push({event:j,listeners:oe}))}}if((t&7)===0){e:{if(j=e==="mouseover"||e==="pointerover",N=e==="mouseout"||e==="pointerout",j&&a!==jt&&(Z=a.relatedTarget||a.fromElement)&&(Bn(Z)||Z[Mn]))break e;if((N||j)&&(j=M.window===M?M:(j=M.ownerDocument)?j.defaultView||j.parentWindow:window,N?(Z=a.relatedTarget||a.toElement,N=R,Z=Z?Bn(Z):null,Z!==null&&(Me=d(Z),oe=Z.tag,Z!==Me||oe!==5&&oe!==27&&oe!==6)&&(Z=null)):(N=null,Z=R),N!==Z)){if(oe=Hd,z="onMouseLeave",x="onMouseEnter",E="mouse",(e==="pointerout"||e==="pointerover")&&(oe=$d,z="onPointerLeave",x="onPointerEnter",E="pointer"),Me=N==null?j:fa(N),O=Z==null?j:fa(Z),j=new oe(z,E+"leave",N,a,M),j.target=Me,j.relatedTarget=O,z=null,Bn(M)===R&&(oe=new oe(x,E+"enter",Z,a,M),oe.target=O,oe.relatedTarget=Me,z=oe),Me=z,N&&Z)t:{for(oe=gv,x=N,E=Z,O=0,z=x;z;z=oe(z))O++;z=0;for(var se=E;se;se=oe(se))z++;for(;0<O-z;)x=oe(x),O--;for(;0<z-O;)E=oe(E),z--;for(;O--;){if(x===E||E!==null&&x===E.alternate){oe=x;break t}x=oe(x),E=oe(E)}oe=null}else oe=null;N!==null&&Lm(B,j,N,oe,!1),Z!==null&&Me!==null&&Lm(B,Me,Z,oe,!0)}}e:{if(j=R?fa(R):window,N=j.nodeName&&j.nodeName.toLowerCase(),N==="select"||N==="input"&&j.type==="file")var Ae=Xd;else if(Yd(j))if(Qd)Ae=Ay;else{Ae=ky;var ne=Ty}else N=j.nodeName,!N||N.toLowerCase()!=="input"||j.type!=="checkbox"&&j.type!=="radio"?R&&te(R.elementType)&&(Ae=Xd):Ae=Ey;if(Ae&&(Ae=Ae(e,R))){Jd(B,Ae,a,M);break e}ne&&ne(e,j,R),e==="focusout"&&R&&j.type==="number"&&R.memoizedProps.value!=null&&Mr(j,"number",j.value)}switch(ne=R?fa(R):window,e){case"focusin":(Yd(ne)||ne.contentEditable==="true")&&(Oi=ne,ru=R,Vr=null);break;case"focusout":Vr=ru=Oi=null;break;case"mousedown":su=!0;break;case"contextmenu":case"mouseup":case"dragend":su=!1,ih(B,a,M);break;case"selectionchange":if(Cy)break;case"keydown":case"keyup":ih(B,a,M)}var me;if(tu)e:{switch(e){case"compositionstart":var be="onCompositionStart";break e;case"compositionend":be="onCompositionEnd";break e;case"compositionupdate":be="onCompositionUpdate";break e}be=void 0}else Ci?Vd(e,a)&&(be="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(be="onCompositionStart");be&&(Pd&&a.locale!=="ko"&&(Ci||be!=="onCompositionStart"?be==="onCompositionEnd"&&Ci&&(me=zd()):(ba=M,Qo="value"in ba?ba.value:ba.textContent,Ci=!0)),ne=to(R,be),0<ne.length&&(be=new qd(be,e,null,a,M),B.push({event:be,listeners:ne}),me?be.data=me:(me=Kd(a),me!==null&&(be.data=me)))),(me=vy?by(e,a):wy(e,a))&&(be=to(R,"onBeforeInput"),0<be.length&&(ne=new qd("onBeforeInput","beforeinput",null,a,M),B.push({event:ne,listeners:be}),ne.data=me)),dv(B,e,R,a,M)}jm(B,t)})}function ps(e,t,a){return{instance:e,listener:t,currentTarget:a}}function to(e,t){for(var a=t+"Capture",s=[];e!==null;){var o=e,c=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||c===null||(o=qn(e,a),o!=null&&s.unshift(ps(e,o,c)),o=qn(e,t),o!=null&&s.push(ps(e,o,c))),e.tag===3)return s;e=e.return}return[]}function gv(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Lm(e,t,a,s,o){for(var c=t._reactName,f=[];a!==null&&a!==s;){var v=a,T=v.alternate,R=v.stateNode;if(v=v.tag,T!==null&&T===s)break;v!==5&&v!==26&&v!==27||R===null||(T=R,o?(R=qn(a,c),R!=null&&f.unshift(ps(a,R,T))):o||(R=qn(a,c),R!=null&&f.push(ps(a,R,T)))),a=a.return}f.length!==0&&e.push({event:t,listeners:f})}var pv=/\r\n?/g,yv=/\u0000|\uFFFD/g;function Dm(e){return(typeof e=="string"?e:""+e).replace(pv,`
9
+ `).replace(yv,"")}function Um(e,t){return t=Dm(t),Dm(e)===t}function Ue(e,t,a,s,o,c){switch(a){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||ya(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&ya(e,""+s);break;case"className":ut(e,"class",s);break;case"tabIndex":ut(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":ut(e,a,s);break;case"style":V(e,s,c);break;case"data":if(t!=="object"){ut(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=ge(""+s),e.setAttribute(a,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(a,"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 c=="function"&&(a==="formAction"?(t!=="input"&&Ue(e,t,"name",o.name,o,null),Ue(e,t,"formEncType",o.formEncType,o,null),Ue(e,t,"formMethod",o.formMethod,o,null),Ue(e,t,"formTarget",o.formTarget,o,null)):(Ue(e,t,"encType",o.encType,o,null),Ue(e,t,"method",o.method,o,null),Ue(e,t,"target",o.target,o,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=ge(""+s),e.setAttribute(a,s);break;case"onClick":s!=null&&(e.onclick=ke);break;case"onScroll":s!=null&&ye("scroll",e);break;case"onScrollEnd":s!=null&&ye("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(l(61));if(a=s.__html,a!=null){if(o.children!=null)throw Error(l(60));e.innerHTML=a}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}a=ge(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""+s):e.removeAttribute(a);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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":s===!0?e.setAttribute(a,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,s):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(a,s):e.removeAttribute(a);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(a):e.setAttribute(a,s);break;case"popover":ye("beforetoggle",e),ye("toggle",e),Ei(e,"popover",s);break;case"xlinkActuate":Mt(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Mt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Mt(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Mt(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Mt(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Mt(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Mt(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Mt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Mt(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Ei(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=ue.get(a)||a,Ei(e,a,s))}}function jc(e,t,a,s,o,c){switch(a){case"style":V(e,s,c);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(l(61));if(a=s.__html,a!=null){if(o.children!=null)throw Error(l(60));e.innerHTML=a}}break;case"children":typeof s=="string"?ya(e,s):(typeof s=="number"||typeof s=="bigint")&&ya(e,""+s);break;case"onScroll":s!=null&&ye("scroll",e);break;case"onScrollEnd":s!=null&&ye("scrollend",e);break;case"onClick":s!=null&&(e.onclick=ke);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Dr.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(o=a.endsWith("Capture"),t=a.slice(2,o?a.length-7:void 0),c=e[lt]||null,c=c!=null?c[a]:null,typeof c=="function"&&e.removeEventListener(t,c,o),typeof s=="function")){typeof c!="function"&&c!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,s,o);break e}a in e?e[a]=s:s===!0?e.setAttribute(a,""):Ei(e,a,s)}}}function Et(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ye("error",e),ye("load",e);var s=!1,o=!1,c;for(c in a)if(a.hasOwnProperty(c)){var f=a[c];if(f!=null)switch(c){case"src":s=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Ue(e,t,c,f,a,null)}}o&&Ue(e,t,"srcSet",a.srcSet,a,null),s&&Ue(e,t,"src",a.src,a,null);return;case"input":ye("invalid",e);var v=c=f=o=null,T=null,R=null;for(s in a)if(a.hasOwnProperty(s)){var M=a[s];if(M!=null)switch(s){case"name":o=M;break;case"type":f=M;break;case"checked":T=M;break;case"defaultChecked":R=M;break;case"value":c=M;break;case"defaultValue":v=M;break;case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(l(137,t));break;default:Ue(e,t,s,M,a,null)}}rl(e,c,v,T,R,f,o,!1);return;case"select":ye("invalid",e),s=f=c=null;for(o in a)if(a.hasOwnProperty(o)&&(v=a[o],v!=null))switch(o){case"value":c=v;break;case"defaultValue":f=v;break;case"multiple":s=v;default:Ue(e,t,o,v,a,null)}t=c,a=f,e.multiple=!!s,t!=null?ga(e,!!s,t,!1):a!=null&&ga(e,!!s,a,!0);return;case"textarea":ye("invalid",e),c=o=s=null;for(f in a)if(a.hasOwnProperty(f)&&(v=a[f],v!=null))switch(f){case"value":s=v;break;case"defaultValue":o=v;break;case"children":c=v;break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(l(91));break;default:Ue(e,t,f,v,a,null)}pa(e,s,o,c);return;case"option":for(T in a)a.hasOwnProperty(T)&&(s=a[T],s!=null)&&(T==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":Ue(e,t,T,s,a,null));return;case"dialog":ye("beforetoggle",e),ye("toggle",e),ye("cancel",e),ye("close",e);break;case"iframe":case"object":ye("load",e);break;case"video":case"audio":for(s=0;s<gs.length;s++)ye(gs[s],e);break;case"image":ye("error",e),ye("load",e);break;case"details":ye("toggle",e);break;case"embed":case"source":case"link":ye("error",e),ye("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(R in a)if(a.hasOwnProperty(R)&&(s=a[R],s!=null))switch(R){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Ue(e,t,R,s,a,null)}return;default:if(te(t)){for(M in a)a.hasOwnProperty(M)&&(s=a[M],s!==void 0&&jc(e,t,M,s,a,void 0));return}}for(v in a)a.hasOwnProperty(v)&&(s=a[v],s!=null&&Ue(e,t,v,s,a,null))}function vv(e,t,a,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,c=null,f=null,v=null,T=null,R=null,M=null;for(N in a){var B=a[N];if(a.hasOwnProperty(N)&&B!=null)switch(N){case"checked":break;case"value":break;case"defaultValue":T=B;default:s.hasOwnProperty(N)||Ue(e,t,N,null,s,B)}}for(var j in s){var N=s[j];if(B=a[j],s.hasOwnProperty(j)&&(N!=null||B!=null))switch(j){case"type":c=N;break;case"name":o=N;break;case"checked":R=N;break;case"defaultChecked":M=N;break;case"value":f=N;break;case"defaultValue":v=N;break;case"children":case"dangerouslySetInnerHTML":if(N!=null)throw Error(l(137,t));break;default:N!==B&&Ue(e,t,j,N,s,B)}}xi(e,f,v,T,R,M,c,o);return;case"select":N=f=v=j=null;for(c in a)if(T=a[c],a.hasOwnProperty(c)&&T!=null)switch(c){case"value":break;case"multiple":N=T;default:s.hasOwnProperty(c)||Ue(e,t,c,null,s,T)}for(o in s)if(c=s[o],T=a[o],s.hasOwnProperty(o)&&(c!=null||T!=null))switch(o){case"value":j=c;break;case"defaultValue":v=c;break;case"multiple":f=c;default:c!==T&&Ue(e,t,o,c,s,T)}t=v,a=f,s=N,j!=null?ga(e,!!a,j,!1):!!s!=!!a&&(t!=null?ga(e,!!a,t,!0):ga(e,!!a,a?[]:"",!1));return;case"textarea":N=j=null;for(v in a)if(o=a[v],a.hasOwnProperty(v)&&o!=null&&!s.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:Ue(e,t,v,null,s,o)}for(f in s)if(o=s[f],c=a[f],s.hasOwnProperty(f)&&(o!=null||c!=null))switch(f){case"value":j=o;break;case"defaultValue":N=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(l(91));break;default:o!==c&&Ue(e,t,f,o,s,c)}sl(e,j,N);return;case"option":for(var Z in a)j=a[Z],a.hasOwnProperty(Z)&&j!=null&&!s.hasOwnProperty(Z)&&(Z==="selected"?e.selected=!1:Ue(e,t,Z,null,s,j));for(T in s)j=s[T],N=a[T],s.hasOwnProperty(T)&&j!==N&&(j!=null||N!=null)&&(T==="selected"?e.selected=j&&typeof j!="function"&&typeof j!="symbol":Ue(e,t,T,j,s,N));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 oe in a)j=a[oe],a.hasOwnProperty(oe)&&j!=null&&!s.hasOwnProperty(oe)&&Ue(e,t,oe,null,s,j);for(R in s)if(j=s[R],N=a[R],s.hasOwnProperty(R)&&j!==N&&(j!=null||N!=null))switch(R){case"children":case"dangerouslySetInnerHTML":if(j!=null)throw Error(l(137,t));break;default:Ue(e,t,R,j,s,N)}return;default:if(te(t)){for(var Me in a)j=a[Me],a.hasOwnProperty(Me)&&j!==void 0&&!s.hasOwnProperty(Me)&&jc(e,t,Me,void 0,s,j);for(M in s)j=s[M],N=a[M],!s.hasOwnProperty(M)||j===N||j===void 0&&N===void 0||jc(e,t,M,j,s,N);return}}for(var x in a)j=a[x],a.hasOwnProperty(x)&&j!=null&&!s.hasOwnProperty(x)&&Ue(e,t,x,null,s,j);for(B in s)j=s[B],N=a[B],!s.hasOwnProperty(B)||j===N||j==null&&N==null||Ue(e,t,B,j,s,N)}function Mm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function bv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),s=0;s<a.length;s++){var o=a[s],c=o.transferSize,f=o.initiatorType,v=o.duration;if(c&&v&&Mm(f)){for(f=0,v=o.responseEnd,s+=1;s<a.length;s++){var T=a[s],R=T.startTime;if(R>v)break;var M=T.transferSize,B=T.initiatorType;M&&Mm(B)&&(T=T.responseEnd,f+=M*(T<v?1:(v-R)/(T-R)))}if(--s,t+=8*(c+f)/(o.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 Nc=null,Lc=null;function no(e){return e.nodeType===9?e:e.ownerDocument}function zm(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 Bm(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 Dc(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 Uc=null;function wv(){var e=window.event;return e&&e.type==="popstate"?e===Uc?!1:(Uc=e,!0):(Uc=null,!1)}var Hm=typeof setTimeout=="function"?setTimeout:void 0,Sv=typeof clearTimeout=="function"?clearTimeout:void 0,qm=typeof Promise=="function"?Promise:void 0,_v=typeof queueMicrotask=="function"?queueMicrotask:typeof qm<"u"?function(e){return qm.resolve(null).then(e).catch(Tv)}:Hm;function Tv(e){setTimeout(function(){throw e})}function Ma(e){return e==="head"}function $m(e,t){var a=t,s=0;do{var o=a.nextSibling;if(e.removeChild(a),o&&o.nodeType===8)if(a=o.data,a==="/$"||a==="/&"){if(s===0){e.removeChild(o),nr(t);return}s--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")s++;else if(a==="html")ys(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,ys(a);for(var c=a.firstChild;c;){var f=c.nextSibling,v=c.nodeName;c[Ya]||v==="SCRIPT"||v==="STYLE"||v==="LINK"&&c.rel.toLowerCase()==="stylesheet"||a.removeChild(c),c=f}}else a==="body"&&ys(e.ownerDocument.body);a=o}while(a);nr(t)}function Pm(e,t){var a=e;e=0;do{var s=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),s&&s.nodeType===8)if(a=s.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=s}while(a)}function Mc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Mc(a),Nr(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function kv(e,t,a,s){for(;e.nodeType===1;){var o=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Ya])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=on(e.nextSibling),e===null)break}return null}function Ev(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=on(e.nextSibling),e===null))return null;return e}function Im(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=on(e.nextSibling),e===null))return null;return e}function zc(e){return e.data==="$?"||e.data==="$~"}function Bc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Av(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var s=function(){t(),a.removeEventListener("DOMContentLoaded",s)};a.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function on(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 Hc=null;function Gm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return on(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function Vm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Km(e,t,a){switch(t=no(a),e){case"html":if(e=t.documentElement,!e)throw Error(l(452));return e;case"head":if(e=t.head,!e)throw Error(l(453));return e;case"body":if(e=t.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function ys(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Nr(e)}var un=new Map,Ym=new Set;function ao(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var na=G.d;G.d={f:xv,r:Cv,D:Ov,C:Rv,L:jv,m:Nv,X:Dv,S:Lv,M:Uv};function xv(){var e=na.f(),t=Jl();return e||t}function Cv(e){var t=Ut(e);t!==null&&t.tag===5&&t.type==="form"?cf(t):na.r(e)}var Fi=typeof document>"u"?null:document;function Jm(e,t,a){var s=Fi;if(s&&typeof t=="string"&&t){var o=bt(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof a=="string"&&(o+='[crossorigin="'+a+'"]'),Ym.has(o)||(Ym.add(o),e={rel:e,crossOrigin:a,href:t},s.querySelector(o)===null&&(t=s.createElement("link"),Et(t,"link",e),ot(t),s.head.appendChild(t)))}}function Ov(e){na.D(e),Jm("dns-prefetch",e,null)}function Rv(e,t){na.C(e,t),Jm("preconnect",e,t)}function jv(e,t,a){na.L(e,t,a);var s=Fi;if(s&&e&&t){var o='link[rel="preload"][as="'+bt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(o+='[imagesrcset="'+bt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(o+='[imagesizes="'+bt(a.imageSizes)+'"]')):o+='[href="'+bt(e)+'"]';var c=o;switch(t){case"style":c=er(e);break;case"script":c=tr(e)}un.has(c)||(e=b({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),un.set(c,e),s.querySelector(o)!==null||t==="style"&&s.querySelector(vs(c))||t==="script"&&s.querySelector(bs(c))||(t=s.createElement("link"),Et(t,"link",e),ot(t),s.head.appendChild(t)))}}function Nv(e,t){na.m(e,t);var a=Fi;if(a&&e){var s=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+bt(s)+'"][href="'+bt(e)+'"]',c=o;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=tr(e)}if(!un.has(c)&&(e=b({rel:"modulepreload",href:e},t),un.set(c,e),a.querySelector(o)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(bs(c)))return}s=a.createElement("link"),Et(s,"link",e),ot(s),a.head.appendChild(s)}}}function Lv(e,t,a){na.S(e,t,a);var s=Fi;if(s&&e){var o=ma(s).hoistableStyles,c=er(e);t=t||"default";var f=o.get(c);if(!f){var v={loading:0,preload:null};if(f=s.querySelector(vs(c)))v.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},a),(a=un.get(c))&&qc(e,a);var T=f=s.createElement("link");ot(T),Et(T,"link",e),T._p=new Promise(function(R,M){T.onload=R,T.onerror=M}),T.addEventListener("load",function(){v.loading|=1}),T.addEventListener("error",function(){v.loading|=2}),v.loading|=4,io(f,t,s)}f={type:"stylesheet",instance:f,count:1,state:v},o.set(c,f)}}}function Dv(e,t){na.X(e,t);var a=Fi;if(a&&e){var s=ma(a).hoistableScripts,o=tr(e),c=s.get(o);c||(c=a.querySelector(bs(o)),c||(e=b({src:e,async:!0},t),(t=un.get(o))&&$c(e,t),c=a.createElement("script"),ot(c),Et(c,"link",e),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},s.set(o,c))}}function Uv(e,t){na.M(e,t);var a=Fi;if(a&&e){var s=ma(a).hoistableScripts,o=tr(e),c=s.get(o);c||(c=a.querySelector(bs(o)),c||(e=b({src:e,async:!0,type:"module"},t),(t=un.get(o))&&$c(e,t),c=a.createElement("script"),ot(c),Et(c,"link",e),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},s.set(o,c))}}function Xm(e,t,a,s){var o=(o=he.current)?ao(o):null;if(!o)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=er(a.href),a=ma(o).hoistableStyles,s=a.get(t),s||(s={type:"style",instance:null,count:0,state:null},a.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=er(a.href);var c=ma(o).hoistableStyles,f=c.get(e);if(f||(o=o.ownerDocument||o,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,f),(c=o.querySelector(vs(e)))&&!c._p&&(f.instance=c,f.state.loading=5),un.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},un.set(e,a),c||Mv(o,e,a,f.state))),t&&s===null)throw Error(l(528,""));return f}if(t&&s!==null)throw Error(l(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=tr(a),a=ma(o).hoistableScripts,s=a.get(t),s||(s={type:"script",instance:null,count:0,state:null},a.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function er(e){return'href="'+bt(e)+'"'}function vs(e){return'link[rel="stylesheet"]['+e+"]"}function Qm(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function Mv(e,t,a,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),Et(t,"link",a),ot(t),e.head.appendChild(t))}function tr(e){return'[src="'+bt(e)+'"]'}function bs(e){return"script[async]"+e}function Wm(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+bt(a.href)+'"]');if(s)return t.instance=s,ot(s),s;var o=b({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),ot(s),Et(s,"style",o),io(s,a.precedence,e),t.instance=s;case"stylesheet":o=er(a.href);var c=e.querySelector(vs(o));if(c)return t.state.loading|=4,t.instance=c,ot(c),c;s=Qm(a),(o=un.get(o))&&qc(s,o),c=(e.ownerDocument||e).createElement("link"),ot(c);var f=c;return f._p=new Promise(function(v,T){f.onload=v,f.onerror=T}),Et(c,"link",s),t.state.loading|=4,io(c,a.precedence,e),t.instance=c;case"script":return c=tr(a.src),(o=e.querySelector(bs(c)))?(t.instance=o,ot(o),o):(s=a,(o=un.get(c))&&(s=b({},a),$c(s,o)),e=e.ownerDocument||e,o=e.createElement("script"),ot(o),Et(o,"link",s),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,io(s,a.precedence,e));return t.instance}function io(e,t,a){for(var s=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=s.length?s[s.length-1]:null,c=o,f=0;f<s.length;f++){var v=s[f];if(v.dataset.precedence===t)c=v;else if(c!==o)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function qc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function $c(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ro=null;function Zm(e,t,a){if(ro===null){var s=new Map,o=ro=new Map;o.set(a,s)}else o=ro,s=o.get(a),s||(s=new Map,o.set(a,s));if(s.has(e))return s;for(s.set(e,null),a=a.getElementsByTagName(e),o=0;o<a.length;o++){var c=a[o];if(!(c[Ya]||c[st]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var f=c.getAttribute(t)||"";f=e+f;var v=s.get(f);v?v.push(c):s.set(f,[c])}}return s}function Fm(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function zv(e,t,a){if(a===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;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!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 eg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Bv(e,t,a,s){if(a.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var o=er(s.href),c=t.querySelector(vs(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=so.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=c,ot(c);return}c=t.ownerDocument||t,s=Qm(s),(o=un.get(o))&&qc(s,o),c=c.createElement("link"),ot(c);var f=c;f._p=new Promise(function(v,T){f.onload=v,f.onerror=T}),Et(c,"link",s),a.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=so.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Pc=0;function Hv(e,t){return e.stylesheets&&e.count===0&&oo(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var s=setTimeout(function(){if(e.stylesheets&&oo(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&Pc===0&&(Pc=62500*bv());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&oo(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>Pc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(o)}}:null}function so(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)oo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var lo=null;function oo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,lo=new Map,t.forEach(qv,e),lo=null,so.call(e))}function qv(e,t){if(!(t.state.loading&4)){var a=lo.get(e);if(a)var s=a.get(null);else{a=new Map,lo.set(e,a);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<o.length;c++){var f=o[c];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(a.set(f.dataset.precedence,f),s=f)}s&&a.set(null,s)}o=t.instance,f=o.getAttribute("data-precedence"),c=a.get(f)||s,c===s&&a.set(null,o),a.set(f,o),this.count++,s=so.bind(this),o.addEventListener("load",s),o.addEventListener("error",s),c?c.parentNode.insertBefore(o,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var ws={$$typeof:P,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function $v(e,t,a,s,o,c,f,v,T){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=xr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xr(0),this.hiddenUpdates=xr(null),this.identifierPrefix=s,this.onUncaughtError=o,this.onCaughtError=c,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=T,this.incompleteTransitions=new Map}function tg(e,t,a,s,o,c,f,v,T,R,M,B){return e=new $v(e,t,a,f,T,R,M,B,v),t=1,c===!0&&(t|=24),c=Kt(3,null,null,t),e.current=c,c.stateNode=e,t=Su(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:s,isDehydrated:a,cache:t},Eu(c),e}function ng(e){return e?(e=Ni,e):Ni}function ag(e,t,a,s,o,c){o=ng(o),s.context===null?s.context=o:s.pendingContext=o,s=Ea(t),s.payload={element:a},c=c===void 0?null:c,c!==null&&(s.callback=c),a=Aa(e,s,t),a!==null&&(Pt(a,e,t),Zr(a,e,t))}function ig(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Ic(e,t){ig(e,t),(e=e.alternate)&&ig(e,t)}function rg(e){if(e.tag===13||e.tag===31){var t=ei(e,67108864);t!==null&&Pt(t,e,67108864),Ic(e,67108864)}}function sg(e){if(e.tag===13||e.tag===31){var t=Wt();t=ki(t);var a=ei(e,t);a!==null&&Pt(a,e,t),Ic(e,t)}}var uo=!0;function Pv(e,t,a,s){var o=L.T;L.T=null;var c=G.p;try{G.p=2,Gc(e,t,a,s)}finally{G.p=c,L.T=o}}function Iv(e,t,a,s){var o=L.T;L.T=null;var c=G.p;try{G.p=8,Gc(e,t,a,s)}finally{G.p=c,L.T=o}}function Gc(e,t,a,s){if(uo){var o=Vc(s);if(o===null)Rc(e,t,s,co,a),og(e,s);else if(Vv(o,e,t,a,s))s.stopPropagation();else if(og(e,s),t&4&&-1<Gv.indexOf(e)){for(;o!==null;){var c=Ut(o);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var f=en(c.pendingLanes);if(f!==0){var v=c;for(v.pendingLanes|=2,v.entangledLanes|=2;f;){var T=1<<31-Ie(f);v.entanglements[1]|=T,f&=~T}On(c),(Re&6)===0&&(Kl=At()+500,ms(0))}}break;case 31:case 13:v=ei(c,2),v!==null&&Pt(v,c,2),Jl(),Ic(c,2)}if(c=Vc(s),c===null&&Rc(e,t,s,co,a),c===o)break;o=c}o!==null&&s.stopPropagation()}else Rc(e,t,s,null,a)}}function Vc(e){return e=Xe(e),Kc(e)}var co=null;function Kc(e){if(co=null,e=Bn(e),e!==null){var t=d(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=h(t),e!==null)return e;e=null}else if(a===31){if(e=m(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return co=e,null}function lg(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(Tr()){case kr:return 2;case Ye:return 8;case Si:case Ft:return 32;case Qs:return 268435456;default:return 32}default:return 32}}var Yc=!1,za=null,Ba=null,Ha=null,Ss=new Map,_s=new Map,qa=[],Gv="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 og(e,t){switch(e){case"focusin":case"focusout":za=null;break;case"dragenter":case"dragleave":Ba=null;break;case"mouseover":case"mouseout":Ha=null;break;case"pointerover":case"pointerout":Ss.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":_s.delete(t.pointerId)}}function Ts(e,t,a,s,o,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:a,eventSystemFlags:s,nativeEvent:c,targetContainers:[o]},t!==null&&(t=Ut(t),t!==null&&rg(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Vv(e,t,a,s,o){switch(t){case"focusin":return za=Ts(za,e,t,a,s,o),!0;case"dragenter":return Ba=Ts(Ba,e,t,a,s,o),!0;case"mouseover":return Ha=Ts(Ha,e,t,a,s,o),!0;case"pointerover":var c=o.pointerId;return Ss.set(c,Ts(Ss.get(c)||null,e,t,a,s,o)),!0;case"gotpointercapture":return c=o.pointerId,_s.set(c,Ts(_s.get(c)||null,e,t,a,s,o)),!0}return!1}function ug(e){var t=Bn(e.target);if(t!==null){var a=d(t);if(a!==null){if(t=a.tag,t===13){if(t=h(a),t!==null){e.blockedOn=t,Ka(e.priority,function(){sg(a)});return}}else if(t===31){if(t=m(a),t!==null){e.blockedOn=t,Ka(e.priority,function(){sg(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ho(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Vc(e.nativeEvent);if(a===null){a=e.nativeEvent;var s=new a.constructor(a.type,a);jt=s,a.target.dispatchEvent(s),jt=null}else return t=Ut(a),t!==null&&rg(t),e.blockedOn=a,!1;t.shift()}return!0}function cg(e,t,a){ho(e)&&a.delete(t)}function Kv(){Yc=!1,za!==null&&ho(za)&&(za=null),Ba!==null&&ho(Ba)&&(Ba=null),Ha!==null&&ho(Ha)&&(Ha=null),Ss.forEach(cg),_s.forEach(cg)}function fo(e,t){e.blockedOn===t&&(e.blockedOn=null,Yc||(Yc=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Kv)))}var mo=null;function dg(e){mo!==e&&(mo=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){mo===e&&(mo=null);for(var t=0;t<e.length;t+=3){var a=e[t],s=e[t+1],o=e[t+2];if(typeof s!="function"){if(Kc(s||a)===null)continue;break}var c=Ut(a);c!==null&&(e.splice(t,3),t-=3,Vu(c,{pending:!0,data:o,method:a.method,action:s},s,o))}}))}function nr(e){function t(T){return fo(T,e)}za!==null&&fo(za,e),Ba!==null&&fo(Ba,e),Ha!==null&&fo(Ha,e),Ss.forEach(t),_s.forEach(t);for(var a=0;a<qa.length;a++){var s=qa[a];s.blockedOn===e&&(s.blockedOn=null)}for(;0<qa.length&&(a=qa[0],a.blockedOn===null);)ug(a),a.blockedOn===null&&qa.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(s=0;s<a.length;s+=3){var o=a[s],c=a[s+1],f=o[lt]||null;if(typeof c=="function")f||dg(a);else if(f){var v=null;if(c&&c.hasAttribute("formAction")){if(o=c,f=c[lt]||null)v=f.formAction;else if(Kc(o)!==null)continue}else v=f.action;typeof v=="function"?a[s+1]=v:(a.splice(s,3),s-=3),dg(a)}}}function hg(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(f){return o=f})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),s||setTimeout(a,20)}function a(){if(!s&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function Jc(e){this._internalRoot=e}go.prototype.render=Jc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var a=t.current,s=Wt();ag(a,s,e,t,null,null)},go.prototype.unmount=Jc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ag(e.current,2,null,e,null,null),Jl(),t[Mn]=null}};function go(e){this._internalRoot=e}go.prototype.unstable_scheduleHydration=function(e){if(e){var t=Va();e={blockedOn:null,target:e,priority:t};for(var a=0;a<qa.length&&t!==0&&t<qa[a].priority;a++);qa.splice(a,0,e),a===0&&ug(e)}};var fg=n.version;if(fg!=="19.2.7")throw Error(l(527,fg,"19.2.7"));G.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=p(t),e=e!==null?w(e):null,e=e===null?null:e.stateNode,e};var Yv={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var po=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!po.isDisabled&&po.supportsFiber)try{fn=po.inject(Yv),it=po}catch{}}return Es.createRoot=function(e,t){if(!u(e))throw Error(l(299));var a=!1,s="",o=wf,c=Sf,f=_f;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=tg(e,1,!1,null,null,a,s,null,o,c,f,hg),e[Mn]=t.current,Oc(e),new Jc(t)},Es.hydrateRoot=function(e,t,a){if(!u(e))throw Error(l(299));var s=!1,o="",c=wf,f=Sf,v=_f,T=null;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(o=a.identifierPrefix),a.onUncaughtError!==void 0&&(c=a.onUncaughtError),a.onCaughtError!==void 0&&(f=a.onCaughtError),a.onRecoverableError!==void 0&&(v=a.onRecoverableError),a.formState!==void 0&&(T=a.formState)),t=tg(e,1,!0,t,a??null,s,o,T,c,f,v,hg),t.context=ng(null),a=t.current,s=Wt(),s=ki(s),o=Ea(s),o.callback=null,Aa(a,o,s),a=s,t.current.lanes=a,ha(t,a),On(t),e[Mn]=t.current,Oc(e),new go(t)},Es.version="19.2.7",Es}var Tg;function a0(){if(Tg)return Wc.exports;Tg=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(n){console.error(n)}}return i(),Wc.exports=n0(),Wc.exports}var i0=a0();const r0=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),s0=i=>i.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,r,l)=>l?l.toUpperCase():r.toLowerCase()),kg=i=>{const n=s0(i);return n.charAt(0).toUpperCase()+n.slice(1)},yp=(...i)=>i.filter((n,r,l)=>!!n&&n.trim()!==""&&l.indexOf(n)===r).join(" ").trim(),l0=i=>{for(const n in i)if(n.startsWith("aria-")||n==="role"||n==="title")return!0};var o0={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const u0=$.forwardRef(({color:i="currentColor",size:n=24,strokeWidth:r=2,absoluteStrokeWidth:l,className:u="",children:d,iconNode:h,...m},g)=>$.createElement("svg",{ref:g,...o0,width:n,height:n,stroke:i,strokeWidth:l?Number(r)*24/Number(n):r,className:yp("lucide",u),...!d&&!l0(m)&&{"aria-hidden":"true"},...m},[...h.map(([p,w])=>$.createElement(p,w)),...Array.isArray(d)?d:[d]]));const ze=(i,n)=>{const r=$.forwardRef(({className:l,...u},d)=>$.createElement(u0,{ref:d,iconNode:n,className:yp(`lucide-${r0(kg(i))}`,`lucide-${i}`,l),...u}));return r.displayName=kg(i),r};const c0=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Eg=ze("activity",c0);const d0=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],h0=ze("badge-check",d0);const f0=[["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"}]],vd=ze("book-open",f0);const m0=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],g0=ze("chevron-left",m0);const p0=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],y0=ze("chevron-right",p0);const v0=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],b0=ze("circle-check",v0);const w0=[["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"}]],As=ze("clipboard",w0);const S0=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],bd=ze("credit-card",S0);const _0=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],td=ze("database",_0);const T0=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],k0=ze("earth",T0);const E0=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],nd=ze("folder-open",E0);const A0=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],vp=ze("layout-grid",A0);const x0=[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]],ad=ze("log-in",x0);const C0=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],O0=ze("log-out",C0);const R0=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],gr=ze("monitor",R0);const j0=[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]],wd=ze("mouse-pointer-2",j0);const N0=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],id=ze("play",N0);const L0=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],D0=ze("power",L0);const U0=[["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"}]],M0=ze("rotate-ccw",U0);const z0=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],rd=ze("send",z0);const B0=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],sd=ze("server",B0);const H0=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],bp=ze("settings",H0);const q0=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ag=ze("shield-check",q0);const $0=[["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"}]],P0=ze("star",$0);const I0=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],dr=ze("terminal",I0);const G0=[["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"}]],xg=ze("volume-2",G0);const V0=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],Cg=ze("wifi",V0);const K0=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Og=ze("x",K0);function zo(i,n){var r={};for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&n.indexOf(l)<0&&(r[l]=i[l]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var u=0,l=Object.getOwnPropertySymbols(i);u<l.length;u++)n.indexOf(l[u])<0&&Object.prototype.propertyIsEnumerable.call(i,l[u])&&(r[l[u]]=i[l[u]]);return r}function Y0(i,n,r,l){function u(d){return d instanceof r?d:new r(function(h){h(d)})}return new(r||(r=Promise))(function(d,h){function m(w){try{p(l.next(w))}catch(b){h(b)}}function g(w){try{p(l.throw(w))}catch(b){h(b)}}function p(w){w.done?d(w.value):u(w.value).then(m,g)}p((l=l.apply(i,n||[])).next())})}const J0=i=>i?(...n)=>i(...n):(...n)=>fetch(...n);class Dd extends Error{constructor(n,r="FunctionsError",l){super(n),this.name=r,this.context=l}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class X0 extends Dd{constructor(n){super("Failed to send a request to the Edge Function","FunctionsFetchError",n)}}class Rg extends Dd{constructor(n){super("Relay Error invoking the Edge Function","FunctionsRelayError",n)}}class jg extends Dd{constructor(n){super("Edge Function returned a non-2xx status code","FunctionsHttpError",n)}}var Sd;(function(i){i.Any="any",i.ApNortheast1="ap-northeast-1",i.ApNortheast2="ap-northeast-2",i.ApSouth1="ap-south-1",i.ApSoutheast1="ap-southeast-1",i.ApSoutheast2="ap-southeast-2",i.CaCentral1="ca-central-1",i.EuCentral1="eu-central-1",i.EuWest1="eu-west-1",i.EuWest2="eu-west-2",i.EuWest3="eu-west-3",i.SaEast1="sa-east-1",i.UsEast1="us-east-1",i.UsWest1="us-west-1",i.UsWest2="us-west-2"})(Sd||(Sd={}));class Q0{constructor(n,{headers:r={},customFetch:l,region:u=Sd.Any}={}){this.url=n,this.headers=r,this.region=u,this.fetch=J0(l)}setAuth(n){this.headers.Authorization=`Bearer ${n}`}invoke(n){return Y0(this,arguments,void 0,function*(r,l={}){var u;let d,h;try{const{headers:m,method:g,body:p,signal:w,timeout:b}=l;let k={},{region:S}=l;S||(S=this.region);const C=new URL(`${this.url}/${r}`);S&&S!=="any"&&(k["x-region"]=S,C.searchParams.set("forceFunctionRegion",S));let D;const I=!!m&&Object.keys(m).some(ae=>ae.toLowerCase()==="content-type");p&&!I?typeof Blob<"u"&&p instanceof Blob||p instanceof ArrayBuffer?(k["Content-Type"]="application/octet-stream",D=p):typeof p=="string"?(k["Content-Type"]="text/plain",D=p):typeof FormData<"u"&&p instanceof FormData?D=p:(k["Content-Type"]="application/json",D=JSON.stringify(p)):p&&typeof p!="string"&&!(typeof Blob<"u"&&p instanceof Blob)&&!(p instanceof ArrayBuffer)&&!(typeof FormData<"u"&&p instanceof FormData)?D=JSON.stringify(p):D=p;let H=w;b&&(h=new AbortController,d=setTimeout(()=>h.abort(),b),w?(H=h.signal,w.addEventListener("abort",()=>h.abort())):H=h.signal);const q=yield this.fetch(C.toString(),{method:g||"POST",headers:Object.assign(Object.assign(Object.assign({},k),this.headers),m),body:D,signal:H}).catch(ae=>{throw new X0(ae)}),P=q.headers.get("x-relay-error");if(P&&P==="true")throw new Rg(q);if(!q.ok)throw new jg(q);let Q=((u=q.headers.get("Content-Type"))!==null&&u!==void 0?u:"text/plain").split(";")[0].trim(),K;return Q==="application/json"?K=yield q.json():Q==="application/octet-stream"||Q==="application/pdf"?K=yield q.blob():Q==="text/event-stream"?K=q:Q==="multipart/form-data"?K=yield q.formData():K=yield q.text(),{data:K,error:null,response:q}}catch(m){return{data:null,error:m,response:m instanceof jg||m instanceof Rg?m.context:void 0}}finally{d&&clearTimeout(d)}})}}const wp=3,Ng=i=>Math.min(1e3*2**i,3e4),W0=[520,503],Sp=["GET","HEAD","OPTIONS"];var Lg=class extends Error{constructor(i){super(i.message),this.name="PostgrestError",this.details=i.details,this.hint=i.hint,this.code=i.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function Dg(i,n){return new Promise(r=>{if(n?.aborted){r();return}const l=setTimeout(()=>{n?.removeEventListener("abort",u),r()},i);function u(){clearTimeout(l),r()}n?.addEventListener("abort",u)})}function Z0(i,n,r,l){return!(!l||r>=wp||!Sp.includes(i)||!W0.includes(n))}var F0=class{constructor(i){var n,r,l,u,d;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=i.method,this.url=i.url,this.headers=new Headers(i.headers),this.schema=i.schema,this.body=i.body,this.shouldThrowOnError=(n=i.shouldThrowOnError)!==null&&n!==void 0?n:!1,this.signal=i.signal,this.isMaybeSingle=(r=i.isMaybeSingle)!==null&&r!==void 0?r:!1,this.shouldStripNulls=(l=i.shouldStripNulls)!==null&&l!==void 0?l:!1,this.urlLengthLimit=(u=i.urlLengthLimit)!==null&&u!==void 0?u:8e3,this.retryEnabled=(d=i.retry)!==null&&d!==void 0?d:!0,i.fetch?this.fetch=i.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(i,n){return this.headers=new Headers(this.headers),this.headers.set(i,n),this}retry(i){return this.retryEnabled=i,this}then(i,n){var r=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){const h=this.headers.get("Accept");h==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!h||h==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const l=this.fetch;let d=(async()=>{let h=0;for(;;){const p={};r.headers.forEach((b,k)=>{p[k]=b}),h>0&&(p["X-Retry-Count"]=String(h));let w;try{w=await l(r.url.toString(),{method:r.method,headers:p,body:JSON.stringify(r.body,(b,k)=>typeof k=="bigint"?k.toString():k),signal:r.signal})}catch(b){if(b?.name==="AbortError"||b?.code==="ABORT_ERR"||!Sp.includes(r.method))throw b;if(r.retryEnabled&&h<wp){const k=Ng(h);h++,await Dg(k,r.signal);continue}throw b}if(Z0(r.method,w.status,h,r.retryEnabled)){var m,g;const b=(m=(g=w.headers)===null||g===void 0?void 0:g.get("Retry-After"))!==null&&m!==void 0?m:null,k=b!==null?Math.max(0,parseInt(b,10)||0)*1e3:Ng(h);await w.text(),h++,await Dg(k,r.signal);continue}return await r.processResponse(w)}})();return this.shouldThrowOnError||(d=d.catch(h=>{var m;let g="",p="",w="";const b=h?.cause;if(b){var k,S,C,D;const q=(k=b?.message)!==null&&k!==void 0?k:"",P=(S=b?.code)!==null&&S!==void 0?S:"";g=`${(C=h?.name)!==null&&C!==void 0?C:"FetchError"}: ${h?.message}`,g+=`
10
+
11
+ Caused by: ${(D=b?.name)!==null&&D!==void 0?D:"Error"}: ${q}`,P&&(g+=` (${P})`),b?.stack&&(g+=`
12
+ ${b.stack}`)}else{var I;g=(I=h?.stack)!==null&&I!==void 0?I:""}const H=this.url.toString().length;return h?.name==="AbortError"||h?.code==="ABORT_ERR"?(w="",p="Request was aborted (timeout or manual cancellation)",H>this.urlLengthLimit&&(p+=`. Note: Your request URL is ${H} 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.`)):(b?.name==="HeadersOverflowError"||b?.code==="UND_ERR_HEADERS_OVERFLOW")&&(w="",p="HTTP headers exceeded server limits (typically 16KB)",H>this.urlLengthLimit&&(p+=`. Your request URL is ${H} 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:`${(m=h?.name)!==null&&m!==void 0?m:"FetchError"}: ${h?.message}`,details:g,hint:p,code:w},data:null,count:null,status:0,statusText:""}})),d.then(i,n)}async processResponse(i){var n=this;let r=null,l=null,u=null,d=i.status,h=i.statusText;if(i.ok){var m,g;if(n.method!=="HEAD"){var p;const k=await i.text();if(k!=="")if(n.headers.get("Accept")==="text/csv")l=k;else if(n.headers.get("Accept")&&(!((p=n.headers.get("Accept"))===null||p===void 0)&&p.includes("application/vnd.pgrst.plan+text")))l=k;else try{l=JSON.parse(k)}catch{if(r={message:k},l=null,n.shouldThrowOnError)throw new Lg({message:k,details:"",hint:"",code:""})}}const w=(m=n.headers.get("Prefer"))===null||m===void 0?void 0:m.match(/count=(exact|planned|estimated)/),b=(g=i.headers.get("content-range"))===null||g===void 0?void 0:g.split("/");w&&b&&b.length>1&&(u=parseInt(b[1])),n.isMaybeSingle&&Array.isArray(l)&&(l.length>1?(r={code:"PGRST116",details:`Results contain ${l.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},l=null,u=null,d=406,h="Not Acceptable"):l.length===1?l=l[0]:l=null)}else{const w=await i.text();try{r=JSON.parse(w),Array.isArray(r)&&i.status===404&&(l=[],r=null,d=200,h="OK")}catch{i.status===404&&w===""?(d=204,h="No Content"):r={message:w}}if(r&&n.shouldThrowOnError)throw new Lg(r)}return{success:r===null,error:r,data:l,count:u,status:d,statusText:h}}returns(){return this}overrideTypes(){return this}},eb=class extends F0{throwOnError(){return super.throwOnError()}select(i){let n=!1;const r=(i??"*").split("").map(l=>/\s/.test(l)&&!n?"":(l==='"'&&(n=!n),l)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(i,{ascending:n=!0,nullsFirst:r,foreignTable:l,referencedTable:u=l}={}){const d=u?`${u}.order`:"order",h=this.url.searchParams.get(d);return this.url.searchParams.set(d,`${h?`${h},`:""}${i}.${n?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(i,{foreignTable:n,referencedTable:r=n}={}){const l=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(l,`${i}`),this}range(i,n,{foreignTable:r,referencedTable:l=r}={}){const u=typeof l>"u"?"offset":`${l}.offset`,d=typeof l>"u"?"limit":`${l}.limit`;return this.url.searchParams.set(u,`${i}`),this.url.searchParams.set(d,`${n-i+1}`),this}abortSignal(i){return this.signal=i,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:i=!1,verbose:n=!1,settings:r=!1,buffers:l=!1,wal:u=!1,format:d="text"}={}){var h;const m=[i?"analyze":null,n?"verbose":null,r?"settings":null,l?"buffers":null,u?"wal":null].filter(Boolean).join("|"),g=(h=this.headers.get("Accept"))!==null&&h!==void 0?h:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${d}; for="${g}"; options=${m};`),d==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(i){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${i}`),this}};const Ug=new RegExp("[,()]");var hr=class extends eb{throwOnError(){return super.throwOnError()}eq(i,n){return this.url.searchParams.append(i,`eq.${n}`),this}neq(i,n){return this.url.searchParams.append(i,`neq.${n}`),this}gt(i,n){return this.url.searchParams.append(i,`gt.${n}`),this}gte(i,n){return this.url.searchParams.append(i,`gte.${n}`),this}lt(i,n){return this.url.searchParams.append(i,`lt.${n}`),this}lte(i,n){return this.url.searchParams.append(i,`lte.${n}`),this}like(i,n){return this.url.searchParams.append(i,`like.${n}`),this}likeAllOf(i,n){return this.url.searchParams.append(i,`like(all).{${n.join(",")}}`),this}likeAnyOf(i,n){return this.url.searchParams.append(i,`like(any).{${n.join(",")}}`),this}ilike(i,n){return this.url.searchParams.append(i,`ilike.${n}`),this}ilikeAllOf(i,n){return this.url.searchParams.append(i,`ilike(all).{${n.join(",")}}`),this}ilikeAnyOf(i,n){return this.url.searchParams.append(i,`ilike(any).{${n.join(",")}}`),this}regexMatch(i,n){return this.url.searchParams.append(i,`match.${n}`),this}regexIMatch(i,n){return this.url.searchParams.append(i,`imatch.${n}`),this}is(i,n){return this.url.searchParams.append(i,`is.${n}`),this}isDistinct(i,n){return this.url.searchParams.append(i,`isdistinct.${n}`),this}in(i,n){const r=Array.from(new Set(n)).map(l=>typeof l=="string"&&Ug.test(l)?`"${l}"`:`${l}`).join(",");return this.url.searchParams.append(i,`in.(${r})`),this}notIn(i,n){const r=Array.from(new Set(n)).map(l=>typeof l=="string"&&Ug.test(l)?`"${l}"`:`${l}`).join(",");return this.url.searchParams.append(i,`not.in.(${r})`),this}contains(i,n){return typeof n=="string"?this.url.searchParams.append(i,`cs.${n}`):Array.isArray(n)?this.url.searchParams.append(i,`cs.{${n.join(",")}}`):this.url.searchParams.append(i,`cs.${JSON.stringify(n)}`),this}containedBy(i,n){return typeof n=="string"?this.url.searchParams.append(i,`cd.${n}`):Array.isArray(n)?this.url.searchParams.append(i,`cd.{${n.join(",")}}`):this.url.searchParams.append(i,`cd.${JSON.stringify(n)}`),this}rangeGt(i,n){return this.url.searchParams.append(i,`sr.${n}`),this}rangeGte(i,n){return this.url.searchParams.append(i,`nxl.${n}`),this}rangeLt(i,n){return this.url.searchParams.append(i,`sl.${n}`),this}rangeLte(i,n){return this.url.searchParams.append(i,`nxr.${n}`),this}rangeAdjacent(i,n){return this.url.searchParams.append(i,`adj.${n}`),this}overlaps(i,n){return typeof n=="string"?this.url.searchParams.append(i,`ov.${n}`):this.url.searchParams.append(i,`ov.{${n.join(",")}}`),this}textSearch(i,n,{config:r,type:l}={}){let u="";l==="plain"?u="pl":l==="phrase"?u="ph":l==="websearch"&&(u="w");const d=r===void 0?"":`(${r})`;return this.url.searchParams.append(i,`${u}fts${d}.${n}`),this}match(i){return Object.entries(i).filter(([n,r])=>r!==void 0).forEach(([n,r])=>{this.url.searchParams.append(n,`eq.${r}`)}),this}not(i,n,r){return this.url.searchParams.append(i,`not.${n}.${r}`),this}or(i,{foreignTable:n,referencedTable:r=n}={}){const l=r?`${r}.or`:"or";return this.url.searchParams.append(l,`(${i})`),this}filter(i,n,r){return this.url.searchParams.append(i,`${n}.${r}`),this}},tb=class{constructor(i,{headers:n={},schema:r,fetch:l,urlLengthLimit:u=8e3,retry:d}){this.url=i,this.headers=new Headers(n),this.schema=r,this.fetch=l,this.urlLengthLimit=u,this.retry=d}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(i,n){const{head:r=!1,count:l}=n??{},u=r?"HEAD":"GET";let d=!1;const h=(i??"*").split("").map(p=>/\s/.test(p)&&!d?"":(p==='"'&&(d=!d),p)).join(""),{url:m,headers:g}=this.cloneRequestState();return m.searchParams.set("select",h),l&&g.append("Prefer",`count=${l}`),new hr({method:u,url:m,headers:g,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(i,{count:n,defaultToNull:r=!0}={}){var l;const u="POST",{url:d,headers:h}=this.cloneRequestState();if(n&&h.append("Prefer",`count=${n}`),r||h.append("Prefer","missing=default"),Array.isArray(i)){const m=i.reduce((g,p)=>g.concat(Object.keys(p)),[]);if(m.length>0){const g=[...new Set(m)].map(p=>`"${p}"`);d.searchParams.set("columns",g.join(","))}}return new hr({method:u,url:d,headers:h,schema:this.schema,body:i,fetch:(l=this.fetch)!==null&&l!==void 0?l:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(i,{onConflict:n,ignoreDuplicates:r=!1,count:l,defaultToNull:u=!0}={}){var d;const h="POST",{url:m,headers:g}=this.cloneRequestState();if(g.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),n!==void 0&&m.searchParams.set("on_conflict",n),l&&g.append("Prefer",`count=${l}`),u||g.append("Prefer","missing=default"),Array.isArray(i)){const p=i.reduce((w,b)=>w.concat(Object.keys(b)),[]);if(p.length>0){const w=[...new Set(p)].map(b=>`"${b}"`);m.searchParams.set("columns",w.join(","))}}return new hr({method:h,url:m,headers:g,schema:this.schema,body:i,fetch:(d=this.fetch)!==null&&d!==void 0?d:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(i,{count:n}={}){var r;const l="PATCH",{url:u,headers:d}=this.cloneRequestState();return n&&d.append("Prefer",`count=${n}`),new hr({method:l,url:u,headers:d,schema:this.schema,body:i,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:i}={}){var n;const r="DELETE",{url:l,headers:u}=this.cloneRequestState();return i&&u.append("Prefer",`count=${i}`),new hr({method:r,url:l,headers:u,schema:this.schema,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function qs(i){"@babel/helpers - typeof";return qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},qs(i)}function nb(i,n){if(qs(i)!="object"||!i)return i;var r=i[Symbol.toPrimitive];if(r!==void 0){var l=r.call(i,n);if(qs(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(i)}function ab(i){var n=nb(i,"string");return qs(n)=="symbol"?n:n+""}function ib(i,n,r){return(n=ab(n))in i?Object.defineProperty(i,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):i[n]=r,i}function Mg(i,n){var r=Object.keys(i);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(i);n&&(l=l.filter(function(u){return Object.getOwnPropertyDescriptor(i,u).enumerable})),r.push.apply(r,l)}return r}function yo(i){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?Mg(Object(r),!0).forEach(function(l){ib(i,l,r[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(r)):Mg(Object(r)).forEach(function(l){Object.defineProperty(i,l,Object.getOwnPropertyDescriptor(r,l))})}return i}var rb=class _p{constructor(n,{headers:r={},schema:l,fetch:u,timeout:d,urlLengthLimit:h=8e3,retry:m}={}){this.url=n,this.headers=new Headers(r),this.schemaName=l,this.urlLengthLimit=h;const g=u??globalThis.fetch;d!==void 0&&d>0?this.fetch=(p,w)=>{const b=new AbortController,k=setTimeout(()=>b.abort(),d),S=w?.signal;if(S){if(S.aborted)return clearTimeout(k),g(p,w);const C=()=>{clearTimeout(k),b.abort()};return S.addEventListener("abort",C,{once:!0}),g(p,yo(yo({},w),{},{signal:b.signal})).finally(()=>{clearTimeout(k),S.removeEventListener("abort",C)})}return g(p,yo(yo({},w),{},{signal:b.signal})).finally(()=>clearTimeout(k))}:this.fetch=g,this.retry=m}from(n){if(!n||typeof n!="string"||n.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new tb(new URL(`${this.url}/${n}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(n){return new _p(this.url,{headers:this.headers,schema:n,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(n,r={},{head:l=!1,get:u=!1,count:d}={}){var h;let m;const g=new URL(`${this.url}/rpc/${n}`);let p;const w=S=>S!==null&&typeof S=="object"&&(!Array.isArray(S)||S.some(w)),b=l&&Object.values(r).some(w);b?(m="POST",p=r):l||u?(m=l?"HEAD":"GET",Object.entries(r).filter(([S,C])=>C!==void 0).map(([S,C])=>[S,Array.isArray(C)?`{${C.join(",")}}`:`${C}`]).forEach(([S,C])=>{g.searchParams.append(S,C)})):(m="POST",p=r);const k=new Headers(this.headers);return b?k.set("Prefer",d?`count=${d},return=minimal`:"return=minimal"):d&&k.set("Prefer",`count=${d}`),new hr({method:m,url:g,headers:k,schema:this.schemaName,body:p,fetch:(h=this.fetch)!==null&&h!==void 0?h:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class sb{constructor(){}static detectEnvironment(){var n;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const r=globalThis;if(typeof globalThis<"u"&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.WebSocket};const l=typeof global<"u"?global:void 0;if(l&&typeof l.WebSocket<"u")return{type:"native",wsConstructor:l.WebSocket};if(typeof globalThis<"u"&&typeof r.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&r.EdgeRuntime||typeof navigator<"u"&&(!((n=navigator.userAgent)===null||n===void 0)&&n.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const u=globalThis.process;if(u){const d=u.versions;if(d&&d.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(){const n=this.detectEnvironment();if(n.wsConstructor)return n.wsConstructor;let r=n.error||"WebSocket not supported in this environment.";throw n.workaround&&(r+=`
13
+
14
+ Suggested solution: ${n.workaround}`),new Error(r)}static isWebSocketSupported(){try{return this.detectEnvironment().type==="native"}catch{return!1}}}const lb="2.110.0",ob=`realtime-js/${lb}`,ub="1.0.0",Tp="2.0.0",cb=Tp,db=1e4,hb=100,Pa={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},kp={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},_d={connecting:"connecting",closing:"closing",closed:"closed"};class fb{constructor(n){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=n??[]}encode(n,r){if(n.event===this.BROADCAST_EVENT&&!(n.payload instanceof ArrayBuffer)&&typeof n.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(n));let l=[n.join_ref,n.ref,n.topic,n.event,n.payload];return r(JSON.stringify(l))}_binaryEncodeUserBroadcastPush(n){var r;return this._isArrayBuffer((r=n.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(n):this._encodeJsonUserBroadcastPush(n)}_encodeBinaryUserBroadcastPush(n){var r,l;const u=(l=(r=n.payload)===null||r===void 0?void 0:r.payload)!==null&&l!==void 0?l:new ArrayBuffer(0);return this._encodeUserBroadcastPush(n,this.BINARY_ENCODING,u)}_encodeJsonUserBroadcastPush(n){var r,l;const u=(l=(r=n.payload)===null||r===void 0?void 0:r.payload)!==null&&l!==void 0?l:{},h=new TextEncoder().encode(JSON.stringify(u)).buffer;return this._encodeUserBroadcastPush(n,this.JSON_ENCODING,h)}_encodeUserBroadcastPush(n,r,l){var u,d;const h=n.topic,m=(u=n.ref)!==null&&u!==void 0?u:"",g=(d=n.join_ref)!==null&&d!==void 0?d:"",p=n.payload.event,w=this.allowedMetadataKeys?this._pick(n.payload,this.allowedMetadataKeys):{},b=Object.keys(w).length===0?"":JSON.stringify(w);if(g.length>255)throw new Error(`joinRef length ${g.length} exceeds maximum of 255`);if(m.length>255)throw new Error(`ref length ${m.length} exceeds maximum of 255`);if(h.length>255)throw new Error(`topic length ${h.length} exceeds maximum of 255`);if(p.length>255)throw new Error(`userEvent length ${p.length} exceeds maximum of 255`);if(b.length>255)throw new Error(`metadata length ${b.length} exceeds maximum of 255`);const k=this.USER_BROADCAST_PUSH_META_LENGTH+g.length+m.length+h.length+p.length+b.length,S=new ArrayBuffer(this.HEADER_LENGTH+k);let C=new DataView(S),D=0;C.setUint8(D++,this.KINDS.userBroadcastPush),C.setUint8(D++,g.length),C.setUint8(D++,m.length),C.setUint8(D++,h.length),C.setUint8(D++,p.length),C.setUint8(D++,b.length),C.setUint8(D++,r),Array.from(g,H=>C.setUint8(D++,H.charCodeAt(0))),Array.from(m,H=>C.setUint8(D++,H.charCodeAt(0))),Array.from(h,H=>C.setUint8(D++,H.charCodeAt(0))),Array.from(p,H=>C.setUint8(D++,H.charCodeAt(0))),Array.from(b,H=>C.setUint8(D++,H.charCodeAt(0)));var I=new Uint8Array(S.byteLength+l.byteLength);return I.set(new Uint8Array(S),0),I.set(new Uint8Array(l),S.byteLength),I.buffer}decode(n,r){if(this._isArrayBuffer(n)){let l=this._binaryDecode(n);return r(l)}if(typeof n=="string"){const l=JSON.parse(n),[u,d,h,m,g]=l;return r({join_ref:u,ref:d,topic:h,event:m,payload:g})}return r({})}_binaryDecode(n){const r=new DataView(n),l=r.getUint8(0),u=new TextDecoder;if(l===this.KINDS.userBroadcast)return this._decodeUserBroadcast(n,r,u)}_decodeUserBroadcast(n,r,l){const u=r.getUint8(1),d=r.getUint8(2),h=r.getUint8(3),m=r.getUint8(4);let g=this.HEADER_LENGTH+4;const p=l.decode(n.slice(g,g+u));g=g+u;const w=l.decode(n.slice(g,g+d));g=g+d;const b=l.decode(n.slice(g,g+h));g=g+h;const k=n.slice(g,n.byteLength),S=m===this.JSON_ENCODING?JSON.parse(l.decode(k)):k,C={type:this.BROADCAST_EVENT,event:w,payload:S};return h>0&&(C.meta=JSON.parse(b)),{join_ref:null,ref:null,topic:p,event:this.BROADCAST_EVENT,payload:C}}_isArrayBuffer(n){var r;return n instanceof ArrayBuffer||((r=n?.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(n,r){return!n||typeof n!="object"?{}:Object.fromEntries(Object.entries(n).filter(([l])=>r.includes(l)))}}var He;(function(i){i.abstime="abstime",i.bool="bool",i.date="date",i.daterange="daterange",i.float4="float4",i.float8="float8",i.int2="int2",i.int4="int4",i.int4range="int4range",i.int8="int8",i.int8range="int8range",i.json="json",i.jsonb="jsonb",i.money="money",i.numeric="numeric",i.oid="oid",i.reltime="reltime",i.text="text",i.time="time",i.timestamp="timestamp",i.timestamptz="timestamptz",i.timetz="timetz",i.tsrange="tsrange",i.tstzrange="tstzrange"})(He||(He={}));const zg=(i,n,r={})=>{var l;const u=(l=r.skipTypes)!==null&&l!==void 0?l:[];return n?Object.keys(n).reduce((d,h)=>(d[h]=mb(h,i,n,u),d),{}):{}},mb=(i,n,r,l)=>{const u=n.find(m=>m.name===i),d=u?.type,h=r[i];return d&&!l.includes(d)?Ep(d,h):Td(h)},Ep=(i,n)=>{if(i.charAt(0)==="_"){const r=i.slice(1,i.length);return vb(n,r)}switch(i){case He.bool:return gb(n);case He.float4:case He.float8:case He.int2:case He.int4:case He.int8:case He.numeric:case He.oid:return pb(n);case He.json:case He.jsonb:return yb(n);case He.timestamp:return bb(n);case He.abstime:case He.date:case He.daterange:case He.int4range:case He.int8range:case He.money:case He.reltime:case He.text:case He.time:case He.timestamptz:case He.timetz:case He.tsrange:case He.tstzrange:return Td(n);default:return Td(n)}},Td=i=>i,gb=i=>{switch(i){case"t":return!0;case"f":return!1;default:return i}},pb=i=>{if(typeof i=="string"){const n=parseFloat(i);if(!Number.isNaN(n))return n}return i},yb=i=>{if(typeof i=="string")try{return JSON.parse(i)}catch{return i}return i},vb=(i,n)=>{if(typeof i!="string")return i;const r=i.length-1,l=i[r];if(i[0]==="{"&&l==="}"){let d;const h=i.slice(1,r);try{d=JSON.parse("["+h+"]")}catch{d=h?h.split(","):[]}return d.map(m=>Ep(n,m))}return i},bb=i=>typeof i=="string"?i.replace(" ","T"):i,Ap=i=>{const n=new URL(i);return n.protocol=n.protocol.replace(/^ws/i,"http"),n.pathname=n.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),n.pathname===""||n.pathname==="/"?n.pathname="/api/broadcast":n.pathname=n.pathname+"/api/broadcast",n.href};var Ds=i=>typeof i=="function"?i:function(){return i},wb=typeof self<"u"?self:null,fr=typeof window<"u"?window:null,Rn=wb||fr||globalThis,Sb="2.0.0",_b=1e4,Tb=1e3,jn={connecting:0,open:1,closing:2,closed:3},It={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},ra={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},kd={longpoll:"longpoll",websocket:"websocket"},kb={complete:4},Ed="base64url.bearer.phx.",vo=class{constructor(i,n,r,l){this.channel=i,this.event=n,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=l,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(i){this.timeout=i,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(i,n){return this.hasReceived(i)&&n(this.receivedResp.response),this.recHooks.push({status:i,callback:n}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:i,response:n,_ref:r}){this.recHooks.filter(l=>l.status===i).forEach(l=>l.callback(n))}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,i=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=i,this.matchReceive(i)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(i){return this.receivedResp&&this.receivedResp.status===i}trigger(i,n){this.channel.trigger(this.refEvent,{status:i,response:n})}},xp=class{constructor(i,n){this.callback=i,this.timerCalc=n,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},Eb=class{constructor(i,n,r){this.state=It.closed,this.topic=i,this.params=Ds(n||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new vo(this,ra.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new xp(()=>{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=It.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(l=>l.send()),this.pushBuffer=[]}),this.joinPush.receive("error",l=>{this.state=It.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,l),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=It.closed,this.socket.remove(this)}),this.onError(l=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,l),this.isJoining()&&this.joinPush.reset(),this.state=It.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 vo(this,ra.leave,Ds({}),this.timeout).send(),this.state=It.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(ra.reply,(l,u)=>{this.trigger(this.replyEventName(u),l)})}join(i=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=i,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(i=>i.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=It.closed,this.bindings=[]}onClose(i){this.on(ra.close,i)}onError(i){return this.on(ra.error,n=>i(n))}on(i,n){let r=this.bindingRef++;return this.bindings.push({event:i,ref:r,callback:n}),r}off(i,n){this.bindings=this.bindings.filter(r=>!(r.event===i&&(typeof n>"u"||n===r.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(i,n,r=this.timeout){if(n=n||{},!this.joinedOnce)throw new Error(`tried to push '${i}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let l=new vo(this,i,function(){return n},r);return this.canPush()?l.send():(l.startTimeout(),this.pushBuffer.push(l)),l}leave(i=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=It.leaving;let n=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(ra.close,"leave")},r=new vo(this,ra.leave,Ds({}),i);return r.receive("ok",()=>n()).receive("timeout",()=>n()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(i,n,r){return n}filterBindings(i,n,r){return!0}isMember(i,n,r,l){return this.topic!==i?!1:l&&l!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:i,event:n,payload:r,joinRef:l}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(i=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=It.joining,this.joinPush.resend(i))}trigger(i,n,r,l){let u=this.onMessage(i,n,r,l);if(n&&!u)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let d=this.bindings.filter(h=>h.event===i&&this.filterBindings(h,n,r));for(let h=0;h<d.length;h++)d[h].callback(u,r,l||this.joinRef())}replyEventName(i){return`chan_reply_${i}`}isClosed(){return this.state===It.closed}isErrored(){return this.state===It.errored}isJoined(){return this.state===It.joined}isJoining(){return this.state===It.joining}isLeaving(){return this.state===It.leaving}},Oo=class{static request(i,n,r,l,u,d,h){if(Rn.XDomainRequest){let m=new Rn.XDomainRequest;return this.xdomainRequest(m,i,n,l,u,d,h)}else if(Rn.XMLHttpRequest){let m=new Rn.XMLHttpRequest;return this.xhrRequest(m,i,n,r,l,u,d,h)}else{if(Rn.fetch&&Rn.AbortController)return this.fetchRequest(i,n,r,l,u,d,h);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(i,n,r,l,u,d,h){let m={method:i,headers:r,body:l},g=null;return u&&(g=new AbortController,setTimeout(()=>g.abort(),u),m.signal=g.signal),Rn.fetch(n,m).then(p=>p.text()).then(p=>this.parseJSON(p)).then(p=>h&&h(p)).catch(p=>{p.name==="AbortError"&&d?d():h&&h(null)}),g}static xdomainRequest(i,n,r,l,u,d,h){return i.timeout=u,i.open(n,r),i.onload=()=>{let m=this.parseJSON(i.responseText);h&&h(m)},d&&(i.ontimeout=d),i.onprogress=()=>{},i.send(l),i}static xhrRequest(i,n,r,l,u,d,h,m){i.open(n,r,!0),i.timeout=d;for(let[g,p]of Object.entries(l))i.setRequestHeader(g,p);return i.onerror=()=>m&&m(null),i.onreadystatechange=()=>{if(i.readyState===kb.complete&&m){let g=this.parseJSON(i.responseText);m(g)}},h&&(i.ontimeout=h),i.send(u),i}static parseJSON(i){if(!i||i==="")return null;try{return JSON.parse(i)}catch{return console&&console.log("failed to parse JSON response",i),null}}static serialize(i,n){let r=[];for(var l in i){if(!Object.prototype.hasOwnProperty.call(i,l))continue;let u=n?`${n}[${l}]`:l,d=i[l];typeof d=="object"?r.push(this.serialize(d,u)):r.push(encodeURIComponent(u)+"="+encodeURIComponent(d))}return r.join("&")}static appendParams(i,n){if(Object.keys(n).length===0)return i;let r=i.match(/\?/)?"&":"?";return`${i}${r}${this.serialize(n)}`}},Ab=i=>{let n="",r=new Uint8Array(i),l=r.byteLength;for(let u=0;u<l;u++)n+=String.fromCharCode(r[u]);return btoa(n)},ar=class{constructor(i,n){n&&n.length===2&&n[1].startsWith(Ed)&&(this.authToken=atob(n[1].slice(Ed.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(i),this.readyState=jn.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(i){return i.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+kd.websocket),"$1/"+kd.longpoll)}endpointURL(){return Oo.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(i,n,r){this.close(i,n,r),this.readyState=jn.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===jn.open||this.readyState===jn.connecting}poll(){const i={Accept:"application/json"};this.authToken&&(i["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",i,null,()=>this.ontimeout(),n=>{if(n){var{status:r,token:l,messages:u}=n;if(r===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=l}else r=0;switch(r){case 200:u.forEach(d=>{setTimeout(()=>this.onmessage({data:d}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=jn.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 new Error(`unhandled poll status ${r}`)}})}send(i){typeof i!="string"&&(i=Ab(i)),this.currentBatch?this.currentBatch.push(i):this.awaitingBatchAck?this.batchBuffer.push(i):(this.currentBatch=[i],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(i){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},i.join(`
15
+ `),()=>this.onerror("timeout"),n=>{this.awaitingBatchAck=!1,!n||n.status!==200?(this.onerror(n&&n.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(i,n,r){for(let u of this.reqs)u.abort();this.readyState=jn.closed;let l=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:i,reason:n,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",l)):this.onclose(l)}ajax(i,n,r,l,u){let d,h=()=>{this.reqs.delete(d),l()};d=Oo.request(i,this.endpointURL(),n,r,this.timeout,h,m=>{this.reqs.delete(d),this.isActive()&&u(m)}),this.reqs.add(d)}},xb=class js{constructor(n,r={}){let l=r.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=n,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(l.state,u=>{let{onJoin:d,onLeave:h,onSync:m}=this.caller;this.joinRef=this.channel.joinRef(),this.state=js.syncState(this.state,u,d,h),this.pendingDiffs.forEach(g=>{this.state=js.syncDiff(this.state,g,d,h)}),this.pendingDiffs=[],m()}),this.channel.on(l.diff,u=>{let{onJoin:d,onLeave:h,onSync:m}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(u):(this.state=js.syncDiff(this.state,u,d,h),m())})}onJoin(n){this.caller.onJoin=n}onLeave(n){this.caller.onLeave=n}onSync(n){this.caller.onSync=n}list(n){return js.list(this.state,n)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(n,r,l,u){let d=this.clone(n),h={},m={};return this.map(d,(g,p)=>{r[g]||(m[g]=p)}),this.map(r,(g,p)=>{let w=d[g];if(w){let b=p.metas.map(D=>D.phx_ref),k=w.metas.map(D=>D.phx_ref),S=p.metas.filter(D=>k.indexOf(D.phx_ref)<0),C=w.metas.filter(D=>b.indexOf(D.phx_ref)<0);S.length>0&&(h[g]=p,h[g].metas=S),C.length>0&&(m[g]=this.clone(w),m[g].metas=C)}else h[g]=p}),this.syncDiff(d,{joins:h,leaves:m},l,u)}static syncDiff(n,r,l,u){let{joins:d,leaves:h}=this.clone(r);return l||(l=function(){}),u||(u=function(){}),this.map(d,(m,g)=>{let p=n[m];if(n[m]=this.clone(g),p){let w=n[m].metas.map(k=>k.phx_ref),b=p.metas.filter(k=>w.indexOf(k.phx_ref)<0);n[m].metas.unshift(...b)}l(m,p,g)}),this.map(h,(m,g)=>{let p=n[m];if(!p)return;let w=g.metas.map(b=>b.phx_ref);p.metas=p.metas.filter(b=>w.indexOf(b.phx_ref)<0),u(m,p,g),p.metas.length===0&&delete n[m]}),n}static list(n,r){return r||(r=function(l,u){return u}),this.map(n,(l,u)=>r(l,u))}static map(n,r){return Object.getOwnPropertyNames(n).map(l=>r(l,n[l]))}static clone(n){return JSON.parse(JSON.stringify(n))}},bo={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(i,n){if(i.payload.constructor===ArrayBuffer)return n(this.binaryEncode(i));{let r=[i.join_ref,i.ref,i.topic,i.event,i.payload];return n(JSON.stringify(r))}},decode(i,n){if(i.constructor===ArrayBuffer)return n(this.binaryDecode(i));{let[r,l,u,d,h]=JSON.parse(i);return n({join_ref:r,ref:l,topic:u,event:d,payload:h})}},binaryEncode(i){let{join_ref:n,ref:r,event:l,topic:u,payload:d}=i,h=this.META_LENGTH+n.length+r.length+u.length+l.length,m=new ArrayBuffer(this.HEADER_LENGTH+h),g=new DataView(m),p=0;g.setUint8(p++,this.KINDS.push),g.setUint8(p++,n.length),g.setUint8(p++,r.length),g.setUint8(p++,u.length),g.setUint8(p++,l.length),Array.from(n,b=>g.setUint8(p++,b.charCodeAt(0))),Array.from(r,b=>g.setUint8(p++,b.charCodeAt(0))),Array.from(u,b=>g.setUint8(p++,b.charCodeAt(0))),Array.from(l,b=>g.setUint8(p++,b.charCodeAt(0)));var w=new Uint8Array(m.byteLength+d.byteLength);return w.set(new Uint8Array(m),0),w.set(new Uint8Array(d),m.byteLength),w.buffer},binaryDecode(i){let n=new DataView(i),r=n.getUint8(0),l=new TextDecoder;switch(r){case this.KINDS.push:return this.decodePush(i,n,l);case this.KINDS.reply:return this.decodeReply(i,n,l);case this.KINDS.broadcast:return this.decodeBroadcast(i,n,l)}},decodePush(i,n,r){let l=n.getUint8(1),u=n.getUint8(2),d=n.getUint8(3),h=this.HEADER_LENGTH+this.META_LENGTH-1,m=r.decode(i.slice(h,h+l));h=h+l;let g=r.decode(i.slice(h,h+u));h=h+u;let p=r.decode(i.slice(h,h+d));h=h+d;let w=i.slice(h,i.byteLength);return{join_ref:m,ref:null,topic:g,event:p,payload:w}},decodeReply(i,n,r){let l=n.getUint8(1),u=n.getUint8(2),d=n.getUint8(3),h=n.getUint8(4),m=this.HEADER_LENGTH+this.META_LENGTH,g=r.decode(i.slice(m,m+l));m=m+l;let p=r.decode(i.slice(m,m+u));m=m+u;let w=r.decode(i.slice(m,m+d));m=m+d;let b=r.decode(i.slice(m,m+h));m=m+h;let k=i.slice(m,i.byteLength),S={status:b,response:k};return{join_ref:g,ref:p,topic:w,event:ra.reply,payload:S}},decodeBroadcast(i,n,r){let l=n.getUint8(1),u=n.getUint8(2),d=this.HEADER_LENGTH+2,h=r.decode(i.slice(d,d+l));d=d+l;let m=r.decode(i.slice(d,d+u));d=d+u;let g=i.slice(d,i.byteLength);return{join_ref:null,ref:null,topic:h,event:m,payload:g}}},Cb=class{constructor(i,n={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=n.timeout||_b,this.transport=n.transport||Rn.WebSocket||ar,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=n.longPollFallbackMs,this.fallbackTimer=null;let r=null;try{r=Rn&&Rn.sessionStorage}catch{}this.sessionStore=n.sessionStorage||r,this.establishedConnections=0,this.defaultEncoder=bo.encode.bind(bo),this.defaultDecoder=bo.decode.bind(bo),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=n.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==ar?(this.encode=n.encode||this.defaultEncoder,this.decode=n.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let l=null;fr&&fr.addEventListener&&(fr.addEventListener("pagehide",u=>{this.conn&&(this.disconnect(),l=this.connectClock)}),fr.addEventListener("pageshow",u=>{l===this.connectClock&&(l=null,this.connect())}),fr.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=n.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=n.autoSendHeartbeat??!0,this.heartbeatCallback=n.heartbeatCallback??(()=>{}),this.rejoinAfterMs=u=>n.rejoinAfterMs?n.rejoinAfterMs(u):[1e3,2e3,5e3][u-1]||1e4,this.reconnectAfterMs=u=>n.reconnectAfterMs?n.reconnectAfterMs(u):[10,50,100,150,200,250,500,1e3,2e3][u-1]||5e3,this.logger=n.logger||null,!this.logger&&n.debug&&(this.logger=(u,d,h)=>{console.log(`${u}: ${d}`,h)}),this.longpollerTimeout=n.longpollerTimeout||2e4,this.params=Ds(n.params||{}),this.endPoint=`${i}/${kd.websocket}`,this.vsn=n.vsn||Sb,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new xp(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{n.beforeReconnect&&await n.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=n.authToken}getLongPollTransport(){return ar}replaceTransport(i){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=i}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let i=Oo.appendParams(Oo.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return i.charAt(0)!=="/"?i:i.charAt(1)==="/"?`${this.protocol()}:${i}`:`${this.protocol()}://${location.host}${i}`}disconnect(i,n,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,i&&i()},n,r)}connect(i){i&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=Ds(i)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==ar?this.connectWithFallback(ar,this.longPollFallbackMs):this.transportConnect())}log(i,n,r){this.logger&&this.logger(i,n,r)}hasLogger(){return this.logger!==null}onOpen(i){let n=this.makeRef();return this.stateChangeCallbacks.open.push([n,i]),n}onClose(i){let n=this.makeRef();return this.stateChangeCallbacks.close.push([n,i]),n}onError(i){let n=this.makeRef();return this.stateChangeCallbacks.error.push([n,i]),n}onMessage(i){let n=this.makeRef();return this.stateChangeCallbacks.message.push([n,i]),n}onHeartbeat(i){this.heartbeatCallback=i}ping(i){if(!this.isConnected())return!1;let n=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:n});let l=this.onMessage(u=>{u.ref===n&&(this.off([l]),i(Date.now()-r))});return!0}transportName(i){return i===ar?"LongPoll":i.name}transportConnect(){this.connectClock++,this.closeWasClean=!1;let i;this.authToken&&(i=["phoenix",`${Ed}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),i),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=n=>this.onConnError(n),this.conn.onmessage=n=>this.onConnMessage(n),this.conn.onclose=n=>this.onConnClose(n)}getSession(i){return this.sessionStore&&this.sessionStore.getItem(i)}storeSession(i,n){this.sessionStore&&this.sessionStore.setItem(i,n)}connectWithFallback(i,n=2500){clearTimeout(this.fallbackTimer);let r=!1,l=!0,u,d,h=this.transportName(i),m=g=>{this.log("transport",`falling back to ${h}...`,g),this.off([u,d]),l=!1,this.replaceTransport(i),this.transportConnect()};if(this.getSession(`phx:fallback:${h}`))return m("memorized");this.fallbackTimer=setTimeout(m,n),d=this.onError(g=>{this.log("transport","error",g),l&&!r&&(clearTimeout(this.fallbackTimer),m(g))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(r=!0,!l){let g=this.transportName(i);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${g}`,"true"),this.log("transport",`established ${g} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(m,n),this.ping(g=>{this.log("transport","connected to primary after",g),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(i){this.log("error","error in heartbeat callback",i)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),Tb,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(i,n,r){if(!this.conn)return i&&i();const l=this.conn;this.waitForBufferDone(l,()=>{n?l.close(n,r||""):l.close(),this.waitForSocketClosed(l,()=>{this.conn===l&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),i&&i()})})}waitForBufferDone(i,n,r=1){if(r===5||!i.bufferedAmount){n();return}setTimeout(()=>{this.waitForBufferDone(i,n,r+1)},150*r)}waitForSocketClosed(i,n,r=1){if(r===5||i.readyState===jn.closed){n();return}setTimeout(()=>{this.waitForSocketClosed(i,n,r+1)},150*r)}onConnClose(i){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",i),this.triggerChanError(i),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",i)}onConnError(i){this.hasLogger()&&this.log("transport","error",i);let n=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",i,n,r),(n===this.transport||r>0)&&this.triggerChanError(i)}triggerChanError(i){this.channels.forEach(n=>{n.isErrored()||n.isLeaving()||n.isClosed()||n.trigger(ra.error,i)})}connectionState(){switch(this.conn&&this.conn.readyState){case jn.connecting:return"connecting";case jn.open:return"open";case jn.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(i){this.off(i.stateChangeRefs),this.channels=this.channels.filter(n=>n!==i)}off(i){for(let n in this.stateChangeCallbacks)this.stateChangeCallbacks[n]=this.stateChangeCallbacks[n].filter(([r])=>i.indexOf(r)===-1)}channel(i,n={}){let r=new Eb(i,n,this);return this.channels.push(r),r}push(i){if(this.hasLogger()){let{topic:n,event:r,payload:l,ref:u,join_ref:d}=i;this.log("push",`${n} ${r} (${d}, ${u})`,l)}this.isConnected()?this.encode(i,n=>this.conn.send(n)):this.sendBuffer.push(()=>this.encode(i,n=>this.conn.send(n)))}makeRef(){let i=this.ref+1;return i===this.ref?this.ref=0:this.ref=i,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(i){this.log("error","error in heartbeat callback",i)}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(i){this.log("error","error in heartbeat callback",i)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(i=>i()),this.sendBuffer=[])}onConnMessage(i){this.decode(i.data,n=>{let{topic:r,event:l,payload:u,ref:d,join_ref:h}=n;if(d&&d===this.pendingHeartbeatRef){const m=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(u.status==="ok"?"ok":"error",m)}catch(g){this.log("error","error in heartbeat callback",g)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${u.status||""} ${r} ${l} ${d&&"("+d+")"||""}`.trim(),u);for(let m=0;m<this.channels.length;m++){const g=this.channels[m];g.isMember(r,l,u,h)&&g.trigger(l,u,d,h)}this.triggerStateCallbacks("message",n)})}triggerStateCallbacks(i,...n){try{this.stateChangeCallbacks[i].forEach(([r,l])=>{try{l(...n)}catch(u){this.log("error",`error in ${i} callback`,u)}})}catch(r){this.log("error",`error triggering ${i} callbacks`,r)}}leaveOpenTopic(i){let n=this.channels.find(r=>r.topic===i&&(r.isJoined()||r.isJoining()));n&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${i}"`),n.leave())}};class Us{constructor(n,r){const l=Rb(r);this.presence=new xb(n.getChannel(),l),this.presence.onJoin((u,d,h)=>{const m=Us.onJoinPayload(u,d,h);n.getChannel().trigger("presence",m)}),this.presence.onLeave((u,d,h)=>{const m=Us.onLeavePayload(u,d,h);n.getChannel().trigger("presence",m)}),this.presence.onSync(()=>{n.getChannel().trigger("presence",{event:"sync"})})}get state(){return Us.transformState(this.presence.state)}static transformState(n){return n=Ob(n),Object.getOwnPropertyNames(n).reduce((r,l)=>{const u=n[l];return r[l]=Ao(u),r},{})}static onJoinPayload(n,r,l){const u=Bg(r),d=Ao(l);return{event:"join",key:n,currentPresences:u,newPresences:d}}static onLeavePayload(n,r,l){const u=Bg(r),d=Ao(l);return{event:"leave",key:n,currentPresences:u,leftPresences:d}}}function Ao(i){return i.metas.map(n=>(n.presence_ref=n.phx_ref,delete n.phx_ref,delete n.phx_ref_prev,n))}function Ob(i){return JSON.parse(JSON.stringify(i))}function Rb(i){return i?.events&&{events:i.events}}function Bg(i){return i?.metas?Ao(i):[]}var Hg;(function(i){i.SYNC="sync",i.JOIN="join",i.LEAVE="leave"})(Hg||(Hg={}));class jb{get state(){return this.presenceAdapter.state}constructor(n,r){this.channel=n,this.presenceAdapter=new Us(this.channel.channelAdapter,r)}}function Nb(i){if(i instanceof Error)return i;if(typeof i=="string")return new Error(i);if(i&&typeof i=="object"){const n=i;if(typeof n.code=="number"){const r=typeof n.reason=="string"&&n.reason?` (${n.reason})`:"";return new Error(`socket closed: ${n.code}${r}`,{cause:i})}return new Error("channel error: transport failure",{cause:i})}return new Error("channel error: connection lost")}class Lb{constructor(n,r,l){const u=Db(l);this.channel=n.getSocket().channel(r,u),this.socket=n}get state(){return this.channel.state}set state(n){this.channel.state=n}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(n,r){return this.channel.on(n,r)}off(n,r){this.channel.off(n,r)}subscribe(n){return this.channel.join(n)}unsubscribe(n){return this.channel.leave(n)}teardown(){this.channel.teardown()}onClose(n){this.channel.onClose(n)}onError(n){return this.channel.onError(n)}push(n,r,l){let u;try{u=this.channel.push(n,r,l)}catch{throw new Error(`tried to push '${n}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>hb){const d=this.channel.pushBuffer.shift();d.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${d.event}`,d.payload())}return u}updateJoinPayload(n){const r=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},r),n)}canPush(){return this.socket.isConnected()&&this.state===Pa.joined}isJoined(){return this.state===Pa.joined}isJoining(){return this.state===Pa.joining}isClosed(){return this.state===Pa.closed}isLeaving(){return this.state===Pa.leaving}updateFilterBindings(n){this.channel.filterBindings=n}updatePayloadTransform(n){this.channel.onMessage=n}getChannel(){return this.channel}}function Db(i){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},i.config)}}const Ub=/[,()"\\]/,Mb=i=>Ub.test(i)||i!==i.trim(),zb=i=>`"${i.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`,qg=i=>{const n=i===null?"null":String(i);return Mb(n)?zb(n):n},Bb=i=>i===null?"null":String(i),Hb=(i,n)=>{if(i==="in"){const r=Array.isArray(n)?n:[n];if(r.length===0)throw new Error("Realtime `in` filter requires at least one value.");return`in.(${Array.from(new Set(r)).map(u=>qg(u)).join(",")})`}return i==="is"?`is.${Bb(n)}`:`${i}.${qg(n)}`};class qb{constructor(){this.filters=[]}add(n,r,l,u=!1){const d=u?"not.":"";return this.filters.push(`${n}=${d}${Hb(r,l)}`),this}eq(n,r){return this.add(n,"eq",r)}neq(n,r){return this.add(n,"neq",r)}gt(n,r){return this.add(n,"gt",r)}gte(n,r){return this.add(n,"gte",r)}lt(n,r){return this.add(n,"lt",r)}lte(n,r){return this.add(n,"lte",r)}in(n,r){return this.add(n,"in",r)}like(n,r){return this.add(n,"like",r)}ilike(n,r){return this.add(n,"ilike",r)}match(n,r){return this.add(n,"match",r)}imatch(n,r){return this.add(n,"imatch",r)}is(n,r){return this.add(n,"is",r)}isDistinct(n,r){return this.add(n,"isdistinct",r)}not(n,r,l){return this.add(n,r,l,!0)}build(){return this.filters.join(",")}toString(){return this.build()}}var $g;(function(i){i.ALL="*",i.INSERT="INSERT",i.UPDATE="UPDATE",i.DELETE="DELETE"})($g||($g={}));var pr;(function(i){i.BROADCAST="broadcast",i.PRESENCE="presence",i.POSTGRES_CHANGES="postgres_changes",i.SYSTEM="system"})(pr||(pr={}));var sa;(function(i){i.SUBSCRIBED="SUBSCRIBED",i.TIMED_OUT="TIMED_OUT",i.CLOSED="CLOSED",i.CHANNEL_ERROR="CHANNEL_ERROR"})(sa||(sa={}));class Ms{get state(){return this.channelAdapter.state}set state(n){this.channelAdapter.state=n}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(n,r={config:{}},l){var u,d;if(this.topic=n,this.params=r,this.socket=l,this.bindings={},this.subTopic=n.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.channelAdapter=new Lb(this.socket.socketAdapter,n,this.params),this.presence=new jb(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=Ap(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((d=(u=this.params.config)===null||u===void 0?void 0:u.broadcast)===null||d===void 0)&&d.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(n,r=this.timeout){var l,u,d;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:h,presence:m,private:g}}=this.params,p=(u=(l=this.bindings.postgres_changes)===null||l===void 0?void 0:l.map(S=>S.filter))!==null&&u!==void 0?u:[],w=!!this.bindings[pr.PRESENCE]&&this.bindings[pr.PRESENCE].length>0||((d=this.params.config.presence)===null||d===void 0?void 0:d.enabled)===!0,b={},k={broadcast:h,presence:Object.assign(Object.assign({},m),{enabled:w}),postgres_changes:p,private:g};this.socket.accessTokenValue&&(b.access_token=this.socket.accessTokenValue),this._onError(S=>{n?.(sa.CHANNEL_ERROR,Nb(S))}),this._onClose(()=>n?.(sa.CLOSED)),this.updateJoinPayload(Object.assign({config:k},b)),this._updateFilterMessage(),this.channelAdapter.subscribe(r).receive("ok",async({postgres_changes:S})=>{if(this.socket._isManualToken()||this.socket.setAuth(),S===void 0){n?.(sa.SUBSCRIBED);return}this._updatePostgresBindings(S,n)}).receive("error",S=>{this.state=Pa.errored;const C=Object.values(S).join(", ")||"error";n?.(sa.CHANNEL_ERROR,new Error(C,{cause:S}))}).receive("timeout",()=>{n?.(sa.TIMED_OUT)})}return this}_updatePostgresBindings(n,r){var l;const u=this.bindings.postgres_changes,d=(l=u?.length)!==null&&l!==void 0?l:0,h=[];for(let m=0;m<d;m++){const g=u[m],{filter:{event:p,schema:w,table:b,filter:k}}=g,S=n&&n[m];if(S&&S.event===p&&Ms.isFilterValueEqual(S.schema,w)&&Ms.isFilterValueEqual(S.table,b)&&Ms.isFilterValueEqual(S.filter,k))h.push(Object.assign(Object.assign({},g),{id:S.id}));else{this.unsubscribe(),this.state=Pa.errored,r?.(sa.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=h,this.state!=Pa.errored&&r&&r(sa.SUBSCRIBED)}presenceState(){return this.presence.state}async track(n,r={}){return await this.send({type:"presence",event:"track",payload:n},r.timeout||this.timeout)}async untrack(n={}){return await this.send({type:"presence",event:"untrack"},n)}on(n,r,l){const u=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),d=n===pr.PRESENCE||n===pr.POSTGRES_CHANGES;if(u&&d)throw this.socket.log("channel",`cannot add \`${n}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${n}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(n,r,l)}async httpSend(n,r,l={}){var u;if(r==null)return Promise.reject(new Error("Payload is required for httpSend()"));const d=r instanceof ArrayBuffer||ArrayBuffer.isView(r),h={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":d?"application/octet-stream":"application/json"};this.socket.accessTokenValue&&(h.Authorization=`Bearer ${this.socket.accessTokenValue}`);const m=new URL(this.broadcastEndpointURL);m.pathname+=`/${encodeURIComponent(this.subTopic)}/events/${encodeURIComponent(n)}`,this.private&&m.searchParams.set("private","true");const g={method:"POST",headers:h,body:d?r:JSON.stringify(r)},p=await this._fetchWithTimeout(m.toString(),g,(u=l.timeout)!==null&&u!==void 0?u:this.timeout);if(p.status===202)return{success:!0};if(p.status===404)return Promise.reject(new 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/realtime-js/migrations/httpsend-server-version.md"));let w=p.statusText;try{const b=await p.json();w=b.error||b.message||w}catch{}return Promise.reject(new Error(w))}async send(n,r={}){var l,u;if(!this.channelAdapter.canPush()&&n.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:d,payload:h}=n,m={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(m.Authorization=`Bearer ${this.socket.accessTokenValue}`);const g={method:"POST",headers:m,body:JSON.stringify({messages:[{topic:this.subTopic,event:d,payload:h,private:this.private}]})};try{const p=await this._fetchWithTimeout(this.broadcastEndpointURL,g,(l=r.timeout)!==null&&l!==void 0?l:this.timeout);return await((u=p.body)===null||u===void 0?void 0:u.cancel()),p.ok?"ok":"error"}catch(p){return p instanceof Error&&p.name==="AbortError"?"timed out":"error"}}else return new Promise(d=>{var h,m,g;const p=this.channelAdapter.push(n.type,n,r.timeout||this.timeout);n.type==="broadcast"&&!(!((g=(m=(h=this.params)===null||h===void 0?void 0:h.config)===null||m===void 0?void 0:m.broadcast)===null||g===void 0)&&g.ack)&&d("ok"),p.receive("ok",()=>d("ok")),p.receive("error",()=>d("error")),p.receive("timeout",()=>d("timed out"))})}updateJoinPayload(n){this.channelAdapter.updateJoinPayload(n)}async unsubscribe(n=this.timeout){return new Promise(r=>{this.channelAdapter.unsubscribe(n).receive("ok",()=>r("ok")).receive("timeout",()=>r("timed out")).receive("error",()=>r("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(n,r,l){const u=new AbortController,d=setTimeout(()=>u.abort(),l),h=await this.socket.fetch(n,Object.assign(Object.assign({},r),{signal:u.signal}));return clearTimeout(d),h}_on(n,r,l){const u=n.toLocaleLowerCase(),d=r?.filter;(d instanceof qb||typeof d=="object"&&d!==null&&typeof d.build=="function")&&(r=Object.assign(Object.assign({},r),{filter:d.build()}));const h=this.channelAdapter.on(n,l),m={type:u,filter:r,callback:l,ref:h};return this.bindings[u]?this.bindings[u].push(m):this.bindings[u]=[m],this._updateFilterMessage(),this}_onClose(n){this.channelAdapter.onClose(n)}_onError(n){this.channelAdapter.onError(n)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((n,r,l)=>{var u,d,h,m,g,p,w;const b=n.event.toLocaleLowerCase();if(this._notThisChannelEvent(b,l))return!1;const k=(u=this.bindings[b])===null||u===void 0?void 0:u.find(S=>S.ref===n.ref);if(!k)return!0;if(["broadcast","presence","postgres_changes"].includes(b))if("id"in k){const S=k.id,C=(d=k.filter)===null||d===void 0?void 0:d.event;return S&&((h=r.ids)===null||h===void 0?void 0:h.includes(S))&&(C==="*"||C?.toLocaleLowerCase()===((m=r.data)===null||m===void 0?void 0:m.type.toLocaleLowerCase()))}else{const S=(p=(g=k?.filter)===null||g===void 0?void 0:g.event)===null||p===void 0?void 0:p.toLocaleLowerCase();return S==="*"||S===((w=r?.event)===null||w===void 0?void 0:w.toLocaleLowerCase())}else return k.type.toLocaleLowerCase()===b})}_notThisChannelEvent(n,r){const{close:l,error:u,leave:d,join:h}=kp;return r&&[l,u,d,h].includes(n)&&r!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((n,r,l)=>{if(typeof r=="object"&&"ids"in r){const u=r.data,{schema:d,table:h,commit_timestamp:m,type:g,errors:p}=u;return Object.assign(Object.assign({},{schema:d,table:h,commit_timestamp:m,eventType:g,new:{},old:{},errors:p}),this._getPayloadRecords(u))}return r})}copyBindings(n){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const r in n.bindings)for(const l of n.bindings[r])this._on(l.type,l.filter,l.callback)}static isFilterValueEqual(n,r){return(n??void 0)===(r??void 0)}_getPayloadRecords(n){const r={new:{},old:{}};return(n.type==="INSERT"||n.type==="UPDATE")&&(r.new=zg(n.columns,n.record)),(n.type==="UPDATE"||n.type==="DELETE")&&(r.old=zg(n.columns,n.old_record)),r}}class $b{constructor(n,r){this.socket=new Cb(n,r)}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(n){this.socket.heartbeatCallback=n}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(n,r,l,u=1e4){return new Promise(d=>{setTimeout(()=>d("timeout"),u),this.socket.disconnect(()=>{n(),d("ok")},r,l)})}push(n){this.socket.push(n)}log(n,r,l){this.socket.log(n,r,l)}makeRef(){return this.socket.makeRef()}onOpen(n){this.socket.onOpen(n)}onClose(n){this.socket.onClose(n)}onError(n){this.socket.onError(n)}onMessage(n){this.socket.onMessage(n)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==_d.connecting}isDisconnecting(){return this.socket.connectionState()==_d.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const Pg={HEARTBEAT_INTERVAL:25e3},Pb=[1e3,2e3,5e3,1e4],Ib=1e4;function Gb(){const i=new Map;return{get length(){return i.size},clear(){i.clear()},getItem(n){return i.has(n)?i.get(n):null},key(n){var r;return(r=Array.from(i.keys())[n])!==null&&r!==void 0?r:null},removeItem(n){i.delete(n)},setItem(n,r){i.set(n,String(r))}}}function Vb(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return Gb()}const Kb=`
16
+ addEventListener("message", (e) => {
17
+ if (e.data.event === "start") {
18
+ setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
19
+ }
20
+ });`;class Yb{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(n,r){var l;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new fb,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=d=>d?(...h)=>d(...h):(...h)=>fetch(...h),!(!((l=r?.params)===null||l===void 0)&&l.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey;const u=this._initializeOptions(r);this.socketAdapter=new $b(n,u),this.httpEndpoint=Ap(n),this.fetch=this._resolveFetch(r?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(n){const r=n.message;throw new Error(`WebSocket not available: ${r}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(n,r){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},n,r)}getChannels(){return this.channels}async removeChannel(n){const r=await n.unsubscribe();return r==="ok"&&n.teardown(),r}async removeAllChannels(){const n=this.channels.map(async l=>{const u=await l.unsubscribe();return l.teardown(),u}),r=await Promise.all(n);return await this.disconnect(),r}log(n,r,l){this.socketAdapter.log(n,r,l)}connectionState(){return this.socketAdapter.connectionState()||_d.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(n,r={config:{}}){const l=`realtime:${n}`,u=this.getChannels().find(d=>d.topic===l);if(u)return u;{const d=new Ms(`realtime:${n}`,r,this);return this._cancelPendingDisconnect(),this.channels.push(d),d}}push(n){this.socketAdapter.push(n)}async setAuth(n=null){this._authPromise=this._performAuth(n);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(n){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(n)}_makeRef(){return this.socketAdapter.makeRef()}_remove(n){this.channels=this.channels.filter(r=>r.topic!==n.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}this._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(n=null){let r,l=!1;if(n)r=n,l=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(u){this.log("error","Error fetching access token from callback",u),r=this.accessTokenValue}else r=this.accessTokenValue;l?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(u=>{const d={access_token:r,version:ob};r&&u.updateJoinPayload(d),u.joinedOnce&&u.channelAdapter.isJoined()&&u.channelAdapter.push(kp.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(n="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${n}`,r)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(r=>{this.log("error","error waiting for auth on connect",r)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(n=>{n.ref&&n.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(n){return(r,l)=>{r=="sent"&&this._setAuthSafely(),n&&n(r,l)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const n=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(n),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(n){let r;if(n)r=n;else{const l=new Blob([Kb],{type:"application/javascript"});r=URL.createObjectURL(l)}return r}_initializeOptions(n){var r,l,u,d,h,m,g,p,w,b,k,S;this.worker=(r=n?.worker)!==null&&r!==void 0?r:!1,this.accessToken=(l=n?.accessToken)!==null&&l!==void 0?l:null;const C={};C.timeout=(u=n?.timeout)!==null&&u!==void 0?u:db,C.heartbeatIntervalMs=(d=n?.heartbeatIntervalMs)!==null&&d!==void 0?d:Pg.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(h=n?.disconnectOnEmptyChannelsAfterMs)!==null&&h!==void 0?h:2*((m=n?.heartbeatIntervalMs)!==null&&m!==void 0?m:Pg.HEARTBEAT_INTERVAL),C.transport=(g=n?.transport)!==null&&g!==void 0?g:sb.getWebSocketConstructor(),C.params=n?.params,C.logger=n?.logger,C.heartbeatCallback=this._wrapHeartbeatCallback(n?.heartbeatCallback),C.sessionStorage=(p=n?.sessionStorage)!==null&&p!==void 0?p:Vb(),C.reconnectAfterMs=(w=n?.reconnectAfterMs)!==null&&w!==void 0?w:(q=>Pb[q-1]||Ib);let D,I;const H=(b=n?.vsn)!==null&&b!==void 0?b:cb;switch(H){case ub:D=(q,P)=>P(JSON.stringify(q)),I=(q,P)=>P(JSON.parse(q));break;case Tp:D=this.serializer.encode.bind(this.serializer),I=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${C.vsn}`)}if(C.vsn=H,C.encode=(k=n?.encode)!==null&&k!==void 0?k:D,C.decode=(S=n?.decode)!==null&&S!==void 0?S:I,C.beforeReconnect=this._reconnectAuth.bind(this),(n?.logLevel||n?.log_level)&&(this.logLevel=n.logLevel||n.log_level,C.params=Object.assign(Object.assign({},C.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=n?.workerUrl,C.autoSendHeartbeat=!this.worker}return C}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var $s=class extends Error{constructor(i,n){super(i),this.name="IcebergError",this.status=n.status,this.icebergType=n.icebergType,this.icebergCode=n.icebergCode,this.details=n.details,this.isCommitStateUnknown=n.icebergType==="CommitStateUnknownException"||[500,502,504].includes(n.status)&&n.icebergType?.includes("CommitState")===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function Jb(i,n,r){const l=new URL(n,i);if(r)for(const[u,d]of Object.entries(r))d!==void 0&&l.searchParams.set(u,d);return l.toString()}async function Xb(i){return!i||i.type==="none"?{}:i.type==="bearer"?{Authorization:`Bearer ${i.token}`}:i.type==="header"?{[i.name]:i.value}:i.type==="custom"?await i.getHeaders():{}}function Qb(i){const n=i.fetchImpl??globalThis.fetch;return{async request({method:r,path:l,query:u,body:d,headers:h}){const m=Jb(i.baseUrl,l,u),g=await Xb(i.auth),p=await n(m,{method:r,headers:{...d?{"Content-Type":"application/json"}:{},...g,...h},body:d?JSON.stringify(d):void 0}),w=await p.text(),b=(p.headers.get("content-type")||"").includes("application/json"),k=b&&w?JSON.parse(w):w;if(!p.ok){const S=b?k:void 0,C=S?.error;throw new $s(C?.message??`Request failed with status ${p.status}`,{status:p.status,icebergType:C?.type,icebergCode:C?.code,details:S})}return{status:p.status,headers:p.headers,data:k}}}}function wo(i){return i.join("")}var Wb=class{constructor(i,n=""){this.client=i,this.prefix=n}async listNamespaces(i){const n=i?{parent:wo(i.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:n})).data.namespaces.map(l=>({namespace:l}))}async createNamespace(i,n){const r={namespace:i.namespace,properties:n?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(i){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${wo(i.namespace)}`})}async loadNamespaceMetadata(i){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${wo(i.namespace)}`})).data.properties}}async namespaceExists(i){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${wo(i.namespace)}`}),!0}catch(n){if(n instanceof $s&&n.status===404)return!1;throw n}}async createNamespaceIfNotExists(i,n){try{return await this.createNamespace(i,n)}catch(r){if(r instanceof $s&&r.status===409)return;throw r}}};function ir(i){return i.join("")}var Zb=class{constructor(i,n="",r){this.client=i,this.prefix=n,this.accessDelegation=r}async listTables(i){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${ir(i.namespace)}/tables`})).data.identifiers}async createTable(i,n){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${ir(i.namespace)}/tables`,body:n,headers:r})).data.metadata}async updateTable(i,n){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${ir(i.namespace)}/tables/${i.name}`,body:n});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(i,n){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${ir(i.namespace)}/tables/${i.name}`,query:{purgeRequested:String(n?.purge??!1)}})}async loadTable(i){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${ir(i.namespace)}/tables/${i.name}`,headers:n})).data.metadata}async tableExists(i){const n={};this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${ir(i.namespace)}/tables/${i.name}`,headers:n}),!0}catch(r){if(r instanceof $s&&r.status===404)return!1;throw r}}async createTableIfNotExists(i,n){try{return await this.createTable(i,n)}catch(r){if(r instanceof $s&&r.status===409)return await this.loadTable({namespace:i.namespace,name:n.name});throw r}}},Fb=class{constructor(i){let n="v1";i.catalogName&&(n+=`/${i.catalogName}`);const r=i.baseUrl.endsWith("/")?i.baseUrl:`${i.baseUrl}/`;this.client=Qb({baseUrl:r,auth:i.auth,fetchImpl:i.fetch}),this.accessDelegation=i.accessDelegation?.join(","),this.namespaceOps=new Wb(this.client,n),this.tableOps=new Zb(this.client,n,this.accessDelegation)}async listNamespaces(i){return this.namespaceOps.listNamespaces(i)}async createNamespace(i,n){return this.namespaceOps.createNamespace(i,n)}async dropNamespace(i){await this.namespaceOps.dropNamespace(i)}async loadNamespaceMetadata(i){return this.namespaceOps.loadNamespaceMetadata(i)}async listTables(i){return this.tableOps.listTables(i)}async createTable(i,n){return this.tableOps.createTable(i,n)}async updateTable(i,n){return this.tableOps.updateTable(i,n)}async dropTable(i,n){await this.tableOps.dropTable(i,n)}async loadTable(i){return this.tableOps.loadTable(i)}async namespaceExists(i){return this.namespaceOps.namespaceExists(i)}async tableExists(i){return this.tableOps.tableExists(i)}async createNamespaceIfNotExists(i,n){return this.namespaceOps.createNamespaceIfNotExists(i,n)}async createTableIfNotExists(i,n){return this.tableOps.createTableIfNotExists(i,n)}};function Ps(i){"@babel/helpers - typeof";return Ps=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Ps(i)}function ew(i,n){if(Ps(i)!="object"||!i)return i;var r=i[Symbol.toPrimitive];if(r!==void 0){var l=r.call(i,n);if(Ps(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(i)}function tw(i){var n=ew(i,"string");return Ps(n)=="symbol"?n:n+""}function nw(i,n,r){return(n=tw(n))in i?Object.defineProperty(i,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):i[n]=r,i}function Ig(i,n){var r=Object.keys(i);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(i);n&&(l=l.filter(function(u){return Object.getOwnPropertyDescriptor(i,u).enumerable})),r.push.apply(r,l)}return r}function le(i){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?Ig(Object(r),!0).forEach(function(l){nw(i,l,r[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(r)):Ig(Object(r)).forEach(function(l){Object.defineProperty(i,l,Object.getOwnPropertyDescriptor(r,l))})}return i}var Bo=class extends Error{constructor(i,n="storage",r,l){super(i),this.__isStorageError=!0,this.namespace=n,this.name=n==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=l}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function Ho(i){return typeof i=="object"&&i!==null&&"__isStorageError"in i}var Ad=class extends Bo{constructor(i,n,r,l="storage"){super(i,l,n,r),this.name=l==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=n,this.statusCode=r}toJSON(){return le({},super.toJSON())}},Cp=class extends Bo{constructor(i,n,r="storage"){super(i,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=n}};function Ro(i,n,r){const l=le({},i),u=n.toLowerCase();for(const d of Object.keys(l))d.toLowerCase()===u&&delete l[d];return l[u]=r,l}function aw(i){const n={};for(const[r,l]of Object.entries(i))n[r.toLowerCase()]=l;return n}const iw=i=>i?(...n)=>i(...n):(...n)=>fetch(...n),rw=i=>{if(typeof i!="object"||i===null)return!1;const n=Object.getPrototypeOf(i);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in i)&&!(Symbol.iterator in i)},xd=i=>{if(Array.isArray(i))return i.map(r=>xd(r));if(typeof i=="function"||i!==Object(i))return i;const n={};return Object.entries(i).forEach(([r,l])=>{const u=r.replace(/([-_][a-z])/gi,d=>d.toUpperCase().replace(/[-_]/g,""));n[u]=xd(l)}),n},sw=i=>!i||typeof i!="string"||i.length===0||i.length>100||i.trim()!==i||i.includes("/")||i.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(i),Gg=i=>{if(typeof i=="object"&&i!==null){const n=i;if(typeof n.msg=="string")return n.msg;if(typeof n.message=="string")return n.message;if(typeof n.error_description=="string")return n.error_description;if(typeof n.error=="string")return n.error;if(typeof n.error=="object"&&n.error!==null){const r=n.error;if(typeof r.message=="string")return r.message}}return JSON.stringify(i)},lw=async(i,n,r,l)=>{if(i!==null&&typeof i=="object"&&"json"in i&&typeof i.json=="function"){const u=i;let d=parseInt(String(u.status),10);Number.isFinite(d)||(d=500),u.json().then(h=>{const m=h?.statusCode||h?.code||d+"";n(new Ad(Gg(h),d,m,l))}).catch(()=>{const h=d+"";n(new Ad(u.statusText||`HTTP ${d} error`,d,h,l))})}else n(new Cp(Gg(i),i,l))},ow=(i,n,r,l)=>{const u={method:i,headers:n?.headers||{}};if(i==="GET"||i==="HEAD"||!l)return le(le({},u),r);if(rw(l)){var d;const h=n?.headers||{};let m;for(const[g,p]of Object.entries(h))g.toLowerCase()==="content-type"&&(m=p);u.headers=Ro(h,"Content-Type",(d=m)!==null&&d!==void 0?d:"application/json"),u.body=JSON.stringify(l)}else u.body=l;return n?.duplex&&(u.duplex=n.duplex),le(le({},u),r)};async function xs(i,n,r,l,u,d,h){return new Promise((m,g)=>{i(r,ow(n,l,u,d)).then(p=>{if(!p.ok)throw p;if(l?.noResolveJson)return p;if(h==="vectors"){const w=p.headers.get("content-type");if(p.headers.get("content-length")==="0"||p.status===204)return{};if(!w||!w.includes("application/json"))return{}}return p.json()}).then(p=>m(p)).catch(p=>lw(p,g,l,h))})}function Op(i="storage"){return{get:async(n,r,l,u)=>xs(n,"GET",r,l,u,void 0,i),post:async(n,r,l,u,d)=>xs(n,"POST",r,u,d,l,i),put:async(n,r,l,u,d)=>xs(n,"PUT",r,u,d,l,i),head:async(n,r,l,u)=>xs(n,"HEAD",r,le(le({},l),{},{noResolveJson:!0}),u,void 0,i),remove:async(n,r,l,u,d)=>xs(n,"DELETE",r,u,d,l,i)}}const uw=Op("storage"),{get:Is,post:_n,put:Cd,head:cw,remove:Gs}=uw,Zt=Op("vectors");var wr=class{constructor(i,n={},r,l="storage"){this.shouldThrowOnError=!1,this.url=i,this.headers=aw(n),this.fetch=iw(r),this.namespace=l}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(i,n){return this.headers=Ro(this.headers,i,n),this}async handleOperation(i){var n=this;try{return{data:await i(),error:null}}catch(r){if(n.shouldThrowOnError)throw r;if(Ho(r))return{data:null,error:r};throw r}}};let Rp;Rp=Symbol.toStringTag;var dw=class{constructor(i,n){this.downloadFn=i,this.shouldThrowOnError=n,this[Rp]="StreamDownloadBuilder",this.promise=null}then(i,n){return this.getPromise().then(i,n)}catch(i){return this.getPromise().catch(i)}finally(i){return this.getPromise().finally(i)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var i=this;try{return{data:(await i.downloadFn()).body,error:null}}catch(n){if(i.shouldThrowOnError)throw n;if(Ho(n))return{data:null,error:n};throw n}}};let jp;jp=Symbol.toStringTag;var hw=class{constructor(i,n){this.downloadFn=i,this.shouldThrowOnError=n,this[jp]="BlobDownloadBuilder",this.promise=null}asStream(){return new dw(this.downloadFn,this.shouldThrowOnError)}then(i,n){return this.getPromise().then(i,n)}catch(i){return this.getPromise().catch(i)}finally(i){return this.getPromise().finally(i)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var i=this;try{return{data:await(await i.downloadFn()).blob(),error:null}}catch(n){if(i.shouldThrowOnError)throw n;if(Ho(n))return{data:null,error:n};throw n}}};const ld={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Vg={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var fw=class extends wr{constructor(i,n={},r,l){super(i,n,l,"storage"),this.bucketId=r}async uploadOrUpdate(i,n,r,l){var u=this;return u.handleOperation(async()=>{let d;const h=le(le({},Vg),l);let m=le(le({},u.headers),i==="POST"&&{"x-upsert":String(h.upsert)});const g=h.metadata;if(typeof Blob<"u"&&r instanceof Blob?(d=new FormData,d.append("cacheControl",h.cacheControl),g&&d.append("metadata",u.encodeMetadata(g)),d.append("",r)):typeof FormData<"u"&&r instanceof FormData?(d=r,d.has("cacheControl")||d.append("cacheControl",h.cacheControl),g&&!d.has("metadata")&&d.append("metadata",u.encodeMetadata(g))):(d=r,m["cache-control"]=`max-age=${h.cacheControl}`,m["content-type"]=h.contentType,g&&(m["x-metadata"]=u.toBase64(u.encodeMetadata(g))),(typeof ReadableStream<"u"&&d instanceof ReadableStream||d&&typeof d=="object"&&"pipe"in d&&typeof d.pipe=="function")&&!h.duplex&&(h.duplex="half")),l?.headers)for(const[k,S]of Object.entries(l.headers))m=Ro(m,k,S);const p=u._removeEmptyFolders(n),w=u._getFinalPath(p),b=await(i=="PUT"?Cd:_n)(u.fetch,`${u.url}/object/${w}`,d,le({headers:m},h?.duplex?{duplex:h.duplex}:{}));return{path:p,id:b.Id,fullPath:b.Key}})}async upload(i,n,r){return this.uploadOrUpdate("POST",i,n,r)}async uploadToSignedUrl(i,n,r,l){var u=this;const d=u._removeEmptyFolders(i),h=u._getFinalPath(d),m=new URL(u.url+`/object/upload/sign/${h}`);return m.searchParams.set("token",n),u.handleOperation(async()=>{let g;const p=le(le({},Vg),l);let w=le(le({},u.headers),{"x-upsert":String(p.upsert)});const b=p.metadata;if(typeof Blob<"u"&&r instanceof Blob?(g=new FormData,g.append("cacheControl",p.cacheControl),b&&g.append("metadata",u.encodeMetadata(b)),g.append("",r)):typeof FormData<"u"&&r instanceof FormData?(g=r,g.has("cacheControl")||g.append("cacheControl",p.cacheControl),b&&!g.has("metadata")&&g.append("metadata",u.encodeMetadata(b))):(g=r,w["cache-control"]=`max-age=${p.cacheControl}`,w["content-type"]=p.contentType,b&&(w["x-metadata"]=u.toBase64(u.encodeMetadata(b))),(typeof ReadableStream<"u"&&g instanceof ReadableStream||g&&typeof g=="object"&&"pipe"in g&&typeof g.pipe=="function")&&!p.duplex&&(p.duplex="half")),l?.headers)for(const[k,S]of Object.entries(l.headers))w=Ro(w,k,S);return{path:d,fullPath:(await Cd(u.fetch,m.toString(),g,le({headers:w},p?.duplex?{duplex:p.duplex}:{}))).Key}})}async createSignedUploadUrl(i,n){var r=this;return r.handleOperation(async()=>{let l=r._getFinalPath(i);const u=le({},r.headers);n?.upsert&&(u["x-upsert"]="true");const d=await _n(r.fetch,`${r.url}/object/upload/sign/${l}`,{},{headers:u}),h=new URL(r.url+d.url),m=h.searchParams.get("token");if(!m)throw new Bo("No token returned by API");return{signedUrl:h.toString(),path:i,token:m}})}async update(i,n,r){return this.uploadOrUpdate("PUT",i,n,r)}async move(i,n,r){var l=this;return l.handleOperation(async()=>await _n(l.fetch,`${l.url}/object/move`,{bucketId:l.bucketId,sourceKey:i,destinationKey:n,destinationBucket:r?.destinationBucket},{headers:l.headers}))}async copy(i,n,r){var l=this;return l.handleOperation(async()=>({path:(await _n(l.fetch,`${l.url}/object/copy`,{bucketId:l.bucketId,sourceKey:i,destinationKey:n,destinationBucket:r?.destinationBucket},{headers:l.headers})).Key}))}async createSignedUrl(i,n,r){var l=this;return l.handleOperation(async()=>{let u=l._getFinalPath(i);const d=typeof r?.transform=="object"&&r.transform!==null&&Object.keys(r.transform).length>0;let h=await _n(l.fetch,`${l.url}/object/sign/${u}`,le({expiresIn:n},d?{transform:r.transform}:{}),{headers:l.headers});const m=new URLSearchParams;r?.download&&m.set("download",r.download===!0?"":r.download),r?.cacheNonce!=null&&m.set("cacheNonce",String(r.cacheNonce));const g=m.toString();return{signedUrl:encodeURI(`${l.url}${h.signedURL}${g?`&${g}`:""}`)}})}async createSignedUrls(i,n,r){var l=this;return l.handleOperation(async()=>{const u=await _n(l.fetch,`${l.url}/object/sign/${l.bucketId}`,{expiresIn:n,paths:i},{headers:l.headers}),d=new URLSearchParams;r?.download&&d.set("download",r.download===!0?"":r.download),r?.cacheNonce!=null&&d.set("cacheNonce",String(r.cacheNonce));const h=d.toString();return u.map(m=>le(le({},m),{},{signedUrl:m.signedURL?encodeURI(`${l.url}${m.signedURL}${h?`&${h}`:""}`):null}))})}download(i,n,r){const l=typeof n?.transform=="object"&&n.transform!==null&&Object.keys(n.transform).length>0?"render/image/authenticated":"object",u=new URLSearchParams;n?.transform&&this.applyTransformOptsToQuery(u,n.transform),n?.cacheNonce!=null&&u.set("cacheNonce",String(n.cacheNonce));const d=u.toString(),h=this._getFinalPath(i),m=()=>Is(this.fetch,`${this.url}/${l}/${h}${d?`?${d}`:""}`,{headers:this.headers,noResolveJson:!0},r);return new hw(m,this.shouldThrowOnError)}async info(i){var n=this;const r=n._getFinalPath(i);return n.handleOperation(async()=>xd(await Is(n.fetch,`${n.url}/object/info/${r}`,{headers:n.headers})))}async exists(i){var n=this;const r=n._getFinalPath(i);try{return await cw(n.fetch,`${n.url}/object/${r}`,{headers:n.headers}),{data:!0,error:null}}catch(u){if(n.shouldThrowOnError)throw u;if(Ho(u)){var l;const d=u instanceof Ad?u.status:u instanceof Cp?(l=u.originalError)===null||l===void 0?void 0:l.status:void 0;if(d!==void 0&&[400,404].includes(d))return{data:!1,error:u}}throw u}}getPublicUrl(i,n){const r=this._getFinalPath(i),l=new URLSearchParams;n?.download&&l.set("download",n.download===!0?"":n.download),n?.transform&&this.applyTransformOptsToQuery(l,n.transform),n?.cacheNonce!=null&&l.set("cacheNonce",String(n.cacheNonce));const u=l.toString(),d=typeof n?.transform=="object"&&n.transform!==null&&Object.keys(n.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${d}/public/${r}`)+(u?`?${u}`:"")}}}async remove(i){var n=this;return n.handleOperation(async()=>await Gs(n.fetch,`${n.url}/object/${n.bucketId}`,{prefixes:i},{headers:n.headers}))}async purgeCache(i,n,r){var l=this;return l.handleOperation(async()=>{const u=l._getFinalPath(i),d=new URLSearchParams;n?.transformations&&d.set("transformations","true");const h=d.toString();return await Gs(l.fetch,`${l.url}/cdn/${u}${h?`?${h}`:""}`,{},{headers:l.headers},r)})}async list(i,n,r){var l=this;return l.handleOperation(async()=>{const u=n?.sortBy?le(le({},ld.sortBy),n.sortBy):ld.sortBy,d=le(le(le({},ld),n),{},{sortBy:u,prefix:i||""});return await _n(l.fetch,`${l.url}/object/list/${l.bucketId}`,d,{headers:l.headers},r)})}async listV2(i,n){var r=this;return r.handleOperation(async()=>{const l=le({},i);return await _n(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,l,{headers:r.headers},n)})}encodeMetadata(i){return JSON.stringify(i)}toBase64(i){return typeof Buffer<"u"?Buffer.from(i).toString("base64"):btoa(i)}_getFinalPath(i){return`${this.bucketId}/${i.replace(/^\/+/,"")}`}_removeEmptyFolders(i){return i.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(i,n){return n.width&&i.set("width",n.width.toString()),n.height&&i.set("height",n.height.toString()),n.resize&&i.set("resize",n.resize),n.format&&i.set("format",n.format),n.quality&&i.set("quality",n.quality.toString()),i}};const mw="2.110.0",Js={"X-Client-Info":`storage-js/${mw}`};var gw=class extends wr{constructor(i,n={},r,l){const u=new URL(i);l?.useNewHostname&&/supabase\.(co|in|red)$/.test(u.hostname)&&!u.hostname.includes("storage.supabase.")&&(u.hostname=u.hostname.replace("supabase.","storage.supabase."));const d=u.href.replace(/\/$/,""),h=le(le({},Js),n);super(d,h,r,"storage")}async listBuckets(i){var n=this;return n.handleOperation(async()=>{const r=n.listBucketOptionsToQueryString(i);return await Is(n.fetch,`${n.url}/bucket${r}`,{headers:n.headers})})}async getBucket(i){var n=this;return n.handleOperation(async()=>await Is(n.fetch,`${n.url}/bucket/${i}`,{headers:n.headers}))}async createBucket(i,n={public:!1}){var r=this;return r.handleOperation(async()=>await _n(r.fetch,`${r.url}/bucket`,{id:i,name:i,type:n.type,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:r.headers}))}async updateBucket(i,n){var r=this;return r.handleOperation(async()=>await Cd(r.fetch,`${r.url}/bucket/${i}`,{id:i,name:i,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(i){var n=this;return n.handleOperation(async()=>await _n(n.fetch,`${n.url}/bucket/${i}/empty`,{},{headers:n.headers}))}async deleteBucket(i){var n=this;return n.handleOperation(async()=>await Gs(n.fetch,`${n.url}/bucket/${i}`,{},{headers:n.headers}))}async purgeBucketCache(i,n,r){var l=this;return l.handleOperation(async()=>{const u=new URLSearchParams;n?.transformations&&u.set("transformations","true");const d=u.toString();return await Gs(l.fetch,`${l.url}/cdn/${i}${d?`?${d}`:""}`,{},{headers:l.headers},r)})}listBucketOptionsToQueryString(i){const n={};return i&&("limit"in i&&(n.limit=String(i.limit)),"offset"in i&&(n.offset=String(i.offset)),i.search&&(n.search=i.search),i.sortColumn&&(n.sortColumn=i.sortColumn),i.sortOrder&&(n.sortOrder=i.sortOrder)),Object.keys(n).length>0?"?"+new URLSearchParams(n).toString():""}},pw=class extends wr{constructor(i,n={},r){const l=i.replace(/\/$/,""),u=le(le({},Js),n);super(l,u,r,"storage")}async createBucket(i){var n=this;return n.handleOperation(async()=>await _n(n.fetch,`${n.url}/bucket`,{name:i},{headers:n.headers}))}async listBuckets(i){var n=this;return n.handleOperation(async()=>{const r=new URLSearchParams;i?.limit!==void 0&&r.set("limit",i.limit.toString()),i?.offset!==void 0&&r.set("offset",i.offset.toString()),i?.sortColumn&&r.set("sortColumn",i.sortColumn),i?.sortOrder&&r.set("sortOrder",i.sortOrder),i?.search&&r.set("search",i.search);const l=r.toString(),u=l?`${n.url}/bucket?${l}`:`${n.url}/bucket`;return await Is(n.fetch,u,{headers:n.headers})})}async deleteBucket(i){var n=this;return n.handleOperation(async()=>await Gs(n.fetch,`${n.url}/bucket/${i}`,{},{headers:n.headers}))}from(i){var n=this;if(!sw(i))throw new Bo("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const r=new Fb({baseUrl:this.url,catalogName:i,auth:{type:"custom",getHeaders:async()=>n.headers},fetch:this.fetch}),l=this.shouldThrowOnError;return new Proxy(r,{get(u,d){const h=u[d];return typeof h!="function"?h:async(...m)=>{try{return{data:await h.apply(u,m),error:null}}catch(g){if(l)throw g;return{data:null,error:g}}}}})}},yw=class extends wr{constructor(i,n={},r){const l=i.replace(/\/$/,""),u=le(le({},Js),{},{"Content-Type":"application/json"},n);super(l,u,r,"vectors")}async createIndex(i){var n=this;return n.handleOperation(async()=>await Zt.post(n.fetch,`${n.url}/CreateIndex`,i,{headers:n.headers})||{})}async getIndex(i,n){var r=this;return r.handleOperation(async()=>await Zt.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:i,indexName:n},{headers:r.headers}))}async listIndexes(i){var n=this;return n.handleOperation(async()=>await Zt.post(n.fetch,`${n.url}/ListIndexes`,i,{headers:n.headers}))}async deleteIndex(i,n){var r=this;return r.handleOperation(async()=>await Zt.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:i,indexName:n},{headers:r.headers})||{})}},vw=class extends wr{constructor(i,n={},r){const l=i.replace(/\/$/,""),u=le(le({},Js),{},{"Content-Type":"application/json"},n);super(l,u,r,"vectors")}async putVectors(i){var n=this;if(i.vectors.length<1||i.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return n.handleOperation(async()=>await Zt.post(n.fetch,`${n.url}/PutVectors`,i,{headers:n.headers})||{})}async getVectors(i){var n=this;return n.handleOperation(async()=>await Zt.post(n.fetch,`${n.url}/GetVectors`,i,{headers:n.headers}))}async listVectors(i){var n=this;if(i.segmentCount!==void 0){if(i.segmentCount<1||i.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(i.segmentIndex!==void 0&&(i.segmentIndex<0||i.segmentIndex>=i.segmentCount))throw new Error(`segmentIndex must be between 0 and ${i.segmentCount-1}`)}return n.handleOperation(async()=>await Zt.post(n.fetch,`${n.url}/ListVectors`,i,{headers:n.headers}))}async queryVectors(i){var n=this;return n.handleOperation(async()=>await Zt.post(n.fetch,`${n.url}/QueryVectors`,i,{headers:n.headers}))}async deleteVectors(i){var n=this;if(i.keys.length<1||i.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return n.handleOperation(async()=>await Zt.post(n.fetch,`${n.url}/DeleteVectors`,i,{headers:n.headers})||{})}},bw=class extends wr{constructor(i,n={},r){const l=i.replace(/\/$/,""),u=le(le({},Js),{},{"Content-Type":"application/json"},n);super(l,u,r,"vectors")}async createBucket(i){var n=this;return n.handleOperation(async()=>await Zt.post(n.fetch,`${n.url}/CreateVectorBucket`,{vectorBucketName:i},{headers:n.headers})||{})}async getBucket(i){var n=this;return n.handleOperation(async()=>await Zt.post(n.fetch,`${n.url}/GetVectorBucket`,{vectorBucketName:i},{headers:n.headers}))}async listBuckets(i={}){var n=this;return n.handleOperation(async()=>await Zt.post(n.fetch,`${n.url}/ListVectorBuckets`,i,{headers:n.headers}))}async deleteBucket(i){var n=this;return n.handleOperation(async()=>await Zt.post(n.fetch,`${n.url}/DeleteVectorBucket`,{vectorBucketName:i},{headers:n.headers})||{})}},ww=class extends bw{constructor(i,n={}){super(i,n.headers||{},n.fetch)}from(i){return new Sw(this.url,this.headers,i,this.fetch)}async createBucket(i){var n=()=>super.createBucket,r=this;return n().call(r,i)}async getBucket(i){var n=()=>super.getBucket,r=this;return n().call(r,i)}async listBuckets(i={}){var n=()=>super.listBuckets,r=this;return n().call(r,i)}async deleteBucket(i){var n=()=>super.deleteBucket,r=this;return n().call(r,i)}},Sw=class extends yw{constructor(i,n,r,l){super(i,n,l),this.vectorBucketName=r}async createIndex(i){var n=()=>super.createIndex,r=this;return n().call(r,le(le({},i),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(i={}){var n=()=>super.listIndexes,r=this;return n().call(r,le(le({},i),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(i){var n=()=>super.getIndex,r=this;return n().call(r,r.vectorBucketName,i)}async deleteIndex(i){var n=()=>super.deleteIndex,r=this;return n().call(r,r.vectorBucketName,i)}index(i){return new _w(this.url,this.headers,this.vectorBucketName,i,this.fetch)}},_w=class extends vw{constructor(i,n,r,l,u){super(i,n,u),this.vectorBucketName=r,this.indexName=l}async putVectors(i){var n=()=>super.putVectors,r=this;return n().call(r,le(le({},i),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(i){var n=()=>super.getVectors,r=this;return n().call(r,le(le({},i),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(i={}){var n=()=>super.listVectors,r=this;return n().call(r,le(le({},i),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(i){var n=()=>super.queryVectors,r=this;return n().call(r,le(le({},i),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(i){var n=()=>super.deleteVectors,r=this;return n().call(r,le(le({},i),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},Tw=class extends gw{constructor(i,n={},r,l){super(i,n,r,l)}from(i){return new fw(this.url,this.headers,i,this.fetch)}get vectors(){return new ww(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new pw(this.url+"/iceberg",this.headers,this.fetch)}};const Np="2.110.0",la=30*1e3,Ns=3,od=Ns*la,kw=2*la,Ew="http://localhost:9999",Aw="supabase.auth.token",xw={"X-Client-Info":`gotrue-js/${Np}`},Od="X-Supabase-Api-Version",Lp={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},Cw=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,Ow=600*1e3;class Vs extends Error{constructor(n,r,l){super(n),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=l}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function X(i){return typeof i=="object"&&i!==null&&"__isAuthError"in i}class Rw extends Vs{constructor(n,r,l){super(n,r,l),this.name="AuthApiError",this.status=r,this.code=l}}function jw(i){return X(i)&&i.name==="AuthApiError"}class Tn extends Vs{constructor(n,r){super(n),this.name="AuthUnknownError",this.originalError=r}}class Dn extends Vs{constructor(n,r,l,u){super(n,l,u),this.name=r,this.status=l}}class St extends Dn{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function So(i){return X(i)&&i.name==="AuthSessionMissingError"}class rr extends Dn{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class _o extends Dn{constructor(n){super(n,"AuthInvalidCredentialsError",400,void 0)}}class To extends Dn{constructor(n,r=null){super(n,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function Nw(i){return X(i)&&i.name==="AuthImplicitGrantRedirectError"}class Kg extends Dn{constructor(n,r=null){super(n,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class Lw extends Dn{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class Rd extends Dn{constructor(n,r){super(n,"AuthRetryableFetchError",r,void 0)}}function Yg(i){return X(i)&&i.name==="AuthRetryableFetchError"}class Jg extends Dn{constructor(n="Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)"){super(n,"AuthRefreshDiscardedError",409,void 0)}}function Dw(i){return X(i)&&i.name==="AuthRefreshDiscardedError"}class Xg extends Dn{constructor(n,r,l){super(n,"AuthWeakPasswordError",r,"weak_password"),this.reasons=l}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class jo extends Dn{constructor(n){super(n,"AuthInvalidJwtError",400,"invalid_jwt")}}const No="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Qg=`
21
+ \r=`.split(""),Uw=(()=>{const i=new Array(128);for(let n=0;n<i.length;n+=1)i[n]=-1;for(let n=0;n<Qg.length;n+=1)i[Qg[n].charCodeAt(0)]=-2;for(let n=0;n<No.length;n+=1)i[No[n].charCodeAt(0)]=n;return i})();function Wg(i,n,r){if(i!==null)for(n.queue=n.queue<<8|i,n.queuedBits+=8;n.queuedBits>=6;){const l=n.queue>>n.queuedBits-6&63;r(No[l]),n.queuedBits-=6}else if(n.queuedBits>0)for(n.queue=n.queue<<6-n.queuedBits,n.queuedBits=6;n.queuedBits>=6;){const l=n.queue>>n.queuedBits-6&63;r(No[l]),n.queuedBits-=6}}function Dp(i,n,r){const l=Uw[i];if(l>-1)for(n.queue=n.queue<<6|l,n.queuedBits+=6;n.queuedBits>=8;)r(n.queue>>n.queuedBits-8&255),n.queuedBits-=8;else{if(l===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(i)}"`)}}function Zg(i){const n=[],r=h=>{n.push(String.fromCodePoint(h))},l={utf8seq:0,codepoint:0},u={queue:0,queuedBits:0},d=h=>{Bw(h,l,r)};for(let h=0;h<i.length;h+=1)Dp(i.charCodeAt(h),u,d);return n.join("")}function Mw(i,n){if(i<=127){n(i);return}else if(i<=2047){n(192|i>>6),n(128|i&63);return}else if(i<=65535){n(224|i>>12),n(128|i>>6&63),n(128|i&63);return}else if(i<=1114111){n(240|i>>18),n(128|i>>12&63),n(128|i>>6&63),n(128|i&63);return}throw new Error(`Unrecognized Unicode codepoint: ${i.toString(16)}`)}function zw(i,n){for(let r=0;r<i.length;r+=1){let l=i.charCodeAt(r);if(l>55295&&l<=56319){const u=(l-55296)*1024&65535;l=(i.charCodeAt(r+1)-56320&65535|u)+65536,r+=1}Mw(l,n)}}function Bw(i,n,r){if(n.utf8seq===0){if(i<=127){r(i);return}for(let l=1;l<6;l+=1)if((i>>7-l&1)===0){n.utf8seq=l;break}if(n.utf8seq===2)n.codepoint=i&31;else if(n.utf8seq===3)n.codepoint=i&15;else if(n.utf8seq===4)n.codepoint=i&7;else throw new Error("Invalid UTF-8 sequence");n.utf8seq-=1}else if(n.utf8seq>0){if(i<=127)throw new Error("Invalid UTF-8 sequence");n.codepoint=n.codepoint<<6|i&63,n.utf8seq-=1,n.utf8seq===0&&r(n.codepoint)}}function vr(i){const n=[],r={queue:0,queuedBits:0},l=u=>{n.push(u)};for(let u=0;u<i.length;u+=1)Dp(i.charCodeAt(u),r,l);return new Uint8Array(n)}function Hw(i){const n=[];return zw(i,r=>n.push(r)),new Uint8Array(n)}function pi(i){const n=[],r={queue:0,queuedBits:0},l=u=>{n.push(u)};return i.forEach(u=>Wg(u,r,l)),Wg(null,r,l),n.join("")}function qw(i){return Math.round(Date.now()/1e3)+i}function $w(){return Symbol("auth-callback")}const Rt=()=>typeof window<"u"&&typeof document<"u",fi={tested:!1,writable:!1},Up=()=>{if(!Rt())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(fi.tested)return fi.writable;const i=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(i,i),globalThis.localStorage.removeItem(i),fi.tested=!0,fi.writable=!0}catch{fi.tested=!0,fi.writable=!1}return fi.writable};function Pw(i){const n={},r=new URL(i);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((u,d)=>{n[d]=u})}catch{}return r.searchParams.forEach((l,u)=>{n[u]=l}),n}const Mp=i=>i?(...n)=>i(...n):(...n)=>fetch(...n),Iw=i=>typeof i=="object"&&i!==null&&"status"in i&&"ok"in i&&"json"in i&&typeof i.json=="function",mr=async(i,n,r)=>{await i.setItem(n,JSON.stringify(r))},bn=async(i,n)=>{const r=await i.getItem(n);if(!r)return null;try{return JSON.parse(r)}catch{return null}},nt=async(i,n)=>{await i.removeItem(n)};class qo{constructor(){this.promise=new qo.promiseConstructor((n,r)=>{this.resolve=n,this.reject=r})}}qo.promiseConstructor=Promise;function ko(i){const n=i.split(".");if(n.length!==3)throw new jo("Invalid JWT structure");for(let l=0;l<n.length;l++)if(!Cw.test(n[l]))throw new jo("JWT not in base64url format");return{header:JSON.parse(Zg(n[0])),payload:JSON.parse(Zg(n[1])),signature:vr(n[2]),raw:{header:n[0],payload:n[1]}}}async function Gw(i){return await new Promise(n=>{setTimeout(()=>n(null),i)})}function Vw(i,n){return new Promise((l,u)=>{(async()=>{for(let d=0;d<1/0;d++)try{const h=await i(d);if(!n(d,null,h)){l(h);return}}catch(h){if(!n(d,h)){u(h);return}}})()})}function Kw(i){return("0"+i.toString(16)).substr(-2)}function Yw(){const n=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",l=r.length;let u="";for(let d=0;d<56;d++)u+=r.charAt(Math.floor(Math.random()*l));return u}return crypto.getRandomValues(n),Array.from(n,Kw).join("")}async function Jw(i){const r=new TextEncoder().encode(i),l=await crypto.subtle.digest("SHA-256",r),u=new Uint8Array(l);return Array.from(u).map(d=>String.fromCharCode(d)).join("")}async function Xw(i){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),i;const r=await Jw(i);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function mi(i,n,r=!1){const l=Yw();let u=l;r&&(u+="/recovery"),await mr(i,`${n}-code-verifier`,u);const d=await Xw(l);return[d,l===d?"plain":"s256"]}const Qw=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function Ww(i){const n=i.headers.get(Od);if(!n||!n.match(Qw))return null;try{return new Date(`${n}T00:00:00.0Z`)}catch{return null}}function Zw(i){if(!i)throw new Error("Missing exp claim");const n=Math.floor(Date.now()/1e3);if(i<=n)throw new Error("JWT has expired")}function Fw(i){switch(i){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const eS=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function aa(i){if(!eS.test(i))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function wn(i){if(!i.passkey)throw new 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 ud(){const i={};return new Proxy(i,{get:(n,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const l=r.toString();if(l==="Symbol(Symbol.toPrimitive)"||l==="Symbol(Symbol.toStringTag)"||l==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(n,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(n,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function tS(i,n){return new Proxy(i,{get:(r,l,u)=>{if(l==="__isInsecureUserWarningProxy")return!0;if(typeof l=="symbol"){const d=l.toString();if(d==="Symbol(Symbol.toPrimitive)"||d==="Symbol(Symbol.toStringTag)"||d==="Symbol(util.inspect.custom)"||d==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,l,u)}return!n.value&&typeof l=="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."),n.value=!0),Reflect.get(r,l,u)}})}function Fg(i){return JSON.parse(JSON.stringify(i))}const gi=i=>{if(typeof i=="object"&&i!==null){const n=i;if(typeof n.msg=="string")return n.msg;if(typeof n.message=="string")return n.message;if(typeof n.error_description=="string")return n.error_description;if(typeof n.error=="string")return n.error}return JSON.stringify(i)},nS=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function ep(i){var n;if(!Iw(i))throw new Rd(gi(i),0);if(nS.includes(i.status))throw new Rd(gi(i),i.status);let r;try{r=await i.json()}catch(d){throw new Tn(gi(d),d)}let l;const u=Ww(i);if(u&&u.getTime()>=Lp["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?l=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(l=r.error_code),l){if(l==="weak_password")throw new Xg(gi(r),i.status,((n=r.weak_password)===null||n===void 0?void 0:n.reasons)||[]);if(l==="session_not_found")throw new St}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((d,h)=>d&&typeof h=="string",!0))throw new Xg(gi(r),i.status,r.weak_password.reasons);throw new Rw(gi(r),i.status||500,l)}const aS=(i,n,r,l)=>{const u={method:i,headers:n?.headers||{}};return i==="GET"?u:(u.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},n?.headers),u.body=JSON.stringify(l),Object.assign(Object.assign({},u),r))};async function F(i,n,r,l){var u;const d=Object.assign({},l?.headers);d[Od]||(d[Od]=Lp["2024-01-01"].name),l?.jwt&&(d.Authorization=`Bearer ${l.jwt}`);const h=(u=l?.query)!==null&&u!==void 0?u:{};l?.redirectTo&&(h.redirect_to=l.redirectTo);const m=Object.keys(h).length?"?"+new URLSearchParams(h).toString():"",g=await iS(i,n,r+m,{headers:d,noResolveJson:l?.noResolveJson},{},l?.body);return l?.xform?l?.xform(g):{data:Object.assign({},g),error:null}}async function iS(i,n,r,l,u,d){const h=aS(n,l,u,d);let m;try{m=await i(r,Object.assign({},h))}catch(g){throw console.error(g),new Rd(gi(g),0)}if(m.ok||await ep(m),l?.noResolveJson)return m;try{return await m.json()}catch(g){await ep(g)}}function cn(i){var n;let r=null;lS(i)&&(r=Object.assign({},i),i.expires_at||(r.expires_at=qw(i.expires_in)));const l=(n=i.user)!==null&&n!==void 0?n:typeof i?.id=="string"?i:null;return{data:{session:r,user:l},error:null}}function tp(i){const n=cn(i);return!n.error&&i.weak_password&&typeof i.weak_password=="object"&&Array.isArray(i.weak_password.reasons)&&i.weak_password.reasons.length&&i.weak_password.message&&typeof i.weak_password.message=="string"&&i.weak_password.reasons.reduce((r,l)=>r&&typeof l=="string",!0)&&(n.data.weak_password=i.weak_password),n}function Ia(i){var n;return{data:{user:(n=i.user)!==null&&n!==void 0?n:i},error:null}}function rS(i){return{data:i,error:null}}function sS(i){const{action_link:n,email_otp:r,hashed_token:l,redirect_to:u,verification_type:d}=i,h=zo(i,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),m={action_link:n,email_otp:r,hashed_token:l,redirect_to:u,verification_type:d},g=Object.assign({},h);return{data:{properties:m,user:g},error:null}}function np(i){return i}function lS(i){return!!i.access_token&&!!i.refresh_token&&!!i.expires_in}const cd=["global","local","others"];class oS{constructor({url:n="",headers:r={},fetch:l,experimental:u}){this.url=n,this.headers=r,this.fetch=Mp(l),this.experimental=u??{},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)}}async signOut(n,r=cd[0]){if(cd.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${cd.join(", ")}`);try{return await F(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:n,noResolveJson:!0}),{data:null,error:null}}catch(l){if(X(l))return{data:null,error:l};throw l}}async inviteUserByEmail(n,r={}){try{return await F(this.fetch,"POST",`${this.url}/invite`,{body:{email:n,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:Ia})}catch(l){if(X(l))return{data:{user:null},error:l};throw l}}async generateLink(n){try{const{options:r}=n,l=zo(n,["options"]),u=Object.assign(Object.assign({},l),r);return"newEmail"in l&&(u.new_email=l?.newEmail,delete u.newEmail),await F(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:u,headers:this.headers,xform:sS,redirectTo:r?.redirectTo})}catch(r){if(X(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(n){try{return await F(this.fetch,"POST",`${this.url}/admin/users`,{body:n,headers:this.headers,xform:Ia})}catch(r){if(X(r))return{data:{user:null},error:r};throw r}}async listUsers(n){var r,l,u,d,h,m,g;try{const p={nextPage:null,lastPage:0,total:0},w=await F(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(l=(r=n?.page)===null||r===void 0?void 0:r.toString())!==null&&l!==void 0?l:"",per_page:(d=(u=n?.perPage)===null||u===void 0?void 0:u.toString())!==null&&d!==void 0?d:""},xform:np});if(w.error)throw w.error;const b=await w.json(),k=(h=w.headers.get("x-total-count"))!==null&&h!==void 0?h:0,S=(g=(m=w.headers.get("link"))===null||m===void 0?void 0:m.split(","))!==null&&g!==void 0?g:[];return S.length>0&&(S.forEach(C=>{const D=parseInt(C.split(";")[0].split("=")[1].substring(0,1)),I=JSON.parse(C.split(";")[1].split("=")[1]);p[`${I}Page`]=D}),p.total=parseInt(k)),{data:Object.assign(Object.assign({},b),p),error:null}}catch(p){if(X(p))return{data:{users:[]},error:p};throw p}}async getUserById(n){aa(n);try{return await F(this.fetch,"GET",`${this.url}/admin/users/${n}`,{headers:this.headers,xform:Ia})}catch(r){if(X(r))return{data:{user:null},error:r};throw r}}async updateUserById(n,r){aa(n);try{return await F(this.fetch,"PUT",`${this.url}/admin/users/${n}`,{body:r,headers:this.headers,xform:Ia})}catch(l){if(X(l))return{data:{user:null},error:l};throw l}}async deleteUser(n,r=!1){aa(n);try{return await F(this.fetch,"DELETE",`${this.url}/admin/users/${n}`,{headers:this.headers,body:{should_soft_delete:r},xform:Ia})}catch(l){if(X(l))return{data:{user:null},error:l};throw l}}async _listFactors(n){aa(n.userId);try{const{data:r,error:l}=await F(this.fetch,"GET",`${this.url}/admin/users/${n.userId}/factors`,{headers:this.headers,xform:u=>({data:{factors:u},error:null})});return{data:r,error:l}}catch(r){if(X(r))return{data:null,error:r};throw r}}async _deleteFactor(n){aa(n.userId),aa(n.id);try{return{data:await F(this.fetch,"DELETE",`${this.url}/admin/users/${n.userId}/factors/${n.id}`,{headers:this.headers}),error:null}}catch(r){if(X(r))return{data:null,error:r};throw r}}async _listOAuthClients(n){var r,l,u,d,h,m,g;try{const p={nextPage:null,lastPage:0,total:0},w=await F(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(l=(r=n?.page)===null||r===void 0?void 0:r.toString())!==null&&l!==void 0?l:"",per_page:(d=(u=n?.perPage)===null||u===void 0?void 0:u.toString())!==null&&d!==void 0?d:""},xform:np});if(w.error)throw w.error;const b=await w.json(),k=(h=w.headers.get("x-total-count"))!==null&&h!==void 0?h:0,S=(g=(m=w.headers.get("link"))===null||m===void 0?void 0:m.split(","))!==null&&g!==void 0?g:[];return S.length>0&&(S.forEach(C=>{const D=parseInt(C.split(";")[0].split("=")[1].substring(0,1)),I=JSON.parse(C.split(";")[1].split("=")[1]);p[`${I}Page`]=D}),p.total=parseInt(k)),{data:Object.assign(Object.assign({},b),p),error:null}}catch(p){if(X(p))return{data:{clients:[]},error:p};throw p}}async _createOAuthClient(n){try{return await F(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(X(r))return{data:null,error:r};throw r}}async _getOAuthClient(n){try{return await F(this.fetch,"GET",`${this.url}/admin/oauth/clients/${n}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(X(r))return{data:null,error:r};throw r}}async _updateOAuthClient(n,r){try{return await F(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${n}`,{body:r,headers:this.headers,xform:l=>({data:l,error:null})})}catch(l){if(X(l))return{data:null,error:l};throw l}}async _deleteOAuthClient(n){try{return await F(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${n}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(X(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(n){try{return await F(this.fetch,"POST",`${this.url}/admin/oauth/clients/${n}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(X(r))return{data:null,error:r};throw r}}async _listCustomProviders(n){try{const r={};return n?.type&&(r.type=n.type),await F(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:r,xform:l=>{var u;return{data:{providers:(u=l?.providers)!==null&&u!==void 0?u:[]},error:null}}})}catch(r){if(X(r))return{data:{providers:[]},error:r};throw r}}async _createCustomProvider(n){try{return await F(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(X(r))return{data:null,error:r};throw r}}async _getCustomProvider(n){try{return await F(this.fetch,"GET",`${this.url}/admin/custom-providers/${n}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(X(r))return{data:null,error:r};throw r}}async _updateCustomProvider(n,r){try{return await F(this.fetch,"PUT",`${this.url}/admin/custom-providers/${n}`,{body:r,headers:this.headers,xform:l=>({data:l,error:null})})}catch(l){if(X(l))return{data:null,error:l};throw l}}async _deleteCustomProvider(n){try{return await F(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${n}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(X(r))return{data:null,error:r};throw r}}async _adminListPasskeys(n){wn(this.experimental),aa(n.userId);try{return await F(this.fetch,"GET",`${this.url}/admin/users/${n.userId}/passkeys`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(X(r))return{data:null,error:r};throw r}}async _adminDeletePasskey(n){wn(this.experimental),aa(n.userId),aa(n.passkeyId);try{return await F(this.fetch,"DELETE",`${this.url}/admin/users/${n.userId}/passkeys/${n.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(X(r))return{data:null,error:r};throw r}}}function ap(i={}){return{getItem:n=>i[n]||null,setItem:(n,r)=>{i[n]=r},removeItem:n=>{delete i[n]}}}globalThis&&Up()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug");class uS extends Error{constructor(n){super(n),this.isAcquireTimeout=!0}}function cS(){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 zp(i){if(!/^0x[a-fA-F0-9]{40}$/.test(i))throw new Error(`@supabase/auth-js: Address "${i}" is invalid.`);return i.toLowerCase()}function dS(i){return parseInt(i,16)}function hS(i){const n=new TextEncoder().encode(i);return"0x"+Array.from(n,l=>l.toString(16).padStart(2,"0")).join("")}function fS(i){var n;const{chainId:r,domain:l,expirationTime:u,issuedAt:d=new Date,nonce:h,notBefore:m,requestId:g,resources:p,scheme:w,uri:b,version:k}=i;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!l)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(h&&h.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${h}`);if(!b)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(k!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${k}`);if(!((n=i.statement)===null||n===void 0)&&n.includes(`
22
+ `))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${i.statement}`)}const S=zp(i.address),C=w?`${w}://${l}`:l,D=i.statement?`${i.statement}
23
+ `:"",I=`${C} wants you to sign in with your Ethereum account:
24
+ ${S}
25
+
26
+ ${D}`;let H=`URI: ${b}
27
+ Version: ${k}
28
+ Chain ID: ${r}${h?`
29
+ Nonce: ${h}`:""}
30
+ Issued At: ${d.toISOString()}`;if(u&&(H+=`
31
+ Expiration Time: ${u.toISOString()}`),m&&(H+=`
32
+ Not Before: ${m.toISOString()}`),g&&(H+=`
33
+ Request ID: ${g}`),p){let q=`
34
+ Resources:`;for(const P of p){if(!P||typeof P!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${P}`);q+=`
35
+ - ${P}`}H+=q}return`${I}
36
+ ${H}`}class mt extends Error{constructor({message:n,code:r,cause:l,name:u}){var d;super(n,{cause:l}),this.__isWebAuthnError=!0,this.name=(d=u??(l instanceof Error?l.name:void 0))!==null&&d!==void 0?d:"Unknown Error",this.code=r}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class Lo extends mt{constructor(n,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:n}),this.name="WebAuthnUnknownError",this.originalError=r}}function mS({error:i,options:n}){var r,l,u;const{publicKey:d}=n;if(!d)throw Error("options was missing required publicKey property");if(i.name==="AbortError"){if(n.signal instanceof AbortSignal)return new mt({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:i})}else if(i.name==="ConstraintError"){if(((r=d.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new mt({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:i});if(n.mediation==="conditional"&&((l=d.authenticatorSelection)===null||l===void 0?void 0:l.userVerification)==="required")return new mt({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:i});if(((u=d.authenticatorSelection)===null||u===void 0?void 0:u.userVerification)==="required")return new mt({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:i})}else{if(i.name==="InvalidStateError")return new mt({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:i});if(i.name==="NotAllowedError")return new mt({message:i.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:i});if(i.name==="NotSupportedError")return d.pubKeyCredParams.filter(m=>m.type==="public-key").length===0?new mt({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:i}):new mt({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:i});if(i.name==="SecurityError"){const h=window.location.hostname;if(Bp(h)){if(d.rp.id!==h)return new mt({message:`The RP ID "${d.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:i})}else return new mt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:i})}else if(i.name==="TypeError"){if(d.user.id.byteLength<1||d.user.id.byteLength>64)return new mt({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:i})}else if(i.name==="UnknownError")return new mt({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:i})}return new mt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:i})}function gS({error:i,options:n}){const{publicKey:r}=n;if(!r)throw Error("options was missing required publicKey property");if(i.name==="AbortError"){if(n.signal instanceof AbortSignal)return new mt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:i})}else{if(i.name==="NotAllowedError")return new mt({message:i.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:i});if(i.name==="SecurityError"){const l=window.location.hostname;if(Bp(l)){if(r.rpId!==l)return new mt({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:i})}else return new mt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:i})}else if(i.name==="UnknownError")return new mt({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:i})}return new mt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:i})}class pS{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const n=new AbortController;return this.controller=n,n.signal}cancelCeremony(){if(this.controller){const n=new Error("Manually cancelling existing WebAuthn API call");n.name="AbortError",this.controller.abort(n),this.controller=void 0}}}const jd=new pS;function ip(i){if(!i)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(i);const{challenge:n,user:r,excludeCredentials:l}=i,u=zo(i,["challenge","user","excludeCredentials"]),d=vr(n).buffer,h=Object.assign(Object.assign({},r),{id:vr(r.id).buffer}),m=Object.assign(Object.assign({},u),{challenge:d,user:h});if(l&&l.length>0){m.excludeCredentials=new Array(l.length);for(let g=0;g<l.length;g++){const p=l[g];m.excludeCredentials[g]=Object.assign(Object.assign({},p),{id:vr(p.id).buffer,type:p.type||"public-key",transports:p.transports})}}return m}function rp(i){if(!i)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(i);const{challenge:n,allowCredentials:r}=i,l=zo(i,["challenge","allowCredentials"]),u=vr(n).buffer,d=Object.assign(Object.assign({},l),{challenge:u});if(r&&r.length>0){d.allowCredentials=new Array(r.length);for(let h=0;h<r.length;h++){const m=r[h];d.allowCredentials[h]=Object.assign(Object.assign({},m),{id:vr(m.id).buffer,type:m.type||"public-key",transports:m.transports})}}return d}function sp(i){var n;if("toJSON"in i&&typeof i.toJSON=="function")return i.toJSON();const r=i;return{id:i.id,rawId:i.id,response:{attestationObject:pi(new Uint8Array(i.response.attestationObject)),clientDataJSON:pi(new Uint8Array(i.response.clientDataJSON))},type:"public-key",clientExtensionResults:i.getClientExtensionResults(),authenticatorAttachment:(n=r.authenticatorAttachment)!==null&&n!==void 0?n:void 0}}function lp(i){var n;if("toJSON"in i&&typeof i.toJSON=="function")return i.toJSON();const r=i,l=i.getClientExtensionResults(),u=i.response;return{id:i.id,rawId:i.id,response:{authenticatorData:pi(new Uint8Array(u.authenticatorData)),clientDataJSON:pi(new Uint8Array(u.clientDataJSON)),signature:pi(new Uint8Array(u.signature)),userHandle:u.userHandle?pi(new Uint8Array(u.userHandle)):void 0},type:"public-key",clientExtensionResults:l,authenticatorAttachment:(n=r.authenticatorAttachment)!==null&&n!==void 0?n:void 0}}function Bp(i){return i==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(i)}function Do(){var i,n;return!!(Rt()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((i=navigator?.credentials)===null||i===void 0?void 0:i.create)=="function"&&typeof((n=navigator?.credentials)===null||n===void 0?void 0:n.get)=="function")}async function Hp(i){try{const n=await navigator.credentials.create(i);return n?n instanceof PublicKeyCredential?{data:n,error:null}:{data:null,error:new Lo("Browser returned unexpected credential type",n)}:{data:null,error:new Lo("Empty credential response",n)}}catch(n){return{data:null,error:mS({error:n,options:i})}}}async function qp(i){try{const n=await navigator.credentials.get(i);return n?n instanceof PublicKeyCredential?{data:n,error:null}:{data:null,error:new Lo("Browser returned unexpected credential type",n)}:{data:null,error:new Lo("Empty credential response",n)}}catch(n){return{data:null,error:gS({error:n,options:i})}}}const yS={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},vS={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Uo(...i){const n=u=>u!==null&&typeof u=="object"&&!Array.isArray(u),r=u=>u instanceof ArrayBuffer||ArrayBuffer.isView(u),l={};for(const u of i)if(u)for(const d in u){const h=u[d];if(h!==void 0)if(Array.isArray(h))l[d]=h;else if(r(h))l[d]=h;else if(n(h)){const m=l[d];n(m)?l[d]=Uo(m,h):l[d]=Uo(h)}else l[d]=h}return l}function bS(i,n){return Uo(yS,i,n||{})}function wS(i,n){return Uo(vS,i,n||{})}class SS{constructor(n){this.client=n,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(n){return this.client.mfa.enroll(Object.assign(Object.assign({},n),{factorType:"webauthn"}))}async _challenge({factorId:n,webauthn:r,friendlyName:l,signal:u},d){var h;try{const{data:m,error:g}=await this.client.mfa.challenge({factorId:n,webauthn:r});if(!m)return{data:null,error:g};const p=u??jd.createNewAbortSignal();if(m.webauthn.type==="create"){const{user:w}=m.webauthn.credential_options.publicKey;if(!w.name){const b=l;if(b)w.name=`${w.id}:${b}`;else{const S=(await this.client.getUser()).data.user,C=((h=S?.user_metadata)===null||h===void 0?void 0:h.name)||S?.email||S?.id||"User";w.name=`${w.id}:${C}`}}w.displayName||(w.displayName=w.name)}switch(m.webauthn.type){case"create":{const w=bS(m.webauthn.credential_options.publicKey,d?.create),{data:b,error:k}=await Hp({publicKey:w,signal:p});return b?{data:{factorId:n,challengeId:m.id,webauthn:{type:m.webauthn.type,credential_response:b}},error:null}:{data:null,error:k}}case"request":{const w=wS(m.webauthn.credential_options.publicKey,d?.request),{data:b,error:k}=await qp(Object.assign(Object.assign({},m.webauthn.credential_options),{publicKey:w,signal:p}));return b?{data:{factorId:n,challengeId:m.id,webauthn:{type:m.webauthn.type,credential_response:b}},error:null}:{data:null,error:k}}}}catch(m){return X(m)?{data:null,error:m}:{data:null,error:new Tn("Unexpected error in challenge",m)}}}async _verify({challengeId:n,factorId:r,webauthn:l}){return this.client.mfa.verify({factorId:r,challengeId:n,webauthn:l})}async _authenticate({factorId:n,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:l=typeof window<"u"?[window.location.origin]:void 0,signal:u}={}},d){if(!r)return{data:null,error:new Vs("rpId is required for WebAuthn authentication")};try{if(!Do())return{data:null,error:new Tn("Browser does not support WebAuthn",null)};const{data:h,error:m}=await this.challenge({factorId:n,webauthn:{rpId:r,rpOrigins:l},signal:u},{request:d});if(!h)return{data:null,error:m};const{webauthn:g}=h;return this._verify({factorId:n,challengeId:h.challengeId,webauthn:{type:g.type,rpId:r,rpOrigins:l,credential_response:g.credential_response}})}catch(h){return X(h)?{data:null,error:h}:{data:null,error:new Tn("Unexpected error in authenticate",h)}}}async _register({friendlyName:n,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:l=typeof window<"u"?[window.location.origin]:void 0,signal:u}={}},d){if(!r)return{data:null,error:new Vs("rpId is required for WebAuthn registration")};try{if(!Do())return{data:null,error:new Tn("Browser does not support WebAuthn",null)};const{data:h,error:m}=await this._enroll({friendlyName:n});if(!h)return await this.client.mfa.listFactors().then(w=>{var b;return(b=w.data)===null||b===void 0?void 0:b.all.find(k=>k.factor_type==="webauthn"&&k.friendly_name===n&&k.status!=="unverified")}).then(w=>w?this.client.mfa.unenroll({factorId:w?.id}):void 0),{data:null,error:m};const{data:g,error:p}=await this._challenge({factorId:h.id,friendlyName:h.friendly_name,webauthn:{rpId:r,rpOrigins:l},signal:u},{create:d});return g?this._verify({factorId:h.id,challengeId:g.challengeId,webauthn:{rpId:r,rpOrigins:l,type:g.webauthn.type,credential_response:g.webauthn.credential_response}}):{data:null,error:p}}catch(h){return X(h)?{data:null,error:h}:{data:null,error:new Tn("Unexpected error in register",h)}}}}cS();const _S={url:Ew,storageKey:Aw,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:xw,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},sr={};class Ks{get jwks(){var n,r;return(r=(n=sr[this.storageKey])===null||n===void 0?void 0:n.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(n){sr[this.storageKey]=Object.assign(Object.assign({},sr[this.storageKey]),{jwks:n})}get jwks_cached_at(){var n,r;return(r=(n=sr[this.storageKey])===null||n===void 0?void 0:n.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(n){sr[this.storageKey]=Object.assign(Object.assign({},sr[this.storageKey]),{cachedAt:n})}constructor(n){var r,l,u;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.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lock=null,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const d=Object.assign(Object.assign({},_S),n);if(this.storageKey=d.storageKey,this.instanceID=(r=Ks.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,Ks.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!d.debug,typeof d.debug=="function"&&(this.logger=d.debug),this.instanceID>0&&Rt()){const h=`${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(h),this.logDebugMessages&&console.trace(h)}if(this.persistSession=d.persistSession,this.autoRefreshToken=d.autoRefreshToken,this.experimental=(l=d.experimental)!==null&&l!==void 0?l:{},this.admin=new oS({url:d.url,headers:d.headers,fetch:d.fetch,experimental:this.experimental}),this.url=d.url,this.headers=d.headers,this.fetch=Mp(d.fetch),this.detectSessionInUrl=d.detectSessionInUrl,this.flowType=d.flowType,this.hasCustomAuthorizationHeader=d.hasCustomAuthorizationHeader,this.throwOnError=d.throwOnError,this.lockAcquireTimeout=d.lockAcquireTimeout,d.lock!=null&&(this.lock=d.lock),this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new SS(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.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?(d.storage?this.storage=d.storage:Up()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=ap(this.memoryStorage)),d.userStorage&&(this.userStorage=d.userStorage)):(this.memoryStorage={},this.storage=ap(this.memoryStorage)),Rt()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(h){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",h)}(u=this.broadcastChannel)===null||u===void 0||u.addEventListener("message",async h=>{this._debug("received broadcast notification from other tab or client",h),(h.data.event==="TOKEN_REFRESHED"||h.data.event==="SIGNED_IN")&&(this.lastRefreshFailure=null);try{await this._notifyAllSubscribers(h.data.event,h.data.session,!1)}catch(m){this._debug("#broadcastChannel","error",m)}})}d.skipAutoInitialize||this.initialize().catch(h=>{this._debug("#initialize()","error",h)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(n){if(this.throwOnError&&n&&n.error)throw n.error;return n}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${Np}) ${new Date().toISOString()}`}_debug(...n){return this.logDebugMessages&&this.logger(this._logPrefix(),...n),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()):await this._initialize())(),await this.initializePromise)}async _initialize(){var n;try{let r={},l="none";if(Rt()&&(r=Pw(window.location.href),this._isImplicitGrantCallback(r)?l="implicit":await this._isPKCECallback(r)&&(l="pkce")),Rt()&&this.detectSessionInUrl&&l!=="none"){const{data:u,error:d}=await this._getSessionFromURL(r,l);if(d){if(this._debug("#_initialize()","error detecting session from URL",d),Nw(d)){const g=(n=d.details)===null||n===void 0?void 0:n.code;if(g==="identity_already_exists"||g==="identity_not_found"||g==="single_identity_not_deletable")return{error:d}}return{error:d}}const{session:h,redirectType:m}=u;return this._debug("#_initialize()","detected session in URL",h,"redirect type",m),await this._saveSession(h),setTimeout(async()=>{m==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",h):await this._notifyAllSubscribers("SIGNED_IN",h)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return X(r)?this._returnResult({error:r}):this._returnResult({error:new Tn("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(n){var r,l,u;try{const d=await F(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(l=(r=n?.options)===null||r===void 0?void 0:r.data)!==null&&l!==void 0?l:{},gotrue_meta_security:{captcha_token:(u=n?.options)===null||u===void 0?void 0:u.captchaToken}},xform:cn}),{data:h,error:m}=d;if(m||!h)return this._returnResult({data:{user:null,session:null},error:m});const g=h.session,p=h.user;return h.session&&(await this._saveSession(h.session),await this._notifyAllSubscribers("SIGNED_IN",g)),this._returnResult({data:{user:p,session:g},error:null})}catch(d){if(X(d))return this._returnResult({data:{user:null,session:null},error:d});throw d}}async signUp(n){var r,l,u;try{let d;if("email"in n){const{email:w,password:b,options:k}=n;let S=null,C=null;this.flowType==="pkce"&&([S,C]=await mi(this.storage,this.storageKey)),d=await F(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:k?.emailRedirectTo,body:{email:w,password:b,data:(r=k?.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:k?.captchaToken},code_challenge:S,code_challenge_method:C},xform:cn})}else if("phone"in n){const{phone:w,password:b,options:k}=n;d=await F(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:w,password:b,data:(l=k?.data)!==null&&l!==void 0?l:{},channel:(u=k?.channel)!==null&&u!==void 0?u:"sms",gotrue_meta_security:{captcha_token:k?.captchaToken}},xform:cn})}else throw new _o("You must provide either an email or phone number and a password");const{data:h,error:m}=d;if(m||!h)return await nt(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:m});const g=h.session,p=h.user;return h.session&&(await this._saveSession(h.session),await this._notifyAllSubscribers("SIGNED_IN",g)),this._returnResult({data:{user:p,session:g},error:null})}catch(d){if(await nt(this.storage,`${this.storageKey}-code-verifier`),X(d))return this._returnResult({data:{user:null,session:null},error:d});throw d}}async signInWithPassword(n){try{let r;if("email"in n){const{email:d,password:h,options:m}=n;r=await F(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:d,password:h,gotrue_meta_security:{captcha_token:m?.captchaToken}},xform:tp})}else if("phone"in n){const{phone:d,password:h,options:m}=n;r=await F(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:d,password:h,gotrue_meta_security:{captcha_token:m?.captchaToken}},xform:tp})}else throw new _o("You must provide either an email or phone number and a password");const{data:l,error:u}=r;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!l||!l.session||!l.user){const d=new rr;return this._returnResult({data:{user:null,session:null},error:d})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:Object.assign({user:l.user,session:l.session},l.weak_password?{weakPassword:l.weak_password}:null),error:u})}catch(r){if(X(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(n){var r,l,u,d;return await this._handleProviderSignIn(n.provider,{redirectTo:(r=n.options)===null||r===void 0?void 0:r.redirectTo,scopes:(l=n.options)===null||l===void 0?void 0:l.scopes,queryParams:(u=n.options)===null||u===void 0?void 0:u.queryParams,skipBrowserRedirect:(d=n.options)===null||d===void 0?void 0:d.skipBrowserRedirect})}async exchangeCodeForSession(n){return await this.initializePromise,this.lock!=null?this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(n)):this._exchangeCodeForSession(n)}async signInWithWeb3(n){const{chain:r}=n;switch(r){case"ethereum":return await this.signInWithEthereum(n);case"solana":return await this.signInWithSolana(n);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(n){var r,l,u,d,h,m,g,p,w,b,k;let S,C;if("message"in n)S=n.message,C=n.signature;else{const{chain:D,wallet:I,statement:H,options:q}=n;let P;if(Rt())if(typeof I=="object")P=I;else{const we=window;if("ethereum"in we&&typeof we.ethereum=="object"&&"request"in we.ethereum&&typeof we.ethereum.request=="function")P=we.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof I!="object"||!q?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");P=I}const Q=new URL((r=q?.url)!==null&&r!==void 0?r:window.location.href),K=await P.request({method:"eth_requestAccounts"}).then(we=>we).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!K||K.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const ae=zp(K[0]);let J=(l=q?.signInWithEthereum)===null||l===void 0?void 0:l.chainId;if(!J){const we=await P.request({method:"eth_chainId"});J=dS(we)}const _e={domain:Q.host,address:ae,statement:H,uri:Q.href,version:"1",chainId:J,nonce:(u=q?.signInWithEthereum)===null||u===void 0?void 0:u.nonce,issuedAt:(h=(d=q?.signInWithEthereum)===null||d===void 0?void 0:d.issuedAt)!==null&&h!==void 0?h:new Date,expirationTime:(m=q?.signInWithEthereum)===null||m===void 0?void 0:m.expirationTime,notBefore:(g=q?.signInWithEthereum)===null||g===void 0?void 0:g.notBefore,requestId:(p=q?.signInWithEthereum)===null||p===void 0?void 0:p.requestId,resources:(w=q?.signInWithEthereum)===null||w===void 0?void 0:w.resources};S=fS(_e),C=await P.request({method:"personal_sign",params:[hS(S),ae]})}try{const{data:D,error:I}=await F(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:S,signature:C},!((b=n.options)===null||b===void 0)&&b.captchaToken?{gotrue_meta_security:{captcha_token:(k=n.options)===null||k===void 0?void 0:k.captchaToken}}:null),xform:cn});if(I)throw I;if(!D||!D.session||!D.user){const H=new rr;return this._returnResult({data:{user:null,session:null},error:H})}return D.session&&(await this._saveSession(D.session),await this._notifyAllSubscribers("SIGNED_IN",D.session)),this._returnResult({data:Object.assign({},D),error:I})}catch(D){if(X(D))return this._returnResult({data:{user:null,session:null},error:D});throw D}}async signInWithSolana(n){var r,l,u,d,h,m,g,p,w,b,k,S;let C,D;if("message"in n)C=n.message,D=n.signature;else{const{chain:I,wallet:H,statement:q,options:P}=n;let Q;if(Rt())if(typeof H=="object")Q=H;else{const ae=window;if("solana"in ae&&typeof ae.solana=="object"&&("signIn"in ae.solana&&typeof ae.solana.signIn=="function"||"signMessage"in ae.solana&&typeof ae.solana.signMessage=="function"))Q=ae.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof H!="object"||!P?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");Q=H}const K=new URL((r=P?.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in Q&&Q.signIn){const ae=await Q.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},P?.signInWithSolana),{version:"1",domain:K.host,uri:K.href}),q?{statement:q}:null));let J;if(Array.isArray(ae)&&ae[0]&&typeof ae[0]=="object")J=ae[0];else if(ae&&typeof ae=="object"&&"signedMessage"in ae&&"signature"in ae)J=ae;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in J&&"signature"in J&&(typeof J.signedMessage=="string"||J.signedMessage instanceof Uint8Array)&&J.signature instanceof Uint8Array)C=typeof J.signedMessage=="string"?J.signedMessage:new TextDecoder().decode(J.signedMessage),D=J.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in Q)||typeof Q.signMessage!="function"||!("publicKey"in Q)||typeof Q!="object"||!Q.publicKey||!("toBase58"in Q.publicKey)||typeof Q.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");C=[`${K.host} wants you to sign in with your Solana account:`,Q.publicKey.toBase58(),...q?["",q,""]:[""],"Version: 1",`URI: ${K.href}`,`Issued At: ${(u=(l=P?.signInWithSolana)===null||l===void 0?void 0:l.issuedAt)!==null&&u!==void 0?u:new Date().toISOString()}`,...!((d=P?.signInWithSolana)===null||d===void 0)&&d.notBefore?[`Not Before: ${P.signInWithSolana.notBefore}`]:[],...!((h=P?.signInWithSolana)===null||h===void 0)&&h.expirationTime?[`Expiration Time: ${P.signInWithSolana.expirationTime}`]:[],...!((m=P?.signInWithSolana)===null||m===void 0)&&m.chainId?[`Chain ID: ${P.signInWithSolana.chainId}`]:[],...!((g=P?.signInWithSolana)===null||g===void 0)&&g.nonce?[`Nonce: ${P.signInWithSolana.nonce}`]:[],...!((p=P?.signInWithSolana)===null||p===void 0)&&p.requestId?[`Request ID: ${P.signInWithSolana.requestId}`]:[],...!((b=(w=P?.signInWithSolana)===null||w===void 0?void 0:w.resources)===null||b===void 0)&&b.length?["Resources",...P.signInWithSolana.resources.map(J=>`- ${J}`)]:[]].join(`
37
+ `);const ae=await Q.signMessage(new TextEncoder().encode(C),"utf8");if(!ae||!(ae instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");D=ae}}try{const{data:I,error:H}=await F(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:C,signature:pi(D)},!((k=n.options)===null||k===void 0)&&k.captchaToken?{gotrue_meta_security:{captcha_token:(S=n.options)===null||S===void 0?void 0:S.captchaToken}}:null),xform:cn});if(H)throw H;if(!I||!I.session||!I.user){const q=new rr;return this._returnResult({data:{user:null,session:null},error:q})}return I.session&&(await this._saveSession(I.session),await this._notifyAllSubscribers("SIGNED_IN",I.session)),this._returnResult({data:Object.assign({},I),error:H})}catch(I){if(X(I))return this._returnResult({data:{user:null,session:null},error:I});throw I}}async _exchangeCodeForSession(n){const r=await bn(this.storage,`${this.storageKey}-code-verifier`),[l,u]=(r??"").split("/");try{if(!l&&this.flowType==="pkce")throw new Lw;const{data:d,error:h}=await F(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:n,code_verifier:l},xform:cn});if(await nt(this.storage,`${this.storageKey}-code-verifier`),h)throw h;if(!d||!d.session||!d.user){const m=new rr;return this._returnResult({data:{user:null,session:null,redirectType:null},error:m})}return d.session&&(await this._saveSession(d.session),await this._notifyAllSubscribers(u==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",d.session)),this._returnResult({data:Object.assign(Object.assign({},d),{redirectType:u??null}),error:h})}catch(d){if(await nt(this.storage,`${this.storageKey}-code-verifier`),X(d))return this._returnResult({data:{user:null,session:null,redirectType:null},error:d});throw d}}async signInWithIdToken(n){try{const{options:r,provider:l,token:u,access_token:d,nonce:h}=n,m=await F(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:l,id_token:u,access_token:d,nonce:h,gotrue_meta_security:{captcha_token:r?.captchaToken}},xform:cn}),{data:g,error:p}=m;if(p)return this._returnResult({data:{user:null,session:null},error:p});if(!g||!g.session||!g.user){const w=new rr;return this._returnResult({data:{user:null,session:null},error:w})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:g,error:p})}catch(r){if(X(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(n){var r,l,u,d,h;try{if("email"in n){const{email:m,options:g}=n;let p=null,w=null;this.flowType==="pkce"&&([p,w]=await mi(this.storage,this.storageKey));const{error:b}=await F(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:m,data:(r=g?.data)!==null&&r!==void 0?r:{},create_user:(l=g?.shouldCreateUser)!==null&&l!==void 0?l:!0,gotrue_meta_security:{captcha_token:g?.captchaToken},code_challenge:p,code_challenge_method:w},redirectTo:g?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:b})}if("phone"in n){const{phone:m,options:g}=n,{data:p,error:w}=await F(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:m,data:(u=g?.data)!==null&&u!==void 0?u:{},create_user:(d=g?.shouldCreateUser)!==null&&d!==void 0?d:!0,gotrue_meta_security:{captcha_token:g?.captchaToken},channel:(h=g?.channel)!==null&&h!==void 0?h:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:p?.message_id},error:w})}throw new _o("You must provide either an email or phone number.")}catch(m){if(await nt(this.storage,`${this.storageKey}-code-verifier`),X(m))return this._returnResult({data:{user:null,session:null},error:m});throw m}}async verifyOtp(n){var r,l;try{let u,d;"options"in n&&(u=(r=n.options)===null||r===void 0?void 0:r.redirectTo,d=(l=n.options)===null||l===void 0?void 0:l.captchaToken);const{data:h,error:m}=await F(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},n),{gotrue_meta_security:{captcha_token:d}}),redirectTo:u,xform:cn});if(m)throw m;if(!h)throw new Error("An error occurred on token verification.");const g=h.session,p=h.user;return g?.access_token&&(await this._saveSession(g),await this._notifyAllSubscribers(n.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",g)),this._returnResult({data:{user:p,session:g},error:null})}catch(u){if(X(u))return this._returnResult({data:{user:null,session:null},error:u});throw u}}async signInWithSSO(n){var r,l,u,d,h;try{let m=null,g=null;this.flowType==="pkce"&&([m,g]=await mi(this.storage,this.storageKey));const p=await F(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in n?{provider_id:n.providerId}:null),"domain"in n?{domain:n.domain}:null),{redirect_to:(l=(r=n.options)===null||r===void 0?void 0:r.redirectTo)!==null&&l!==void 0?l:void 0}),!((u=n?.options)===null||u===void 0)&&u.captchaToken?{gotrue_meta_security:{captcha_token:n.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:m,code_challenge_method:g}),headers:this.headers,xform:rS});return!((d=p.data)===null||d===void 0)&&d.url&&Rt()&&!(!((h=n.options)===null||h===void 0)&&h.skipBrowserRedirect)&&window.location.assign(p.data.url),this._returnResult(p)}catch(m){if(await nt(this.storage,`${this.storageKey}-code-verifier`),X(m))return this._returnResult({data:null,error:m});throw m}}async reauthenticate(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate()):await this._reauthenticate()}async _reauthenticate(){try{return await this._useSession(async n=>{const{data:{session:r},error:l}=n;if(l)throw l;if(!r)throw new St;const{error:u}=await F(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:u})})}catch(n){if(X(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async resend(n){try{const r=`${this.url}/resend`;if("email"in n){const{email:l,type:u,options:d}=n;let h=null,m=null;this.flowType==="pkce"&&([h,m]=await mi(this.storage,this.storageKey));const{error:g}=await F(this.fetch,"POST",r,{headers:this.headers,body:{email:l,type:u,gotrue_meta_security:{captcha_token:d?.captchaToken},code_challenge:h,code_challenge_method:m},redirectTo:d?.emailRedirectTo});return g&&await nt(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:g})}else if("phone"in n){const{phone:l,type:u,options:d}=n,{data:h,error:m}=await F(this.fetch,"POST",r,{headers:this.headers,body:{phone:l,type:u,gotrue_meta_security:{captcha_token:d?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:h?.message_id},error:m})}throw new _o("You must provide either an email or phone number and a type")}catch(r){if(await nt(this.storage,`${this.storageKey}-code-verifier`),X(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async n=>n)):await this._useSession(async n=>n)}async _acquireLock(n,r){this._debug("#_acquireLock","begin",n);try{if(this.lockAcquired){const l=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),u=(async()=>(await l,await r()))();return this.pendingInLock.push((async()=>{try{await u}catch{}})()),u}return await this.lock(`lock:${this.storageKey}`,n,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const l=r();for(this.pendingInLock.push((async()=>{try{await l}catch{}})()),await l;this.pendingInLock.length;){const u=[...this.pendingInLock];await Promise.all(u),this.pendingInLock.splice(0,u.length)}return await l}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(n){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await n(r)}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!",new Error().stack);try{let n=null;const r=await bn(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?n=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!n)return{data:{session:null},error:null};const l=n.expires_at?n.expires_at*1e3-Date.now()<od:!1;if(this._debug("#__loadSession()",`session has${l?"":" not"} expired`,"expires_at",n.expires_at),!l){if(this.userStorage){const h=await bn(this.userStorage,this.storageKey+"-user");h?.user?n.user=h.user:n.user=ud()}if(this.storage.isServer&&n.user&&!n.user.__isUserNotAvailableProxy){const h={value:this.suppressGetSessionWarning};n.user=tS(n.user,h),h.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:n},error:null}}const{data:u,error:d}=await this._callRefreshToken(n.refresh_token);if(d){if(!!(n.expires_at&&n.expires_at*1e3>Date.now())){const m=await bn(this.storage,this.storageKey);if(m&&m.refresh_token===n.refresh_token)return this._returnResult({data:{session:n},error:null})}return this._returnResult({data:{session:null},error:d})}return this._returnResult({data:{session:u},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(n){if(n)return await this._getUser(n);await this.initializePromise;let r;return this.lock!=null?r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser()):r=await this._getUser(),r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(n){try{return n?await F(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:n,xform:Ia}):await this._useSession(async r=>{var l,u,d;const{data:h,error:m}=r;if(m)throw m;return!(!((l=h.session)===null||l===void 0)&&l.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new St}:await F(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(d=(u=h.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0,xform:Ia})})}catch(r){if(X(r))return So(r)&&(await this._removeSession(),await nt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(n,r={}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(n,r)):await this._updateUser(n,r)}async _updateUser(n,r={}){try{return await this._useSession(async l=>{const{data:u,error:d}=l;if(d)throw d;if(!u.session)throw new St;const h=u.session;let m=null,g=null;this.flowType==="pkce"&&n.email!=null&&([m,g]=await mi(this.storage,this.storageKey));const{data:p,error:w}=await F(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r?.emailRedirectTo,body:Object.assign(Object.assign({},n),{code_challenge:m,code_challenge_method:g}),jwt:h.access_token,xform:Ia});if(w)throw w;return h.user=p.user,await this._saveSession(h),await this._notifyAllSubscribers("USER_UPDATED",h),this._returnResult({data:{user:h.user},error:null})})}catch(l){if(await nt(this.storage,`${this.storageKey}-code-verifier`),X(l))return this._returnResult({data:{user:null},error:l});throw l}}async setSession(n){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(n)):await this._setSession(n)}async _setSession(n){try{if(!n.access_token||!n.refresh_token)throw new St;const r=Date.now()/1e3;let l=r,u=!0,d=null;const{payload:h}=ko(n.access_token);if(h.exp&&(l=h.exp,u=l<=r),u){const{data:m,error:g}=await this._callRefreshToken(n.refresh_token);if(g)return this._returnResult({data:{user:null,session:null},error:g});if(!m)return{data:{user:null,session:null},error:null};d=m}else{const{data:m,error:g}=await this._getUser(n.access_token);if(g)return this._returnResult({data:{user:null,session:null},error:g});d={access_token:n.access_token,refresh_token:n.refresh_token,user:m.user,token_type:"bearer",expires_in:l-r,expires_at:l},await this._saveSession(d),await this._notifyAllSubscribers("SIGNED_IN",d)}return this._returnResult({data:{user:d.user,session:d},error:null})}catch(r){if(X(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(n){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(n)):await this._refreshSession(n)}async _refreshSession(n){try{return await this._useSession(async r=>{var l;if(!n){const{data:h,error:m}=r;if(m)throw m;n=(l=h.session)!==null&&l!==void 0?l:void 0}if(!n?.refresh_token)throw new St;const{data:u,error:d}=await this._callRefreshToken(n.refresh_token);return d?this._returnResult({data:{user:null,session:null},error:d}):u?this._returnResult({data:{user:u.user,session:u},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(X(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(n,r){var l;try{if(!Rt())throw new To("No browser detected.");if(n.error||n.error_description||n.error_code)throw new To(n.error_description||"Error in URL with unspecified error_description",{error:n.error||"unspecified_error",code:n.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new Kg("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new To("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!n.code)throw new Kg("No code detected.");const{data:P,error:Q}=await this._exchangeCodeForSession(n.code);if(Q)throw Q;const K=new URL(window.location.href);return K.searchParams.delete("code"),window.history.replaceState(window.history.state,"",K.toString()),{data:{session:P.session,redirectType:(l=P.redirectType)!==null&&l!==void 0?l:null},error:null}}const{provider_token:u,provider_refresh_token:d,access_token:h,refresh_token:m,expires_in:g,expires_at:p,token_type:w}=n;if(!h||!g||!m||!w)throw new To("No session defined in URL");const b=Math.round(Date.now()/1e3),k=parseInt(g);let S=b+k;p&&(S=parseInt(p));const C=S-b;C*1e3<=la&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${C}s, should have been closer to ${k}s`);const D=S-k;b-D>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",D,S,b):b-D<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",D,S,b);const{data:I,error:H}=await this._getUser(h);if(H)throw H;const q={provider_token:u,provider_refresh_token:d,access_token:h,expires_in:k,expires_at:S,refresh_token:m,token_type:w,user:I.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:q,redirectType:n.type},error:null})}catch(u){if(X(u))return this._returnResult({data:{session:null,redirectType:null},error:u});throw u}}_isImplicitGrantCallback(n){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),n):!!(n.access_token||n.error||n.error_description||n.error_code)}async _isPKCECallback(n){const r=await bn(this.storage,`${this.storageKey}-code-verifier`);return!!(n.code&&r)}async signOut(n={scope:"global"}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(n)):await this._signOut(n)}async _signOut({scope:n}={scope:"global"}){return await this._useSession(async r=>{var l;const{data:u,error:d}=r;if(d&&!So(d))return this._returnResult({error:d});const h=(l=u.session)===null||l===void 0?void 0:l.access_token;if(h){const{error:m}=await this.admin.signOut(h,n);if(m&&!(jw(m)&&(m.status===404||m.status===401||m.status===403)||So(m)))return this._returnResult({error:m})}return n!=="others"&&(await this._removeSession(),await nt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(n){const r=$w(),l={id:r,callback:n,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,l),(async()=>(await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)}):await this._emitInitialSession(r)))(),{data:{subscription:l}}}async _emitInitialSession(n){return await this._useSession(async r=>{var l,u;try{const{data:{session:d},error:h}=r;if(h)throw h;await((l=this.stateChangeEmitters.get(n))===null||l===void 0?void 0:l.callback("INITIAL_SESSION",d)),this._debug("INITIAL_SESSION","callback id",n,"session",d)}catch(d){await((u=this.stateChangeEmitters.get(n))===null||u===void 0?void 0:u.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",n,"error",d),So(d)?console.warn(d):console.error(d)}})}async resetPasswordForEmail(n,r={}){let l=null,u=null;this.flowType==="pkce"&&([l,u]=await mi(this.storage,this.storageKey,!0));try{return await F(this.fetch,"POST",`${this.url}/recover`,{body:{email:n,code_challenge:l,code_challenge_method:u,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(d){if(await nt(this.storage,`${this.storageKey}-code-verifier`),X(d))return this._returnResult({data:null,error:d});throw d}}async getUserIdentities(){var n;try{const{data:r,error:l}=await this.getUser();if(l)throw l;return this._returnResult({data:{identities:(n=r.user.identities)!==null&&n!==void 0?n:[]},error:null})}catch(r){if(X(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(n){return"token"in n?this.linkIdentityIdToken(n):this.linkIdentityOAuth(n)}async linkIdentityOAuth(n){var r;try{const{data:l,error:u}=await this._useSession(async d=>{var h,m,g,p,w;const{data:b,error:k}=d;if(k)throw k;const S=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,n.provider,{redirectTo:(h=n.options)===null||h===void 0?void 0:h.redirectTo,scopes:(m=n.options)===null||m===void 0?void 0:m.scopes,queryParams:(g=n.options)===null||g===void 0?void 0:g.queryParams,skipBrowserRedirect:!0});return await F(this.fetch,"GET",S,{headers:this.headers,jwt:(w=(p=b.session)===null||p===void 0?void 0:p.access_token)!==null&&w!==void 0?w:void 0})});if(u)throw u;return Rt()&&!(!((r=n.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(l?.url),this._returnResult({data:{provider:n.provider,url:l?.url},error:null})}catch(l){if(X(l))return this._returnResult({data:{provider:n.provider,url:null},error:l});throw l}}async linkIdentityIdToken(n){return await this._useSession(async r=>{var l;try{const{error:u,data:{session:d}}=r;if(u)throw u;const{options:h,provider:m,token:g,access_token:p,nonce:w}=n,b=await F(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(l=d?.access_token)!==null&&l!==void 0?l:void 0,body:{provider:m,id_token:g,access_token:p,nonce:w,link_identity:!0,gotrue_meta_security:{captcha_token:h?.captchaToken}},xform:cn}),{data:k,error:S}=b;return S?this._returnResult({data:{user:null,session:null},error:S}):!k||!k.session||!k.user?this._returnResult({data:{user:null,session:null},error:new rr}):(k.session&&(await this._saveSession(k.session),await this._notifyAllSubscribers("USER_UPDATED",k.session)),this._returnResult({data:k,error:S}))}catch(u){if(await nt(this.storage,`${this.storageKey}-code-verifier`),X(u))return this._returnResult({data:{user:null,session:null},error:u});throw u}})}async unlinkIdentity(n){try{return await this._useSession(async r=>{var l,u;const{data:d,error:h}=r;if(h)throw h;return await F(this.fetch,"DELETE",`${this.url}/user/identities/${n.identity_id}`,{headers:this.headers,jwt:(u=(l=d.session)===null||l===void 0?void 0:l.access_token)!==null&&u!==void 0?u:void 0})})}catch(r){if(X(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(n){const r="#_refreshAccessToken()";this._debug(r,"begin");try{const l=Date.now();return await Vw(async u=>(u>0&&await Gw(200*Math.pow(2,u-1)),this._debug(r,"refreshing attempt",u),await F(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:n},headers:this.headers,xform:cn})),(u,d)=>{const h=200*Math.pow(2,u);return d&&Yg(d)&&Date.now()+h-l<la})}catch(l){if(this._debug(r,"error",l),X(l))return this._returnResult({data:{session:null,user:null},error:l});throw l}finally{this._debug(r,"end")}}_isValidSession(n){return typeof n=="object"&&n!==null&&"access_token"in n&&"refresh_token"in n&&"expires_at"in n}async _handleProviderSignIn(n,r){const l=await this._getUrlForProvider(`${this.url}/authorize`,n,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",n,"options",r,"url",l),Rt()&&!r.skipBrowserRedirect&&window.location.assign(l),{data:{provider:n,url:l},error:null}}async _recoverAndRefresh(){var n,r;const l="#_recoverAndRefresh()";this._debug(l,"begin");try{const u=await bn(this.storage,this.storageKey);if(u&&this.userStorage){let h=await bn(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!h&&(h={user:u.user},await mr(this.userStorage,this.storageKey+"-user",h)),u.user=(n=h?.user)!==null&&n!==void 0?n:ud()}else if(u&&!u.user&&!u.user){const h=await bn(this.storage,this.storageKey+"-user");h&&h?.user?(u.user=h.user,await nt(this.storage,this.storageKey+"-user"),await mr(this.storage,this.storageKey,u)):u.user=ud()}if(this._debug(l,"session from storage",u),!this._isValidSession(u)){this._debug(l,"session is not valid"),u!==null&&await this._removeSession();return}const d=((r=u.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<od;if(this._debug(l,`session has${d?"":" not"} expired with margin of ${od}s`),d){if(this.autoRefreshToken&&u.refresh_token){const{error:h}=await this._callRefreshToken(u.refresh_token);h&&(Dw(h)?this._debug(l,"refresh discarded by commit guard",h):this._debug(l,"refresh failed",h))}}else if(u.user&&u.user.__isUserNotAvailableProxy===!0)try{const{data:h,error:m}=await this._getUser(u.access_token);!m&&h?.user?(u.user=h.user,await this._saveSession(u),await this._notifyAllSubscribers("SIGNED_IN",u)):this._debug(l,"could not get user data, skipping SIGNED_IN notification")}catch(h){console.error("Error getting user data:",h),this._debug(l,"error getting user data, skipping SIGNED_IN notification",h)}else await this._notifyAllSubscribers("SIGNED_IN",u)}catch(u){this._debug(l,"error",u),console.error(u);return}finally{this._debug(l,"end")}}async _callRefreshToken(n){var r,l;if(!n)throw new St;if(this.refreshingDeferred)return this.refreshingDeferred.promise;if(this.lastRefreshFailure&&this.lastRefreshFailure.refreshToken===n&&Date.now()<this.lastRefreshFailure.expiresAt)return this._debug("#_callRefreshToken()","returning cached failure (cooldown active)"),this.lastRefreshFailure.result;const u="#_callRefreshToken()";this._debug(u,"begin");try{this.refreshingDeferred=new qo;const d=await bn(this.storage,this.storageKey),{data:h,error:m}=await this._refreshAccessToken(n);if(m)throw m;if(!h.session)throw new St;const g=await bn(this.storage,this.storageKey);if(d!==null&&(g===null||g.refresh_token!==d.refresh_token)){this._debug(u,"commit guard: storage changed since refresh started, discarding rotated tokens",{startedWith:"present",nowHolds:g?"replaced":"cleared"});const k={data:null,error:new Jg};return this.refreshingDeferred.resolve(k),k}const w=this._sessionRemovalEpoch;if(await this._saveSession(h.session),this._sessionRemovalEpoch!==w){this._debug(u,"commit guard (post-save): _removeSession ran during _saveSession, undoing write"),await nt(this.storage,this.storageKey),this.userStorage&&await nt(this.userStorage,this.storageKey+"-user");const k={data:null,error:new Jg};return this.refreshingDeferred.resolve(k),k}await this._notifyAllSubscribers("TOKEN_REFRESHED",h.session);const b={data:h.session,error:null};return this.lastRefreshFailure=null,this.refreshingDeferred.resolve(b),b}catch(d){if(this._debug(u,"error",d),X(d)){const h={data:null,error:d};if(!Yg(d)){const m=await bn(this.storage,this.storageKey);!!(m?.expires_at&&m.expires_at*1e3>Date.now())?this._debug(u,"proactive refresh failed, access token still valid — preserving session"):await this._removeSession()}return this.lastRefreshFailure={refreshToken:n,result:h,expiresAt:Date.now()+kw},(r=this.refreshingDeferred)===null||r===void 0||r.resolve(h),h}throw(l=this.refreshingDeferred)===null||l===void 0||l.reject(d),d}finally{this.refreshingDeferred=null,this._debug(u,"end")}}async _notifyAllSubscribers(n,r,l=!0){const u=`#_notifyAllSubscribers(${n})`;this._debug(u,"begin",r,`broadcast = ${l}`);try{this.broadcastChannel&&l&&this.broadcastChannel.postMessage({event:n,session:r});const d=[],h=Array.from(this.stateChangeEmitters.values()).map(async m=>{try{await m.callback(n,r)}catch(g){d.push(g)}});if(await Promise.all(h),d.length>0){for(let m=0;m<d.length;m+=1)console.error(d[m]);throw d[0]}}finally{this._debug(u,"end")}}async _saveSession(n){this._debug("#_saveSession()",n),this.suppressGetSessionWarning=!0,await nt(this.storage,`${this.storageKey}-code-verifier`);const r=Object.assign({},n),l=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!l&&r.user&&await mr(this.userStorage,this.storageKey+"-user",{user:r.user});const u=Object.assign({},r);delete u.user;const d=Fg(u);await mr(this.storage,this.storageKey,d)}else{const u=Fg(r);await mr(this.storage,this.storageKey,u)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug("#_removeSession()"),this.lastRefreshFailure=null,this.suppressGetSessionWarning=!1,await nt(this.storage,this.storageKey),await nt(this.storage,this.storageKey+"-code-verifier"),await nt(this.storage,this.storageKey+"-user"),this.userStorage&&await nt(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const n=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{n&&Rt()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",n)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const n=setInterval(()=>this._autoRefreshTokenTick(),la);this.autoRefreshTicker=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n);const r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const n=this.autoRefreshTicker;this.autoRefreshTicker=null,n&&clearInterval(n);const r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async dispose(){var n;this._removeVisibilityChangedCallback(),await this._stopAutoRefresh(),(n=this.broadcastChannel)===null||n===void 0||n.close(),this.broadcastChannel=null,this.stateChangeEmitters.clear()}async _autoRefreshTokenTick(){if(this._debug("#_autoRefreshTokenTick()","begin"),this.lock!=null){try{await this._acquireLock(0,async()=>{try{const n=Date.now();try{return await this._useSession(async r=>{const{data:{session:l}}=r;if(!l||!l.refresh_token||!l.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const u=Math.floor((l.expires_at*1e3-n)/la);this._debug("#_autoRefreshTokenTick()",`access token expires in ${u} ticks, a tick lasts ${la}ms, refresh threshold is ${Ns} ticks`),u<=Ns&&await this._callRefreshToken(l.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(n){if(n instanceof uS)this._debug("auto refresh token tick lock not available");else throw n}return}if(this.refreshingDeferred!==null){this._debug("#_autoRefreshTokenTick()","refresh already in flight, skipping");return}try{const n=Date.now();try{await this._useSession(async r=>{const{data:{session:l}}=r;if(!l||!l.refresh_token||!l.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const u=Math.floor((l.expires_at*1e3-n)/la);this._debug("#_autoRefreshTokenTick()",`access token expires in ${u} ticks, a tick lasts ${la}ms, refresh threshold is ${Ns} ticks`),u<=Ns&&await this._callRefreshToken(l.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Rt()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(n){this._debug("#visibilityChangedCallback","error",n)}},window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(n){console.error("_handleVisibilityChange",n)}}async _onVisibilityChanged(n){const r=`#_onVisibilityChanged(${n})`;if(this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"){if(this.autoRefreshToken&&this._startAutoRefresh(),!n)if(await this.initializePromise,this.lock!=null)await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()});else{if(document.visibilityState!=="visible"){this._debug(r,"visibilityState is no longer visible, skipping recovery");return}await this._recoverAndRefresh()}}else document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(n,r,l){const u=[`provider=${encodeURIComponent(r)}`];if(l?.redirectTo&&u.push(`redirect_to=${encodeURIComponent(l.redirectTo)}`),l?.scopes&&u.push(`scopes=${encodeURIComponent(l.scopes)}`),this.flowType==="pkce"){const[d,h]=await mi(this.storage,this.storageKey),m=new URLSearchParams({code_challenge:`${encodeURIComponent(d)}`,code_challenge_method:`${encodeURIComponent(h)}`});u.push(m.toString())}if(l?.queryParams){const d=new URLSearchParams(l.queryParams);u.push(d.toString())}return l?.skipBrowserRedirect&&u.push(`skip_http_redirect=${l.skipBrowserRedirect}`),`${n}?${u.join("&")}`}async _unenroll(n){try{return await this._useSession(async r=>{var l;const{data:u,error:d}=r;return d?this._returnResult({data:null,error:d}):await F(this.fetch,"DELETE",`${this.url}/factors/${n.factorId}`,{headers:this.headers,jwt:(l=u?.session)===null||l===void 0?void 0:l.access_token})})}catch(r){if(X(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(n){try{return await this._useSession(async r=>{var l,u;const{data:d,error:h}=r;if(h)return this._returnResult({data:null,error:h});const m=Object.assign({friendly_name:n.friendlyName,factor_type:n.factorType},n.factorType==="phone"?{phone:n.phone}:n.factorType==="totp"?{issuer:n.issuer}:{}),{data:g,error:p}=await F(this.fetch,"POST",`${this.url}/factors`,{body:m,headers:this.headers,jwt:(l=d?.session)===null||l===void 0?void 0:l.access_token});return p?this._returnResult({data:null,error:p}):(n.factorType==="totp"&&g.type==="totp"&&(!((u=g?.totp)===null||u===void 0)&&u.qr_code)&&(g.totp.qr_code=`data:image/svg+xml;utf-8,${g.totp.qr_code}`),this._returnResult({data:g,error:null}))})}catch(r){if(X(r))return this._returnResult({data:null,error:r});throw r}}async _verify(n){const r=async()=>{try{return await this._useSession(async l=>{var u;const{data:d,error:h}=l;if(h)return this._returnResult({data:null,error:h});const m=Object.assign({challenge_id:n.challengeId},"webauthn"in n?{webauthn:Object.assign(Object.assign({},n.webauthn),{credential_response:n.webauthn.type==="create"?sp(n.webauthn.credential_response):lp(n.webauthn.credential_response)})}:{code:n.code}),{data:g,error:p}=await F(this.fetch,"POST",`${this.url}/factors/${n.factorId}/verify`,{body:m,headers:this.headers,jwt:(u=d?.session)===null||u===void 0?void 0:u.access_token});return p?this._returnResult({data:null,error:p}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+g.expires_in},g)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",g),this._returnResult({data:g,error:p}))})}catch(l){if(X(l))return this._returnResult({data:null,error:l});throw l}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,r):r()}async _challenge(n){const r=async()=>{try{return await this._useSession(async l=>{var u;const{data:d,error:h}=l;if(h)return this._returnResult({data:null,error:h});const m=await F(this.fetch,"POST",`${this.url}/factors/${n.factorId}/challenge`,{body:n,headers:this.headers,jwt:(u=d?.session)===null||u===void 0?void 0:u.access_token});if(m.error)return m;const{data:g}=m;if(g.type!=="webauthn")return{data:g,error:null};switch(g.webauthn.type){case"create":return{data:Object.assign(Object.assign({},g),{webauthn:Object.assign(Object.assign({},g.webauthn),{credential_options:Object.assign(Object.assign({},g.webauthn.credential_options),{publicKey:ip(g.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},g),{webauthn:Object.assign(Object.assign({},g.webauthn),{credential_options:Object.assign(Object.assign({},g.webauthn.credential_options),{publicKey:rp(g.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(l){if(X(l))return this._returnResult({data:null,error:l});throw l}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,r):r()}async _challengeAndVerify(n){const{data:r,error:l}=await this._challenge({factorId:n.factorId});return l?this._returnResult({data:null,error:l}):await this._verify({factorId:n.factorId,challengeId:r.id,code:n.code})}async _listFactors(){var n;const{data:{user:r},error:l}=await this.getUser();if(l)return{data:null,error:l};const u={all:[],phone:[],totp:[],webauthn:[]};for(const d of(n=r?.factors)!==null&&n!==void 0?n:[])u.all.push(d),d.status==="verified"&&u[d.factor_type].push(d);return{data:u,error:null}}async _getAuthenticatorAssuranceLevel(n){var r,l,u,d;if(n)try{const{payload:S}=ko(n);let C=null;S.aal&&(C=S.aal);let D=C;const{data:{user:I},error:H}=await this.getUser(n);if(H)return this._returnResult({data:null,error:H});((l=(r=I?.factors)===null||r===void 0?void 0:r.filter(Q=>Q.status==="verified"))!==null&&l!==void 0?l:[]).length>0&&(D="aal2");const P=S.amr||[];return{data:{currentLevel:C,nextLevel:D,currentAuthenticationMethods:P},error:null}}catch(S){if(X(S))return this._returnResult({data:null,error:S});throw S}const{data:{session:h},error:m}=await this.getSession();if(m)return this._returnResult({data:null,error:m});if(!h)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:g}=ko(h.access_token);let p=null;g.aal&&(p=g.aal);let w=p;((d=(u=h.user.factors)===null||u===void 0?void 0:u.filter(S=>S.status==="verified"))!==null&&d!==void 0?d:[]).length>0&&(w="aal2");const k=g.amr||[];return{data:{currentLevel:p,nextLevel:w,currentAuthenticationMethods:k},error:null}}async _getAuthorizationDetails(n){try{return await this._useSession(async r=>{const{data:{session:l},error:u}=r;return u?this._returnResult({data:null,error:u}):l?await F(this.fetch,"GET",`${this.url}/oauth/authorizations/${n}`,{headers:this.headers,jwt:l.access_token,xform:d=>({data:d,error:null})}):this._returnResult({data:null,error:new St})})}catch(r){if(X(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(n,r){try{return await this._useSession(async l=>{const{data:{session:u},error:d}=l;if(d)return this._returnResult({data:null,error:d});if(!u)return this._returnResult({data:null,error:new St});const h=await F(this.fetch,"POST",`${this.url}/oauth/authorizations/${n}/consent`,{headers:this.headers,jwt:u.access_token,body:{action:"approve"},xform:m=>({data:m,error:null})});return h.data&&h.data.redirect_url&&Rt()&&!r?.skipBrowserRedirect&&window.location.assign(h.data.redirect_url),h})}catch(l){if(X(l))return this._returnResult({data:null,error:l});throw l}}async _denyAuthorization(n,r){try{return await this._useSession(async l=>{const{data:{session:u},error:d}=l;if(d)return this._returnResult({data:null,error:d});if(!u)return this._returnResult({data:null,error:new St});const h=await F(this.fetch,"POST",`${this.url}/oauth/authorizations/${n}/consent`,{headers:this.headers,jwt:u.access_token,body:{action:"deny"},xform:m=>({data:m,error:null})});return h.data&&h.data.redirect_url&&Rt()&&!r?.skipBrowserRedirect&&window.location.assign(h.data.redirect_url),h})}catch(l){if(X(l))return this._returnResult({data:null,error:l});throw l}}async _listOAuthGrants(){try{return await this._useSession(async n=>{const{data:{session:r},error:l}=n;return l?this._returnResult({data:null,error:l}):r?await F(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:u=>({data:u,error:null})}):this._returnResult({data:null,error:new St})})}catch(n){if(X(n))return this._returnResult({data:null,error:n});throw n}}async _revokeOAuthGrant(n){try{return await this._useSession(async r=>{const{data:{session:l},error:u}=r;return u?this._returnResult({data:null,error:u}):l?(await F(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:l.access_token,query:{client_id:n.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new St})})}catch(r){if(X(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(n,r={keys:[]}){let l=r.keys.find(m=>m.kid===n);if(l)return l;const u=Date.now();if(l=this.jwks.keys.find(m=>m.kid===n),l&&this.jwks_cached_at+Ow>u)return l;const{data:d,error:h}=await F(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(h)throw h;return!d.keys||d.keys.length===0||(this.jwks=d,this.jwks_cached_at=u,l=d.keys.find(m=>m.kid===n),!l)?null:l}async getClaims(n,r={}){try{let l=n;if(!l){const{data:S,error:C}=await this.getSession();if(C||!S.session)return this._returnResult({data:null,error:C});l=S.session.access_token}const{header:u,payload:d,signature:h,raw:{header:m,payload:g}}=ko(l);if(!r?.allowExpired)try{Zw(d.exp)}catch(S){throw new jo(S instanceof Error?S.message:"JWT validation failed")}const p=!u.alg||u.alg.startsWith("HS")||!u.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(u.kid,r?.keys?{keys:r.keys}:r?.jwks);if(!p){const{error:S}=await this.getUser(l);if(S)throw S;return{data:{claims:d,header:u,signature:h},error:null}}const w=Fw(u.alg),b=await crypto.subtle.importKey("jwk",p,w,!0,["verify"]);if(!await crypto.subtle.verify(w,b,h,Hw(`${m}.${g}`)))throw new jo("Invalid JWT signature");return{data:{claims:d,header:u,signature:h},error:null}}catch(l){if(X(l))return this._returnResult({data:null,error:l});throw l}}async signInWithPasskey(n){var r,l,u;wn(this.experimental);try{if(!Do())return this._returnResult({data:null,error:new Tn("Browser does not support WebAuthn",null)});const{data:d,error:h}=await this._startPasskeyAuthentication({options:{captchaToken:(r=n?.options)===null||r===void 0?void 0:r.captchaToken}});if(h||!d)return this._returnResult({data:null,error:h});const m=rp(d.options),g=(u=(l=n?.options)===null||l===void 0?void 0:l.signal)!==null&&u!==void 0?u:jd.createNewAbortSignal(),{data:p,error:w}=await qp({publicKey:m,signal:g});if(w||!p)return this._returnResult({data:null,error:w??new Tn("WebAuthn ceremony failed",null)});const b=lp(p);return this._verifyPasskeyAuthentication({challengeId:d.challenge_id,credential:b})}catch(d){if(X(d))return this._returnResult({data:null,error:d});throw d}}async registerPasskey(n){var r,l;wn(this.experimental);try{if(!Do())return this._returnResult({data:null,error:new Tn("Browser does not support WebAuthn",null)});const{data:u,error:d}=await this._startPasskeyRegistration();if(d||!u)return this._returnResult({data:null,error:d});const h=ip(u.options),m=(l=(r=n?.options)===null||r===void 0?void 0:r.signal)!==null&&l!==void 0?l:jd.createNewAbortSignal(),{data:g,error:p}=await Hp({publicKey:h,signal:m});if(p||!g)return this._returnResult({data:null,error:p??new Tn("WebAuthn ceremony failed",null)});const w=sp(g);return this._verifyPasskeyRegistration({challengeId:u.challenge_id,credential:w})}catch(u){if(X(u))return this._returnResult({data:null,error:u});throw u}}async _startPasskeyRegistration(){wn(this.experimental);try{return await this._useSession(async n=>{const{data:{session:r},error:l}=n;if(l)return this._returnResult({data:null,error:l});if(!r)return this._returnResult({data:null,error:new St});const{data:u,error:d}=await F(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:r.access_token,body:{}});return d?this._returnResult({data:null,error:d}):this._returnResult({data:u,error:null})})}catch(n){if(X(n))return this._returnResult({data:null,error:n});throw n}}async _verifyPasskeyRegistration(n){wn(this.experimental);try{return await this._useSession(async r=>{const{data:{session:l},error:u}=r;if(u)return this._returnResult({data:null,error:u});if(!l)return this._returnResult({data:null,error:new St});const{data:d,error:h}=await F(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:l.access_token,body:{challenge_id:n.challengeId,credential:n.credential}});return h?this._returnResult({data:null,error:h}):this._returnResult({data:d,error:null})})}catch(r){if(X(r))return this._returnResult({data:null,error:r});throw r}}async _startPasskeyAuthentication(n){var r;wn(this.experimental);try{const{data:l,error:u}=await F(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(r=n?.options)===null||r===void 0?void 0:r.captchaToken}}});return u?this._returnResult({data:null,error:u}):this._returnResult({data:l,error:null})}catch(l){if(X(l))return this._returnResult({data:null,error:l});throw l}}async _verifyPasskeyAuthentication(n){wn(this.experimental);try{const{data:r,error:l}=await F(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:n.challengeId,credential:n.credential},xform:cn});return l?this._returnResult({data:null,error:l}):(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:r,error:null}))}catch(r){if(X(r))return this._returnResult({data:null,error:r});throw r}}async _listPasskeys(){wn(this.experimental);try{return await this._useSession(async n=>{const{data:{session:r},error:l}=n;if(l)return this._returnResult({data:null,error:l});if(!r)return this._returnResult({data:null,error:new St});const{data:u,error:d}=await F(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:r.access_token,xform:h=>({data:h,error:null})});return d?this._returnResult({data:null,error:d}):this._returnResult({data:u,error:null})})}catch(n){if(X(n))return this._returnResult({data:null,error:n});throw n}}async _updatePasskey(n){wn(this.experimental);try{return await this._useSession(async r=>{const{data:{session:l},error:u}=r;if(u)return this._returnResult({data:null,error:u});if(!l)return this._returnResult({data:null,error:new St});const{data:d,error:h}=await F(this.fetch,"PATCH",`${this.url}/passkeys/${n.passkeyId}`,{headers:this.headers,jwt:l.access_token,body:{friendly_name:n.friendlyName}});return h?this._returnResult({data:null,error:h}):this._returnResult({data:d,error:null})})}catch(r){if(X(r))return this._returnResult({data:null,error:r});throw r}}async _deletePasskey(n){wn(this.experimental);try{return await this._useSession(async r=>{const{data:{session:l},error:u}=r;if(u)return this._returnResult({data:null,error:u});if(!l)return this._returnResult({data:null,error:new St});const{error:d}=await F(this.fetch,"DELETE",`${this.url}/passkeys/${n.passkeyId}`,{headers:this.headers,jwt:l.access_token,noResolveJson:!0});return d?this._returnResult({data:null,error:d}):this._returnResult({data:null,error:null})})}catch(r){if(X(r))return this._returnResult({data:null,error:r});throw r}}}Ks.nextInstanceID={};const TS=Ks,kS="2.110.0";let Ls="",Mo;if(typeof Deno<"u"){var dd;Ls="deno",Mo=(dd=Deno.version)===null||dd===void 0?void 0:dd.deno}else if(typeof document<"u")Ls="web";else if(typeof navigator<"u"&&navigator.product==="ReactNative")Ls="react-native";else{var hd;Ls="node",Mo=typeof process<"u"?(hd=process.version)===null||hd===void 0?void 0:hd.replace(/^v/,""):void 0}const $p=[`runtime=${Ls}`];Mo&&$p.push(`runtime-version=${Mo}`);const ES={"X-Client-Info":`supabase-js/${kS}; ${$p.join("; ")}`},AS={headers:ES},xS={schema:"public"},CS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},OS={},RS={enabled:!1,respectSamplingDecision:!0};function jS(i,n,r,l){function u(d){return d instanceof r?d:new r(function(h){h(d)})}return new(r||(r=Promise))(function(d,h){function m(w){try{p(l.next(w))}catch(b){h(b)}}function g(w){try{p(l.throw(w))}catch(b){h(b)}}function p(w){w.done?d(w.value):u(w.value).then(m,g)}p((l=l.apply(i,[])).next())})}let fd=null;const NS="@opentelemetry/api";function LS(){return fd===null&&(fd=import(NS).catch(()=>null)),fd}function DS(){return jS(this,void 0,void 0,function*(){try{const i=yield LS();if(!i||!i.propagation||!i.context)return null;const n={};i.propagation.inject(i.context.active(),n);const r=n.traceparent;return r?{traceparent:r,tracestate:n.tracestate,baggage:n.baggage}:null}catch{return null}})}function US(i){if(!i||typeof i!="string")return null;const n=i.split("-");if(n.length!==4)return null;const[r,l,u,d]=n;if(r.length!==2||l.length!==32||u.length!==16||d.length!==2)return null;const h=/^[0-9a-f]+$/i;return!h.test(r)||!h.test(l)||!h.test(u)||!h.test(d)||l==="00000000000000000000000000000000"||u==="0000000000000000"?null:{version:r,traceId:l,parentId:u,traceFlags:d,isSampled:(parseInt(d,16)&1)===1}}function MS(i,n){if(!i||!n||n.length===0)return!1;let r;if(i instanceof URL)r=i;else try{r=new URL(i)}catch{return!1}for(const l of n)try{if(typeof l=="string"){if(zS(r.hostname,l))return!0}else if(l instanceof RegExp){if(l.test(r.hostname))return!0}else if(typeof l=="function"&&l(r))return!0}catch{continue}return!1}function zS(i,n){if(n===i)return!0;if(n.startsWith("*.")){const r=n.slice(2);if(i.endsWith(r)&&(i===r||i.endsWith("."+r)))return!0}return!1}function BS(i){const n=[];try{const r=new URL(i);n.push(r.hostname)}catch{}return n.push("*.supabase.co","*.supabase.in"),n.push("localhost","127.0.0.1","[::1]"),n}function Ys(i){"@babel/helpers - typeof";return Ys=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Ys(i)}function HS(i,n){if(Ys(i)!="object"||!i)return i;var r=i[Symbol.toPrimitive];if(r!==void 0){var l=r.call(i,n);if(Ys(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(i)}function qS(i){var n=HS(i,"string");return Ys(n)=="symbol"?n:n+""}function $S(i,n,r){return(n=qS(n))in i?Object.defineProperty(i,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):i[n]=r,i}function op(i,n){var r=Object.keys(i);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(i);n&&(l=l.filter(function(u){return Object.getOwnPropertyDescriptor(i,u).enumerable})),r.push.apply(r,l)}return r}function Ze(i){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?op(Object(r),!0).forEach(function(l){$S(i,l,r[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(r)):op(Object(r)).forEach(function(l){Object.defineProperty(i,l,Object.getOwnPropertyDescriptor(r,l))})}return i}const PS=i=>i?(...n)=>i(...n):(...n)=>fetch(...n),IS=()=>Headers,GS=(i,n,r,l,u)=>{const d=PS(l),h=IS(),m=u?.enabled===!0,g=u?.respectSamplingDecision!==!1,p=m?BS(n):null;return async(w,b)=>{var k;const S=(k=await r())!==null&&k!==void 0?k:i;let C=new h(b?.headers);if(C.has("apikey")||C.set("apikey",i),C.has("Authorization")||C.set("Authorization",`Bearer ${S}`),p){const D=await VS(w,p,g);D&&(D.traceparent&&!C.has("traceparent")&&C.set("traceparent",D.traceparent),D.tracestate&&!C.has("tracestate")&&C.set("tracestate",D.tracestate),D.baggage&&!C.has("baggage")&&C.set("baggage",D.baggage))}return d(w,Ze(Ze({},b),{},{headers:C}))}};async function VS(i,n,r){if(!MS(typeof i=="string"||i instanceof URL?i:i.url,n))return null;const l=await DS();if(!l||!l.traceparent)return null;if(r){const u=US(l.traceparent);if(u&&!u.isSampled)return null}return l}function up(i){return typeof i=="boolean"?{enabled:i}:i}function KS(i){return i.endsWith("/")?i:i+"/"}function YS(i,n){var r,l,u,d,h,m;const{db:g,auth:p,realtime:w,global:b}=i,{db:k,auth:S,realtime:C,global:D}=n,I=up(i.tracePropagation),H=up(n.tracePropagation),q={db:Ze(Ze({},k),g),auth:Ze(Ze({},S),p),realtime:Ze(Ze({},C),w),storage:{},global:Ze(Ze(Ze({},D),b),{},{headers:Ze(Ze({},(r=D?.headers)!==null&&r!==void 0?r:{}),(l=b?.headers)!==null&&l!==void 0?l:{})}),tracePropagation:{enabled:(u=(d=I?.enabled)!==null&&d!==void 0?d:H?.enabled)!==null&&u!==void 0?u:!1,respectSamplingDecision:(h=(m=I?.respectSamplingDecision)!==null&&m!==void 0?m:H?.respectSamplingDecision)!==null&&h!==void 0?h:!0},accessToken:async()=>""};return i.accessToken?q.accessToken=i.accessToken:delete q.accessToken,q}function JS(i){const n=i?.trim();if(!n)throw new Error("supabaseUrl is required.");if(!n.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(KS(n))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var XS=class extends TS{constructor(i){super(i)}},QS=class{constructor(i,n,r){var l,u;this.supabaseUrl=i,this.supabaseKey=n;const d=JS(i);if(!n)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",d),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",d),this.storageUrl=new URL("storage/v1",d),this.functionsUrl=new URL("functions/v1",d);const h=`sb-${d.hostname.split(".")[0]}-auth-token`,m={db:xS,realtime:OS,auth:Ze(Ze({},CS),{},{storageKey:h}),global:AS,tracePropagation:RS},g=YS(r??{},m);if(this.settings=g,this.storageKey=(l=g.auth.storageKey)!==null&&l!==void 0?l:"",this.headers=(u=g.global.headers)!==null&&u!==void 0?u:{},g.accessToken)this.accessToken=g.accessToken,this.auth=new Proxy({},{get:(w,b)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(b)} is not possible`)}});else{var p;this.auth=this._initSupabaseAuthClient((p=g.auth)!==null&&p!==void 0?p:{},this.headers,g.global.fetch)}this.fetch=GS(n,i,this._getAccessToken.bind(this),g.global.fetch,g.tracePropagation),this.realtime=this._initRealtimeClient(Ze({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},g.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(w=>this.realtime.setAuth(w)).catch(w=>console.warn("Failed to set initial Realtime auth token:",w)),this.rest=new rb(new URL("rest/v1",d).href,{headers:this.headers,schema:g.db.schema,fetch:this.fetch,timeout:g.db.timeout,urlLengthLimit:g.db.urlLengthLimit}),this.storage=new Tw(this.storageUrl.href,this.headers,this.fetch,r?.storage),g.accessToken||this._listenForAuthEvents()}get functions(){return new Q0(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(i){return this.rest.from(i)}schema(i){return this.rest.schema(i)}rpc(i,n={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(i,n,r)}channel(i,n={config:{}}){return this.realtime.channel(i,n)}getChannels(){return this.realtime.getChannels()}removeChannel(i){return this.realtime.removeChannel(i)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var i=this,n,r;if(i.accessToken)return await i.accessToken();const{data:l}=await i.auth.getSession();return(n=(r=l.session)===null||r===void 0?void 0:r.access_token)!==null&&n!==void 0?n:i.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:i,persistSession:n,detectSessionInUrl:r,storage:l,userStorage:u,storageKey:d,flowType:h,lock:m,debug:g,throwOnError:p,experimental:w,lockAcquireTimeout:b,skipAutoInitialize:k},S,C){const D={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new XS({url:this.authUrl.href,headers:Ze(Ze({},D),S),storageKey:d,autoRefreshToken:i,persistSession:n,detectSessionInUrl:r,storage:l,userStorage:u,flowType:h,lock:m,debug:g,throwOnError:p,experimental:w,fetch:C,lockAcquireTimeout:b,skipAutoInitialize:k,hasCustomAuthorizationHeader:Object.keys(this.headers).some(I=>I.toLowerCase()==="authorization")})}_initRealtimeClient(i){return new Yb(this.realtimeUrl.href,Ze(Ze({},i),{},{params:Ze(Ze({},{apikey:this.supabaseKey}),i?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((i,n)=>{this._handleTokenChanged(i,"CLIENT",n?.access_token)})}_handleTokenChanged(i,n,r){(i==="TOKEN_REFRESHED"||i==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):i==="SIGNED_OUT"&&(this.realtime.setAuth(),n=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const WS=(i,n,r)=>new QS(i,n,r);function ZS(){if(typeof window<"u")return!1;const i=globalThis.process;if(!i)return!1;const n=i.version;if(n==null)return!1;const r=n.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=20:!1}ZS()&&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 Node.js 22 or later. For more information, visit: https://github.com/orgs/supabase/discussions/45715");const FS="https://otbyfkjxrkngvjziawki.supabase.co",e_="sb_publishable_NpUs0RDJH2YnllsqTKO6TQ_1jTdSsNQ",Ln=WS(FS,e_,{auth:{autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"pkce",storageKey:"livedesk.mindexec.supabase.auth"}}),md=new WeakMap;function t_(i){return String(i.frameMode||i.mode||"").toLowerCase()==="mode2-lz4"||String(i.compression||"").toLowerCase()==="lz4"||String(i.mimeType||"").toLowerCase()==="application/vnd.livedesk.lz4-raw"}function n_(i){return String(i.frameMode||i.mode||"").toLowerCase()==="mode3-h264-hw"||String(i.codec||"").toLowerCase()==="h264"||String(i.mimeType||"").toLowerCase()==="video/h264"}function cp(i,n,r){let l=r,u=n;if(l===15){let d=255;for(;d===255;){if(u>=i.length)throw new Error("Invalid LZ4 block: length overrun.");d=i[u],u+=1,l+=d}}return{length:l,cursor:u}}function a_(i,n){const r=new Uint8Array(n);let l=0,u=0;for(;l<i.length;){const d=i[l];l+=1;const h=cp(i,l,d>>4);l=h.cursor;const m=h.length;if(l+m>i.length||u+m>r.length)throw new Error("Invalid LZ4 block: literal overrun.");if(r.set(i.subarray(l,l+m),u),l+=m,u+=m,l>=i.length)break;if(l+2>i.length)throw new Error("Invalid LZ4 block: missing offset.");const g=i[l]|i[l+1]<<8;if(l+=2,g<=0||g>u)throw new Error("Invalid LZ4 block: bad match offset.");const p=cp(i,l,d&15);l=p.cursor;const w=p.length+4;if(u+w>r.length)throw new Error("Invalid LZ4 block: match overrun.");let b=u-g;for(let k=0;k<w;k+=1)r[u]=r[b],u+=1,b+=1}if(u!==r.length)throw new Error("Invalid LZ4 block: incomplete output.");return r}function i_(i){const n=Math.max(1,Math.floor(i.width||0)),r=Math.max(1,Math.floor(i.height||0)),l=Math.max(1,Math.floor(i.bytesPerPixel||4)),u=Math.max(n*r*l,Math.floor(i.uncompressedByteLength||0)),d=a_(new Uint8Array(i.payload),u),h=String(i.pixelFormat||i.codec||"").toLowerCase();if(l!==4)throw new Error(`Unsupported mode2 pixel size: ${l}`);const m=new Uint8ClampedArray(n*r*4);if(h==="rgba32"||h==="rgba")m.set(d.subarray(0,m.length));else for(let g=0,p=0;p<m.length;g+=4,p+=4)m[p]=d[g+2],m[p+1]=d[g+1],m[p+2]=d[g],m[p+3]=d[g+3];return new ImageData(m,n,r)}function r_(i){const n=window.VideoDecoder;if(!n||!window.EncodedVideoChunk)throw new Error("WebCodecs H.264 decode is not supported in this browser.");const r=md.get(i);if(r&&r.decoder.state!=="closed")return r;const u={decoder:new n({output:d=>{try{const h=d.displayWidth||d.codedWidth||i.width||960,m=d.displayHeight||d.codedHeight||i.height||540;(i.width!==h||i.height!==m)&&(i.width=h,i.height=m),i.getContext("2d")?.drawImage(d,0,0,h,m)}finally{d.close()}},error:()=>{md.delete(i)}}),configured:!1,keyFrameSeen:!1};return md.set(i,u),u}function s_(i,n){const r=r_(i);if(!r.configured){const d={codec:"avc1.42E01E",codedWidth:Math.max(1,Math.floor(n.width||960)),codedHeight:Math.max(1,Math.floor(n.height||540)),hardwareAcceleration:"prefer-hardware",optimizeForLatency:!0,avc:{format:String(n.h264Format||"").toLowerCase()==="avc"?"avc":"annexb"}};r.decoder.configure(d),r.configured=!0}const l=n.isKeyFrame===!0||String(n.chunkType||"").toLowerCase()==="key";if(!l&&!r.keyFrameSeen)return;l&&(r.keyFrameSeen=!0);const u=new EncodedVideoChunk({type:l?"key":"delta",timestamp:Math.max(0,Math.floor(n.timestampUs||n.frameSeq*1e3)),duration:Math.max(0,Math.floor(n.durationUs||0))||void 0,data:n.payload});r.decoder.decode(u)}async function l_(i,n,r){if(n_(n)){r()||s_(i,n);return}if(t_(n)){const g=i_(n);if(r())return;(i.width!==g.width||i.height!==g.height)&&(i.width=g.width,i.height=g.height),i.getContext("2d")?.putImageData(g,0,0);return}const l=new Blob([n.payload],{type:n.mimeType}),u=await createImageBitmap(l);if(r()){u.close();return}const d=n.width||u.width||960,h=n.height||u.height||540;(i.width!==d||i.height!==h)&&(i.width=d,i.height=h);const m=i.getContext("2d");m&&(m.clearRect(0,0,d,h),m.drawImage(u,0,0,d,h)),u.close()}const zs=5179,Lt=Xs(`http://127.0.0.1:${zs}`);function o_(i){const n=i.split(".").map(r=>Number(r));return n.length===4&&n.every(r=>Number.isInteger(r)&&r>=0&&r<=255)?n:[]}function u_(i){const n=i.trim().toLowerCase();return n==="localhost"||n==="127.0.0.1"||n==="::1"||n==="[::1]"}function c_(i){const n=i.trim().toLowerCase();return!n||n==="0.0.0.0"||n==="::"||n==="[::]"}function d_(i){const n=o_(i);return n.length===0?!1:n[0]===10||n[0]===172&&n[1]>=16&&n[1]<=31||n[0]===192&&n[1]===168}function h_(i){return i.includes(":")&&!i.startsWith("[")?`[${i}]`:i}function f_(i){const n=String(i||"").trim();if(!n)return null;const r=/^[a-z][a-z\d+.-]*:\/\//i.test(n)?n:`tcp://${n}`;try{const l=new URL(r),u=l.hostname.replace(/^\[|\]$/g,""),d=Number(l.port);return!u||!Number.isInteger(d)||d<1||d>65535||c_(u)?null:{host:u,port:d}}catch{return null}}function Xs(i){const n=String(i||"").trim()||`http://127.0.0.1:${zs}`,r=/^[a-z][a-z\d+.-]*:\/\//i.test(n)?n:`http://${n}`;try{const l=new URL(r);return l.port||(l.port=String(zs)),l.hash="",l.search="",l.toString().replace(/\/+$/,"")}catch{return`http://127.0.0.1:${zs}`}}function m_(i){const n=f_(i);return n?Xs(`http://${h_(n.host)}:${zs}`):""}function dp(i){const r=[i?.endpoint,...Array.isArray(i?.endpoint_candidates)?i.endpoint_candidates:[]].map(l=>m_(String(l||""))).filter(Boolean);return[...new Set(r)]}function Bs(i=Lt){if(!(typeof window>"u"||window.location.protocol!=="https:"))try{const n=new URL(i);if(n.protocol!=="http:")return;if(u_(n.hostname))return"loopback";if(d_(n.hostname))return"local"}catch{return}}function Ud(i,n=Lt){const r=new URL(i,Xs(n));return r.protocol=r.protocol==="https:"?"wss:":"ws:",r.toString()}async function Sn(i,n,r=Lt){const l=Xs(r),u={...n,headers:{"Content-Type":"application/json",...n?.headers||{}},cache:"no-store"},d=Bs(l);d&&(u.targetAddressSpace=d);let h;try{h=await fetch(`${l}${i}`,u)}catch(m){throw d?new Error("LiveDesk Hub is not reachable at this local network address. If Chrome shows a local network prompt, allow it; otherwise restart the Hub so port 5179 is open on the network."):m}if(!h.ok)throw new Error(`${h.status} ${h.statusText}`);return await h.json()}function g_(i){if(!i)return"-";const n=Date.now()-Date.parse(i);return Number.isFinite(n)?n<1e3?"now":n<6e4?`${Math.round(n/1e3)}s`:n<36e5?`${Math.round(n/6e4)}m`:`${Math.round(n/36e5)}h`:"-"}async function Cs(i){await navigator.clipboard.writeText(i)}const hp="livedesk_remote_host_targets",p_="livedesk_entitlements";function y_(i){const r=(Array.isArray(i)?i:[i||Lt]).map(l=>Xs(l||Lt));return[...new Set(r.filter(Boolean))]}function v_(){const[i,n]=$.useState(null),[r,l]=$.useState(!0);return $.useEffect(()=>{let u=!0;Ln.auth.getSession().then(({data:h})=>{u&&(n(h.session??null),l(!1))});const{data:{subscription:d}}=Ln.auth.onAuthStateChange((h,m)=>{n(m),l(!1)});return()=>{u=!1,d.unsubscribe()}},[]),{session:i,loading:r}}function b_(i,n=!0){const[r,l]=$.useState(null),[u,d]=$.useState([]),[h,m]=$.useState(""),[g,p]=$.useState(""),[w,b]=$.useState(0),k=Array.isArray(i)?i.join(`
38
+ `):String(i||""),S=$.useMemo(()=>y_(i),[k]),C=$.useMemo(()=>S.find(H=>Bs(H)==="loopback")||S[0]||Lt,[S]),D=$.useCallback(async()=>{if(!n){l(null),d([]),p(""),m("");return}let H=null;for(const q of S)try{const[P,Q]=await Promise.all([Sn("/api/remote/status",void 0,q),Sn("/api/remote/devices",void 0,q)]);l(P),d(Q.devices||[]),p(q),m("");return}catch(P){H=P}throw p(""),H||new Error("No LiveDesk Hub endpoint is reachable.")},[n,S]),I=$.useCallback(()=>{D().catch(H=>{m(H instanceof Error?H.message:String(H))}),b(H=>H+1)},[D]);return $.useEffect(()=>{if(!n){l(null),d([]),p(""),m("");return}let H=!0;const q=async()=>{try{await D()}catch(Q){H&&m(Q instanceof Error?Q.message:String(Q))}};q();const P=window.setInterval(q,2500);return()=>{H=!1,window.clearInterval(P)}},[n,D,w]),{status:r,devices:u,error:h,refresh:I,hubBaseUrl:g||C,hubCandidates:S}}function w_(i){const[n,r]=$.useState(null),[l,u]=$.useState(""),d=i?.user?.id||"",h=$.useCallback(async()=>{if(!d){r(null);return}const{data:m,error:g}=await Ln.from(hp).select("*").eq("user_id",d).maybeSingle();if(g){u(g.message);return}r(m),u("")},[d]);return $.useEffect(()=>{h()},[h]),$.useEffect(()=>{if(!d)return;const m=Ln.channel(`livedesk-remote-host-targets-${d.replace(/[^a-zA-Z0-9]/g,"")}`).on("postgres_changes",{event:"*",schema:"public",table:hp,filter:`user_id=eq.${d}`},g=>r(g.new)).subscribe();return()=>{Ln.removeChannel(m)}},[d]),{target:n,error:l,refresh:h}}function S_(i){const[n,r]=$.useState(null),[l,u]=$.useState(!1),[d,h]=$.useState(""),m=i?.user?.id||"",g=$.useCallback(async()=>{if(!m){r(null),h(""),u(!1);return}u(!0);const{data:w,error:b}=await Ln.from(p_).select("*").eq("user_id",m).eq("product_key","livedesk").maybeSingle();if(b){h(b.message),u(!1);return}r(w),h(""),u(!1)},[m]);$.useEffect(()=>{g()},[g]);const p=$.useMemo(()=>!n||n.status!=="active"?!1:n.expires_at?new Date(n.expires_at).getTime()>Date.now():!0,[n]);return{entitlement:n,licensed:p,loading:l,error:d,refresh:g}}function __(i,n,r=Lt,l={}){const[u,d]=$.useState(new Map),[h,m]=$.useState("idle"),g=$.useMemo(()=>[...i].sort().join(","),[i]),p=Number.isFinite(l.fps)?Number(l.fps):2,w=Number.isFinite(l.maxWidth)?Number(l.maxWidth):640,b=Number.isFinite(l.maxHeight)?Number(l.maxHeight):360,k=Number.isFinite(l.quality)?Number(l.quality):45,S=String(l.frameMode||l.mode||"mode3-h264-hw").trim()||"mode3-h264-hw";return $.useEffect(()=>{const C=g?g.split(",").filter(Boolean):[];if(C.length===0){m("idle"),d(new Map);return}const D=new WebSocket(Ud(`/api/remote/frames/ws?devices=${encodeURIComponent(C.join(","))}`,r));return D.binaryType="arraybuffer",m("connecting"),D.addEventListener("open",()=>{m("open"),D.send(JSON.stringify({type:"subscribe",deviceIds:C,autoStartLive:n,fps:p,maxWidth:w,maxHeight:b,quality:k,mode:S,frameMode:S}))}),D.addEventListener("message",I=>{if(typeof I.data=="string")return;const H=I.data instanceof ArrayBuffer?I.data:null;if(!H||H.byteLength<5)return;const P=new DataView(H).getUint32(0,!1);if(P<=0||P+4>H.byteLength)return;const Q=new Uint8Array(H.slice(4,4+P)),K=JSON.parse(new TextDecoder().decode(Q)),ae=H.slice(4+P),J={deviceId:String(K.deviceId||""),kind:K.kind==="thumbnail"?"thumbnail":"live",frameSeq:Number(K.frameSeq||0),streamId:String(K.streamId||""),width:Number(K.width||0),height:Number(K.height||0),mimeType:String(K.mimeType||"image/jpeg"),mode:K.mode?String(K.mode):void 0,frameMode:K.frameMode?String(K.frameMode):void 0,frameProfile:K.frameProfile?String(K.frameProfile):void 0,encoding:K.encoding?String(K.encoding):void 0,codec:K.codec?String(K.codec):void 0,compression:K.compression?String(K.compression):void 0,pixelFormat:K.pixelFormat?String(K.pixelFormat):void 0,bytesPerPixel:Number(K.bytesPerPixel||0)||0,uncompressedByteLength:Number(K.uncompressedByteLength||0)||0,h264Format:K.h264Format?String(K.h264Format):void 0,isKeyFrame:K.isKeyFrame===!0,chunkType:K.chunkType?String(K.chunkType):void 0,timestampUs:Number(K.timestampUs||0)||0,durationUs:Number(K.durationUs||0)||0,hardwareEncoder:K.hardwareEncoder?String(K.hardwareEncoder):void 0,platformProfile:K.platformProfile?String(K.platformProfile):void 0,capturedAt:String(K.capturedAt||""),receivedAt:String(K.receivedAt||""),byteLength:Number(K.byteLength||ae.byteLength),contentHash:K.contentHash?String(K.contentHash):void 0,payload:ae};J.deviceId&&d(_e=>{const we=_e.get(J.deviceId);if(we&&we.frameSeq>J.frameSeq)return _e;const Dt=new Map(_e);return Dt.set(J.deviceId,J),Dt})}),D.addEventListener("error",()=>m("error")),D.addEventListener("close",()=>m("closed")),()=>{D.close()}},[n,g,p,S,r,b,w,k]),{frames:u,state:h}}function T_(i,n=Lt){const r=$.useRef(null),[l,u]=$.useState("idle");$.useEffect(()=>{if(!i){r.current?.close(),r.current=null,u("idle");return}const h=new WebSocket(Ud("/api/remote/input/ws",n));return r.current=h,u("connecting"),h.addEventListener("open",()=>u("open")),h.addEventListener("close",()=>u("closed")),h.addEventListener("error",()=>u("error")),()=>{h.close(),r.current===h&&(r.current=null)}},[i,n]);const d=$.useCallback((h,m)=>{const g=r.current;return!g||g.readyState!==WebSocket.OPEN||!h?!1:(g.send(JSON.stringify({type:"input",requestId:crypto.randomUUID(),deviceId:h,input:{...m,issuedAt:new Date().toISOString()}})),!0)},[]);return{state:l,sendInput:d}}function k_(i){const n=String(i||"").toLowerCase();return n.includes("audio/pcm")||n.includes("audio/l16")||n.includes("f32le")||n.includes("s16le")}function E_(i,n,r){const l=Math.max(1,Math.min(8,Math.floor(n.channels||2))),u=Math.max(8e3,Math.min(192e3,Math.floor(n.sampleRate||48e3))),d=String(n.mimeType||"").toLowerCase(),h=d.includes("s16le")||d.includes("audio/l16"),m=h?2:4,g=Math.floor(r.byteLength/m),p=Math.floor(g/l),w=i.createBuffer(l,p,u),b=new DataView(r);for(let k=0;k<l;k+=1){const S=w.getChannelData(k);for(let C=0;C<p;C+=1){const I=(C*l+k)*m;S[C]=h?Math.max(-1,Math.min(1,b.getInt16(I,!0)/32768)):Math.max(-1,Math.min(1,b.getFloat32(I,!0)))}}return w}function A_(i,n,r=Lt){const l=$.useRef(null),u=$.useRef(0),[d,h]=$.useState("idle"),[m,g]=$.useState(null),[p,w]=$.useState("");return $.useEffect(()=>{if(!n||!i){h("idle"),g(null),w("");return}const b=window.AudioContext||window.webkitAudioContext;if(!b){h("unsupported"),w("Audio playback is not supported in this browser.");return}const k=new b;l.current=k,u.current=k.currentTime;const S=new WebSocket(Ud(`/api/remote/audio/ws?devices=${encodeURIComponent(i)}`,r));S.binaryType="arraybuffer";let C=!1;return h("connecting"),w(""),S.addEventListener("open",()=>{C||(h("open"),S.send(JSON.stringify({type:"subscribe",deviceIds:[i]})),k.resume())}),S.addEventListener("message",D=>{if(typeof D.data=="string")return;const I=D.data instanceof ArrayBuffer?D.data:null;!I||I.byteLength<5||(async()=>{try{const q=new DataView(I).getUint32(0,!1);if(q<=0||q+4>I.byteLength)return;const P=new Uint8Array(I.slice(4,4+q)),Q=JSON.parse(new TextDecoder().decode(P)),K=I.slice(4+q),ae={deviceId:String(Q.deviceId||""),frameSeq:Number(Q.frameSeq||0),streamId:String(Q.streamId||""),mimeType:String(Q.mimeType||"audio/webm;codecs=opus"),sampleRate:Number(Q.sampleRate||48e3),channels:Number(Q.channels||2),capturedAt:String(Q.capturedAt||""),receivedAt:String(Q.receivedAt||""),byteLength:Number(Q.byteLength||K.byteLength),payload:K};if(!ae.deviceId||C)return;const J=k_(ae.mimeType)?E_(k,ae,K):await k.decodeAudioData(K.slice(0));if(C)return;const _e=k.createBufferSource();_e.buffer=J,_e.connect(k.destination);const we=Math.max(k.currentTime+.02,u.current);_e.start(we),u.current=we+J.duration,g(ae),h("playing")}catch(H){C||(h("error"),w(H instanceof Error?H.message:String(H)))}})()}),S.addEventListener("error",()=>{C||h("error")}),S.addEventListener("close",()=>{C||h("closed")}),()=>{C=!0,S.close(),k.close().catch(()=>{}),l.current===k&&(l.current=null)}},[i,n,r]),{state:d,lastFrame:m,error:p}}const x_=120,C_=999,lr=4,Pp="livedesk.remoteDirectory",Nd="livedesk.localHubAccessEnabled",Ip="livedesk.streamSettings",O_=24*1024*1024,Nn={frameMode:"mode3-h264-hw",fps:12,maxWidth:960,maxHeight:540,quality:60,autoStartLive:!0},xo=[{id:"mode3-h264-hw",label:"Mode 3",detail:"H.264 hardware"},{id:"mode2-lz4",label:"Mode 2",detail:"LZ4 raw"},{id:"mode1-jpeg",label:"Mode 1",detail:"JPEG test"}],gd=[{id:"640x360",label:"Compact",width:640,height:360},{id:"960x540",label:"Standard",width:960,height:540},{id:"1280x720",label:"HD",width:1280,height:720}],R_=[2,5,8,12,20,24],j_=[45,60,75,90];function Hs(i,n){const r=i.capabilities?.[n];return typeof r=="boolean"?r:/^(1|true|yes|on)$/i.test(String(r||"").trim())}function Co(i){return i.deviceName||i.hostname||i.deviceId}function N_(){return"npx -y livedesk client"}function L_(){return"npx -y livedesk"}function D_(){try{return localStorage.getItem(Pp)||""}catch{return""}}function U_(){try{return localStorage.getItem(Nd)==="1"}catch{return!1}}function or(i){try{i?localStorage.setItem(Nd,"1"):localStorage.removeItem(Nd)}catch{}}function yr(i,n,r,l){const u=Number(i);return Number.isFinite(u)?Math.max(n,Math.min(r,Math.round(u))):l}function Gp(i){const n=String(i||"").trim();return xo.some(r=>r.id===n)?n:Nn.frameMode}function M_(){try{const i=JSON.parse(localStorage.getItem(Ip)||"{}"),n=yr(i.maxWidth,320,2560,Nn.maxWidth),r=yr(i.maxHeight,180,1440,Nn.maxHeight);return{frameMode:Gp(i.frameMode),fps:yr(i.fps,1,24,Nn.fps),maxWidth:n,maxHeight:r,quality:yr(i.quality,20,95,Nn.quality),autoStartLive:typeof i.autoStartLive=="boolean"?i.autoStartLive:Nn.autoStartLive}}catch{return Nn}}function z_(i){try{localStorage.setItem(Ip,JSON.stringify(i))}catch{}}function fp(i,n){return i.length!==n.length?!1:i.every((r,l)=>r===n[l])}function yi(i){if(!Number.isFinite(i)||i<=0)return"0 B";const n=["B","KB","MB","GB","TB"];let r=i,l=0;for(;r>=1024&&l<n.length-1;)r/=1024,l+=1;const u=l===0||r>=100?0:1;return`${r.toFixed(u)} ${n[l]}`}function B_(i){const n=new Uint8Array(i),r=32768;let l="";for(let u=0;u<n.length;u+=r){const d=n.subarray(u,u+r);l+=String.fromCharCode(...d)}return btoa(l)}function H_(i){return i===1?"middle":i===2?"right":"left"}function mp(i,...n){for(const r of n){const l=i?.[r];if(typeof l=="string"&&l.trim())return l.trim()}return""}function Os(i){const n=Number(i);return Number.isInteger(n)&&n>=1&&n<=C_?n:0}const q_={cpu:"CPU",memory:"MEM",disk:"Disk",gpu:"GPU",npu:"NPU",temp:"Temp",network:"Net"};function $_(i,n,r){if(i==="online")return"Online";if(i==="busy")return"Busy";if(i==="stale")return"Stale";if(i==="offline")return"Offline";if(r==="failed")return"Task failed";const l=i==="critical"?"critical":"warn",u=n.find(h=>h.state===l)||n.find(h=>h.state==="critical"||h.state==="warn");if(!u)return i==="critical"?"Issue":"Check";const d=q_[u.id]||u.label;return u.value&&u.value!=="-"?`${d} ${u.value}`:d}function $o(i,n){const r=n.split(".");let l=i;for(const u of r){if(l==null)return;if(Array.isArray(l)){const d=Number(u);l=Number.isInteger(d)?l[d]:void 0;continue}if(typeof l=="object"){l=l[u];continue}return}return l}function Je(i,...n){for(const r of n){const l=$o(i,r),u=Number(l);if(Number.isFinite(u))return u}}function Gt(i,...n){for(const r of n){const l=$o(i,r);if(typeof l=="string"&&l.trim())return l.trim();if(typeof l=="number"&&Number.isFinite(l))return String(l)}return""}function P_(i,...n){for(const r of n){const l=$o(i,r);if(typeof l=="boolean")return l;if(/^(1|true|yes|on|online|running|ready)$/i.test(String(l||"").trim()))return!0;if(/^(0|false|no|off|offline|stopped|missing)$/i.test(String(l||"").trim()))return!1}}function ia(i){const n=Number(i);if(Number.isFinite(n))return Math.max(0,Math.min(1,n>1?n/100:n))}function pd(i,n){if(!(typeof i!="number"||typeof n!="number"||!Number.isFinite(i)||!Number.isFinite(n)||i<=0))return ia((i-Math.max(0,n))/i)}function Rs(i){return i===void 0?"-":`${Math.round(i*100)}%`}function yd(i){return i===void 0||!Number.isFinite(i)?"":i>=1e3?`${(i/1e3).toFixed(i>=1e4?0:1)}Gb/s`:`${Math.round(i)}Mb/s`}function ur(i,n=.92,r=.78){return i===void 0?"unknown":i>=n?"critical":i>=r?"warn":"good"}function Vp(i){return!Number.isFinite(i)||!i||i<=0?"-":i<3600?`${Math.round(i/60)}m`:i<86400?`${Math.round(i/3600)}h`:`${Math.round(i/86400)}d`}function Eo(i,n,r){const l=$o(i,`tools.${n}`),u=Gt(i,`tools.${n}.status`,`tooling.${n}.status`,`${n}.status`).toLowerCase(),d=P_(i,`tools.${n}.running`,`tooling.${n}.running`,`${n}.running`),h=Gt(i,`tools.${n}.version`,`tooling.${n}.version`,`${n}.version`),m=Gt(i,`tools.${n}.port`,`tooling.${n}.port`,`${n}.port`);let g="unknown";return u==="busy"?g="busy":["online","running","ready","active"].includes(u)||d===!0?g="online":(["offline","stopped","missing","not-found"].includes(u)||d===!1||l===!1)&&(g="offline"),{id:n,label:r,status:g,detail:g==="offline"?"offline":h||(m?`:${m}`:g==="unknown"?"not reported":g)}}function Kp(i){const n=i.status||{},r=Je(n,"cpu.cores","cpuCores","processorCount"),l=Je(n,"loadavg.0","cpu.load1"),u=ia(Je(n,"cpu.usedRatio","cpu.usageRatio","cpu.ratio","cpu.usedPct","cpu.usagePct","cpu.percent")??(r&&l!==void 0?l/Math.max(1,r):void 0)),d=Je(n,"memory.totalBytes","totalMem"),h=Je(n,"memory.freeBytes","freeMem"),m=ia(Je(n,"memory.usedRatio","memory.usedPct","usedMemRatio"))??pd(d,h),g=Je(n,"disk.totalBytes","rootDisk.totalBytes","storage.totalBytes"),p=Je(n,"disk.freeBytes","rootDisk.freeBytes","storage.freeBytes"),w=ia(Je(n,"disk.usedRatio","disk.usedPct","rootDisk.usedRatio","storage.usedRatio"))??pd(g,p),b=Je(n,"thermal.cpuC","temperatureC","cpu.temperatureC","gpu.temperatureC"),k=ia(Je(n,"gpu.usedRatio","gpu.usageRatio","gpu.usedPct","gpu.usagePct","gpu.percent","accelerators.gpu.usageRatio")),S=Gt(n,"gpu.name","gpu.model","accelerators.gpu.name"),C=Je(n,"gpu.memory.totalBytes","gpu.totalMemoryBytes","gpu.vramTotalBytes"),D=Je(n,"gpu.memory.freeBytes","gpu.freeMemoryBytes","gpu.vramFreeBytes"),I=ia(Je(n,"gpu.memory.usedRatio","gpu.vramUsedRatio"))??pd(C,D),H=Je(n,"gpu.temperatureC","thermal.gpuC"),q=ia(Je(n,"npu.usedRatio","npu.usageRatio","npu.usedPct","npu.usagePct","npu.percent","accelerators.npu.usageRatio")),P=Gt(n,"npu.name","npu.model","accelerators.npu.name"),Q=Je(n,"npu.tops","npu.topsInt8","accelerators.npu.tops"),K=Je(n,"network.rxMbps","network.receiveMbps","network.downMbps"),ae=Je(n,"network.txMbps","network.transmitMbps","network.upMbps"),J=Je(n,"network.latencyMs","network.rttMs"),_e=ia(Je(n,"network.usedRatio","network.usageRatio","network.saturationRatio")),we=Gt(n,"network.link","network.interface","network.name"),Dt=b===void 0?void 0:ia((b-35)/60),gt=Gt(n,"workload.role","role","lane")||(Hs(i,"aiAssist")?"Agent worker":Hs(i,"taskDispatch")?"Task worker":"Local machine"),Le=Gt(i.latestTask,"status")||Gt(n,"workload.status")||"idle",pt=Gt(i.latestTask,"title","instructionPreview")||Gt(n,"workload.title"),vt=Gt(i.latestTask,"resultSummary","error","instructionPreview")||Gt(n,"workload.summary"),Pe=[Eo(n,"ollama","Ollama"),Eo(n,"lmStudio","LM Studio"),Eo(n,"comfyui","ComfyUI"),Eo(n,"stableDiffusion","Stable Diffusion")],L=Pe.some(U=>U.status!=="unknown"),G=Date.parse(i.lastSeenAt||i.connectedAt||""),ie=Number.isFinite(G)?Date.now()-G:0;let ee="online";i.connected?ie>5*6e4?ee="stale":(b??0)>=86||(H??0)>=88||(u??0)>=.94||(k??0)>=.96||(q??0)>=.96||(m??0)>=.94||(w??0)>=.94||(J??0)>=200||Le==="failed"?ee="critical":(b??0)>=78||(H??0)>=80||(u??0)>=.82||(k??0)>=.86||(q??0)>=.86||(m??0)>=.82||(w??0)>=.86||(J??0)>=80?ee="warn":(["queued","running","targeted"].includes(Le)||Pe.some(U=>U.status==="busy"))&&(ee="busy"):ee="offline";const Te=Pe.filter(U=>U.status==="online"||U.status==="busy").length,A=[{id:"cpu",label:"CPU",value:Rs(u),detail:r?`${r} cores`:l!==void 0?`load ${l.toFixed(1)}`:"not reported",ratio:u,state:ur(u,.92,.78)},{id:"memory",label:"MEM",value:Rs(m),detail:d?`${yi(d-(h||0))} / ${yi(d)}`:"not reported",ratio:m,state:ur(m,.92,.78)},{id:"disk",label:"DISK",value:Rs(w),detail:g&&p!==void 0?`${yi(p)} free`:"not reported",ratio:w,state:ur(w,.92,.82)},{id:"gpu",label:"GPU",value:Rs(k??I),detail:S||(C&&D!==void 0?`${yi(D)} VRAM free`:H!==void 0?`${Math.round(H)}C`:"not reported"),ratio:k??I,state:H!==void 0&&H>=88?"critical":H!==void 0&&H>=80?"warn":ur(k??I,.96,.86)},{id:"npu",label:"NPU",value:q!==void 0?Rs(q):Q!==void 0?`${Math.round(Q)} TOPS`:"-",detail:P||(Q!==void 0?"neural engine":"not reported"),ratio:q,state:ur(q,.96,.86)},{id:"temp",label:"TEMP",value:b===void 0?"-":`${Math.round(b)}C`,detail:Te>0?`${Te} local tools`:`uptime ${Vp(Je(n,"uptimeSec"))}`,ratio:Dt,state:b===void 0?"unknown":b>=86?"critical":b>=78?"warn":"good"},{id:"network",label:"NET",value:yd(K)||(J!==void 0?`${Math.round(J)}ms`:we||"-"),detail:yd(ae)?`${yd(ae)} up`:we||"not reported",ratio:_e,state:J!==void 0&&J>=200?"critical":J!==void 0&&J>=80?"warn":ur(_e,.9,.75)}];return{state:ee,label:$_(ee,A,Le),role:gt,taskLabel:pt||(Le==="idle"?"idle":Le),taskStatus:Le,taskSummary:vt,tools:L?Pe:Pe.map(U=>({...U,detail:"not reported"})),metrics:A}}const I_=[{id:"small",label:"Small"},{id:"medium",label:"Medium"},{id:"large",label:"Large"}],G_=[{id:"wall",label:"Wall",icon:vp,accent:"blue"},{id:"control",label:"Control",icon:wd,accent:"red"},{id:"agents",label:"Agents",icon:dr,accent:"violet"},{id:"doc",label:"Doc",icon:vd,accent:"amber"},{id:"pricing",label:"Pricing",icon:bd,accent:"green"},{id:"settings",label:"Settings",icon:bp,accent:"gray"}];function at(i){return i.replace(/\bRemoteHub\b/g,"Hub client endpoint").replace(/\bManagers\b/g,"Hubs").replace(/\bManager\b/g,"Hub").replace(/\bmanager\b/g,"Hub").replace(/\bMANAGER\b/g,"HUB").replace(/매니저/g,"Hub")}function cr(i){return i.map(n=>at(n))}function Ot(i){return{languageName:i.languageName,languageLabel:i.languageLabel,eyebrow:i.eyebrow,title:at(i.title),intro:at(i.intro),sections:[{title:at(i.managerTitle),body:at(i.managerBody),points:cr(i.managerPoints)},{title:at(i.clientTitle),body:at(i.clientBody),points:cr(i.clientPoints)},{title:at(i.syncTitle),body:at(i.syncBody),points:cr(i.syncPoints)},{title:at(i.platformTitle),body:at(i.platformBody),points:cr(i.platformPoints)}],sync:{title:at(i.syncTitle),body:at(i.syncBody),points:cr(i.syncPoints)},firewall:{title:at(i.firewallTitle),body:at(i.firewallBody),points:cr(i.firewallPoints)},commands:{title:at(i.commandsTitle),body:at(i.commandsBody),manager:at(i.managerCommandLabel),primary:at(i.clientCommandLabel),slot:at(i.slotCommandLabel),manual:at(i.manualCommandLabel)}}}const br={ko:Ot({languageName:"한국어",languageLabel:"문서 언어",eyebrow:"LiveDesk Manual",title:"한 줄로 여는 로컬 Screen Wall",intro:"LiveDesk는 매니저 PC 한 대에서 여러 작업 PC, AI 박스, 맥미니, 개발 장비를 한 화면에 모니터링하고 필요한 제어를 실행하는 npm-first 원격 작업 데크입니다.",managerTitle:"1. 매니저 실행",managerBody:"화면을 모아 볼 컴퓨터에서 LiveDesk 매니저를 실행합니다. 매니저는 UI와 로컬 서버를 같이 열고 브라우저를 http://127.0.0.1:5179 로 띄웁니다.",managerPoints:["명령은 npx -y livedesk 입니다.","매니저는 Screen Wall/API 포트 5179와 클라이언트 접속 포트 5197을 사용합니다.","기존 LiveDesk 포트가 남아 있으면 기본적으로 정리하고 새로 시작합니다. 필요하면 --no-clean 을 붙입니다."],clientTitle:"2. 워크스테이션 연결",clientBody:"모니터링할 PC에서는 같은 Google 계정으로 로그인합니다. 매니저가 켜져 있지 않아도 클라이언트는 종료하지 않고 5초마다 계속 찾습니다.",clientPoints:["빈 자리에 자동 배치하려면 npx -y livedesk client 를 실행합니다.","자리 번호를 고정하려면 npx -y livedesk client 3 처럼 번호를 붙입니다.","컴퓨터가 많을 때도 다시 로그인하지 않도록 집요하게 재접속을 시도합니다."],syncTitle:"3. Sync Server와 자동 발견",syncBody:"Sync Server는 이 매니저를 현재 계정의 활성 Screen Wall로 Supabase에 등록합니다. 클라이언트는 같은 Google 계정으로 로그인한 뒤 그 기록을 읽고 접속 후보들을 순서대로 시도합니다.",syncPoints:["등록 정보에는 host instance, LAN/private 주소, public 후보 주소, pair token, 짧은 lease가 포함됩니다.","같은 LAN 후보를 먼저 쓰고, 필요하면 외부 주소 후보를 시도합니다.","매니저 위치, VPN, 방화벽, 공유기 설정이 바뀌었거나 개발 중 활성 매니저를 바꿀 때 Sync Server를 누릅니다.","이제 livedesk.pages.dev의 Chrome Local Network Access 허용은 기본 실행 경로가 아닙니다. npm 매니저 앱이 실제 서버입니다."],platformTitle:"4. 현재 플랫폼 상태",platformBody:"Windows는 실제 화면 전송까지 확인되었습니다. macOS와 Linux도 npm 구조로 같은 명령을 목표로 지원을 넓히고 있습니다.",platformPoints:["Windows: 현재 작동 확인.","macOS: manager/client 경로는 준비되어 있으며 화면 캡처와 제어에는 Screen Recording/Accessibility 권한이 필요합니다.","Linux: linux-x64 runtime, grim/gnome-screenshot/import/scrot 캡처, xdotool 입력 백엔드가 추가되었습니다. 오디오는 아직 비활성입니다."],firewallTitle:"방화벽과 외부 장소 연결",firewallBody:"같은 LAN 안에서는 보통 공유기 포트포워딩이 필요 없습니다. 다른 장소의 PC를 붙이려면 클라이언트가 매니저의 클라이언트 접속 포트에 도달할 수 있어야 합니다.",firewallPoints:["클라이언트 접속 포트는 TCP 5197입니다.","클라이언트 쪽은 나가는 연결이므로 보통 인바운드 포트 개방이 필요 없습니다.","다른 네트워크에서 붙일 때는 매니저 PC 방화벽에서 TCP 5197 인바운드를 허용하고, 공유기에서는 TCP 5197을 매니저 PC로 전달합니다.","Screen Wall/API 포트 5179는 매니저 UI용입니다. 외부 브라우저에서 Wall을 직접 열 필요가 있을 때만 별도로 노출을 검토합니다.","공개 인터넷에 바로 열기보다 VPN, Tailscale, ZeroTier, 고정 IP allowlist를 우선합니다."],commandsTitle:"현재 사용 명령",commandsBody:"웹사이트를 찾아가 설치 파일을 받는 방식보다 터미널 한 줄로 모든 운영체제에서 거의 같은 흐름을 쓰는 것이 LiveDesk의 기본 방향입니다.",managerCommandLabel:"매니저 시작",clientCommandLabel:"워크스테이션 연결",slotCommandLabel:"3번 슬롯에 고정",manualCommandLabel:"고급 수동 연결"}),en:Ot({languageName:"English",languageLabel:"Document language",eyebrow:"LiveDesk Manual",title:"Open a local Screen Wall with one command",intro:"LiveDesk is an npm-first remote work deck for monitoring many workstations, AI boxes, Mac minis, and dev machines from one manager PC.",managerTitle:"1. Run the manager",managerBody:"Run LiveDesk on the computer that will watch the screens. The manager starts the UI and local server together, then opens http://127.0.0.1:5179.",managerPoints:["The command is npx -y livedesk.","The manager uses port 5179 for the Screen Wall/API and port 5197 for client connections.","If an old LiveDesk process still owns those ports, startup cleans it by default. Add --no-clean when you want to keep it."],clientTitle:"2. Connect a workstation",clientBody:"On each monitored computer, sign in with the same Google account. If no manager is online yet, the client keeps running and retries every 5 seconds.",clientPoints:["Run npx -y livedesk client for first available placement.","Run npx -y livedesk client 3 to pin the machine to slot 3.","Clients keep trying so large workstation stacks do not need repeated sign-in."],syncTitle:"3. Sync Server and discovery",syncBody:"Sync Server publishes this manager as the active Screen Wall for the signed-in account. Clients read that Supabase record after Google sign-in and try the endpoint candidates in order.",syncPoints:["The record includes host instance, LAN/private addresses, public endpoint candidates, pair token, and a short lease.","LAN candidates are preferred first, then public candidates if needed.","Press Sync Server after manager moves, VPN/firewall/router changes, or when this development machine should take over as active manager.","Chrome Local Network Access on livedesk.pages.dev is no longer the default runtime path. The npm manager app is the real server."],platformTitle:"4. Current platform state",platformBody:"Windows has been verified with live screen transfer. macOS and Linux follow the same npm command path as support expands.",platformPoints:["Windows: verified working.","macOS: manager/client paths are prepared; screen capture and control require Screen Recording/Accessibility permissions.","Linux: linux-x64 runtime, grim/gnome-screenshot/import/scrot capture, and xdotool input backend are added. Audio is still disabled."],firewallTitle:"Firewall and remote locations",firewallBody:"On the same LAN, router forwarding is usually unnecessary. For another office, building, or country, clients must be able to reach the manager client port.",firewallPoints:["Client connection port: TCP 5197.","Client machines normally only need outbound access.","For remote networks, allow inbound TCP 5197 on the manager firewall and forward TCP 5197 from the router to the manager PC.","Screen Wall/API port 5179 is for the manager UI. Expose it only if a remote browser must open the Wall directly.","Prefer VPN, Tailscale, ZeroTier, or fixed-IP allowlists over public internet exposure."],commandsTitle:"Current commands",commandsBody:"The product direction is one terminal command across operating systems instead of finding a website, downloading, and installing manually.",managerCommandLabel:"Start manager",clientCommandLabel:"Connect workstation",slotCommandLabel:"Pin to slot 3",manualCommandLabel:"Advanced manual connection"}),ja:Ot({languageName:"日本語",languageLabel:"ドキュメント言語",eyebrow:"LiveDesk Manual",title:"1行でローカル Screen Wall を開く",intro:"LiveDesk は、複数の作業 PC、AI マシン、Mac mini、開発機を1台の manager PC から監視する npm-first のリモート作業デッキです。",managerTitle:"1. manager を実行",managerBody:"画面を集めて見るコンピューターで LiveDesk manager を実行します。UI とローカルサーバーが同時に起動し、http://127.0.0.1:5179 が開きます。",managerPoints:["コマンドは npx -y livedesk です。","Screen Wall/API は 5179、client 接続は 5197 を使います。","古い LiveDesk プロセスがポートを使っている場合は、基本的に自動で整理して起動します。"],clientTitle:"2. workstation を接続",clientBody:"監視される PC で同じ Google アカウントにログインします。manager がまだ無くても client は終了せず、5秒ごとに再試行します。",clientPoints:["空きスロットに入れるには npx -y livedesk client を実行します。","スロットを固定するには npx -y livedesk client 3 のように番号を付けます。","大量の PC でも再ログインなしで待ち続けます。"],syncTitle:"3. Sync Server と自動検出",syncBody:"Sync Server はこの manager を現在の Google アカウントの active Screen Wall として Supabase に登録します。",syncPoints:["host instance、LAN/private アドレス、public 候補、pair token、短い lease を登録します。","client は LAN 候補を優先し、必要なら public 候補も試します。","VPN、firewall、router、manager の場所が変わったら Sync Server を押します。","livedesk.pages.dev の Chrome Local Network Access は標準実行経路ではありません。npm manager アプリが実際のサーバーです。"],platformTitle:"4. 現在のプラットフォーム状態",platformBody:"Windows は live screen transfer まで確認済みです。macOS と Linux も同じ npm コマンド経路を目標に対応を広げています。",platformPoints:["Windows: 動作確認済み。","macOS: 画面取得と制御には Screen Recording/Accessibility 権限が必要です。","Linux: linux-x64 runtime、grim/gnome-screenshot/import/scrot capture、xdotool input backend を追加済み。audio は未対応です。"],firewallTitle:"Firewall と外部拠点",firewallBody:"同じ LAN なら通常 router forwarding は不要です。外部拠点では client が manager の接続ポートへ到達できる必要があります。",firewallPoints:["client 接続ポートは TCP 5197 です。","client 側は通常 outbound だけで足ります。","外部 network では manager PC の firewall で TCP 5197 inbound を許可し、router から manager PC へ forward します。","5179 は manager UI 用なので、外部ブラウザで Wall を開く必要がある時だけ公開を検討します。","公開 internet より VPN、Tailscale、ZeroTier、IP allowlist を優先してください。"],commandsTitle:"現在のコマンド",commandsBody:"Web サイトから installer を探すより、OS をまたいで terminal 1行で動かす方向です。",managerCommandLabel:"manager 起動",clientCommandLabel:"workstation 接続",slotCommandLabel:"slot 3 に固定",manualCommandLabel:"高度な手動接続"}),"zh-CN":Ot({languageName:"简体中文",languageLabel:"文档语言",eyebrow:"LiveDesk Manual",title:"用一条命令打开本地 Screen Wall",intro:"LiveDesk 是 npm-first 的远程工作台,用一台 manager PC 监控多台工作站、AI 主机、Mac mini 和开发机器。",managerTitle:"1. 运行 manager",managerBody:"在负责查看屏幕的电脑上运行 LiveDesk manager。它会同时启动 UI 和本地服务器,并打开 http://127.0.0.1:5179。",managerPoints:["命令是 npx -y livedesk。","Screen Wall/API 使用 5179,client 连接使用 5197。","如果旧的 LiveDesk 进程占用端口,默认会清理后重新启动。"],clientTitle:"2. 连接 workstation",clientBody:"在被监控的电脑上使用同一个 Google 账号登录。即使 manager 还没在线,client 也会继续运行并每 5 秒重试。",clientPoints:["自动放入空位: npx -y livedesk client。","固定到 3 号位置: npx -y livedesk client 3。","大量电脑也可以持续等待,不需要反复登录。"],syncTitle:"3. Sync Server 和自动发现",syncBody:"Sync Server 会把当前 manager 作为该账号的 active Screen Wall 写入 Supabase。client 登录后读取记录并依次尝试连接候选地址。",syncPoints:["记录包括 host instance、LAN/private 地址、public 候选、pair token 和短 lease。","优先尝试同一 LAN 地址,需要时再尝试外部地址。","manager 位置、VPN、防火墙或路由变化后请点击 Sync Server。","livedesk.pages.dev 的 Chrome Local Network Access 不再是默认运行方式。npm manager app 才是真正服务器。"],platformTitle:"4. 当前平台状态",platformBody:"Windows 已确认可传输实时画面。macOS 和 Linux 正按同一 npm 命令路径扩展支持。",platformPoints:["Windows: 已确认可用。","macOS: 画面捕获和控制需要 Screen Recording/Accessibility 权限。","Linux: 已加入 linux-x64 runtime、grim/gnome-screenshot/import/scrot 捕获、xdotool 输入后端。音频尚未启用。"],firewallTitle:"防火墙和外部地点",firewallBody:"同一 LAN 通常不需要路由端口转发。不同地点连接时,client 必须能访问 manager 的 client 连接端口。",firewallPoints:["client 连接端口是 TCP 5197。","client 机器通常只需要出站访问。","跨网络时,在 manager 防火墙放行 TCP 5197 入站,并在路由器转发到 manager PC。","5179 是 manager UI 端口,仅在需要远程浏览器直接打开 Wall 时考虑暴露。","优先使用 VPN、Tailscale、ZeroTier 或固定 IP allowlist。"],commandsTitle:"当前命令",commandsBody:"产品方向是跨操作系统使用一条终端命令,而不是先找网站、下载、安装。",managerCommandLabel:"启动 manager",clientCommandLabel:"连接 workstation",slotCommandLabel:"固定到 slot 3",manualCommandLabel:"高级手动连接"}),"zh-TW":Ot({languageName:"繁體中文",languageLabel:"文件語言",eyebrow:"LiveDesk Manual",title:"用一行指令開啟本機 Screen Wall",intro:"LiveDesk 是 npm-first 的遠端工作台,用一台 manager PC 監看多台工作站、AI 主機、Mac mini 與開發機。",managerTitle:"1. 執行 manager",managerBody:"在負責看畫面的電腦上執行 LiveDesk manager。它會同時啟動 UI 與本機伺服器,並開啟 http://127.0.0.1:5179。",managerPoints:["指令是 npx -y livedesk。","Screen Wall/API 使用 5179,client 連線使用 5197。","若舊的 LiveDesk 程序占用連接埠,預設會清理後重新啟動。"],clientTitle:"2. 連接 workstation",clientBody:"在被監看的電腦上使用同一個 Google 帳號登入。即使 manager 尚未上線,client 也會持續執行並每 5 秒重試。",clientPoints:["自動放入空位: npx -y livedesk client。","固定到 3 號位置: npx -y livedesk client 3。","大量電腦也能持續等待,不需要反覆登入。"],syncTitle:"3. Sync Server 與自動探索",syncBody:"Sync Server 會把目前 manager 登錄為此帳號的 active Screen Wall。client 登入後讀取 Supabase 記錄並依序嘗試連線候選地址。",syncPoints:["記錄包含 host instance、LAN/private 位址、public 候選、pair token 與短 lease。","優先嘗試 LAN 位址,需要時再嘗試外部位址。","manager 位置、VPN、防火牆或路由設定改變後請按 Sync Server。","livedesk.pages.dev 的 Chrome Local Network Access 不再是預設執行路徑。npm manager app 才是真正伺服器。"],platformTitle:"4. 目前平台狀態",platformBody:"Windows 已確認可傳輸即時畫面。macOS 與 Linux 也沿用相同 npm 指令路徑擴充支援。",platformPoints:["Windows: 已確認可用。","macOS: 畫面擷取與控制需要 Screen Recording/Accessibility 權限。","Linux: 已加入 linux-x64 runtime、grim/gnome-screenshot/import/scrot capture、xdotool input backend。音訊尚未啟用。"],firewallTitle:"防火牆與外部地點",firewallBody:"同一 LAN 通常不需要路由器轉發。不同地點連線時,client 必須能到達 manager 的 client 連線埠。",firewallPoints:["client 連線埠是 TCP 5197。","client 電腦通常只需要對外連線。","跨網路時,請在 manager 防火牆允許 TCP 5197 inbound,並從路由器轉發到 manager PC。","5179 是 manager UI 連接埠,只在需要遠端瀏覽器直接打開 Wall 時才考慮公開。","優先使用 VPN、Tailscale、ZeroTier 或固定 IP allowlist。"],commandsTitle:"目前指令",commandsBody:"產品方向是跨作業系統用一行 terminal 指令,而不是先找網站、下載、安裝。",managerCommandLabel:"啟動 manager",clientCommandLabel:"連接 workstation",slotCommandLabel:"固定到 slot 3",manualCommandLabel:"進階手動連線"}),es:Ot({languageName:"Español",languageLabel:"Idioma del documento",eyebrow:"LiveDesk Manual",title:"Abre un Screen Wall local con un comando",intro:"LiveDesk es una consola npm-first para vigilar muchas estaciones, cajas de IA, Mac mini y equipos de desarrollo desde un PC manager.",managerTitle:"1. Ejecuta el manager",managerBody:"Ejecuta LiveDesk en el equipo que verá las pantallas. El manager inicia la UI y el servidor local juntos y abre http://127.0.0.1:5179.",managerPoints:["El comando es npx -y livedesk.","El manager usa 5179 para Screen Wall/API y 5197 para conexiones client.","Si un proceso antiguo ocupa los puertos, el arranque lo limpia por defecto."],clientTitle:"2. Conecta una workstation",clientBody:"En cada equipo monitoreado, inicia sesión con la misma cuenta Google. Si el manager aún no está activo, el client sigue intentando cada 5 segundos.",clientPoints:["Usa npx -y livedesk client para el primer slot libre.","Usa npx -y livedesk client 3 para fijar el equipo al slot 3.","Los clients siguen esperando para no repetir login en muchas máquinas."],syncTitle:"3. Sync Server y descubrimiento",syncBody:"Sync Server publica este manager como Screen Wall activo para la cuenta. Los clients leen el registro en Supabase y prueban los endpoints.",syncPoints:["Incluye host instance, direcciones LAN/private, candidatos public, pair token y lease corto.","Primero se prueban candidatos LAN, luego públicos si hace falta.","Pulsa Sync Server después de cambios de manager, VPN, firewall o router.","Chrome Local Network Access en livedesk.pages.dev ya no es el flujo principal. La app npm manager es el servidor real."],platformTitle:"4. Estado de plataformas",platformBody:"Windows ya fue verificado con transferencia de pantalla. macOS y Linux siguen el mismo camino npm.",platformPoints:["Windows: verificado.","macOS: captura y control requieren permisos Screen Recording/Accessibility.","Linux: agregado linux-x64 runtime, captura grim/gnome-screenshot/import/scrot y entrada xdotool. Audio aún desactivado."],firewallTitle:"Firewall y sedes remotas",firewallBody:"En la misma LAN normalmente no hace falta port forwarding. Para otra red, los clients deben llegar al puerto client del manager.",firewallPoints:["Puerto de conexión client: TCP 5197.","Los equipos client normalmente solo necesitan salida.","Para redes remotas, permite TCP 5197 inbound en el manager y reenvía TCP 5197 al PC manager.","El puerto 5179 es para la UI del manager; expónlo solo si un navegador remoto debe abrir el Wall.","Prefiere VPN, Tailscale, ZeroTier o allowlist de IP fijas."],commandsTitle:"Comandos actuales",commandsBody:"La dirección del producto es un comando de terminal común entre sistemas, no descargar e instalar desde una web.",managerCommandLabel:"Iniciar manager",clientCommandLabel:"Conectar workstation",slotCommandLabel:"Fijar al slot 3",manualCommandLabel:"Conexión manual avanzada"}),fr:Ot({languageName:"Français",languageLabel:"Langue du document",eyebrow:"LiveDesk Manual",title:"Ouvrir un Screen Wall local en une commande",intro:"LiveDesk est un deck npm-first pour surveiller plusieurs postes, machines IA, Mac mini et machines dev depuis un PC manager.",managerTitle:"1. Lancer le manager",managerBody:"Lancez LiveDesk sur l’ordinateur qui observe les écrans. Le manager démarre l’UI et le serveur local, puis ouvre http://127.0.0.1:5179.",managerPoints:["La commande est npx -y livedesk.","Le manager utilise 5179 pour Screen Wall/API et 5197 pour les connexions client.","Si un ancien processus utilise les ports, le démarrage le nettoie par défaut."],clientTitle:"2. Connecter une workstation",clientBody:"Sur chaque ordinateur surveillé, connectez-vous avec le même compte Google. Si le manager n’est pas encore actif, le client réessaie toutes les 5 secondes.",clientPoints:["Utilisez npx -y livedesk client pour le premier slot libre.","Utilisez npx -y livedesk client 3 pour fixer la machine au slot 3.","Les clients continuent d’attendre pour éviter les reconnexions répétées."],syncTitle:"3. Sync Server et découverte",syncBody:"Sync Server publie ce manager comme Screen Wall actif du compte. Les clients lisent l’enregistrement Supabase et testent les endpoints.",syncPoints:["Il contient host instance, adresses LAN/private, candidats public, pair token et lease court.","Les candidats LAN sont essayés en premier, puis les candidats publics si besoin.","Cliquez Sync Server après un changement de manager, VPN, firewall ou routeur.","Chrome Local Network Access sur livedesk.pages.dev n’est plus le chemin par défaut. L’app npm manager est le vrai serveur."],platformTitle:"4. État des plateformes",platformBody:"Windows est vérifié avec transfert d’écran live. macOS et Linux suivent le même chemin npm.",platformPoints:["Windows: vérifié.","macOS: capture et contrôle nécessitent Screen Recording/Accessibility.","Linux: runtime linux-x64, capture grim/gnome-screenshot/import/scrot et entrée xdotool ajoutés. Audio désactivé."],firewallTitle:"Firewall et sites distants",firewallBody:"Sur le même LAN, le port forwarding est rarement nécessaire. Depuis un autre réseau, les clients doivent atteindre le port client du manager.",firewallPoints:["Port de connexion client: TCP 5197.","Les machines client ont normalement seulement besoin de sortie réseau.","Pour un réseau distant, autorisez TCP 5197 entrant sur le manager et redirigez TCP 5197 vers le PC manager.","Le port 5179 sert à l’UI manager; exposez-le seulement si un navigateur distant doit ouvrir le Wall.","Préférez VPN, Tailscale, ZeroTier ou allowlist IP fixes."],commandsTitle:"Commandes actuelles",commandsBody:"La direction produit est une commande terminal commune aux OS, plutôt qu’un téléchargement manuel depuis un site.",managerCommandLabel:"Démarrer manager",clientCommandLabel:"Connecter workstation",slotCommandLabel:"Fixer au slot 3",manualCommandLabel:"Connexion manuelle avancée"}),de:Ot({languageName:"Deutsch",languageLabel:"Dokumentsprache",eyebrow:"LiveDesk Manual",title:"Lokale Screen Wall mit einem Befehl öffnen",intro:"LiveDesk ist ein npm-first Arbeitsdeck, um viele Workstations, AI-Boxen, Mac minis und Dev-Rechner von einem Manager-PC zu überwachen.",managerTitle:"1. Manager starten",managerBody:"Starte LiveDesk auf dem Computer, der die Screens sieht. Der Manager startet UI und lokalen Server zusammen und öffnet http://127.0.0.1:5179.",managerPoints:["Der Befehl ist npx -y livedesk.","Der Manager nutzt 5179 für Screen Wall/API und 5197 für Client-Verbindungen.","Wenn alte LiveDesk-Prozesse Ports belegen, werden sie beim Start standardmäßig bereinigt."],clientTitle:"2. Workstation verbinden",clientBody:"Melde dich auf jedem überwachten Computer mit demselben Google-Konto an. Wenn kein Manager online ist, versucht der Client alle 5 Sekunden weiter.",clientPoints:["npx -y livedesk client nutzt den ersten freien Slot.","npx -y livedesk client 3 fixiert den Rechner auf Slot 3.","Clients warten weiter, damit große Setups kein wiederholtes Login brauchen."],syncTitle:"3. Sync Server und Discovery",syncBody:"Sync Server veröffentlicht diesen Manager als aktive Screen Wall des Kontos. Clients lesen den Supabase-Eintrag und testen Endpoints der Reihe nach.",syncPoints:["Enthält host instance, LAN/private Adressen, public Kandidaten, pair token und kurze lease.","LAN-Kandidaten werden zuerst versucht, danach public Kandidaten.","Nach Änderungen an Manager, VPN, Firewall oder Router Sync Server drücken.","Chrome Local Network Access auf livedesk.pages.dev ist nicht mehr der Standardpfad. Die npm Manager App ist der echte Server."],platformTitle:"4. Plattformstatus",platformBody:"Windows wurde mit Live-Screen-Transfer geprüft. macOS und Linux folgen demselben npm-Pfad.",platformPoints:["Windows: verifiziert.","macOS: Capture und Control brauchen Screen Recording/Accessibility Rechte.","Linux: linux-x64 Runtime, grim/gnome-screenshot/import/scrot Capture und xdotool Input Backend sind ergänzt. Audio ist deaktiviert."],firewallTitle:"Firewall und entfernte Standorte",firewallBody:"Im gleichen LAN ist Router-Forwarding meist unnötig. Aus anderen Netzwerken müssen Clients den Client-Port des Managers erreichen.",firewallPoints:["Client-Verbindungsport: TCP 5197.","Client-Rechner brauchen normalerweise nur ausgehenden Zugriff.","Für entfernte Netzwerke TCP 5197 inbound am Manager erlauben und vom Router zum Manager-PC forwarden.","Port 5179 ist für die Manager-UI; nur öffnen, wenn ein Remote-Browser die Wall direkt öffnen muss.","VPN, Tailscale, ZeroTier oder feste IP-Allowlists bevorzugen."],commandsTitle:"Aktuelle Befehle",commandsBody:"Die Produktlinie ist ein Terminalbefehl über Betriebssysteme hinweg, statt Website suchen, herunterladen und installieren.",managerCommandLabel:"Manager starten",clientCommandLabel:"Workstation verbinden",slotCommandLabel:"An Slot 3 fixieren",manualCommandLabel:"Erweiterte manuelle Verbindung"}),"pt-BR":Ot({languageName:"Português",languageLabel:"Idioma do documento",eyebrow:"LiveDesk Manual",title:"Abra um Screen Wall local com um comando",intro:"LiveDesk é um deck npm-first para monitorar várias estações, caixas de IA, Mac minis e máquinas dev a partir de um PC manager.",managerTitle:"1. Execute o manager",managerBody:"Rode LiveDesk no computador que verá as telas. O manager inicia a UI e o servidor local juntos e abre http://127.0.0.1:5179.",managerPoints:["O comando é npx -y livedesk.","O manager usa 5179 para Screen Wall/API e 5197 para conexões client.","Se um processo antigo ocupa as portas, a inicialização limpa por padrão."],clientTitle:"2. Conecte uma workstation",clientBody:"Em cada computador monitorado, entre com a mesma conta Google. Se o manager ainda não estiver online, o client tenta a cada 5 segundos.",clientPoints:["Use npx -y livedesk client para o primeiro slot livre.","Use npx -y livedesk client 3 para fixar no slot 3.","Clients continuam tentando para evitar login repetido em muitos PCs."],syncTitle:"3. Sync Server e descoberta",syncBody:"Sync Server publica este manager como Screen Wall ativo da conta. Clients leem o registro no Supabase e testam endpoints.",syncPoints:["Inclui host instance, endereços LAN/private, candidatos public, pair token e lease curto.","Candidatos LAN vêm primeiro; public depois se necessário.","Clique Sync Server após mudanças de manager, VPN, firewall ou roteador.","Chrome Local Network Access em livedesk.pages.dev não é mais o caminho padrão. O app npm manager é o servidor real."],platformTitle:"4. Estado das plataformas",platformBody:"Windows foi verificado com transferência de tela. macOS e Linux seguem o mesmo caminho npm.",platformPoints:["Windows: verificado.","macOS: captura e controle precisam de permissões Screen Recording/Accessibility.","Linux: runtime linux-x64, captura grim/gnome-screenshot/import/scrot e entrada xdotool adicionados. Áudio ainda desativado."],firewallTitle:"Firewall e locais remotos",firewallBody:"Na mesma LAN normalmente não é preciso port forwarding. Em outra rede, clients precisam alcançar a porta client do manager.",firewallPoints:["Porta client: TCP 5197.","Máquinas client normalmente só precisam de saída.","Para redes remotas, permita TCP 5197 inbound no manager e encaminhe TCP 5197 para o PC manager.","A porta 5179 é para a UI do manager; exponha apenas se um navegador remoto precisar abrir o Wall.","Prefira VPN, Tailscale, ZeroTier ou allowlist de IP fixo."],commandsTitle:"Comandos atuais",commandsBody:"A direção do produto é um comando de terminal comum entre sistemas, não baixar e instalar manualmente.",managerCommandLabel:"Iniciar manager",clientCommandLabel:"Conectar workstation",slotCommandLabel:"Fixar no slot 3",manualCommandLabel:"Conexão manual avançada"}),it:Ot({languageName:"Italiano",languageLabel:"Lingua documento",eyebrow:"LiveDesk Manual",title:"Apri uno Screen Wall locale con un comando",intro:"LiveDesk è un deck npm-first per monitorare workstation, box AI, Mac mini e macchine dev da un solo PC manager.",managerTitle:"1. Avvia il manager",managerBody:"Esegui LiveDesk sul computer che guarderà gli schermi. Il manager avvia UI e server locale e apre http://127.0.0.1:5179.",managerPoints:["Il comando è npx -y livedesk.","Il manager usa 5179 per Screen Wall/API e 5197 per connessioni client.","Se vecchi processi occupano le porte, l’avvio le pulisce di default."],clientTitle:"2. Connetti una workstation",clientBody:"Su ogni computer monitorato, accedi con lo stesso account Google. Se il manager non è online, il client riprova ogni 5 secondi.",clientPoints:["npx -y livedesk client usa il primo slot libero.","npx -y livedesk client 3 fissa la macchina allo slot 3.","I client continuano a provare per evitare login ripetuti."],syncTitle:"3. Sync Server e discovery",syncBody:"Sync Server pubblica questo manager come Screen Wall attivo dell’account. I client leggono Supabase e provano gli endpoint.",syncPoints:["Include host instance, indirizzi LAN/private, candidati public, pair token e lease breve.","Prima LAN, poi public se necessario.","Premi Sync Server dopo cambi di manager, VPN, firewall o router.","Chrome Local Network Access su livedesk.pages.dev non è più il percorso principale. L’app npm manager è il server reale."],platformTitle:"4. Stato piattaforme",platformBody:"Windows è verificato con trasferimento schermo live. macOS e Linux seguono lo stesso percorso npm.",platformPoints:["Windows: verificato.","macOS: capture e control richiedono permessi Screen Recording/Accessibility.","Linux: aggiunti runtime linux-x64, capture grim/gnome-screenshot/import/scrot e input xdotool. Audio disattivato."],firewallTitle:"Firewall e sedi remote",firewallBody:"Nella stessa LAN di solito non serve port forwarding. Da altre reti, i client devono raggiungere la porta client del manager.",firewallPoints:["Porta client: TCP 5197.","I client normalmente richiedono solo uscita.","Per reti remote, abilita TCP 5197 inbound sul manager e inoltra TCP 5197 al PC manager.","La porta 5179 è per la UI manager; esponila solo se un browser remoto deve aprire il Wall.","Preferisci VPN, Tailscale, ZeroTier o IP allowlist."],commandsTitle:"Comandi attuali",commandsBody:"La direzione è un comando terminale comune tra sistemi operativi, invece di download e install manuale.",managerCommandLabel:"Avvia manager",clientCommandLabel:"Connetti workstation",slotCommandLabel:"Fissa allo slot 3",manualCommandLabel:"Connessione manuale avanzata"}),id:Ot({languageName:"Bahasa Indonesia",languageLabel:"Bahasa dokumen",eyebrow:"LiveDesk Manual",title:"Buka Screen Wall lokal dengan satu perintah",intro:"LiveDesk adalah deck npm-first untuk memantau banyak workstation, AI box, Mac mini, dan mesin dev dari satu PC manager.",managerTitle:"1. Jalankan manager",managerBody:"Jalankan LiveDesk di komputer yang melihat layar. Manager membuka UI dan server lokal bersama, lalu membuka http://127.0.0.1:5179.",managerPoints:["Perintahnya npx -y livedesk.","Manager memakai 5179 untuk Screen Wall/API dan 5197 untuk koneksi client.","Jika proses lama memakai port itu, startup membersihkannya secara default."],clientTitle:"2. Hubungkan workstation",clientBody:"Di komputer yang dipantau, masuk dengan akun Google yang sama. Jika manager belum online, client tetap mencoba tiap 5 detik.",clientPoints:["npx -y livedesk client memakai slot kosong pertama.","npx -y livedesk client 3 mengunci mesin ke slot 3.","Client terus mencoba agar banyak PC tidak perlu login berulang."],syncTitle:"3. Sync Server dan discovery",syncBody:"Sync Server menerbitkan manager ini sebagai Screen Wall aktif untuk akun. Client membaca Supabase dan mencoba endpoint.",syncPoints:["Berisi host instance, alamat LAN/private, kandidat public, pair token, dan lease pendek.","Kandidat LAN dicoba lebih dulu, lalu public jika perlu.","Tekan Sync Server setelah perubahan manager, VPN, firewall, atau router.","Chrome Local Network Access di livedesk.pages.dev bukan jalur utama lagi. App npm manager adalah server sebenarnya."],platformTitle:"4. Status platform",platformBody:"Windows sudah diverifikasi dengan live screen transfer. macOS dan Linux mengikuti jalur npm yang sama.",platformPoints:["Windows: terverifikasi.","macOS: capture dan control perlu izin Screen Recording/Accessibility.","Linux: runtime linux-x64, capture grim/gnome-screenshot/import/scrot, dan input xdotool sudah ditambahkan. Audio belum aktif."],firewallTitle:"Firewall dan lokasi luar",firewallBody:"Di LAN yang sama biasanya tidak perlu port forwarding. Dari jaringan lain, client harus mencapai port client manager.",firewallPoints:["Port client: TCP 5197.","Mesin client biasanya hanya perlu akses keluar.","Untuk jaringan luar, izinkan TCP 5197 inbound di manager dan forward TCP 5197 ke PC manager.","Port 5179 untuk UI manager; buka hanya jika browser luar harus membuka Wall.","Utamakan VPN, Tailscale, ZeroTier, atau IP allowlist."],commandsTitle:"Perintah saat ini",commandsBody:"Arah produk adalah satu perintah terminal lintas OS, bukan download dan instal manual.",managerCommandLabel:"Mulai manager",clientCommandLabel:"Hubungkan workstation",slotCommandLabel:"Kunci ke slot 3",manualCommandLabel:"Koneksi manual lanjutan"}),vi:Ot({languageName:"Tiếng Việt",languageLabel:"Ngôn ngữ tài liệu",eyebrow:"LiveDesk Manual",title:"Mở Screen Wall cục bộ bằng một lệnh",intro:"LiveDesk là deck npm-first để giám sát nhiều workstation, máy AI, Mac mini và máy dev từ một PC manager.",managerTitle:"1. Chạy manager",managerBody:"Chạy LiveDesk trên máy dùng để xem màn hình. Manager khởi động UI và server cục bộ cùng lúc, rồi mở http://127.0.0.1:5179.",managerPoints:["Lệnh là npx -y livedesk.","Manager dùng 5179 cho Screen Wall/API và 5197 cho kết nối client.","Nếu tiến trình cũ giữ port, startup mặc định sẽ dọn và khởi động lại."],clientTitle:"2. Kết nối workstation",clientBody:"Trên mỗi máy được giám sát, đăng nhập cùng tài khoản Google. Nếu manager chưa online, client tiếp tục thử mỗi 5 giây.",clientPoints:["npx -y livedesk client dùng slot trống đầu tiên.","npx -y livedesk client 3 ghim máy vào slot 3.","Client tiếp tục chờ để nhiều máy không cần đăng nhập lại."],syncTitle:"3. Sync Server và tự phát hiện",syncBody:"Sync Server đăng manager này là Screen Wall đang hoạt động của tài khoản. Client đọc Supabase và thử các endpoint.",syncPoints:["Bao gồm host instance, địa chỉ LAN/private, public candidate, pair token và lease ngắn.","Ưu tiên LAN trước, sau đó thử public nếu cần.","Bấm Sync Server sau thay đổi manager, VPN, firewall hoặc router.","Chrome Local Network Access trên livedesk.pages.dev không còn là đường chạy chính. App npm manager mới là server thật."],platformTitle:"4. Trạng thái nền tảng",platformBody:"Windows đã được kiểm chứng với truyền màn hình live. macOS và Linux đi theo cùng đường npm.",platformPoints:["Windows: đã kiểm chứng.","macOS: capture và control cần quyền Screen Recording/Accessibility.","Linux: đã thêm runtime linux-x64, capture grim/gnome-screenshot/import/scrot và input xdotool. Audio chưa bật."],firewallTitle:"Firewall và địa điểm ngoài",firewallBody:"Trong cùng LAN thường không cần port forwarding. Từ mạng khác, client phải truy cập được port client của manager.",firewallPoints:["Port client: TCP 5197.","Máy client thường chỉ cần kết nối outbound.","Với mạng ngoài, cho phép TCP 5197 inbound trên manager và forward TCP 5197 tới PC manager.","Port 5179 dành cho UI manager; chỉ mở nếu trình duyệt từ xa cần mở Wall trực tiếp.","Ưu tiên VPN, Tailscale, ZeroTier hoặc allowlist IP cố định."],commandsTitle:"Lệnh hiện tại",commandsBody:"Hướng sản phẩm là một lệnh terminal dùng chung giữa các OS, thay vì tải và cài thủ công.",managerCommandLabel:"Khởi động manager",clientCommandLabel:"Kết nối workstation",slotCommandLabel:"Ghim vào slot 3",manualCommandLabel:"Kết nối thủ công nâng cao"}),th:Ot({languageName:"ไทย",languageLabel:"ภาษาของเอกสาร",eyebrow:"LiveDesk Manual",title:"เปิด Screen Wall ภายในด้วยคำสั่งเดียว",intro:"LiveDesk คือ deck แบบ npm-first สำหรับดู workstation, กล่อง AI, Mac mini และเครื่อง dev หลายเครื่องจาก manager PC เครื่องเดียว",managerTitle:"1. รัน manager",managerBody:"รัน LiveDesk บนเครื่องที่ใช้ดูหน้าจอ Manager จะเปิด UI และ local server พร้อมกัน แล้วเปิด http://127.0.0.1:5179",managerPoints:["คำสั่งคือ npx -y livedesk","Manager ใช้ 5179 สำหรับ Screen Wall/API และ 5197 สำหรับ client connection","ถ้า process เก่ายังใช้ port อยู่ startup จะล้างให้โดย default"],clientTitle:"2. เชื่อม workstation",clientBody:"บนเครื่องที่ต้อง monitor ให้ login ด้วย Google account เดียวกัน ถ้า manager ยังไม่ออนไลน์ client จะลองใหม่ทุก 5 วินาที",clientPoints:["npx -y livedesk client จะใช้ slot ว่างแรก","npx -y livedesk client 3 จะตรึงเครื่องไว้ที่ slot 3","Client จะรอต่อเนื่องเพื่อไม่ต้อง login ซ้ำเมื่อมีหลายเครื่อง"],syncTitle:"3. Sync Server และ discovery",syncBody:"Sync Server จะ publish manager นี้เป็น active Screen Wall ของ account แล้ว client อ่านข้อมูลจาก Supabase และลอง endpoint ต่างๆ",syncPoints:["มี host instance, LAN/private address, public candidate, pair token และ short lease","ลอง LAN ก่อน แล้วค่อยลอง public ถ้าจำเป็น","กด Sync Server หลังเปลี่ยน manager, VPN, firewall หรือ router","Chrome Local Network Access บน livedesk.pages.dev ไม่ใช่ runtime หลักแล้ว app npm manager คือ server จริง"],platformTitle:"4. สถานะ platform",platformBody:"Windows ตรวจสอบแล้วว่าส่งภาพ live ได้ macOS และ Linux ใช้เส้นทาง npm เดียวกัน",platformPoints:["Windows: verified","macOS: capture/control ต้องใช้สิทธิ์ Screen Recording/Accessibility","Linux: เพิ่ม linux-x64 runtime, grim/gnome-screenshot/import/scrot capture และ xdotool input แล้ว audio ยังปิดอยู่"],firewallTitle:"Firewall และเครื่องต่างสถานที่",firewallBody:"ใน LAN เดียวกันปกติไม่ต้อง port forwarding ถ้าอยู่คนละ network client ต้องเข้าถึง client port ของ manager ได้",firewallPoints:["Client port คือ TCP 5197","เครื่อง client ปกติต้องการ outbound เท่านั้น","ถ้าอยู่นอก network ให้เปิด TCP 5197 inbound ที่ manager และ forward TCP 5197 ไปยัง manager PC","Port 5179 เป็น UI ของ manager เปิดเฉพาะเมื่อ browser ระยะไกลต้องเปิด Wall โดยตรง","ควรใช้ VPN, Tailscale, ZeroTier หรือ IP allowlist ก่อนเปิดสู่ public internet"],commandsTitle:"คำสั่งปัจจุบัน",commandsBody:"ทิศทาง product คือคำสั่ง terminal เดียวข้าม OS ไม่ใช่ download/install จากเว็บไซต์",managerCommandLabel:"เริ่ม manager",clientCommandLabel:"เชื่อม workstation",slotCommandLabel:"ตรึง slot 3",manualCommandLabel:"manual connection ขั้นสูง"}),hi:Ot({languageName:"हिन्दी",languageLabel:"दस्तावेज़ भाषा",eyebrow:"LiveDesk Manual",title:"एक कमांड से local Screen Wall खोलें",intro:"LiveDesk एक npm-first remote work deck है जिससे एक manager PC से कई workstation, AI box, Mac mini और dev machines देखे जा सकते हैं।",managerTitle:"1. manager चलाएं",managerBody:"जिस computer से screens देखनी हैं उस पर LiveDesk manager चलाएं। यह UI और local server साथ में शुरू करता है और http://127.0.0.1:5179 खोलता है।",managerPoints:["कमांड है npx -y livedesk।","Manager Screen Wall/API के लिए 5179 और client connections के लिए 5197 इस्तेमाल करता है।","अगर पुराने LiveDesk ports बचे हों तो startup default रूप से साफ करता है।"],clientTitle:"2. workstation जोड़ें",clientBody:"हर monitored computer पर उसी Google account से sign in करें। Manager online न हो तब भी client बंद नहीं होता और हर 5 सेकंड retry करता है।",clientPoints:["npx -y livedesk client पहला खाली slot लेता है।","npx -y livedesk client 3 machine को slot 3 पर pin करता है।","बहुत सी machines हों तब भी बार-बार login की जरूरत नहीं रहती।"],syncTitle:"3. Sync Server और discovery",syncBody:"Sync Server इस manager को account का active Screen Wall बनाकर Supabase में publish करता है। Clients record पढ़कर endpoints try करते हैं।",syncPoints:["इसमें host instance, LAN/private addresses, public candidates, pair token और short lease होता है।","LAN candidates पहले try होते हैं, जरूरत हो तो public candidates।","Manager, VPN, firewall या router बदलने के बाद Sync Server दबाएं।","livedesk.pages.dev का Chrome Local Network Access अब default runtime नहीं है। npm manager app ही real server है।"],platformTitle:"4. Platform status",platformBody:"Windows live screen transfer के साथ verified है। macOS और Linux भी इसी npm path पर आगे बढ़ रहे हैं।",platformPoints:["Windows: verified.","macOS: capture/control के लिए Screen Recording/Accessibility permissions चाहिए।","Linux: linux-x64 runtime, grim/gnome-screenshot/import/scrot capture और xdotool input backend जोड़े गए हैं। Audio अभी disabled है।"],firewallTitle:"Firewall और remote locations",firewallBody:"Same LAN में आम तौर पर router forwarding जरूरी नहीं। दूसरे network से clients को manager client port तक पहुंचना होगा।",firewallPoints:["Client connection port: TCP 5197.","Client machines को आम तौर पर सिर्फ outbound access चाहिए।","Remote network के लिए manager firewall में TCP 5197 inbound allow करें और router से TCP 5197 manager PC पर forward करें।","5179 manager UI port है; इसे तभी expose करें जब remote browser को Wall खोलना हो।","Public internet से पहले VPN, Tailscale, ZeroTier या fixed IP allowlist बेहतर है।"],commandsTitle:"Current commands",commandsBody:"Product direction है OS के बीच एक terminal command, website से download/install नहीं।",managerCommandLabel:"Start manager",clientCommandLabel:"Connect workstation",slotCommandLabel:"Pin to slot 3",manualCommandLabel:"Advanced manual connection"}),ar:Ot({languageName:"العربية",languageLabel:"لغة المستند",eyebrow:"LiveDesk Manual",title:"افتح Screen Wall محلي بأمر واحد",intro:"LiveDesk هو deck بنمط npm-first لمراقبة عدة workstations وأجهزة AI وMac mini وأجهزة تطوير من كمبيوتر manager واحد.",managerTitle:"1. شغل manager",managerBody:"شغل LiveDesk على الكمبيوتر الذي سيعرض الشاشات. يبدأ manager الواجهة والخادم المحلي معا ويفتح http://127.0.0.1:5179.",managerPoints:["الأمر هو npx -y livedesk.","يستخدم manager المنفذ 5179 للواجهة/API والمنفذ 5197 لاتصالات client.","إذا بقيت عملية LiveDesk قديمة على المنافذ، يتم تنظيفها افتراضيا عند التشغيل."],clientTitle:"2. وصل workstation",clientBody:"على كل كمبيوتر تتم مراقبته، سجل الدخول بنفس حساب Google. إذا لم يكن manager متاحا، يبقى client يعمل ويحاول كل 5 ثوان.",clientPoints:["npx -y livedesk client يختار أول slot فارغ.","npx -y livedesk client 3 يثبت الجهاز في slot 3.","clients تستمر بالمحاولة لتجنب تكرار تسجيل الدخول عند كثرة الأجهزة."],syncTitle:"3. Sync Server والاكتشاف",syncBody:"Sync Server ينشر هذا manager كـ active Screen Wall للحساب. يقرأ clients سجل Supabase ويجربون endpoints بالترتيب.",syncPoints:["السجل يتضمن host instance وعناوين LAN/private وpublic candidates وpair token وlease قصير.","يتم تفضيل LAN أولا، ثم public عند الحاجة.","اضغط Sync Server بعد تغيير manager أو VPN أو firewall أو router.","Chrome Local Network Access على livedesk.pages.dev لم يعد مسار التشغيل الافتراضي. تطبيق npm manager هو الخادم الحقيقي."],platformTitle:"4. حالة المنصات",platformBody:"Windows تم التحقق منه مع نقل شاشة live. macOS وLinux يتبعان نفس مسار npm.",platformPoints:["Windows: تم التحقق.","macOS: capture/control يحتاجان أذونات Screen Recording/Accessibility.","Linux: تمت إضافة linux-x64 runtime وgrim/gnome-screenshot/import/scrot capture وxdotool input. الصوت ما زال معطلا."],firewallTitle:"Firewall والمواقع البعيدة",firewallBody:"داخل نفس LAN غالبا لا تحتاج port forwarding. من شبكة أخرى يجب أن يصل client إلى منفذ manager client.",firewallPoints:["منفذ client: TCP 5197.","أجهزة client تحتاج عادة اتصال outbound فقط.","للشبكات البعيدة، اسمح TCP 5197 inbound على manager ووجه TCP 5197 من router إلى manager PC.","المنفذ 5179 مخصص لواجهة manager؛ اكشفه فقط إذا كان متصفح بعيد يحتاج فتح Wall مباشرة.","يفضل VPN أو Tailscale أو ZeroTier أو fixed IP allowlist بدل التعريض العام."],commandsTitle:"الأوامر الحالية",commandsBody:"اتجاه المنتج هو أمر terminal واحد عبر الأنظمة، وليس تحميل وتثبيت يدوي من موقع.",managerCommandLabel:"Start manager",clientCommandLabel:"Connect workstation",slotCommandLabel:"Pin to slot 3",manualCommandLabel:"Advanced manual connection"}),tr:Ot({languageName:"Türkçe",languageLabel:"Belge dili",eyebrow:"LiveDesk Manual",title:"Yerel Screen Wall tek komutla açılsın",intro:"LiveDesk, tek bir manager PC üzerinden birçok workstation, AI box, Mac mini ve dev machine izlemek için npm-first bir çalışma deckidir.",managerTitle:"1. Manager çalıştır",managerBody:"Ekranları izleyecek bilgisayarda LiveDesk manager çalıştır. Manager UI ve local server birlikte başlar ve http://127.0.0.1:5179 açılır.",managerPoints:["Komut: npx -y livedesk.","Manager Screen Wall/API için 5179, client bağlantıları için 5197 kullanır.","Eski LiveDesk process portları tutuyorsa başlangıç varsayılan olarak temizler."],clientTitle:"2. Workstation bağla",clientBody:"İzlenecek bilgisayarda aynı Google hesabıyla giriş yap. Manager henüz online değilse client kapanmaz ve her 5 saniyede tekrar dener.",clientPoints:["npx -y livedesk client ilk boş slota yerleşir.","npx -y livedesk client 3 makineyi slot 3’e sabitler.","Çok makinede tekrar tekrar login gerekmesin diye client beklemeye devam eder."],syncTitle:"3. Sync Server ve discovery",syncBody:"Sync Server bu managerı hesabın active Screen Wall kaydı olarak Supabase’e yazar. Clients bu kaydı okuyup endpoint adaylarını dener.",syncPoints:["Host instance, LAN/private adresler, public adaylar, pair token ve kısa lease içerir.","Önce LAN adayları, gerekirse public adaylar denenir.","Manager, VPN, firewall veya router değişince Sync Server’a bas.","livedesk.pages.dev üzerindeki Chrome Local Network Access artık default runtime yolu değil. Gerçek server npm manager app."],platformTitle:"4. Platform durumu",platformBody:"Windows live screen transfer ile doğrulandı. macOS ve Linux aynı npm yolunu takip ediyor.",platformPoints:["Windows: doğrulandı.","macOS: capture/control için Screen Recording/Accessibility izinleri gerekir.","Linux: linux-x64 runtime, grim/gnome-screenshot/import/scrot capture ve xdotool input backend eklendi. Audio kapalı."],firewallTitle:"Firewall ve uzak konumlar",firewallBody:"Aynı LAN içinde genelde router forwarding gerekmez. Başka ağdan clients manager client portuna ulaşabilmelidir.",firewallPoints:["Client port: TCP 5197.","Client makineler normalde sadece outbound erişim ister.","Uzak ağ için manager firewall üzerinde TCP 5197 inbound aç ve routerdan TCP 5197yi manager PCye forward et.","5179 manager UI portudur; sadece uzak browser Wall açacaksa expose et.","Public internet yerine VPN, Tailscale, ZeroTier veya sabit IP allowlist tercih et."],commandsTitle:"Güncel komutlar",commandsBody:"Ürün yönü, webden indirip kurmak yerine işletim sistemleri arasında ortak tek terminal komutu.",managerCommandLabel:"Manager başlat",clientCommandLabel:"Workstation bağla",slotCommandLabel:"Slot 3’e sabitle",manualCommandLabel:"Gelişmiş manuel bağlantı"})},V_=Object.entries(br).map(([i,n])=>({id:i,label:n.languageName}));function K_(){if(typeof navigator>"u")return"en";const i=navigator.languages?.length?navigator.languages:[navigator.language];for(const n of i){const r=n.toLowerCase();if(br[n])return n;if(r.startsWith("zh-tw")||r.startsWith("zh-hk"))return"zh-TW";if(r.startsWith("pt"))return"pt-BR";const l=r.split("-")[0];if(br[l])return l}return"en"}function gp({index:i,selected:n,onSelect:r}){const l=i+1;return y.jsx("article",{className:`device-tile placeholder-tile ${n?"selected":""}`,children:y.jsxs("button",{className:"tile-screen",onClick:r,"aria-pressed":n,title:`Select slot ${l}`,type:"button",children:[y.jsx("span",{className:"slot-grid","aria-hidden":"true"}),y.jsxs("span",{className:"empty-screen",children:[y.jsx(gr,{size:24}),y.jsxs("strong",{children:["Slot ",String(l).padStart(3,"0")]})]})]})})}function pp({device:i,frame:n,selected:r,controlEnabled:l,onSelect:u,onFocusDevice:d,onOpenControl:h,sendInput:m}){const g=$.useRef(null),p=$.useRef(0),w=Kp(i);$.useEffect(()=>{const S=g.current;if(!S||!n)return;let C=!1;return l_(S,n,()=>C).catch(()=>{}),()=>{C=!0}},[n]);const b=S=>{const C=S.currentTarget.getBoundingClientRect();return{normalizedX:Math.max(0,Math.min(1,(S.clientX-C.left)/Math.max(1,C.width))),normalizedY:Math.max(0,Math.min(1,(S.clientY-C.top)/Math.max(1,C.height)))}},k=(S,C)=>{if(l){if(C==="pointermove"){const D=performance.now();if(D-p.current<24)return;p.current=D}m(i.deviceId,{type:C,...b(S),button:H_(S.button)})}};return y.jsx("article",{className:`device-tile ${r?"selected":""} ${i.connected?"online":"offline"}`,children:y.jsxs("button",{className:"tile-screen","aria-pressed":r,onClick:()=>{l||u()},onDoubleClick:S=>{S.preventDefault(),h()},type:"button",children:[y.jsx("canvas",{ref:g,className:"remote-canvas",tabIndex:l?0:-1,onPointerDown:S=>{l&&(d(),S.currentTarget.focus(),S.currentTarget.setPointerCapture(S.pointerId),k(S,"pointerdown"))},onPointerMove:S=>k(S,"pointermove"),onPointerUp:S=>k(S,"pointerup"),onWheel:S=>{l&&(S.preventDefault(),m(i.deviceId,{type:"wheel",deltaX:S.deltaX,deltaY:S.deltaY}))},onKeyDown:S=>{l&&m(i.deviceId,{type:"keydown",key:S.key,code:S.code,text:S.key.length===1?S.key:"",repeat:S.repeat})},onKeyUp:S=>{l&&m(i.deviceId,{type:"keyup",key:S.key,code:S.code,text:S.key.length===1?S.key:"",repeat:!1})},onContextMenu:S=>l&&S.preventDefault()}),!n&&y.jsx("span",{className:"empty-screen",children:y.jsx(gr,{size:26})}),y.jsx("span",{className:`tile-health-pill state-${w.state}`,children:w.label}),y.jsx("span",{className:"tile-metrics","aria-label":`${Co(i)} status`,children:w.metrics.slice(0,3).map(S=>y.jsxs("span",{className:`tile-metric state-${S.state}`,children:[y.jsx("b",{children:S.label}),y.jsx("em",{children:S.value}),S.ratio!==void 0&&y.jsx("i",{style:{width:`${Math.round(S.ratio*100)}%`}})]},S.id))})]})})}function Y_(){const{session:i,loading:n}=v_(),{target:r,error:l,refresh:u}=w_(i),d=$.useMemo(()=>{if(!r?.active)return null;const _=r.expires_at?Date.parse(r.expires_at):Number.POSITIVE_INFINITY;return Number.isFinite(_)&&_<=Date.now()?null:r},[r]),h=$.useMemo(()=>dp(d),[d]),m=$.useMemo(()=>h.length>0?[...new Set([...h,Lt])]:[Lt],[h]),[g,p]=$.useState(U_),w=$.useMemo(()=>m.some(_=>!!Bs(_)),[m]),b=!w||g,{status:k,devices:S,error:C,refresh:D,hubBaseUrl:I}=b_(m,b),{entitlement:H,licensed:q,loading:P,error:Q,refresh:K}=S_(i),[ae,J]=$.useState([]),[_e,we]=$.useState([]),[Dt,gt]=$.useState(""),[Le,pt]=$.useState(!1),[vt,Pe]=$.useState(!1),[L,G]=$.useState(""),[ie,ee]=$.useState(""),[Te,A]=$.useState(""),[U,Y]=$.useState("wall"),[W,ce]=$.useState("large"),[he,Ee]=$.useState(K_),[Ve,Ke]=$.useState(!1),[kn,dn]=$.useState(!1),[vi,bi]=$.useState(!1),[Un,Sr]=$.useState(!1),[oa,Po]=$.useState(D_),[Ce,wi]=$.useState(M_),[ua,hn]=$.useState(null),[Io,_r]=$.useState(!1),At=$.useRef(null),Tr=$.useRef(!1),kr=$.useRef(0),Ye=$.useMemo(()=>S.filter(_=>_.connected),[S]),Si=$.useMemo(()=>Ye.reduce((_,V)=>Math.max(_,Os(V.slotNumber)),0),[Ye]),Ft=Math.max(x_,Ye.length,Si),Qs=$.useMemo(()=>{const _=Array(Ft).fill(null),V=[];for(const te of Ye){const ue=Os(te.slotNumber);ue>0&&ue<=Ft&&!_[ue-1]?_[ue-1]=te:V.push(te)}for(const te of V){const ue=_.findIndex(Oe=>!Oe);ue<0?_.push(te):_[ue]=te}return _},[Ye,Ft]),Ws=$.useMemo(()=>Ye.map(_=>_.deviceId),[Ye]),Er=$.useMemo(()=>new Set(ae),[ae]),fn=$.useMemo(()=>new Set(_e),[_e]),it=$.useMemo(()=>Ye.filter(_=>Er.has(_.deviceId)||fn.has(Os(_.slotNumber))),[Ye,Er,fn]),re=$.useMemo(()=>S.find(_=>_.deviceId===Dt)||it[0]||null,[S,Dt,it]),Ie=$.useMemo(()=>re?Kp(re):null,[re]),Go=re?Hs(re,"control"):!1,Ar=re?Hs(re,"audio")||Hs(re,"remoteAudio"):!1,Zs=Ye.length<=lr,rt=q||Zs,mn=`Free plan includes up to ${lr} workstations. Upgrade to LTD for ${Ye.length} workstations.`,ca=rt&&!!re,en=rt&&!!re&&Go,Ga=rt&&!!re&&Ar,da=rt?Ws:[],Vo=$.useMemo(()=>({fps:Ce.fps,maxWidth:Ce.maxWidth,maxHeight:Ce.maxHeight,quality:Ce.quality,mode:Ce.frameMode,frameMode:Ce.frameMode}),[Ce]),{frames:_i,state:xr}=__(da,Ce.autoStartLive&&da.length>0,I,Vo),{state:ha,sendInput:Fs}=T_(en&&Le,I),{state:Cr,error:Or}=A_(re?.deviceId||"",Ga&&vt,I);$.useEffect(()=>{const _=new URLSearchParams(window.location.search).get("checkout");if(_==="success"){ee("Checkout returned. Waiting for Dodo confirmation."),K();const V=window.setInterval(()=>{K()},4e3),te=window.setTimeout(()=>{window.clearInterval(V)},45e3);return()=>{window.clearInterval(V),window.clearTimeout(te)}}_==="cancelled"&&ee("Checkout cancelled.")},[K]),$.useEffect(()=>{!rt&&Le&&pt(!1),!rt&&vt&&Pe(!1)},[vt,Le,rt]),$.useEffect(()=>{Pe(!1)},[re?.deviceId]),$.useEffect(()=>{const _=Ye.map(te=>te.deviceId),V=new Set(_);J(te=>{const ue=te.filter(Oe=>V.has(Oe));return fp(te,ue)?te:ue}),gt(te=>te&&V.has(te)?te:""),we(te=>{const ue=te.filter(Oe=>Oe>=1&&Oe<=Ft);return fp(te.map(String),ue.map(String))?te:ue})},[Ye,Ft]),$.useEffect(()=>{try{localStorage.setItem(Pp,oa)}catch{}},[oa]),$.useEffect(()=>{z_(Ce)},[Ce]);const Ti=$.useCallback(async()=>{const _=new Set(m);_.add(Lt);try{const ge=await Sn("/api/remote/status",void 0,Lt);dp({endpoint:ge.agentEndpoint,endpoint_candidates:[...ge.agentEndpointCandidates||[],...ge.hostTargetEndpointCandidates||[]]}).forEach(ke=>_.add(ke))}catch{}const V=[..._].sort((ge,ke)=>{const jt=Xe=>{const Fe=Bs(Xe);return Fe==="local"?0:Fe==="loopback"?1:2};return jt(ge)-jt(ke)||ge.localeCompare(ke)});let te=!1,ue="",Oe=!1;try{for(const ge of V){const ke=Bs(ge);try{if(await Sn("/api/health",void 0,ge),ke==="local")return p(!0),or(!0),ge;ke==="loopback"&&(te=!0,ue=ge)}catch{ke==="local"&&(Oe=!0)}}return te?(Oe&&ee("LiveDesk Hub is reachable on this PC, but not through the LAN address yet. Restart LiveDesk Hub to bind 5179 on the network."),p(!0),or(!0),ue||Lt):(p(!1),or(!1),"")}catch{return p(!1),or(!1),""}},[m]),ki=async()=>{G("auth"),dn(!1),await Ti();const{error:_}=await Ln.auth.signInWithOAuth({provider:"google",options:{redirectTo:window.location.origin}});_&&(ee(_.message),G(""))},Rr=async()=>{G("auth"),dn(!1),await Ln.auth.signOut(),G("")};$.useEffect(()=>{if(!kn)return;const _=te=>{te.target instanceof Element&&(te.target.closest(".account-popover, .rail-account")||dn(!1))},V=te=>{te.key==="Escape"&&dn(!1)};return window.addEventListener("pointerdown",_),window.addEventListener("keydown",V),()=>{window.removeEventListener("pointerdown",_),window.removeEventListener("keydown",V)}},[kn]);const Va=$.useCallback(async(_={})=>{const V=_.silent===!0,te=_.takeover===!0,ue=_.requestLocalAccess===!0,Oe=ue?await Ti():"";if(!i?.user){V||ee("Sign in before publishing this host.");return}if(!Tr.current){Tr.current=!0,V||G("host");try{const ge=Oe||I||Lt,ke=k||await Sn("/api/remote/status",void 0,ge);if(!ke.started)throw new Error("Start LiveDesk on this computer before syncing the server.");const jt=`livedesk-${i.user.id}`,Xe=await Sn("/api/remote/host-target",{method:"POST",body:JSON.stringify({nodeId:jt,leaseMs:6e4,takeover:te})},ge);if(!Xe.ok)throw new Error(Xe.error||"host-target-failed");const Fe=await Sn("/api/remote/status",void 0,ge),va=Xe.hostTarget||{},ll=Fe.hostTargetEndpointCandidates||Fe.agentEndpointCandidates||ke.agentEndpointCandidates||[Fe.agentEndpoint||ke.agentEndpoint].filter(Boolean),{data:Qa,error:zr}=await Ln.rpc("set_livedesk_remote_host_target",{p_node_id:jt,p_lease_id:String(va.leaseId||Fe.hostTargetLeaseId||crypto.randomUUID()),p_host_instance_id:Fe.hostInstanceId||jt,p_endpoint:Fe.hostTargetEndpoint||Fe.agentEndpoint||ke.agentEndpoint,p_pair_token:Fe.pairToken||"",p_manager_package:"@livedesk/hub",p_manager_version:Fe.managerVersion||"0.1.0",p_agent_package:"@livedesk/client",p_activated_at:new Date().toISOString(),p_expires_at:new Date(Date.now()+6e4).toISOString(),p_takeover:te,p_endpoint_candidates:ll});if(zr)throw zr;const qn=Array.isArray(Qa)?Qa[0]:Qa;if(qn&&qn.ok===!1)throw new Error(qn.reason||"registry-rejected");V||(ee("Host published."),(ue||w)&&(p(!0),or(!0)),D()),u()}catch(ge){if(!V){const ke=ge instanceof Error?ge.message:String(ge);ke.includes("local network access")&&(p(!1),or(!1)),ee(ke)}}finally{Tr.current=!1,V||G("")}}},[I,w,D,u,Ti,i,k]);$.useEffect(()=>{if(!i?.user||!k?.started||C)return;const _=r?.expires_at?Date.parse(r.expires_at):Number.POSITIVE_INFINITY,V=r?.active===!0&&(!r.expires_at||!Number.isFinite(_)||_>Date.now()),te=!!r?.host_instance_id&&!!k.hostInstanceId&&r.host_instance_id===k.hostInstanceId;if(V&&!te)return;let ue=!1;const Oe=()=>{if(ue)return;const ke=Date.now();ke-kr.current<25e3||(kr.current=ke,Va({silent:!0}))};Oe();const ge=window.setInterval(Oe,3e4);return()=>{ue=!0,window.clearInterval(ge)}},[C,Va,i?.user?.id,k?.agentEndpoint,k?.hostInstanceId,k?.started,r?.active,r?.expires_at,r?.host_instance_id]);const Ka=$.useCallback(_=>{_&&(gt(_),J(V=>V.includes(_)?V:[...V,_]))},[]),gn=$.useCallback(_=>{if(!_)return;const V=Ye.find(ue=>ue.deviceId===_),te=Os(V?.slotNumber);gt(_),te>0&&we(ue=>ue.filter(Oe=>Oe!==te)),J(ue=>ue.includes(_)?ue:[...ue,_])},[Ye]),st=$.useCallback(_=>{!Number.isInteger(_)||_<1||_>Ft||(gt(""),we(V=>V.includes(_)?V.filter(te=>te!==_):[...V,_].sort((te,ue)=>te-ue)))},[Ft]),lt=$.useCallback(()=>{J([]),we([]),gt(""),pt(!1),Pe(!1)},[]),Mn=$.useCallback(()=>{J([]),gt(""),pt(!1),Pe(!1),we(Array.from({length:Ft},(_,V)=>V+1))},[Ft]);$.useEffect(()=>{const _=V=>{const te=V.target,ue=te?.tagName?.toLowerCase();te?.isContentEditable||ue==="input"||ue==="textarea"||ue==="select"||((V.ctrlKey||V.metaKey)&&V.key.toLowerCase()==="a"&&(V.preventDefault(),Mn()),V.key==="Escape"&&lt())};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[lt,Mn]);const zn=async _=>{if(!rt){ee(mn);return}Ka(_);try{await Sn(`/api/remote/devices/${encodeURIComponent(_)}/live/start`,{method:"POST",body:JSON.stringify({fps:Ce.fps,maxWidth:Ce.maxWidth,maxHeight:Ce.maxHeight,quality:Ce.quality,mode:Ce.frameMode,frameMode:Ce.frameMode})},I),ee("Live stream requested."),D()}catch(V){ee(V instanceof Error?V.message:String(V))}},el=async _=>{if(Ka(_),Y("control"),!rt){pt(!1),ee(mn);return}pt(!0),await zn(_)},Ko=async()=>{if(!re){ee("Select a workstation before playing audio.");return}if(!rt){ee(mn);return}if(!Ar){ee("Selected workstation does not report remote audio support yet.");return}const _=!vt;Pe(_);try{await Sn(`/api/remote/devices/${encodeURIComponent(re.deviceId)}/audio/${_?"start":"stop"}`,{method:"POST",body:JSON.stringify({mimeType:"audio/webm;codecs=opus",sampleRate:48e3,channels:2})},I),ee(_?"Remote audio requested.":"Remote audio stopped.")}catch(V){Pe(!1),ee(V instanceof Error?V.message:String(V))}},jr=async _=>{const V=Array.from(_).filter(ge=>ge.size>=0);if(V.length===0)return;if(!rt){ee(mn);return}const te=it.length>0?it.map(ge=>ge.deviceId):re?[re.deviceId]:[];if(te.length===0){ee("Select at least one workstation before dropping files.");return}const ue=V.reduce((ge,ke)=>ge+ke.size,0),Oe=crypto.randomUUID();if(ue>O_){hn({id:Oe,status:"failed",progress:100,message:`Transfer is too large (${yi(ue)}).`});return}hn({id:Oe,status:"reading",progress:2,message:`Preparing ${V.length} file${V.length===1?"":"s"}`});try{let ge=0;const ke=[];for(const Xe of V){const Fe=await Xe.arrayBuffer();ge+=Xe.size,hn({id:Oe,status:"reading",progress:Math.max(4,Math.round(ge/Math.max(1,ue)*58)),message:`Preparing ${yi(ge)} / ${yi(ue)}`}),ke.push({name:Xe.name,relativePath:Xe.webkitRelativePath||Xe.name,size:Xe.size,type:Xe.type,lastModified:Xe.lastModified,dataBase64:B_(Fe)})}hn({id:Oe,status:"sending",progress:72,message:`Sending to ${te.length} workstation${te.length===1?"":"s"}`});const jt=await Sn("/api/remote/files/transfer",{method:"POST",body:JSON.stringify({transferId:Oe,deviceIds:te,remoteDirectory:oa.trim(),files:ke})},I);if(!jt.ok)throw new Error(jt.error||"file-transfer-not-queued");hn({id:Oe,status:"queued",progress:100,message:`Queued ${V.length} file${V.length===1?"":"s"} to ${jt.queued}/${jt.total}`}),window.setTimeout(()=>{hn(Xe=>Xe?.id===Oe&&Xe.status==="queued"?null:Xe)},4500)}catch(ge){hn({id:Oe,status:"failed",progress:100,message:ge instanceof Error?ge.message:String(ge)})}},Ya=_=>{_.preventDefault(),_.stopPropagation(),_r(!1),jr(_.dataTransfer.files)},Nr=async()=>{const _=Te.trim();if(_){if(!rt){ee(mn);return}G("task");try{await Sn("/api/remote/tasks",{method:"POST",body:JSON.stringify({instruction:_,allConnected:!0,approvalLevel:"task-only"})},I),A(""),ee("Task queued."),D()}catch(V){ee(V instanceof Error?V.message:String(V))}finally{G("")}}},Bn=async()=>{if(!i){ee("Sign in with Google before checkout.");return}if(q){ee("LiveDesk license is already active.");return}G("checkout");try{const{data:_,error:V}=await Ln.functions.invoke("dodo-checkout",{body:{plan:"ltd"}});if(V)throw V;if(!_?.checkout_url)throw new Error("Checkout function did not return a checkout URL.");window.location.assign(_.checkout_url)}catch(_){ee(_ instanceof Error?_.message:String(_)),G("")}},Ut=N_(),fa=L_(),ma=Ye.length,ot=Ws.filter(_=>_i.has(_)).length,Lr=C?"offline":k?.started?"online":"starting",Dr=U==="settings",En=U==="pricing",Hn=U==="doc",tl=!En&&!Hn,nl=U==="control",Ja=it.length+_e.filter(_=>!Ye.some(V=>Os(V.slotNumber)===_)).length,Yo=_e.length===1?`Slot ${String(_e[0]).padStart(3,"0")}`:`${_e.length} slots selected`,Ei=Ja===0?"No workstation":Ja>1?`${Ja} selected`:re?Co(re):Yo,ut=br[he]||br.en,Mt=ut.sync||br.en.sync,xt=n||P?"checking":q?`${(H?.plan||"ltd").toUpperCase()} active`:Zs?`Free ${Ye.length}/${lr}`:`Upgrade ${Ye.length}/${lr}`,al=q?"Licensed":L==="checkout"?"Opening":"$30 LTD",Ur=q?"License active":i?q?"Licensed":L==="checkout"?"Opening checkout":"Buy with Dodo":L==="auth"?"Opening Google":"Sign in to buy",il=q||L==="checkout"||L==="auth"||n||P,Xa=i?.user.user_metadata,Ai=mp(Xa,"avatar_url","picture"),bt=mp(Xa,"full_name","name")||i?.user.email||"Google",xi=bt.slice(0,1).toUpperCase(),rl=k?.started?"Local app ready":"Start LiveDesk",Mr=r?.active?"Published":i?"Not published":"Sign in required",ga=gd.find(_=>_.width===Ce.maxWidth&&_.height===Ce.maxHeight)?.id||`${Ce.maxWidth}x${Ce.maxHeight}`,sl=xo.find(_=>_.id===Ce.frameMode)||xo[0],pa=_=>{wi(V=>({...V,..._}))},ya=_=>{const V=gd.find(te=>te.id===_);V&&pa({maxWidth:V.width,maxHeight:V.height})},Jo=_=>{if(_==="control"){if(Y(_),!rt){pt(!1),ee(mn);return}pt(!0),re&&zn(re.deviceId);return}Y(_),pt(!1)};return y.jsxs("main",{className:"app-shell",children:[y.jsxs("aside",{className:"tool-rail","aria-label":"LiveDesk tools",children:[y.jsx("div",{className:"rail-brand",title:"LiveDesk",children:y.jsx(gr,{size:22})}),y.jsx("nav",{className:"rail-tools",children:G_.map(_=>{const V=_.icon;return y.jsxs("button",{className:`rail-tool ${U===_.id?"active":""} accent-${_.accent}`,onClick:()=>Jo(_.id),title:_.label,type:"button",children:[y.jsx(V,{size:19}),y.jsx("span",{children:_.label})]},_.id)})}),y.jsxs("div",{className:"rail-footer",children:[y.jsxs("button",{className:`rail-tool compact local-settings ${vi?"active":""}`,onClick:()=>{bi(_=>!_),dn(!1)},title:"Local Settings",type:"button",children:[y.jsx(bp,{size:18}),y.jsx("span",{children:"Settings"})]}),vi&&y.jsxs("section",{className:"local-settings-popover",role:"dialog","aria-label":"LiveDesk local settings",children:[y.jsxs("div",{className:"local-settings-head",children:[y.jsxs("div",{children:[y.jsx("strong",{children:"Local Settings"}),y.jsx("p",{children:"Saved on this browser"})]}),y.jsx("button",{className:"icon-button",onClick:()=>bi(!1),title:"Close settings",type:"button",children:y.jsx(Og,{size:15})})]}),y.jsxs("label",{className:"local-setting-row",children:[y.jsx("span",{children:"Frame mode"}),y.jsx("select",{value:Ce.frameMode,onChange:_=>pa({frameMode:Gp(_.target.value)}),children:xo.map(_=>y.jsxs("option",{value:_.id,children:[_.label," - ",_.detail]},_.id))})]}),y.jsxs("div",{className:"local-setting-grid",children:[y.jsxs("label",{className:"local-setting-row",children:[y.jsx("span",{children:"FPS"}),y.jsx("select",{value:Ce.fps,onChange:_=>pa({fps:yr(_.target.value,1,24,Nn.fps)}),children:R_.map(_=>y.jsx("option",{value:_,children:_},_))})]}),y.jsxs("label",{className:"local-setting-row",children:[y.jsx("span",{children:"Size"}),y.jsx("select",{value:ga,onChange:_=>ya(_.target.value),children:gd.map(_=>y.jsx("option",{value:_.id,children:_.label},_.id))})]})]}),y.jsxs("label",{className:"local-setting-row",children:[y.jsx("span",{children:"Quality"}),y.jsx("select",{value:Ce.quality,onChange:_=>pa({quality:yr(_.target.value,20,95,Nn.quality)}),children:j_.map(_=>y.jsx("option",{value:_,children:_},_))})]}),y.jsxs("label",{className:"local-setting-toggle",children:[y.jsx("input",{type:"checkbox",checked:Ce.autoStartLive,onChange:_=>pa({autoStartLive:_.target.checked})}),y.jsx("span",{children:"Auto live on connected screens"})]}),y.jsxs("div",{className:"local-settings-summary",children:[y.jsx("span",{children:sl.label}),y.jsxs("strong",{children:[Ce.maxWidth,"x",Ce.maxHeight," · ",Ce.fps,"fps"]})]}),y.jsx("button",{className:"local-settings-reset",onClick:()=>wi(Nn),type:"button",children:"Reset local settings"})]}),y.jsxs("button",{className:"rail-tool compact sync-server",onClick:()=>Va({takeover:!0,requestLocalAccess:!0}),title:"Sync Server",type:"button",children:[y.jsx(td,{size:18}),y.jsx("span",{children:"Sync Server"})]}),y.jsxs("button",{className:`rail-account ${i?"signed-in":""}`,onClick:()=>{dn(_=>!_),bi(!1)},disabled:n||L==="auth","aria-expanded":kn,title:i?`Account: ${i.user.email||bt}`:"Sign in with Google",type:"button",children:[i?Ai?y.jsx("img",{src:Ai,alt:bt,referrerPolicy:"no-referrer"}):y.jsx("span",{className:"avatar-fallback",children:xi}):y.jsx(ad,{size:18}),y.jsx("span",{children:i?"Account":"Google"})]}),kn&&y.jsxs("section",{className:"account-popover",role:"dialog","aria-label":"LiveDesk account",children:[y.jsxs("div",{className:"account-popover-head",children:[y.jsx("div",{className:"account-popover-avatar",children:i&&Ai?y.jsx("img",{src:Ai,alt:bt,referrerPolicy:"no-referrer"}):i?y.jsx("span",{children:xi}):y.jsx(ad,{size:18})}),y.jsxs("div",{children:[y.jsx("strong",{children:i?bt:"Account"}),y.jsx("p",{children:i?.user.email||"Not signed in"})]})]}),y.jsxs("dl",{className:"account-popover-facts",children:[y.jsx("dt",{children:"User"}),y.jsx("dd",{children:i?.user.email||"Not signed in"}),y.jsx("dt",{children:"Network"}),y.jsx("dd",{children:rl}),y.jsx("dt",{children:"Access"}),y.jsx("dd",{children:Mr}),y.jsx("dt",{children:"Plan"}),y.jsx("dd",{children:xt})]}),i?y.jsxs("button",{className:"account-popover-action",onClick:Rr,disabled:L==="auth",type:"button",children:[y.jsx(O0,{size:16}),"Logout"]}):y.jsxs("button",{className:"account-popover-action primary",onClick:ki,disabled:L==="auth",type:"button",children:[y.jsx(ad,{size:16}),"Sign in with Google"]})]})]})]}),y.jsxs("section",{className:`desk-stage ${tl&&!Ve?"dock-open":""}`,children:[y.jsxs("header",{className:"topbar",children:[y.jsxs("div",{className:"brand",children:[y.jsx("span",{className:"brand-mark",children:y.jsx(Eg,{size:18})}),y.jsxs("div",{children:[y.jsx("h1",{children:"LiveDesk"}),y.jsx("p",{children:"Control wall for local machines"})]})]}),tl&&y.jsx("div",{className:"top-actions",children:y.jsx("div",{className:"segmented-control","aria-label":"Screen size",children:I_.map(_=>y.jsx("button",{className:W===_.id?"active":"",onClick:()=>ce(_.id),type:"button",children:_.label},_.id))})})]}),Hn?y.jsxs("section",{className:"doc-page",lang:he,dir:he==="ar"?"rtl":"ltr",children:[y.jsxs("section",{className:"doc-hero",children:[y.jsxs("div",{className:"doc-hero-copy",children:[y.jsxs("span",{className:"pricing-eyebrow",children:[y.jsx(vd,{size:16}),ut.eyebrow]}),y.jsx("h2",{children:ut.title}),y.jsx("p",{children:ut.intro})]}),y.jsxs("label",{className:"doc-language-picker",children:[y.jsxs("span",{children:[y.jsx(k0,{size:17}),ut.languageLabel]}),y.jsx("select",{value:he,onChange:_=>Ee(_.target.value),children:V_.map(_=>y.jsx("option",{value:_.id,children:_.label},_.id))})]})]}),y.jsx("section",{className:"doc-grid",children:ut.sections.map((_,V)=>{const ue=[sd,dr,vp,Cg][V]||vd;return y.jsxs("article",{className:"doc-card",children:[y.jsx("div",{className:"doc-card-icon",children:y.jsx(ue,{size:19})}),y.jsxs("div",{children:[y.jsx("h3",{children:_.title}),y.jsx("p",{children:_.body}),y.jsx("ul",{children:_.points.map(Oe=>y.jsx("li",{children:Oe},Oe))})]})]},_.title)})}),Mt&&y.jsxs("section",{className:"doc-sync",children:[y.jsxs("div",{className:"doc-sync-head",children:[y.jsx(td,{size:20}),y.jsxs("div",{children:[y.jsx("h3",{children:Mt.title}),y.jsx("p",{children:Mt.body})]})]}),y.jsx("ul",{children:Mt.points.map(_=>y.jsx("li",{children:_},_))})]}),y.jsxs("section",{className:"doc-firewall",children:[y.jsxs("div",{className:"doc-firewall-head",children:[y.jsx(Ag,{size:20}),y.jsxs("div",{children:[y.jsx("h3",{children:ut.firewall.title}),y.jsx("p",{children:ut.firewall.body})]})]}),y.jsx("ul",{children:ut.firewall.points.map(_=>y.jsx("li",{children:_},_))})]}),y.jsxs("section",{className:"doc-command-panel",children:[y.jsxs("div",{className:"doc-command-head",children:[y.jsx(dr,{size:20}),y.jsxs("div",{children:[y.jsx("h3",{children:ut.commands.title}),y.jsx("p",{children:ut.commands.body})]})]}),y.jsxs("div",{className:"doc-command-list",children:[ut.commands.manager&&y.jsxs("div",{className:"doc-command-row",children:[y.jsx("span",{children:ut.commands.manager}),y.jsx("code",{children:fa}),y.jsx("button",{className:"icon-button",onClick:()=>Cs(fa),title:"Copy command",type:"button",children:y.jsx(As,{size:16})})]}),y.jsxs("div",{className:"doc-command-row",children:[y.jsx("span",{children:ut.commands.primary}),y.jsx("code",{children:Ut}),y.jsx("button",{className:"icon-button",onClick:()=>Cs(Ut),title:"Copy command",type:"button",children:y.jsx(As,{size:16})})]}),y.jsxs("div",{className:"doc-command-row",children:[y.jsx("span",{children:ut.commands.slot}),y.jsx("code",{children:`${Ut} 3`}),y.jsx("button",{className:"icon-button",onClick:()=>Cs(`${Ut} 3`),title:"Copy command",type:"button",children:y.jsx(As,{size:16})})]})]})]})]}):En?y.jsxs("section",{className:"pricing-page",children:[(Q||ie)&&y.jsx("section",{className:"notice-band",children:Q||ie}),y.jsxs("section",{className:"pricing-offer",children:[y.jsx("button",{className:"pricing-close",onClick:()=>Y("wall"),title:"Close pricing",type:"button",children:y.jsx(Og,{size:18})}),y.jsxs("div",{className:"pricing-offer-head",children:[y.jsxs("span",{className:"pricing-eyebrow",children:[y.jsx(P0,{size:15}),"Founder launch"]}),y.jsxs("div",{className:"deal-price-line",children:[y.jsx("span",{className:"deal-original",children:"$59"}),y.jsx("span",{className:"deal-arrow",children:"→"}),y.jsx("strong",{children:"$30"}),y.jsxs("span",{className:"deal-badge",children:[y.jsx(h0,{size:15}),"Lifetime deal"]})]}),y.jsx("p",{children:"Monitor and control your local workstation wall. Free for 4 PCs, then unlock larger local setups with one payment."})]}),y.jsxs("div",{className:"deal-table",role:"table","aria-label":"LiveDesk launch pricing",children:[y.jsxs("div",{className:"deal-row deal-row-head",role:"row",children:[y.jsx("span",{role:"columnheader",children:"Plan"}),y.jsx("span",{role:"columnheader",children:"Launch benefit"}),y.jsx("span",{role:"columnheader",children:"Now"})]}),y.jsxs("div",{className:"deal-row deal-row-highlight",role:"row",children:[y.jsx("strong",{role:"cell",children:"Founder LTD"}),y.jsxs("span",{role:"cell",children:[y.jsx("s",{children:"$59"})," local lifetime unlock"]}),y.jsx("strong",{role:"cell",children:"$30"})]}),y.jsxs("div",{className:"deal-row",role:"row",children:[y.jsx("strong",{role:"cell",children:"Free"}),y.jsx("span",{role:"cell",children:"Live, control, audio, files, tasks"}),y.jsx("strong",{role:"cell",children:"$0"})]}),y.jsxs("div",{className:"deal-row",role:"row",children:[y.jsx("strong",{role:"cell",children:"Workstations"}),y.jsx("span",{role:"cell",children:"4 free, larger walls with LTD"}),y.jsxs("strong",{role:"cell",children:[Ye.length,"/",lr]})]}),y.jsxs("div",{className:"deal-row",role:"row",children:[y.jsx("strong",{role:"cell",children:"Future monthly"}),y.jsx("span",{role:"cell",children:"Cloud relay and team features later"}),y.jsx("strong",{role:"cell",children:"separate"})]})]}),y.jsxs("section",{className:"deal-module",children:[y.jsxs("div",{className:"deal-module-title",children:[y.jsx("strong",{children:"LiveDesk includes"}),y.jsx("span",{children:xt})]}),y.jsxs("ul",{className:"deal-feature-list",children:[y.jsxs("li",{children:[y.jsx(gr,{size:16}),y.jsx("span",{children:"Screen wall slots"}),y.jsx("b",{children:"120+"})]}),y.jsxs("li",{children:[y.jsx(wd,{size:16}),y.jsx("span",{children:"Focused control"}),y.jsx("b",{children:"Local"})]}),y.jsxs("li",{children:[y.jsx(xg,{size:16}),y.jsx("span",{children:"Remote PC audio"}),y.jsx("b",{children:"PCM"})]}),y.jsxs("li",{children:[y.jsx(nd,{size:16}),y.jsx("span",{children:"File transfer"}),y.jsx("b",{children:"24MB"})]})]})]}),y.jsxs("section",{className:"deal-open-price",children:[y.jsx("span",{children:"Opening special price"}),y.jsx("strong",{children:"$30 LTD"}),y.jsx("small",{children:"Early buyers keep this local lifetime license after monthly plans arrive."})]}),y.jsxs("p",{className:"deal-note",children:[y.jsx(b0,{size:15}),"Free plan stays available for up to ",lr," local workstations."]}),y.jsxs("button",{className:"deal-cta",onClick:i?Bn:ki,disabled:il,type:"button",children:[y.jsx(bd,{size:18}),Ur]}),y.jsx("button",{className:"deal-later",onClick:()=>Y("wall"),type:"button",children:"Later"})]})]}):y.jsx(y.Fragment,{children:y.jsxs("section",{className:`monitor-layout ${Ve?"dock-collapsed":""}`,children:[y.jsx("section",{className:`screen-wall-panel ${Io?"drop-active":""}`,onClick:_=>{_.currentTarget===_.target&&lt()},onDragEnter:_=>{_.preventDefault(),_r(!0)},onDragOver:_=>{_.preventDefault(),_.dataTransfer.dropEffect="copy"},onDragLeave:_=>{_.currentTarget===_.target&&_r(!1)},onDrop:Ya,children:nl?y.jsxs("section",{className:"control-focus",children:[y.jsxs("div",{className:"control-focus-head",children:[y.jsxs("div",{children:[y.jsx("span",{children:"Focused control"}),y.jsx("strong",{children:re?Co(re):"No workstation"})]}),y.jsxs("button",{className:"text-button",onClick:()=>re&&zn(re.deviceId),disabled:!ca,type:"button",children:[y.jsx(id,{size:16}),"Start live"]})]}),y.jsx("div",{className:"screen-wall control-wall",onClick:_=>{_.currentTarget===_.target&&lt()},children:re?y.jsx(pp,{device:re,frame:_i.get(re.deviceId),selected:!0,controlEnabled:en&&Le,onSelect:()=>gn(re.deviceId),onFocusDevice:()=>Ka(re.deviceId),onOpenControl:()=>el(re.deviceId),sendInput:Fs},re.deviceId):y.jsx(gp,{index:0,selected:fn.has(1),onSelect:()=>st(1)})})]}):y.jsx("div",{className:`screen-wall size-${W}`,onClick:_=>{_.currentTarget===_.target&&lt()},children:Qs.map((_,V)=>{const te=V+1;return _?y.jsx(pp,{device:_,frame:_i.get(_.deviceId),selected:Er.has(_.deviceId)||fn.has(te),controlEnabled:en&&Le&&re?.deviceId===_.deviceId,onSelect:()=>gn(_.deviceId),onFocusDevice:()=>Ka(_.deviceId),onOpenControl:()=>el(_.deviceId),sendInput:Fs},_.deviceId):y.jsx(gp,{index:V,selected:fn.has(te),onSelect:()=>st(te)},`slot-${V}`)})})}),y.jsxs("aside",{className:`right-dock ${Dr?"settings-mode":"actions-mode"} ${Ve?"collapsed":""}`,"aria-label":"LiveDesk tools",children:[y.jsx("button",{className:"dock-toggle",onClick:()=>Ke(_=>!_),"aria-label":Ve?"Show control panel":"Hide control panel",title:Ve?"Show control panel":"Hide control panel",type:"button",children:Ve?y.jsx(g0,{size:18}):y.jsx(y0,{size:18})}),!Ve&&(Dr?y.jsxs(y.Fragment,{children:[(C||l||Q||ie)&&y.jsx("section",{className:"notice-band",children:C||l||Q||ie}),y.jsxs("section",{className:"command-deck",children:[y.jsxs("div",{className:"setup-card",children:[y.jsxs("div",{className:"setup-head",children:[y.jsx("span",{className:"setup-icon",children:y.jsx(gr,{size:18})}),y.jsxs("div",{children:[y.jsx("strong",{children:"Add workstation"}),y.jsx("span",{children:"Connect another local PC to this wall."})]})]}),y.jsxs("button",{className:"text-button primary full",onClick:()=>Cs(Ut),type:"button",children:[y.jsx(As,{size:16}),"Copy setup"]}),y.jsxs("button",{className:"setup-disclosure",onClick:()=>Sr(_=>!_),type:"button",children:[y.jsx(dr,{size:15}),"Advanced setup"]}),Un&&y.jsxs("div",{className:"setup-code-row",children:[y.jsx("code",{children:Ut}),y.jsx("button",{className:"icon-button",onClick:()=>Cs(Ut),title:"Copy setup command",type:"button",children:y.jsx(As,{size:16})})]})]}),y.jsxs("div",{className:"settings-card",children:[y.jsxs("div",{className:"panel-title",children:[y.jsx(nd,{size:17}),y.jsx("h2",{children:"Files"})]}),y.jsxs("label",{className:"field-row",children:[y.jsx("span",{children:"Remote folder"}),y.jsx("input",{value:oa,onChange:_=>Po(_.target.value),placeholder:"Desktop/LiveDeskFiles"})]}),y.jsx("p",{className:"muted",children:"Blank uses Desktop/LiveDeskFiles on each workstation."})]}),y.jsxs("div",{className:"deck-actions",children:[y.jsxs("button",{className:"text-button primary",onClick:()=>Va({takeover:!0,requestLocalAccess:!0}),disabled:!i||L==="host",type:"button",children:[y.jsx(td,{size:16}),"Sync access"]}),y.jsxs("button",{className:"text-button buy",onClick:Bn,disabled:L==="checkout"||q,type:"button",children:[y.jsx(bd,{size:16}),al]})]})]}),y.jsxs("section",{className:"status-strip",children:[y.jsxs("div",{className:`status-item state-${Lr}`,children:[y.jsx(sd,{size:18}),y.jsx("span",{children:"Local app"}),y.jsx("strong",{children:Lr})]}),y.jsxs("div",{className:"status-item",children:[y.jsx(Cg,{size:18}),y.jsx("span",{children:"Slots"}),y.jsxs("strong",{children:[ma,"/",Ft]})]}),y.jsxs("div",{className:"status-item",children:[y.jsx(Eg,{size:18}),y.jsx("span",{children:"Frames"}),y.jsxs("strong",{children:[ot," ",xr]})]}),y.jsxs("div",{className:"status-item",children:[y.jsx(Ag,{size:18}),y.jsx("span",{children:"Plan"}),y.jsx("strong",{children:xt})]})]})]}):y.jsxs(y.Fragment,{children:[y.jsxs("section",{className:"action-dock",children:[y.jsxs("div",{className:"action-context",children:[y.jsx("span",{children:Ja>0?"Selection":"No selection"}),y.jsx("strong",{children:Ei})]}),y.jsx("input",{ref:At,className:"hidden-file-input",type:"file",multiple:!0,onChange:_=>{_.currentTarget.files&&jr(_.currentTarget.files),_.currentTarget.value=""}}),(C||ie)&&y.jsx("div",{className:"notice-band compact",children:y.jsx("span",{children:C||ie})}),y.jsxs("div",{className:"action-grid",children:[y.jsxs("button",{className:"action-tile primary",onClick:()=>re&&zn(re.deviceId),disabled:!ca,type:"button",children:[y.jsx(id,{size:21}),y.jsx("span",{children:"Live"})]}),y.jsxs("button",{className:`action-tile ${Le?"active":""}`,onClick:()=>pt(_=>!_),disabled:!en,type:"button",children:[y.jsx(wd,{size:21}),y.jsx("span",{children:ha!=="idle"?ha:"Control"})]}),y.jsxs("button",{className:`action-tile ${vt?"active":""}`,onClick:Ko,disabled:!Ga,type:"button",title:Ar?"Remote PC audio":"Remote audio is not supported by this workstation yet",children:[y.jsx(xg,{size:21}),y.jsx("span",{children:vt&&Cr!=="idle"?Cr:"Audio"})]}),y.jsxs("button",{className:"action-tile",onClick:()=>At.current?.click(),disabled:!rt||it.length===0,type:"button",title:"File transfer",children:[y.jsx(nd,{size:21}),y.jsx("span",{children:"Files"})]}),y.jsxs("button",{className:"action-tile",disabled:!0,type:"button",title:"Reboot",children:[y.jsx(M0,{size:21}),y.jsx("span",{children:"Reboot"})]}),y.jsxs("button",{className:"action-tile",disabled:!0,type:"button",title:"Power",children:[y.jsx(D0,{size:21}),y.jsx("span",{children:"Power"})]}),y.jsxs("button",{className:"action-tile",disabled:!0,type:"button",title:"Terminal",children:[y.jsx(dr,{size:21}),y.jsx("span",{children:"Shell"})]})]})]}),re&&Ie&&y.jsxs("section",{className:"side-panel selected-panel",children:[y.jsxs("div",{className:"machine-detail-head",children:[y.jsxs("div",{className:"panel-title",children:[y.jsx(gr,{size:17}),y.jsx("h2",{children:"Machine detail"})]}),y.jsx("span",{className:`machine-health state-${Ie.state}`,children:Ie.label})]}),y.jsxs("div",{className:"machine-title",children:[y.jsx("strong",{children:Co(re)}),y.jsx("span",{children:Ie.role})]}),y.jsx("div",{className:"machine-metric-grid",children:Ie.metrics.map(_=>y.jsxs("article",{className:`machine-metric state-${_.state}`,children:[y.jsx("span",{children:_.label}),y.jsx("strong",{children:_.value}),y.jsx("small",{children:_.detail}),_.ratio!==void 0&&y.jsx("i",{children:y.jsx("b",{style:{width:`${Math.round(_.ratio*100)}%`}})})]},_.id))}),y.jsxs("section",{className:"machine-section",children:[y.jsxs("div",{className:"machine-section-title",children:[y.jsx(dr,{size:15}),y.jsx("span",{children:"Local services"})]}),y.jsx("div",{className:"tool-probe-list",children:Ie.tools.map(_=>y.jsxs("span",{className:`tool-probe state-${_.status}`,children:[y.jsx("b",{children:_.label}),y.jsx("em",{children:_.detail})]},_.id))})]}),y.jsxs("section",{className:"machine-section",children:[y.jsxs("div",{className:"machine-section-title",children:[y.jsx(rd,{size:15}),y.jsx("span",{children:"Workload"})]}),y.jsxs("div",{className:"workload-card",children:[y.jsx("strong",{children:Ie.taskLabel}),y.jsx("span",{children:Ie.taskStatus}),Ie.taskSummary&&y.jsx("p",{children:Ie.taskSummary})]})]}),y.jsxs("div",{className:"machine-section",children:[y.jsxs("div",{className:"machine-section-title",children:[y.jsx(sd,{size:15}),y.jsx("span",{children:"System"})]}),y.jsxs("dl",{className:"facts compact",children:[y.jsx("dt",{children:"Platform"}),y.jsxs("dd",{children:[re.platform||"-"," ",re.arch||""]}),y.jsx("dt",{children:"Release"}),y.jsx("dd",{children:Gt(re.status,"release")||"-"}),y.jsx("dt",{children:"Uptime"}),y.jsx("dd",{children:Vp(Je(re.status,"uptimeSec"))}),y.jsx("dt",{children:"Last seen"}),y.jsx("dd",{children:g_(re.lastSeenAt||re.connectedAt)}),y.jsx("dt",{children:"Agent"}),y.jsx("dd",{children:re.agentVersion||"-"}),y.jsx("dt",{children:"Address"}),y.jsx("dd",{children:re.remoteAddress||"-"})]})]}),Or&&y.jsx("p",{className:"panel-warning",children:Or}),y.jsxs("button",{className:"text-button full",onClick:()=>re&&zn(re.deviceId),disabled:!ca,type:"button",children:[y.jsx(id,{size:16}),"Start live"]})]}),y.jsxs("section",{className:"side-panel task-panel",children:[y.jsxs("div",{className:"panel-title",children:[y.jsx(rd,{size:17}),y.jsx("h2",{children:"Task"})]}),y.jsx("textarea",{value:Te,onChange:_=>A(_.target.value),placeholder:"Prepare a short status report.",rows:4}),y.jsxs("button",{className:"text-button full primary",onClick:Nr,disabled:L==="task"||!Te.trim()||!rt,type:"button",children:[y.jsx(rd,{size:16}),"Send to connected"]})]})]}))]})]})})]}),ua&&y.jsxs("aside",{className:`transfer-bar state-${ua.status}`,"aria-live":"polite",children:[y.jsx("div",{className:"transfer-bar-track",children:y.jsx("span",{style:{width:`${Math.max(0,Math.min(100,ua.progress))}%`}})}),y.jsx("p",{children:ua.message})]})]})}i0.createRoot(document.getElementById("root")).render(y.jsx($.StrictMode,{children:y.jsx(Y_,{})}));