@syncular/console 0.0.6-82 → 0.0.6-83
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.
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
function AM(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const i in s)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(s,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>s[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();const Ce=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,ct=globalThis,Ji="10.39.0";function ha(){return Wh(ct),ct}function Wh(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Ji,t[Ji]=t[Ji]||{}}function Bc(e,t,n=ct){const s=n.__SENTRY__=n.__SENTRY__||{},i=s[Ji]=s[Ji]||{};return i[e]||(i[e]=t())}const kM=["debug","info","warn","error","log","assert","trace"],OM="Sentry Logger ",hh={};function pa(e){if(!("console"in ct))return e();const t=ct.console,n={},s=Object.keys(hh);s.forEach(i=>{const a=hh[i];n[i]=t[i],t[i]=a});try{return e()}finally{s.forEach(i=>{t[i]=n[i]})}}function MM(){Fv().enabled=!0}function IM(){Fv().enabled=!1}function WC(){return Fv().enabled}function PM(...e){Bv("log",...e)}function DM(...e){Bv("warn",...e)}function zM(...e){Bv("error",...e)}function Bv(e,...t){Ce&&WC()&&pa(()=>{ct.console[e](`${OM}[${e}]:`,...t)})}function Fv(){return Ce?Bc("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const be={enable:MM,disable:IM,isEnabled:WC,log:PM,warn:DM,error:zM},JC=50,oa="?",lw=/\(error: (.*)\)/,uw=/captureMessage|captureException/;function eR(...e){const t=e.sort((n,s)=>n[0]-s[0]).map(n=>n[1]);return(n,s=0,i=0)=>{const a=[],l=n.split(`
|
|
2
|
-
`);for(let f=s;f<l.length;f++){let d=l[f];d.length>1024&&(d=d.slice(0,1024));const p=lw.test(d)?d.replace(lw,"$1"):d;if(!p.match(/\S*Error: /)){for(const g of t){const y=g(p);if(y){a.push(y);break}}if(a.length>=JC+i)break}}return UM(a.slice(i))}}function LM(e){return Array.isArray(e)?eR(...e):e}function UM(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(Sd(t).function||"")&&t.pop(),t.reverse(),uw.test(Sd(t).function||"")&&(t.pop(),uw.test(Sd(t).function||"")&&t.pop()),t.slice(0,JC).map(n=>({...n,filename:n.filename||Sd(t).filename,function:n.function||oa}))}function Sd(e){return e[e.length-1]||{}}const Lg="<anonymous>";function Qs(e){try{return!e||typeof e!="function"?Lg:e.name||Lg}catch{return Lg}}function fw(e){const t=e.exception;if(t){const n=[];try{return t.values.forEach(s=>{s.stacktrace.frames&&n.push(...s.stacktrace.frames)}),n}catch{return}}}function tR(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const Zd={},dw={};function ci(e,t){Zd[e]=Zd[e]||[],Zd[e].push(t)}function li(e,t){if(!dw[e]){dw[e]=!0;try{t()}catch(n){Ce&&be.error(`Error while instrumenting ${e}`,n)}}}function Hr(e,t){const n=e&&Zd[e];if(n)for(const s of n)try{s(t)}catch(i){Ce&&be.error(`Error while triggering instrumentation handler.
|
|
3
|
-
Type: ${e}
|
|
4
|
-
Name: ${Qs(s)}
|
|
5
|
-
Error:`,i)}}let Ug=null;function nR(e){const t="error";ci(t,e),li(t,$M)}function $M(){Ug=ct.onerror,ct.onerror=function(e,t,n,s,i){return Hr("error",{column:s,error:i,line:n,msg:e,url:t}),Ug?Ug.apply(this,arguments):!1},ct.onerror.__SENTRY_INSTRUMENTED__=!0}let $g=null;function rR(e){const t="unhandledrejection";ci(t,e),li(t,BM)}function BM(){$g=ct.onunhandledrejection,ct.onunhandledrejection=function(e){return Hr("unhandledrejection",e),$g?$g.apply(this,arguments):!0},ct.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const sR=Object.prototype.toString;function Jh(e){switch(sR.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Ws(e,Error)}}function Fc(e,t){return sR.call(e)===`[object ${t}]`}function oR(e){return Fc(e,"ErrorEvent")}function hw(e){return Fc(e,"DOMError")}function FM(e){return Fc(e,"DOMException")}function Zs(e){return Fc(e,"String")}function ep(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Tc(e){return e===null||ep(e)||typeof e!="object"&&typeof e!="function"}function yu(e){return Fc(e,"Object")}function tp(e){return typeof Event<"u"&&Ws(e,Event)}function HM(e){return typeof Element<"u"&&Ws(e,Element)}function qM(e){return Fc(e,"RegExp")}function Hc(e){return!!(e?.then&&typeof e.then=="function")}function VM(e){return yu(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Ws(e,t){try{return e instanceof t}catch{return!1}}function iR(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}function Hv(e){return typeof Request<"u"&&Ws(e,Request)}const qv=ct,KM=80;function Vr(e,t={}){if(!e)return"<unknown>";try{let n=e;const s=5,i=[];let a=0,l=0;const f=" > ",d=f.length;let p;const g=Array.isArray(t)?t:t.keyAttrs,y=!Array.isArray(t)&&t.maxStringLength||KM;for(;n&&a++<s&&(p=GM(n,g),!(p==="html"||a>1&&l+i.length*d+p.length>=y));)i.push(p),l+=p.length,n=n.parentNode;return i.reverse().join(f)}catch{return"<unknown>"}}function GM(e,t){const n=e,s=[];if(!n?.tagName)return"";if(qv.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}s.push(n.tagName.toLowerCase());const i=t?.length?t.filter(l=>n.getAttribute(l)).map(l=>[l,n.getAttribute(l)]):null;if(i?.length)i.forEach(l=>{s.push(`[${l[0]}="${l[1]}"]`)});else{n.id&&s.push(`#${n.id}`);const l=n.className;if(l&&Zs(l)){const f=l.split(/\s+/);for(const d of f)s.push(`.${d}`)}}const a=["aria-label","type","name","title","alt"];for(const l of a){const f=n.getAttribute(l);f&&s.push(`[${l}="${f}"]`)}return s.join("")}function ku(){try{return qv.document.location.href}catch{return""}}function aR(e){if(!qv.HTMLElement)return null;let t=e;const n=5;for(let s=0;s<n;s++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}function gr(e,t,n){if(!(t in e))return;const s=e[t];if(typeof s!="function")return;const i=n(s);typeof i=="function"&&cR(i,s);try{e[t]=i}catch{Ce&&be.log(`Failed to replace method "${t}" in object`,e)}}function Yn(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{Ce&&be.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function cR(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,Yn(e,"__sentry_original__",t)}catch{}}function Vv(e){return e.__sentry_original__}function lR(e){if(Jh(e))return{message:e.message,name:e.name,stack:e.stack,...mw(e)};if(tp(e)){const t={type:e.type,target:pw(e.target),currentTarget:pw(e.currentTarget),...mw(e)};return typeof CustomEvent<"u"&&Ws(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function pw(e){try{return HM(e)?Vr(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function mw(e){if(typeof e=="object"&&e!==null){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}else return{}}function ZM(e){const t=Object.keys(lR(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let ac;function Ou(e){if(ac!==void 0)return ac?ac(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=ct;return t in n&&typeof n[t]=="function"?(ac=n[t],ac(e)):(ac=null,e())}function Ko(){return Ou(()=>Math.random())}function Mu(){return Ou(()=>Date.now())}function qy(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function gw(e,t){if(!Array.isArray(e))return"";const n=[];for(let s=0;s<e.length;s++){const i=e[s];try{iR(i)?n.push(tR(i)):n.push(String(i))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Yd(e,t,n=!1){return Zs(e)?qM(t)?t.test(e):Zs(t)?n?e===t:e.includes(t):!1:!1}function Go(e,t=[],n=!1){return t.some(s=>Yd(e,s,n))}function YM(){const e=ct;return e.crypto||e.msCrypto}let Bg;function XM(){return Ko()*16}function qr(e=YM()){try{if(e?.randomUUID)return Ou(()=>e.randomUUID()).replace(/-/g,"")}catch{}return Bg||(Bg="10000000100040008000"+1e11),Bg.replace(/[018]/g,t=>(t^(XM()&15)>>t/4).toString(16))}function uR(e){return e.exception?.values?.[0]}function Gi(e){const{message:t,event_id:n}=e;if(t)return t;const s=uR(e);return s?s.type&&s.value?`${s.type}: ${s.value}`:s.type||s.value||n||"<unknown>":n||"<unknown>"}function Vy(e,t,n){const s=e.exception=e.exception||{},i=s.values=s.values||[],a=i[0]=i[0]||{};a.value||(a.value=t||""),a.type||(a.type="Error")}function Cc(e,t){const n=uR(e);if(!n)return;const s={type:"generic",handled:!0},i=n.mechanism;if(n.mechanism={...s,...i,...t},t&&"data"in t){const a={...i?.data,...t.data};n.mechanism.data=a}}function yw(e){if(QM(e))return!0;try{Yn(e,"__sentry_captured__",!0)}catch{}return!1}function QM(e){try{return e.__sentry_captured__}catch{}}const fR=1e3;function ma(){return Mu()/fR}function WM(){const{performance:e}=ct;if(!e?.now||!e.timeOrigin)return ma;const t=e.timeOrigin;return()=>(t+Ou(()=>e.now()))/fR}let vw;function cn(){return(vw??(vw=WM()))()}let Fg=null;function JM(){const{performance:e}=ct;if(!e?.now)return;const t=3e5,n=Ou(()=>e.now()),s=Mu(),i=e.timeOrigin;if(typeof i=="number"&&Math.abs(i+n-s)<t)return i;const a=e.timing?.navigationStart;return typeof a=="number"&&Math.abs(a+n-s)<t?a:s-n}function Sr(){return Fg===null&&(Fg=JM()),Fg}function eI(e){const t=cn(),n={sid:qr(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>nI(n)};return e&&Rc(n,e),n}function Rc(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||cn(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:qr()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{const n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function tI(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),Rc(e,n)}function nI(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function Iu(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;const s={...e};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(s[i]=Iu(s[i],t[i],n-1));return s}function Js(){return qr()}function Ys(){return qr().substring(16)}const Ky="_sentrySpan";function Nc(e,t){t?Yn(e,Ky,t):delete e[Ky]}function jc(e){return e[Ky]}const rI=100;class eo{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Js(),sampleRand:Ko()}}clone(){const t=new eo;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,Nc(t,jc(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Rc(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(t){return this._conversationId=t||void 0,this._notifyScopeListeners(),this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n=typeof t=="function"?t(this):t,s=n instanceof eo?n.getScopeData():yu(n)?t:void 0,{tags:i,attributes:a,extra:l,user:f,contexts:d,level:p,fingerprint:g=[],propagationContext:y,conversationId:b}=s||{};return this._tags={...this._tags,...i},this._attributes={...this._attributes,...a},this._extra={...this._extra,...l},this._contexts={...this._contexts,...d},f&&Object.keys(f).length&&(this._user=f),p&&(this._level=p),g.length&&(this._fingerprint=g),y&&(this._propagationContext=y),b&&(this._conversationId=b),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,Nc(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Js(),sampleRand:Ko()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){const s=typeof n=="number"?n:rI;if(s<=0)return this;const i={timestamp:ma(),...t,message:t.message?qy(t.message,2048):t.message};return this._breadcrumbs.push(i),this._breadcrumbs.length>s&&(this._breadcrumbs=this._breadcrumbs.slice(-s),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:jc(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Iu(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){const s=n?.event_id||qr();if(!this._client)return Ce&&be.warn("No client configured on scope - will not capture exception!"),s;const i=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:i,...n,event_id:s},this),s}captureMessage(t,n,s){const i=s?.event_id||qr();if(!this._client)return Ce&&be.warn("No client configured on scope - will not capture message!"),i;const a=s?.syntheticException??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:a,...s,event_id:i},this),i}captureEvent(t,n){const s=t.event_id||n?.event_id||qr();return this._client?(this._client.captureEvent(t,{...n,event_id:s},this),s):(Ce&&be.warn("No client configured on scope - will not capture event!"),s)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}}function sI(){return Bc("defaultCurrentScope",()=>new eo)}function oI(){return Bc("defaultIsolationScope",()=>new eo)}class iI{constructor(t,n){let s;t?s=t:s=new eo;let i;n?i=n:i=new eo,this._stack=[{scope:s}],this._isolationScope=i}withScope(t){const n=this._pushScope();let s;try{s=t(n)}catch(i){throw this._popScope(),i}return Hc(s)?s.then(i=>(this._popScope(),i),i=>{throw this._popScope(),i}):(this._popScope(),s)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function Ac(){const e=ha(),t=Wh(e);return t.stack=t.stack||new iI(sI(),oI())}function aI(e){return Ac().withScope(e)}function cI(e,t){const n=Ac();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function bw(e){return Ac().withScope(()=>e(Ac().getIsolationScope()))}function lI(){return{withIsolationScope:bw,withScope:aI,withSetScope:cI,withSetIsolationScope:(e,t)=>bw(t),getCurrentScope:()=>Ac().getScope(),getIsolationScope:()=>Ac().getIsolationScope()}}function qc(e){const t=Wh(e);return t.acs?t.acs:lI()}function bt(){const e=ha();return qc(e).getCurrentScope()}function os(){const e=ha();return qc(e).getIsolationScope()}function uI(){return Bc("globalScope",()=>new eo)}function Pu(...e){const t=ha(),n=qc(t);if(e.length===2){const[s,i]=e;return s?n.withSetScope(s,i):n.withScope(i)}return n.withScope(e[0])}function vt(){return bt().getClient()}function dR(e){const t=e.getPropagationContext(),{traceId:n,parentSpanId:s,propagationSpanId:i}=t,a={trace_id:n,span_id:i||Ys()};return s&&(a.parent_span_id=s),a}const vs="sentry.source",Kv="sentry.sample_rate",hR="sentry.previous_trace_sample_rate",to="sentry.op",gn="sentry.origin",vu="sentry.idle_span_finish_reason",Du="sentry.measurement_unit",zu="sentry.measurement_value",xw="sentry.custom_span_name",Gv="sentry.profile_id",Vc="sentry.exclusive_time",fI="sentry.link.type",dI="gen_ai.conversation.id",hI=0,Zv=1,hn=2;function pI(e){if(e<400&&e>=100)return{code:Zv};if(e>=400&&e<500)switch(e){case 401:return{code:hn,message:"unauthenticated"};case 403:return{code:hn,message:"permission_denied"};case 404:return{code:hn,message:"not_found"};case 409:return{code:hn,message:"already_exists"};case 413:return{code:hn,message:"failed_precondition"};case 429:return{code:hn,message:"resource_exhausted"};case 499:return{code:hn,message:"cancelled"};default:return{code:hn,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:hn,message:"unimplemented"};case 503:return{code:hn,message:"unavailable"};case 504:return{code:hn,message:"deadline_exceeded"};default:return{code:hn,message:"internal_error"}}return{code:hn,message:"internal_error"}}function pR(e,t){e.setAttribute("http.response.status_code",t);const n=pI(t);n.message!=="unknown_error"&&e.setStatus(n)}const mR="_sentryScope",gR="_sentryIsolationScope";function mI(e){try{const t=ct.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function gI(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}function yI(e,t,n){e&&(Yn(e,gR,mI(n)),Yn(e,mR,t))}function ph(e){const t=e;return{scope:t[mR],isolationScope:gI(t[gR])}}const Yv="sentry-",vI=/^sentry-/,bI=8192;function yR(e){const t=SI(e);if(!t)return;const n=Object.entries(t).reduce((s,[i,a])=>{if(i.match(vI)){const l=i.slice(Yv.length);s[l]=a}return s},{});if(Object.keys(n).length>0)return n}function xI(e){if(!e)return;const t=Object.entries(e).reduce((n,[s,i])=>(i&&(n[`${Yv}${s}`]=i),n),{});return _I(t)}function SI(e){if(!(!e||!Zs(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const s=Sw(n);return Object.entries(s).forEach(([i,a])=>{t[i]=a}),t},{}):Sw(e)}function Sw(e){return e.split(",").map(t=>{const n=t.indexOf("=");if(n===-1)return[];const s=t.slice(0,n),i=t.slice(n+1);return[s,i].map(a=>{try{return decodeURIComponent(a.trim())}catch{return}})}).reduce((t,[n,s])=>(n&&s&&(t[n]=s),t),{})}function _I(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,s],i)=>{const a=`${encodeURIComponent(n)}=${encodeURIComponent(s)}`,l=i===0?a:`${t},${a}`;return l.length>bI?(Ce&&be.warn(`Not adding key: ${n} with val: ${s} to baggage header due to exceeding baggage size limits.`),t):l},"")}const wI=/^o(\d+)\./,EI=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function TI(e){return e==="http"||e==="https"}function Kc(e,t=!1){const{host:n,path:s,pass:i,port:a,projectId:l,protocol:f,publicKey:d}=e;return`${f}://${d}${t&&i?`:${i}`:""}@${n}${a?`:${a}`:""}/${s&&`${s}/`}${l}`}function CI(e){const t=EI.exec(e);if(!t){pa(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,s,i="",a="",l="",f=""]=t.slice(1);let d="",p=f;const g=p.split("/");if(g.length>1&&(d=g.slice(0,-1).join("/"),p=g.pop()),p){const y=p.match(/^\d+/);y&&(p=y[0])}return vR({host:a,pass:i,path:d,projectId:p,port:l,protocol:n,publicKey:s})}function vR(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function RI(e){if(!Ce)return!0;const{port:t,projectId:n,protocol:s}=e;return["protocol","publicKey","host","projectId"].find(l=>e[l]?!1:(be.error(`Invalid Sentry Dsn: ${l} missing`),!0))?!1:n.match(/^\d+$/)?TI(s)?t&&isNaN(parseInt(t,10))?(be.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(be.error(`Invalid Sentry Dsn: Invalid protocol ${s}`),!1):(be.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function NI(e){return e.match(wI)?.[1]}function jI(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let s;return t.orgId?s=String(t.orgId):n&&(s=NI(n)),s}function AI(e){const t=typeof e=="string"?CI(e):vR(e);if(!(!t||!RI(t)))return t}function bu(e){if(typeof e=="boolean")return Number(e);const t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}const bR=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function kI(e){if(!e)return;const t=e.match(bR);if(!t)return;let n;return t[3]==="1"?n=!0:t[3]==="0"&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function OI(e,t){const n=kI(e),s=yR(t);if(!n?.traceId)return{traceId:Js(),sampleRand:Ko()};const i=MI(n,s);s&&(s.sample_rand=i.toString());const{traceId:a,parentSpanId:l,parentSampled:f}=n;return{traceId:a,parentSpanId:l,sampled:f,dsc:s||{},sampleRand:i}}function xR(e=Js(),t=Ys(),n){let s="";return n!==void 0&&(s=n?"-1":"-0"),`${e}-${t}${s}`}function SR(e=Js(),t=Ys(),n){return`00-${e}-${t}-${n?"01":"00"}`}function MI(e,t){const n=bu(t?.sample_rand);if(n!==void 0)return n;const s=bu(t?.sample_rate);return s&&e?.parentSampled!==void 0?e.parentSampled?Ko()*s:s+Ko()*(1-s):Ko()}const _R=0,Xv=1;let _w=!1;function II(e){const{spanId:t,traceId:n}=e.spanContext(),{data:s,op:i,parent_span_id:a,status:l,origin:f,links:d}=yt(e);return{parent_span_id:a,span_id:t,trace_id:n,data:s,op:i,status:l,origin:f,links:d}}function wR(e){const{spanId:t,traceId:n,isRemote:s}=e.spanContext(),i=s?t:yt(e).parent_span_id,a=ph(e).scope,l=s?a?.getPropagationContext().propagationSpanId||Ys():t;return{parent_span_id:i,span_id:l,trace_id:n}}function PI(e){const{traceId:t,spanId:n}=e.spanContext(),s=ui(e);return xR(t,n,s)}function DI(e){const{traceId:t,spanId:n}=e.spanContext(),s=ui(e);return SR(t,n,s)}function ER(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:s,...i},attributes:a})=>({span_id:t,trace_id:n,sampled:s===Xv,attributes:a,...i}))}function ea(e){return typeof e=="number"?ww(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?ww(e.getTime()):cn()}function ww(e){return e>9999999999?e/1e3:e}function yt(e){if(LI(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(zI(e)){const{attributes:s,startTime:i,name:a,endTime:l,status:f,links:d}=e,p="parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0;return{span_id:t,trace_id:n,data:s,description:a,parent_span_id:p,start_timestamp:ea(i),timestamp:ea(l)||void 0,status:TR(f),op:s[to],origin:s[gn],links:ER(d)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function zI(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function LI(e){return typeof e.getSpanJSON=="function"}function ui(e){const{traceFlags:t}=e.spanContext();return t===Xv}function TR(e){if(!(!e||e.code===hI))return e.code===Zv?"ok":e.message||"internal_error"}const ta="_sentryChildSpans",Gy="_sentryRootSpan";function CR(e,t){const n=e[Gy]||e;Yn(t,Gy,n),e[ta]?e[ta].add(t):Yn(e,ta,new Set([t]))}function UI(e,t){e[ta]&&e[ta].delete(t)}function Xd(e){const t=new Set;function n(s){if(!t.has(s)&&ui(s)){t.add(s);const i=s[ta]?Array.from(s[ta]):[];for(const a of i)n(a)}}return n(e),Array.from(t)}function Dn(e){return e[Gy]||e}function Xn(){const e=ha(),t=qc(e);return t.getActiveSpan?t.getActiveSpan():jc(bt())}function Zy(){_w||(pa(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),_w=!0)}let Ew=!1;function $I(){if(Ew)return;function e(){const t=Xn(),n=t&&Dn(t);if(n){const s="internal_error";Ce&&be.log(`[Tracing] Root span: ${s} -> Global error occurred`),n.setStatus({code:hn,message:s})}}e.tag="sentry_tracingErrorCallback",Ew=!0,nR(e),rR(e)}function rs(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=e||vt()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function Tw(e){be.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function mh(e,t){if(!t?.length||!e.description)return!1;for(const n of t){if(FI(n)){if(Yd(e.description,n))return Ce&&Tw(e),!0;continue}if(!n.name&&!n.op)continue;const s=n.name?Yd(e.description,n.name):!0,i=n.op?e.op&&Yd(e.op,n.op):!0;if(s&&i)return Ce&&Tw(e),!0}return!1}function BI(e,t){const n=t.parent_span_id,s=t.span_id;if(n)for(const i of e)i.parent_span_id===s&&(i.parent_span_id=n)}function FI(e){return typeof e=="string"||e instanceof RegExp}const Qv="production",RR="_frozenDsc";function Qd(e,t){Yn(e,RR,t)}function NR(e,t){const n=t.getOptions(),{publicKey:s}=t.getDsn()||{},i={environment:n.environment||Qv,release:n.release,public_key:s,trace_id:e,org_id:jI(t)};return t.emit("createDsc",i),i}function Wv(e,t){const n=t.getPropagationContext();return n.dsc||NR(n.traceId,e)}function no(e){const t=vt();if(!t)return{};const n=Dn(e),s=yt(n),i=s.data,a=n.spanContext().traceState,l=a?.get("sentry.sample_rate")??i[Kv]??i[hR];function f(S){return(typeof l=="number"||typeof l=="string")&&(S.sample_rate=`${l}`),S}const d=n[RR];if(d)return f(d);const p=a?.get("sentry.dsc"),g=p&&yR(p);if(g)return f(g);const y=NR(e.spanContext().traceId,t),b=i[vs],x=s.description;return b!=="url"&&x&&(y.transaction=x),rs()&&(y.sampled=String(ui(n)),y.sample_rand=a?.get("sentry.sample_rand")??ph(n).scope?.getPropagationContext().sampleRand.toString()),f(y),t.emit("createDsc",y,n),y}class ei{constructor(t={}){this._traceId=t.traceId||Js(),this._spanId=t.spanId||Ys()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:_R}}end(t){}setAttribute(t,n){return this}setAttributes(t){return this}setStatus(t){return this}updateName(t){return this}isRecording(){return!1}addEvent(t,n,s){return this}addLink(t){return this}addLinks(t){return this}recordException(t,n){}}function Vs(e,t=100,n=1/0){try{return Yy("",e,t,n)}catch(s){return{ERROR:`**non-serializable** (${s})`}}}function jR(e,t=3,n=100*1024){const s=Vs(e,t);return KI(s)>n?jR(e,t-1,n):s}function Yy(e,t,n=1/0,s=1/0,i=GI()){const[a,l]=i;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const f=HI(e,t);if(!f.startsWith("[object "))return f;if(t.__sentry_skip_normalization__)return t;const d=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(d===0)return f.replace("object ","");if(a(t))return"[Circular ~]";const p=t;if(p&&typeof p.toJSON=="function")try{const x=p.toJSON();return Yy("",x,d-1,s,i)}catch{}const g=Array.isArray(t)?[]:{};let y=0;const b=lR(t);for(const x in b){if(!Object.prototype.hasOwnProperty.call(b,x))continue;if(y>=s){g[x]="[MaxProperties ~]";break}const S=b[x];g[x]=Yy(x,S,d-1,s,i),y++}return l(t),g}function HI(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(iR(t))return tR(t);if(VM(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${Qs(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=qI(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function qI(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function VI(e){return~-encodeURI(e).split(/%..|./).length}function KI(e){return VI(JSON.stringify(e))}function GI(){const e=new WeakSet;function t(s){return e.has(s)?!0:(e.add(s),!1)}function n(s){e.delete(s)}return[t,n]}function ga(e,t=[]){return[e,t]}function ZI(e,t){const[n,s]=e;return[n,[...s,t]]}function Xy(e,t){const n=e[1];for(const s of n){const i=s[0].type;if(t(s,i))return!0}return!1}function YI(e,t){return Xy(e,(n,s)=>t.includes(s))}function Qy(e){const t=Wh(ct);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function XI(e){const[t,n]=e;let s=JSON.stringify(t);function i(a){typeof s=="string"?s=typeof a=="string"?s+a:[Qy(s),a]:s.push(typeof a=="string"?Qy(a):a)}for(const a of n){const[l,f]=a;if(i(`
|
|
6
|
-
${JSON.stringify(l)}
|
|
7
|
-
`),typeof f=="string"||f instanceof Uint8Array)i(f);else{let d;try{d=JSON.stringify(f)}catch{d=JSON.stringify(Vs(f))}i(d)}}return typeof s=="string"?s:QI(s)}function QI(e){const t=e.reduce((i,a)=>i+a.length,0),n=new Uint8Array(t);let s=0;for(const i of e)n.set(i,s),s+=i.length;return n}function WI(e){return[{type:"span"},e]}function JI(e){const t=typeof e.data=="string"?Qy(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const eP={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",log:"log_item",metric:"metric",trace_metric:"metric"};function Cw(e){return eP[e]}function AR(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function tP(e,t,n,s){const i=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&s&&{dsn:Kc(s)},...i&&{trace:i}}}function nP(e,t){if(!t)return e;const n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function rP(e,t,n,s){const i=AR(n),a={sent_at:new Date().toISOString(),...i&&{sdk:i},...!!s&&t&&{dsn:Kc(t)}},l="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return ga(a,[l])}function sP(e,t,n,s){const i=AR(n),a=e.type&&e.type!=="replay_event"?e.type:"event";nP(e,n?.sdk);const l=tP(e,i,s,t);return delete e.sdkProcessingMetadata,ga(l,[[{type:a},e]])}function oP(e,t){function n(x){return!!x.trace_id&&!!x.public_key}const s=no(e[0]),i=t?.getDsn(),a=t?.getOptions().tunnel,l={sent_at:new Date().toISOString(),...n(s)&&{trace:s},...!!a&&i&&{dsn:Kc(i)}},{beforeSendSpan:f,ignoreSpans:d}=t?.getOptions()||{},p=d?.length?e.filter(x=>!mh(yt(x),d)):e,g=e.length-p.length;g&&t?.recordDroppedEvent("before_send","span",g);const y=f?x=>{const S=yt(x),w=f(S);return w||(Zy(),S)}:yt,b=[];for(const x of p){const S=y(x);S&&b.push(WI(S))}return ga(l,b)}function iP(e){if(!Ce)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:s}=yt(e),{spanId:i}=e.spanContext(),a=ui(e),l=Dn(e),f=l===e,d=`[Tracing] Starting ${a?"sampled":"unsampled"} ${f?"root ":""}span`,p=[`op: ${n}`,`name: ${t}`,`ID: ${i}`];if(s&&p.push(`parent ID: ${s}`),!f){const{op:g,description:y}=yt(l);p.push(`root ID: ${l.spanContext().spanId}`),g&&p.push(`root op: ${g}`),y&&p.push(`root description: ${y}`)}be.log(`${d}
|
|
8
|
-
${p.join(`
|
|
9
|
-
`)}`)}function aP(e){if(!Ce)return;const{description:t="< unknown name >",op:n="< unknown op >"}=yt(e),{spanId:s}=e.spanContext(),a=Dn(e)===e,l=`[Tracing] Finishing "${n}" ${a?"root ":""}span "${t}" with ID ${s}`;be.log(l)}function cP(e,t,n,s=Xn()){const i=s&&Dn(s);i&&(Ce&&be.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),i.addEvent(e,{[zu]:t,[Du]:n}))}function Rw(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const s=n.attributes||{},i=s[Du],a=s[zu];typeof i=="string"&&typeof a=="number"&&(t[n.name]={value:a,unit:i})}),t}const Nw=1e3;class np{constructor(t={}){this._traceId=t.traceId||Js(),this._spanId=t.spanId||Ys(),this._startTime=t.startTimestamp||cn(),this._links=t.links,this._attributes={},this.setAttributes({[gn]:"manual",[to]:t.op,...t.attributes}),this._name=t.name,t.parentSpanId&&(this._parentSpanId=t.parentSpanId),"sampled"in t&&(this._sampled=t.sampled),t.endTimestamp&&(this._endTime=t.endTimestamp),this._events=[],this._isStandaloneSpan=t.isStandalone,this._endTime&&this._onSpanEnded()}addLink(t){return this._links?this._links.push(t):this._links=[t],this}addLinks(t){return this._links?this._links.push(...t):this._links=t,this}recordException(t,n){}spanContext(){const{_spanId:t,_traceId:n,_sampled:s}=this;return{spanId:t,traceId:n,traceFlags:s?Xv:_R}}setAttribute(t,n){return n===void 0?delete this._attributes[t]:this._attributes[t]=n,this}setAttributes(t){return Object.keys(t).forEach(n=>this.setAttribute(n,t[n])),this}updateStartTime(t){this._startTime=ea(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(vs,"custom"),this}end(t){this._endTime||(this._endTime=ea(t),aP(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[to],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:TR(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[gn],profile_id:this._attributes[Gv],exclusive_time:this._attributes[Vc],measurements:Rw(this._events),is_segment:this._isStandaloneSpan&&Dn(this)===this||void 0,segment_id:this._isStandaloneSpan?Dn(this).spanContext().spanId:void 0,links:ER(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,s){Ce&&be.log("[Tracing] Adding an event to span:",t);const i=jw(n)?n:s||cn(),a=jw(n)?{}:n||{},l={name:t,time:ea(i),attributes:a};return this._events.push(l),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=vt();if(t&&t.emit("spanEnd",this),!(this._isStandaloneSpan||this===Dn(this)))return;if(this._isStandaloneSpan){this._sampled?uP(oP([this],t)):(Ce&&be.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}const s=this._convertSpanToTransaction();s&&(ph(this).scope||bt()).captureEvent(s)}_convertSpanToTransaction(){if(!Aw(yt(this)))return;this._name||(Ce&&be.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:t,isolationScope:n}=ph(this),s=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;const a=Xd(this).filter(g=>g!==this&&!lP(g)).map(g=>yt(g)).filter(Aw),l=this._attributes[vs];delete this._attributes[xw],a.forEach(g=>{delete g.data[xw]});const f={contexts:{trace:II(this)},spans:a.length>Nw?a.sort((g,y)=>g.start_timestamp-y.start_timestamp).slice(0,Nw):a,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:no(this)},request:s,...l&&{transaction_info:{source:l}}},d=Rw(this._events);return d&&Object.keys(d).length&&(Ce&&be.log("[Measurements] Adding measurements to transaction event",JSON.stringify(d,void 0,2)),f.measurements=d),f}}function jw(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function Aw(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function lP(e){return e instanceof np&&e.isStandaloneSpan()}function uP(e){const t=vt();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function fP(e,t,n=()=>{},s=()=>{}){let i;try{i=e()}catch(a){throw t(a),n(),a}return dP(i,t,n,s)}function dP(e,t,n,s){return Hc(e)?e.then(i=>(n(),s(i),i),i=>{throw t(i),n(),i}):(n(),s(e),e)}function hP(e,t,n){if(!rs(e))return[!1];let s,i;typeof e.tracesSampler=="function"?(i=e.tracesSampler({...t,inheritOrSampleWith:f=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):f}),s=!0):t.parentSampled!==void 0?i=t.parentSampled:typeof e.tracesSampleRate<"u"&&(i=e.tracesSampleRate,s=!0);const a=bu(i);if(a===void 0)return Ce&&be.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(i)} of type ${JSON.stringify(typeof i)}.`),[!1];if(!a)return Ce&&be.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,a,s];const l=n<a;return l||Ce&&be.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`),[l,a,s]}const kR="__SENTRY_SUPPRESS_TRACING__";function OR(e,t){const n=eb();if(n.startSpan)return n.startSpan(e,t);const s=IR(e),{forceTransaction:i,parentSpan:a,scope:l}=e,f=l?.clone();return Pu(f,()=>mP(a)(()=>{const p=bt(),g=PR(p,a),b=e.onlyIfParent&&!g?new ei:MR({parentSpan:g,spanArguments:s,forceTransaction:i,scope:p});return Nc(p,b),fP(()=>t(b),()=>{const{status:x}=yt(b);b.isRecording()&&(!x||x==="ok")&&b.setStatus({code:hn,message:"internal_error"})},()=>{b.end()})}))}function Gc(e){const t=eb();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=IR(e),{forceTransaction:s,parentSpan:i}=e;return(e.scope?l=>Pu(e.scope,l):i!==void 0?l=>Jv(i,l):l=>l())(()=>{const l=bt(),f=PR(l,i);return e.onlyIfParent&&!f?new ei:MR({parentSpan:f,spanArguments:n,forceTransaction:s,scope:l})})}function Jv(e,t){const n=eb();return n.withActiveSpan?n.withActiveSpan(e,t):Pu(s=>(Nc(s,e||void 0),t(s)))}function MR({parentSpan:e,spanArguments:t,forceTransaction:n,scope:s}){if(!rs()){const l=new ei;if(n||!e){const f={sampled:"false",sample_rate:"0",transaction:t.name,...no(l)};Qd(l,f)}return l}const i=os();let a;if(e&&!n)a=pP(e,s,t),CR(e,a);else if(e){const l=no(e),{traceId:f,spanId:d}=e.spanContext(),p=ui(e);a=kw({traceId:f,parentSpanId:d,...t},s,p),Qd(a,l)}else{const{traceId:l,dsc:f,parentSpanId:d,sampled:p}={...i.getPropagationContext(),...s.getPropagationContext()};a=kw({traceId:l,parentSpanId:d,...t},s,p),f&&Qd(a,f)}return iP(a),yI(a,s,i),a}function IR(e){const n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const s={...n};return s.startTimestamp=ea(e.startTime),delete s.startTime,s}return n}function eb(){const e=ha();return qc(e)}function kw(e,t,n){const s=vt(),i=s?.getOptions()||{},{name:a=""}=e,l={spanAttributes:{...e.attributes},spanName:a,parentSampled:n};s?.emit("beforeSampling",l,{decision:!1});const f=l.parentSampled??n,d=l.spanAttributes,p=t.getPropagationContext(),[g,y,b]=t.getScopeData().sdkProcessingMetadata[kR]?[!1]:hP(i,{name:a,parentSampled:f,attributes:d,parentSampleRate:bu(p.dsc?.sample_rate)},p.sampleRand),x=new np({...e,attributes:{[vs]:"custom",[Kv]:y!==void 0&&b?y:void 0,...d},sampled:g});return!g&&s&&(Ce&&be.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),s.recordDroppedEvent("sample_rate","transaction")),s&&s.emit("spanStart",x),x}function pP(e,t,n){const{spanId:s,traceId:i}=e.spanContext(),a=t.getScopeData().sdkProcessingMetadata[kR]?!1:ui(e),l=a?new np({...n,parentSpanId:s,traceId:i,sampled:a}):new ei({traceId:i});CR(e,l);const f=vt();return f&&(f.emit("spanStart",l),n.endTimestamp&&f.emit("spanEnd",l)),l}function PR(e,t){if(t)return t;if(t===null)return;const n=jc(e);if(!n)return;const s=vt();return(s?s.getOptions():{}).parentSpanIsAlwaysRootSpan?Dn(n):n}function mP(e){return e!==void 0?t=>Jv(e,t):t=>t()}const Wd={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},gP="heartbeatFailed",yP="idleTimeout",vP="finalTimeout",bP="externalFinish";function DR(e,t={}){const n=new Map;let s=!1,i,a=bP,l=!t.disableAutoFinish;const f=[],{idleTimeout:d=Wd.idleTimeout,finalTimeout:p=Wd.finalTimeout,childSpanTimeout:g=Wd.childSpanTimeout,beforeSpanEnd:y,trimIdleSpanEndTimestamp:b=!0}=t,x=vt();if(!x||!rs()){const j=new ei,A={sample_rate:"0",sampled:"false",...no(j)};return Qd(j,A),j}const S=bt(),w=Xn(),T=xP(e);T.end=new Proxy(T.end,{apply(j,A,P){if(y&&y(T),A instanceof ei)return;const[Q,...B]=P,U=Q||cn(),Z=ea(U),K=Xd(T).filter(L=>L!==T),ee=yt(T);if(!K.length||!b)return z(Z),Reflect.apply(j,A,[Z,...B]);const D=x.getOptions().ignoreSpans,G=K?.reduce((L,I)=>{const H=yt(I);return!H.timestamp||D&&mh(H,D)?L:L?Math.max(L,H.timestamp):H.timestamp},void 0),q=ee.start_timestamp,V=Math.min(q?q+p/1e3:1/0,Math.max(q||-1/0,Math.min(Z,G||1/0)));return z(V),Reflect.apply(j,A,[V,...B])}});function C(){i&&(clearTimeout(i),i=void 0)}function O(j){C(),i=setTimeout(()=>{!s&&n.size===0&&l&&(a=yP,T.end(j))},d)}function N(j){i=setTimeout(()=>{!s&&l&&(a=gP,T.end(j))},g)}function R(j){C(),n.set(j,!0);const A=cn();N(A+g/1e3)}function M(j){if(n.has(j)&&n.delete(j),n.size===0){const A=cn();O(A+d/1e3)}}function z(j){s=!0,n.clear(),f.forEach(K=>K()),Nc(S,w);const A=yt(T),{start_timestamp:P}=A;if(!P)return;A.data[vu]||T.setAttribute(vu,a);const B=A.status;(!B||B==="unknown")&&T.setStatus({code:Zv}),be.log(`[Tracing] Idle span "${A.op}" finished`);const U=Xd(T).filter(K=>K!==T);let Z=0;U.forEach(K=>{K.isRecording()&&(K.setStatus({code:hn,message:"cancelled"}),K.end(j),Ce&&be.log("[Tracing] Cancelling span since span ended early",JSON.stringify(K,void 0,2)));const ee=yt(K),{timestamp:D=0,start_timestamp:G=0}=ee,q=G<=j,V=(p+d)/1e3,L=D-G<=V;if(Ce){const I=JSON.stringify(K,void 0,2);q?L||be.log("[Tracing] Discarding span since it finished after idle span final timeout",I):be.log("[Tracing] Discarding span since it happened after idle span was finished",I)}(!L||!q)&&(UI(T,K),Z++)}),Z>0&&T.setAttribute("sentry.idle_span_discarded_spans",Z)}return f.push(x.on("spanStart",j=>{if(s||j===T||yt(j).timestamp||j instanceof np&&j.isStandaloneSpan())return;Xd(T).includes(j)&&R(j.spanContext().spanId)})),f.push(x.on("spanEnd",j=>{s||M(j.spanContext().spanId)})),f.push(x.on("idleSpanEnableAutoFinish",j=>{j===T&&(l=!0,O(),n.size&&N())})),t.disableAutoFinish||O(),setTimeout(()=>{s||(T.setStatus({code:hn,message:"deadline_exceeded"}),a=vP,T.end())},p),T}function xP(e){const t=Gc(e);return Nc(bt(),t),Ce&&be.log("[Tracing] Started span is an idle span"),t}const Hg=0,Ow=1,Mw=2;function Lu(e){return new xu(t=>{t(e)})}function tb(e){return new xu((t,n)=>{n(e)})}class xu{constructor(t){this._state=Hg,this._handlers=[],this._runExecutor(t)}then(t,n){return new xu((s,i)=>{this._handlers.push([!1,a=>{if(!t)s(a);else try{s(t(a))}catch(l){i(l)}},a=>{if(!n)i(a);else try{s(n(a))}catch(l){i(l)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new xu((n,s)=>{let i,a;return this.then(l=>{a=!1,i=l,t&&t()},l=>{a=!0,i=l,t&&t()}).then(()=>{if(a){s(i);return}n(i)})})}_executeHandlers(){if(this._state===Hg)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===Ow&&n[1](this._value),this._state===Mw&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(a,l)=>{if(this._state===Hg){if(Hc(l)){l.then(s,i);return}this._state=a,this._value=l,this._executeHandlers()}},s=a=>{n(Ow,a)},i=a=>{n(Mw,a)};try{t(s,i)}catch(a){i(a)}}}function SP(e,t,n,s=0){try{const i=Wy(t,n,e,s);return Hc(i)?i:Lu(i)}catch(i){return tb(i)}}function Wy(e,t,n,s){const i=n[s];if(!e||!i)return e;const a=i({...e},t);return Ce&&a===null&&be.log(`Event processor "${i.id||"?"}" dropped event`),Hc(a)?a.then(l=>Wy(l,t,n,s+1)):Wy(a,t,n,s+1)}let Fi,Iw,Pw,Lo;function _P(e){const t=ct._sentryDebugIds,n=ct._debugIds;if(!t&&!n)return{};const s=t?Object.keys(t):[],i=n?Object.keys(n):[];if(Lo&&s.length===Iw&&i.length===Pw)return Lo;Iw=s.length,Pw=i.length,Lo={},Fi||(Fi={});const a=(l,f)=>{for(const d of l){const p=f[d],g=Fi?.[d];if(g&&Lo&&p)Lo[g[0]]=p,Fi&&(Fi[d]=[g[0],p]);else if(p){const y=e(d);for(let b=y.length-1;b>=0;b--){const S=y[b]?.filename;if(S&&Lo&&Fi){Lo[S]=p,Fi[d]=[S,p];break}}}}};return t&&a(s,t),n&&a(i,n),Lo}function wP(e,t){const{fingerprint:n,span:s,breadcrumbs:i,sdkProcessingMetadata:a}=t;EP(e,t),s&&RP(e,s),NP(e,n),TP(e,i),CP(e,a)}function Dw(e,t){const{extra:n,tags:s,attributes:i,user:a,contexts:l,level:f,sdkProcessingMetadata:d,breadcrumbs:p,fingerprint:g,eventProcessors:y,attachments:b,propagationContext:x,transactionName:S,span:w}=t;Ql(e,"extra",n),Ql(e,"tags",s),Ql(e,"attributes",i),Ql(e,"user",a),Ql(e,"contexts",l),e.sdkProcessingMetadata=Iu(e.sdkProcessingMetadata,d,2),f&&(e.level=f),S&&(e.transactionName=S),w&&(e.span=w),p.length&&(e.breadcrumbs=[...e.breadcrumbs,...p]),g.length&&(e.fingerprint=[...e.fingerprint,...g]),y.length&&(e.eventProcessors=[...e.eventProcessors,...y]),b.length&&(e.attachments=[...e.attachments,...b]),e.propagationContext={...e.propagationContext,...x}}function Ql(e,t,n){e[t]=Iu(e[t],n,1)}function nb(e,t){const n=uI().getScopeData();return e&&Dw(n,e.getScopeData()),t&&Dw(n,t.getScopeData()),n}function EP(e,t){const{extra:n,tags:s,user:i,contexts:a,level:l,transactionName:f}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(s).length&&(e.tags={...s,...e.tags}),Object.keys(i).length&&(e.user={...i,...e.user}),Object.keys(a).length&&(e.contexts={...a,...e.contexts}),l&&(e.level=l),f&&e.type!=="transaction"&&(e.transaction=f)}function TP(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function CP(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function RP(e,t){e.contexts={trace:wR(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:no(t),...e.sdkProcessingMetadata};const n=Dn(t),s=yt(n).description;s&&!e.transaction&&e.type==="transaction"&&(e.transaction=s)}function NP(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}function jP(e,t,n,s,i,a){const{normalizeDepth:l=3,normalizeMaxBreadth:f=1e3}=e,d={...t,event_id:t.event_id||n.event_id||qr(),timestamp:t.timestamp||ma()},p=n.integrations||e.integrations.map(C=>C.name);AP(d,e),MP(d,p),i&&i.emit("applyFrameMetadata",t),t.type===void 0&&kP(d,e.stackParser);const g=PP(s,n.captureContext);n.mechanism&&Cc(d,n.mechanism);const y=i?i.getEventProcessors():[],b=nb(a,g),x=[...n.attachments||[],...b.attachments];x.length&&(n.attachments=x),wP(d,b);const S=[...y,...b.eventProcessors];return(n.data&&n.data.__sentry__===!0?Lu(d):SP(S,d,n)).then(C=>(C&&OP(C),typeof l=="number"&&l>0?IP(C,l,f):C))}function AP(e,t){const{environment:n,release:s,dist:i,maxValueLength:a}=t;e.environment=e.environment||n||Qv,!e.release&&s&&(e.release=s),!e.dist&&i&&(e.dist=i);const l=e.request;l?.url&&a&&(l.url=qy(l.url,a)),a&&e.exception?.values?.forEach(f=>{f.value&&(f.value=qy(f.value,a))})}function kP(e,t){const n=_P(t);e.exception?.values?.forEach(s=>{s.stacktrace?.frames?.forEach(i=>{i.filename&&(i.debug_id=n[i.filename])})})}function OP(e){const t={};if(e.exception?.values?.forEach(s=>{s.stacktrace?.frames?.forEach(i=>{i.debug_id&&(i.abs_path?t[i.abs_path]=i.debug_id:i.filename&&(t[i.filename]=i.debug_id),delete i.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([s,i])=>{n.push({type:"sourcemap",code_file:s,debug_id:i})})}function MP(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function IP(e,t,n){if(!e)return null;const s={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(i=>({...i,...i.data&&{data:Vs(i.data,t,n)}}))},...e.user&&{user:Vs(e.user,t,n)},...e.contexts&&{contexts:Vs(e.contexts,t,n)},...e.extra&&{extra:Vs(e.extra,t,n)}};return e.contexts?.trace&&s.contexts&&(s.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(s.contexts.trace.data=Vs(e.contexts.trace.data,t,n))),e.spans&&(s.spans=e.spans.map(i=>({...i,...i.data&&{data:Vs(i.data,t,n)}}))),e.contexts?.flags&&s.contexts&&(s.contexts.flags=Vs(e.contexts.flags,3,n)),s}function PP(e,t){if(!t)return e;const n=e?e.clone():new eo;return n.update(t),n}function zR(e,t){return bt().captureException(e,void 0)}function LR(e,t){return bt().captureEvent(e,t)}function DP(e,t){os().setContext(e,t)}function zP(){const e=vt();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function zw(e){const t=os(),n=bt(),{userAgent:s}=ct.navigator||{},i=eI({user:n.getUser()||t.getUser(),...s&&{userAgent:s},...e}),a=t.getSession();return a?.status==="ok"&&Rc(a,{status:"exited"}),UR(),t.setSession(i),i}function UR(){const e=os(),n=bt().getSession()||e.getSession();n&&tI(n),$R(),e.setSession()}function $R(){const e=os(),t=vt(),n=e.getSession();n&&t&&t.captureSession(n)}function Lw(e=!1){if(e){UR();return}$R()}const LP="7";function UP(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function $P(e){return`${UP(e)}${e.projectId}/envelope/`}function BP(e,t){const n={sentry_version:LP};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function FP(e,t,n){return t||`${$P(e)}?${BP(e,n)}`}const Uw=[];function HP(e){const t={};return e.forEach(n=>{const{name:s}=n,i=t[s];i&&!i.isDefaultInstance&&n.isDefaultInstance||(t[s]=n)}),Object.values(t)}function qP(e){const t=e.defaultIntegrations||[],n=e.integrations;t.forEach(i=>{i.isDefaultInstance=!0});let s;if(Array.isArray(n))s=[...t,...n];else if(typeof n=="function"){const i=n(t);s=Array.isArray(i)?i:[i]}else s=t;return HP(s)}function VP(e,t){const n={};return t.forEach(s=>{s&&BR(e,s,n)}),n}function $w(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function BR(e,t,n){if(n[t.name]){Ce&&be.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!Uw.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),Uw.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){const s=t.preprocessEvent.bind(t);e.on("preprocessEvent",(i,a)=>s(i,a,e))}if(typeof t.processEvent=="function"){const s=t.processEvent.bind(t),i=Object.assign((a,l)=>s(a,l,e),{id:t.name});e.addEventProcessor(i)}Ce&&be.log(`Integration installed: ${t.name}`)}function KP(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function GP(e,t){const{value:n,unit:s}=KP(e)?e:{value:e,unit:void 0},i=ZP(n),a=s&&typeof s=="string"?{unit:s}:{};if(i)return{...i,...a};if(!t||t==="skip-undefined"&&n===void 0)return;let l="";try{l=JSON.stringify(n)??""}catch{}return{value:l,type:"string",...a}}function gh(e,t=!1){const n={};for(const[s,i]of Object.entries(e??{})){const a=GP(i,t);a&&(n[s]=a)}return n}function ZP(e){const t=typeof e=="string"?"string":typeof e=="boolean"?"boolean":typeof e=="number"&&!Number.isNaN(e)?Number.isInteger(e)?"integer":"double":null;if(t)return{value:e,type:t}}function FR(e,t){return t?Pu(t,()=>{const n=Xn(),s=n?wR(n):dR(t);return[n?no(n):Wv(e,t),s]}):[void 0,void 0]}const YP={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function XP(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function QP(e,t,n,s){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&s&&(i.dsn=Kc(s)),ga(i,[XP(e)])}const WP=100;function ps(e,t,n,s=!0){n&&(!e[t]||s)&&(e[t]=n)}function JP(e,t){const n=sb(),s=HR(e);s===void 0?n.set(e,[t]):s.length>=WP?(rb(e,s),n.set(e,[t])):n.set(e,[...s,t])}function eD(e,t=bt(),n=JP){const s=t?.getClient()??vt();if(!s){Ce&&be.warn("No client available to capture log.");return}const{release:i,environment:a,enableLogs:l=!1,beforeSendLog:f}=s.getOptions();if(!l){Ce&&be.warn("logging option not enabled, log will not be captured.");return}const[,d]=FR(s,t),p={...e.attributes},{user:{id:g,email:y,username:b},attributes:x={}}=nb(os(),t);ps(p,"user.id",g,!1),ps(p,"user.email",y,!1),ps(p,"user.name",b,!1),ps(p,"sentry.release",i),ps(p,"sentry.environment",a);const{name:S,version:w}=s.getSdkMetadata()?.sdk??{};ps(p,"sentry.sdk.name",S),ps(p,"sentry.sdk.version",w);const T=s.getIntegrationByName("Replay"),C=T?.getReplayId(!0);ps(p,"sentry.replay_id",C),C&&T?.getRecordingMode()==="buffer"&&ps(p,"sentry._internal.replay_is_buffering",!0);const O=e.message;if(ep(O)){const{__sentry_template_string__:B,__sentry_template_values__:U=[]}=O;U?.length&&(p["sentry.message.template"]=B),U.forEach((Z,K)=>{p[`sentry.message.parameter.${K}`]=Z})}const N=jc(t);ps(p,"sentry.trace.parent_span_id",N?.spanContext().spanId);const R={...e,attributes:p};s.emit("beforeCaptureLog",R);const M=f?pa(()=>f(R)):R;if(!M){s.recordDroppedEvent("before_send","log_item",1),Ce&&be.warn("beforeSendLog returned null, log will not be captured.");return}const{level:z,message:j,attributes:A={},severityNumber:P}=M,Q={timestamp:cn(),level:z,body:j,trace_id:d?.trace_id,severity_number:P??YP[z],attributes:{...gh(x),...gh(A,!0)}};n(s,Q),s.emit("afterCaptureLog",M)}function rb(e,t){const n=t??HR(e)??[];if(n.length===0)return;const s=e.getOptions(),i=QP(n,s._metadata,s.tunnel,e.getDsn());sb().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(i)}function HR(e){return sb().get(e)}function sb(){return Bc("clientToLogBufferMap",()=>new WeakMap)}function tD(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function nD(e,t,n,s){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&s&&(i.dsn=Kc(s)),ga(i,[tD(e)])}const rD=1e3;function Fs(e,t,n,s=!0){n&&(s||!(t in e))&&(e[t]=n)}function sD(e,t){const n=ib(),s=qR(e);s===void 0?n.set(e,[t]):s.length>=rD?(ob(e,s),n.set(e,[t])):n.set(e,[...s,t])}function oD(e,t,n){const{release:s,environment:i}=t.getOptions(),a={...e.attributes};Fs(a,"user.id",n.id,!1),Fs(a,"user.email",n.email,!1),Fs(a,"user.name",n.username,!1),Fs(a,"sentry.release",s),Fs(a,"sentry.environment",i);const{name:l,version:f}=t.getSdkMetadata()?.sdk??{};Fs(a,"sentry.sdk.name",l),Fs(a,"sentry.sdk.version",f);const d=t.getIntegrationByName("Replay"),p=d?.getReplayId(!0);return Fs(a,"sentry.replay_id",p),p&&d?.getRecordingMode()==="buffer"&&Fs(a,"sentry._internal.replay_is_buffering",!0),{...e,attributes:a}}function iD(e,t,n,s){const[,i]=FR(t,n),a=jc(n),l=a?a.spanContext().traceId:i?.trace_id,f=a?a.spanContext().spanId:void 0;return{timestamp:cn(),trace_id:l??"",span_id:f,name:e.name,type:e.type,unit:e.unit,value:e.value,attributes:{...gh(s),...gh(e.attributes,"skip-undefined")}}}function aD(e,t){const n=t?.scope??bt(),s=t?.captureSerializedMetric??sD,i=n?.getClient()??vt();if(!i){Ce&&be.warn("No client available to capture metric.");return}const{_experiments:a,enableMetrics:l,beforeSendMetric:f}=i.getOptions();if(!(l??a?.enableMetrics??!0)){Ce&&be.warn("metrics option not enabled, metric will not be captured.");return}const{user:p,attributes:g}=nb(os(),n),y=oD(e,i,p);i.emit("processMetric",y);const b=f||a?.beforeSendMetric,x=b?b(y):y;if(!x){Ce&&be.log("`beforeSendMetric` returned `null`, will not send metric.");return}const S=iD(x,i,n,g);Ce&&be.log("[Metric]",S),s(i,S),i.emit("afterCaptureMetric",x)}function ob(e,t){const n=t??qR(e)??[];if(n.length===0)return;const s=e.getOptions(),i=nD(n,s._metadata,s.tunnel,e.getDsn());ib().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(i)}function qR(e){return ib().get(e)}function ib(){return Bc("clientToMetricBufferMap",()=>new WeakMap)}function VR(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}const ab=Symbol.for("SentryBufferFullError");function cb(e=100){const t=new Set;function n(){return t.size<e}function s(l){t.delete(l)}function i(l){if(!n())return tb(ab);const f=l();return t.add(f),f.then(()=>s(f),()=>s(f)),f}function a(l){if(!t.size)return Lu(!0);const f=Promise.allSettled(Array.from(t)).then(()=>!0);if(!l)return f;const d=[f,new Promise(p=>VR(setTimeout(()=>p(!1),l)))];return Promise.race(d)}return{get $(){return Array.from(t)},add:i,drain:a}}const cD=60*1e3;function lD(e,t=Mu()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const s=Date.parse(`${e}`);return isNaN(s)?cD:s-t}function uD(e,t){return e[t]||e.all||0}function fD(e,t,n=Mu()){return uD(e,t)>n}function dD(e,{statusCode:t,headers:n},s=Mu()){const i={...e},a=n?.["x-sentry-rate-limits"],l=n?.["retry-after"];if(a)for(const f of a.trim().split(",")){const[d,p,,,g]=f.split(":",5),y=parseInt(d,10),b=(isNaN(y)?60:y)*1e3;if(!p)i.all=s+b;else for(const x of p.split(";"))x==="metric_bucket"?(!g||g.split(";").includes("custom"))&&(i[x]=s+b):i[x]=s+b}else l?i.all=s+lD(l,s):t===429&&(i.all=s+60*1e3);return i}const KR=64;function hD(e,t,n=cb(e.bufferSize||KR)){let s={};const i=l=>n.drain(l);function a(l){const f=[];if(Xy(l,(y,b)=>{const x=Cw(b);fD(s,x)?e.recordDroppedEvent("ratelimit_backoff",x):f.push(y)}),f.length===0)return Promise.resolve({});const d=ga(l[0],f),p=y=>{if(YI(d,["client_report"])){Ce&&be.warn(`Dropping client report. Will not send outcomes (reason: ${y}).`);return}Xy(d,(b,x)=>{e.recordDroppedEvent(y,Cw(x))})},g=()=>t({body:XI(d)}).then(y=>y.statusCode===413?(Ce&&be.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),p("send_error"),y):(Ce&&y.statusCode!==void 0&&(y.statusCode<200||y.statusCode>=300)&&be.warn(`Sentry responded with status code ${y.statusCode} to sent event.`),s=dD(s,y),y),y=>{throw p("network_error"),Ce&&be.error("Encountered error running transport request:",y),y});return n.add(g).then(y=>y,y=>{if(y===ab)return Ce&&be.error("Skipped sending event because buffer is full."),p("queue_overflow"),Promise.resolve({});throw y})}return{send:a,flush:i}}function pD(e,t,n){const s=[{type:"client_report"},{timestamp:ma(),discarded_events:e}];return ga(t?{dsn:t}:{},[s])}function GR(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function mD(e){const{trace_id:t,parent_span_id:n,span_id:s,status:i,origin:a,data:l,op:f}=e.contexts?.trace??{};return{data:l??{},description:e.transaction,op:f,parent_span_id:n,span_id:s??"",start_timestamp:e.start_timestamp??0,status:i,timestamp:e.timestamp,trace_id:t??"",origin:a,profile_id:l?.[Gv],exclusive_time:l?.[Vc],measurements:e.measurements,is_segment:!0}}function gD(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[Gv]:e.profile_id},...e.exclusive_time&&{[Vc]:e.exclusive_time}}}},measurements:e.measurements}}const Bw="Not capturing exception because it's already been captured.",Fw="Discarded session because of missing or non-string release",ZR=Symbol.for("SentryInternalError"),YR=Symbol.for("SentryDoNotSendEventError"),yD=5e3;function Jd(e){return{message:e,[ZR]:!0}}function qg(e){return{message:e,[YR]:!0}}function Hw(e){return!!e&&typeof e=="object"&&ZR in e}function qw(e){return!!e&&typeof e=="object"&&YR in e}function Vw(e,t,n,s,i){let a=0,l,f=!1;e.on(n,()=>{a=0,clearTimeout(l),f=!1}),e.on(t,d=>{a+=s(d),a>=8e5?i(e):f||(f=!0,l=VR(setTimeout(()=>{i(e)},yD)))}),e.on("flush",()=>{i(e)})}class vD{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=cb(t.transportOptions?.bufferSize??KR),t.dsn?this._dsn=AI(t.dsn):Ce&&be.warn("No DSN provided, client will not send events."),this._dsn){const s=FP(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:s})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&Vw(this,"afterCaptureLog","flushLogs",_D,rb),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&Vw(this,"afterCaptureMetric","flushMetrics",SD,ob)}captureException(t,n,s){const i=qr();if(yw(t))return Ce&&be.log(Bw),i;const a={event_id:i,...n};return this._process(()=>this.eventFromException(t,a).then(l=>this._captureEvent(l,a,s)).then(l=>l),"error"),a.event_id}captureMessage(t,n,s,i){const a={event_id:qr(),...s},l=ep(t)?t:String(t),f=Tc(t),d=f?this.eventFromMessage(l,n,a):this.eventFromException(t,a);return this._process(()=>d.then(p=>this._captureEvent(p,a,i)),f?"unknown":"error"),a.event_id}captureEvent(t,n,s){const i=qr();if(n?.originalException&&yw(n.originalException))return Ce&&be.log(Bw),i;const a={event_id:i,...n},l=t.sdkProcessingMetadata||{},f=l.capturedSpanScope,d=l.capturedSpanIsolationScope,p=Kw(t.type);return this._process(()=>this._captureEvent(t,a,f||s,d),p),a.event_id}captureSession(t){this.sendSession(t),Rc(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){const n=this._transport;if(!n)return!0;this.emit("flush");const s=await this._isClientDoneProcessing(t),i=await n.flush(t);return s&&i}async close(t){const n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){const n=this._integrations[t.name];BR(this,t,this._integrations),n||$w(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let s=sP(t,this._dsn,this._options._metadata,this._options.tunnel);for(const i of n.attachments||[])s=ZI(s,JI(i));this.sendEnvelope(s).then(i=>this.emit("afterSendEvent",t,i))}sendSession(t){const{release:n,environment:s=Qv}=this._options;if("aggregates"in t){const a=t.attrs||{};if(!a.release&&!n){Ce&&be.warn(Fw);return}a.release=a.release||n,a.environment=a.environment||s,t.attrs=a}else{if(!t.release&&!n){Ce&&be.warn(Fw);return}t.release=t.release||n,t.environment=t.environment||s}this.emit("beforeSendSession",t);const i=rP(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(i)}recordDroppedEvent(t,n,s=1){if(this._options.sendClientReports){const i=`${t}:${n}`;Ce&&be.log(`Recording outcome: "${i}"${s>1?` (${s} times)`:""}`),this._outcomes[i]=(this._outcomes[i]||0)+s}}on(t,n){const s=this._hooks[t]=this._hooks[t]||new Set,i=(...a)=>n(...a);return s.add(i),()=>{s.delete(i)}}emit(t,...n){const s=this._hooks[t];s&&s.forEach(i=>i(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return Ce&&be.error("Error while sending envelope:",n),{}}return Ce&&be.error("Transport disabled"),{}}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=VP(this,t),$w(this,t)}_updateSessionFromEvent(t,n){let s=n.level==="fatal",i=!1;const a=n.exception?.values;if(a){i=!0,s=!1;for(const d of a)if(d.mechanism?.handled===!1){s=!0;break}}const l=t.status==="ok";(l&&t.errors===0||l&&s)&&(Rc(t,{...s&&{status:"crashed"},errors:t.errors||Number(i||s)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||n<t;){if(await new Promise(s=>setTimeout(s,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,s,i){const a=this.getOptions(),l=Object.keys(this._integrations);return!n.integrations&&l?.length&&(n.integrations=l),this.emit("preprocessEvent",t,n),t.type||i.setLastEventId(t.event_id||n.event_id),jP(a,t,n,s,this,i).then(f=>{if(f===null)return f;this.emit("postprocessEvent",f,n),f.contexts={trace:dR(s),...f.contexts};const d=Wv(this,s);return f.sdkProcessingMetadata={dynamicSamplingContext:d,...f.sdkProcessingMetadata},f})}_captureEvent(t,n={},s=bt(),i=os()){return Ce&&Jy(t)&&be.log(`Captured error event \`${GR(t)[0]||"<unknown>"}\``),this._processEvent(t,n,s,i).then(a=>a.event_id,a=>{Ce&&(qw(a)?be.log(a.message):Hw(a)?be.warn(a.message):be.warn(a))})}_processEvent(t,n,s,i){const a=this.getOptions(),{sampleRate:l}=a,f=XR(t),d=Jy(t),g=`before send for type \`${t.type||"error"}\``,y=typeof l>"u"?void 0:bu(l);if(d&&typeof y=="number"&&Ko()>y)return this.recordDroppedEvent("sample_rate","error"),tb(qg(`Discarding event because it's not included in the random sample (sampling rate = ${l})`));const b=Kw(t.type);return this._prepareEvent(t,n,s,i).then(x=>{if(x===null)throw this.recordDroppedEvent("event_processor",b),qg("An event processor returned `null`, will not send event.");if(n.data&&n.data.__sentry__===!0)return x;const w=xD(this,a,x,n);return bD(w,g)}).then(x=>{if(x===null){if(this.recordDroppedEvent("before_send",b),f){const C=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",C)}throw qg(`${g} returned \`null\`, will not send event.`)}const S=s.getSession()||i.getSession();if(d&&S&&this._updateSessionFromEvent(S,x),f){const T=x.sdkProcessingMetadata?.spanCountBeforeProcessing||0,C=x.spans?x.spans.length:0,O=T-C;O>0&&this.recordDroppedEvent("before_send","span",O)}const w=x.transaction_info;if(f&&w&&x.transaction!==t.transaction){const T="custom";x.transaction_info={...w,source:T}}return this.sendEvent(x,n),x}).then(null,x=>{throw qw(x)||Hw(x)?x:(this.captureException(x,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:x}),Jd(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
10
|
-
Reason: ${x}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(s=>(this._numProcessing--,s),s=>(this._numProcessing--,s===ab&&this.recordDroppedEvent("queue_overflow",n),s))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,s])=>{const[i,a]=n.split(":");return{reason:i,category:a,quantity:s}})}_flushOutcomes(){Ce&&be.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){Ce&&be.log("No outcomes to send");return}if(!this._dsn){Ce&&be.log("No dsn provided, will not send outcomes");return}Ce&&be.log("Sending outcomes:",t);const n=pD(t,this._options.tunnel&&Kc(this._dsn));this.sendEnvelope(n)}}function Kw(e){return e==="replay_event"?"replay":e||"error"}function bD(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Hc(e))return e.then(s=>{if(!yu(s)&&s!==null)throw Jd(n);return s},s=>{throw Jd(`${t} rejected with ${s}`)});if(!yu(e)&&e!==null)throw Jd(n);return e}function xD(e,t,n,s){const{beforeSend:i,beforeSendTransaction:a,beforeSendSpan:l,ignoreSpans:f}=t;let d=n;if(Jy(d)&&i)return i(d,s);if(XR(d)){if(l||f){const p=mD(d);if(f?.length&&mh(p,f))return null;if(l){const g=l(p);g?d=Iu(n,gD(g)):Zy()}if(d.spans){const g=[],y=d.spans;for(const x of y){if(f?.length&&mh(x,f)){BI(y,x);continue}if(l){const S=l(x);S?g.push(S):(Zy(),g.push(x))}else g.push(x)}const b=d.spans.length-g.length;b&&e.recordDroppedEvent("before_send","span",b),d.spans=g}}if(a){if(d.spans){const p=d.spans.length;d.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:p}}return a(d,s)}}return d}function Jy(e){return e.type===void 0}function XR(e){return e.type==="transaction"}function SD(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+QR(e.attributes)}function _D(e){let t=0;return e.message&&(t+=e.message.length*2),t+QR(e.attributes)}function QR(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*Gw(n[0]):Tc(n)?t+=Gw(n):t+=100}),t}function Gw(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function wD(e){return Jh(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function Zw(e){return wD(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function ED(e,t){t.debug===!0&&(Ce?be.enable():pa(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),bt().update(t.initialScope);const s=new e(t);return TD(s),s.init(),s}function TD(e){bt().setClient(e)}const CD="thismessage:/";function WR(e){return"isRelative"in e}function JR(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,s=n?CD:void 0;try{if("canParse"in URL&&!URL.canParse(e,s))return;const i=new URL(e,s);return n?{isRelative:n,pathname:i.pathname,search:i.search,hash:i.hash}:i}catch{}}function RD(e){if(WR(e))return e.pathname;const t=new URL(e);return t.search="",t.hash="",["80","443"].includes(t.port)&&(t.port=""),t.password&&(t.password="%filtered%"),t.username&&(t.username="%filtered%"),t.toString()}function na(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",s=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:s,relative:t[5]+n+s}}function ND(e){return e.split(/[?#]/,1)[0]}function Zo(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),s=n?n[1]:"text/plain",i=e.includes(";base64,"),a=e.indexOf(",");let l="";if(t&&a!==-1){const f=e.slice(a+1);l=f.length>10?`${f.slice(0,10)}... [truncated]`:f}return`data:${s}${i?",base64":""}${l?`,${l}`:""}`}return e}function jD(e,...t){const n=new String(String.raw(e,...t));return n.__sentry_template_string__=e.join("\0").replace(/%/g,"%%").replace(/\0/g,"%s"),n.__sentry_template_values__=t,n}const AD=jD;function kD(e){"aggregates"in e?e.attrs?.ip_address===void 0&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function e1(e,t,n=[t],s="npm"){const i=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};i.name||(i.name=`sentry.javascript.${t}`,i.packages=n.map(a=>({name:`${s}:@sentry/${a}`,version:Ji})),i.version=Ji)}function t1(e={}){const t=e.client||vt();if(!zP()||!t)return{};const n=ha(),s=qc(n);if(s.getTraceData)return s.getTraceData(e);const i=e.scope||bt(),a=e.span||Xn(),l=a?PI(a):OD(i),f=a?no(a):Wv(t,i),d=xI(f);if(!bR.test(l))return be.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const g={"sentry-trace":l,baggage:d};return e.propagateTraceparent&&(g.traceparent=a?DI(a):MD(i)),g}function OD(e){const{traceId:t,sampled:n,propagationSpanId:s}=e.getPropagationContext();return xR(t,s,n)}function MD(e){const{traceId:t,sampled:n,propagationSpanId:s}=e.getPropagationContext();return SR(t,s,n)}const ID=100;function ia(e,t){const n=vt(),s=os();if(!n)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:a=ID}=n.getOptions();if(a<=0)return;const f={timestamp:ma(),...e},d=i?pa(()=>i(f,t)):f;d!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",d,t),s.addBreadcrumb(d,a))}let Yw;const PD="FunctionToString",Xw=new WeakMap,DD=(()=>({name:PD,setupOnce(){Yw=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Vv(this),n=Xw.has(vt())&&t!==void 0?t:this;return Yw.apply(n,e)}}catch{}},setup(e){Xw.set(e,!0)}})),zD=DD,LD=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,`can't redefine non-configurable property "solana"`,"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],UD="EventFilters",$D=(e={})=>{let t;return{name:UD,setup(n){const s=n.getOptions();t=Qw(e,s)},processEvent(n,s,i){if(!t){const a=i.getOptions();t=Qw(e,a)}return FD(n,t)?null:n}}},BD=((e={})=>({...$D(e),name:"InboundFilters"}));function Qw(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:LD],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function FD(e,t){if(e.type){if(e.type==="transaction"&&qD(e,t.ignoreTransactions))return Ce&&be.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
11
|
-
Event: ${Gi(e)}`),!0}else{if(HD(e,t.ignoreErrors))return Ce&&be.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
12
|
-
Event: ${Gi(e)}`),!0;if(ZD(e))return Ce&&be.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
13
|
-
Event: ${Gi(e)}`),!0;if(VD(e,t.denyUrls))return Ce&&be.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
14
|
-
Event: ${Gi(e)}.
|
|
15
|
-
Url: ${yh(e)}`),!0;if(!KD(e,t.allowUrls))return Ce&&be.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
16
|
-
Event: ${Gi(e)}.
|
|
17
|
-
Url: ${yh(e)}`),!0}return!1}function HD(e,t){return t?.length?GR(e).some(n=>Go(n,t)):!1}function qD(e,t){if(!t?.length)return!1;const n=e.transaction;return n?Go(n,t):!1}function VD(e,t){if(!t?.length)return!1;const n=yh(e);return n?Go(n,t):!1}function KD(e,t){if(!t?.length)return!0;const n=yh(e);return n?Go(n,t):!0}function GD(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function yh(e){try{const n=[...e.exception?.values??[]].reverse().find(s=>s.mechanism?.parent_id===void 0&&s.stacktrace?.frames?.length)?.stacktrace?.frames;return n?GD(n):null}catch{return Ce&&be.error(`Cannot extract url for event ${Gi(e)}`),null}}function ZD(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function YD(e,t,n,s,i,a){if(!i.exception?.values||!a||!Ws(a.originalException,Error))return;const l=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;l&&(i.exception.values=ev(e,t,s,a.originalException,n,i.exception.values,l,0))}function ev(e,t,n,s,i,a,l,f){if(a.length>=n+1)return a;let d=[...a];if(Ws(s[i],Error)){Ww(l,f,s);const p=e(t,s[i]),g=d.length;Jw(p,i,g,f),d=ev(e,t,n,s[i],i,[p,...d],p,g)}return n1(s)&&s.errors.forEach((p,g)=>{if(Ws(p,Error)){Ww(l,f,s);const y=e(t,p),b=d.length;Jw(y,`errors[${g}]`,b,f),d=ev(e,t,n,p,i,[y,...d],y,b)}}),d}function n1(e){return Array.isArray(e.errors)}function Ww(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...n1(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Jw(e,t,n,s){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:s}}function XD(e){const t="console";ci(t,e),li(t,QD)}function QD(){"console"in ct&&kM.forEach(function(e){e in ct.console&&gr(ct.console,e,function(t){return hh[e]=t,function(...n){Hr("console",{args:n,level:e}),hh[e]?.apply(ct.console,n)}})})}function WD(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const JD="Dedupe",e2=(()=>{let e;return{name:JD,processEvent(t){if(t.type)return t;try{if(n2(t,e))return Ce&&be.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),t2=e2;function n2(e,t){return t?!!(r2(e,t)||s2(e,t)):!1}function r2(e,t){const n=e.message,s=t.message;return!(!n&&!s||n&&!s||!n&&s||n!==s||!s1(e,t)||!r1(e,t))}function s2(e,t){const n=eE(t),s=eE(e);return!(!n||!s||n.type!==s.type||n.value!==s.value||!s1(e,t)||!r1(e,t))}function r1(e,t){let n=fw(e),s=fw(t);if(!n&&!s)return!0;if(n&&!s||!n&&s||(n=n,s=s,s.length!==n.length))return!1;for(let i=0;i<s.length;i++){const a=s[i],l=n[i];if(a.filename!==l.filename||a.lineno!==l.lineno||a.colno!==l.colno||a.function!==l.function)return!1}return!0}function s1(e,t){let n=e.fingerprint,s=t.fingerprint;if(!n&&!s)return!0;if(n&&!s||!n&&s)return!1;n=n,s=s;try{return n.join("")===s.join("")}catch{return!1}}function eE(e){return e.exception?.values?.[0]}const o2="ConversationId",i2=(()=>({name:o2,setup(e){e.on("spanStart",t=>{const n=bt().getScopeData(),s=os().getScopeData(),i=n.conversationId||s.conversationId;i&&t.setAttribute(dI,i)})}})),a2=i2;function c2(e,t,n,s,i){if(!e.fetchData)return;const{method:a,url:l}=e.fetchData,f=rs()&&t(l);if(e.endTimestamp&&f){const x=e.fetchData.__span;if(!x)return;const S=s[x];S&&(f2(S,e),l2(S,e,i),delete s[x]);return}const{spanOrigin:d="auto.http.browser",propagateTraceparent:p=!1}=typeof i=="object"?i:{spanOrigin:i},g=!!Xn(),y=f&&g?Gc(h2(l,a,d)):new ei;if(e.fetchData.__span=y.spanContext().spanId,s[y.spanContext().spanId]=y,n(e.fetchData.url)){const x=e.args[0],S={...e.args[1]||{}},w=u2(x,S,rs()&&g?y:void 0,p);w&&(e.args[1]=S,S.headers=w)}const b=vt();if(b){const x={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};b.emit("beforeOutgoingRequestSpan",y,x)}return y}function l2(e,t,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function u2(e,t,n,s){const i=t1({span:n,propagateTraceparent:s}),a=i["sentry-trace"],l=i.baggage,f=i.traceparent;if(!a)return;const d=t.headers||(Hv(e)?e.headers:void 0);if(d)if(d2(d)){const p=new Headers(d);if(p.get("sentry-trace")||p.set("sentry-trace",a),s&&f&&!p.get("traceparent")&&p.set("traceparent",f),l){const g=p.get("baggage");g?_d(g)||p.set("baggage",`${g},${l}`):p.set("baggage",l)}return p}else if(Array.isArray(d)){const p=[...d];d.find(y=>y[0]==="sentry-trace")||p.push(["sentry-trace",a]),s&&f&&!d.find(y=>y[0]==="traceparent")&&p.push(["traceparent",f]);const g=d.find(y=>y[0]==="baggage"&&_d(y[1]));return l&&!g&&p.push(["baggage",l]),p}else{const p="sentry-trace"in d?d["sentry-trace"]:void 0,g="traceparent"in d?d.traceparent:void 0,y="baggage"in d?d.baggage:void 0,b=y?Array.isArray(y)?[...y]:[y]:[],x=y&&(Array.isArray(y)?y.find(w=>_d(w)):_d(y));l&&!x&&b.push(l);const S={...d,"sentry-trace":p??a,baggage:b.length>0?b.join(","):void 0};return s&&f&&!g&&(S.traceparent=f),S}else return{...i}}function f2(e,t){if(t.response){pR(e,t.response.status);const n=t.response?.headers?.get("content-length");if(n){const s=parseInt(n);s>0&&e.setAttribute("http.response_content_length",s)}}else t.error&&e.setStatus({code:hn,message:"internal_error"});e.end()}function _d(e){return e.split(",").some(t=>t.trim().startsWith(Yv))}function d2(e){return typeof Headers<"u"&&Ws(e,Headers)}function h2(e,t,n){if(e.startsWith("data:")){const a=Zo(e);return{name:`${t} ${a}`,attributes:tE(e,void 0,t,n)}}const s=JR(e),i=s?RD(s):e;return{name:`${t} ${i}`,attributes:tE(e,s,t,n)}}function tE(e,t,n,s){const i={url:Zo(e),type:"fetch","http.method":n,[gn]:s,[to]:"http.client"};return t&&(WR(t)||(i["http.url"]=Zo(t.href),i["server.address"]=t.host),t.search&&(i["http.query"]=t.search),t.hash&&(i["http.fragment"]=t.hash)),i}function Zc(e,t,n,s,i){eD({level:e,message:t,attributes:n,severityNumber:i},s)}function p2(e,t,{scope:n}={}){Zc("trace",e,t,n)}function m2(e,t,{scope:n}={}){Zc("debug",e,t,n)}function g2(e,t,{scope:n}={}){Zc("info",e,t,n)}function y2(e,t,{scope:n}={}){Zc("warn",e,t,n)}function v2(e,t,{scope:n}={}){Zc("error",e,t,n)}function b2(e,t,{scope:n}={}){Zc("fatal",e,t,n)}const x2=Object.freeze(Object.defineProperty({__proto__:null,debug:m2,error:v2,fatal:b2,fmt:AD,info:g2,trace:p2,warn:y2},Symbol.toStringTag,{value:"Module"}));function lb(e,t,n,s){aD({type:e,name:t,value:n,unit:s?.unit,attributes:s?.attributes},{scope:s?.scope})}function nE(e,t=1,n){lb("counter",e,t,n)}function rE(e,t,n){lb("gauge",e,t,n)}function sE(e,t,n){lb("distribution",e,t,n)}function o1(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const Su=ct;function S2(){return"history"in Su&&!!Su.history}function _2(){if(!("fetch"in Su))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function tv(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function w2(){if(typeof EdgeRuntime=="string")return!0;if(!_2())return!1;if(tv(Su.fetch))return!0;let e=!1;const t=Su.document;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=tv(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){Ce&&be.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function i1(e,t){const n="fetch";ci(n,e),li(n,()=>a1(void 0,t))}function E2(e){const t="fetch-body-resolved";ci(t,e),li(t,()=>a1(C2))}function a1(e,t=!1){t&&!w2()||gr(ct,"fetch",function(n){return function(...s){const i=new Error,{method:a,url:l}=R2(s),f={args:s,fetchData:{method:a,url:l},startTimestamp:cn()*1e3,virtualError:i,headers:N2(s)};return e||Hr("fetch",{...f}),n.apply(ct,s).then(async d=>(e?e(d):Hr("fetch",{...f,endTimestamp:cn()*1e3,response:d}),d),d=>{Hr("fetch",{...f,endTimestamp:cn()*1e3,error:d}),Jh(d)&&d.stack===void 0&&(d.stack=i.stack,Yn(d,"framesToPop",1));const g=vt()?.getOptions().enhanceFetchErrorMessages??"always";if(g!==!1&&d instanceof TypeError&&(d.message==="Failed to fetch"||d.message==="Load failed"||d.message==="NetworkError when attempting to fetch resource."))try{const x=new URL(f.fetchData.url).host;g==="always"?d.message=`${d.message} (${x})`:Yn(d,"__sentry_fetch_url_host__",x)}catch{}throw d})}})}async function T2(e,t){if(e?.body){const n=e.body,s=n.getReader(),i=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3);let a=!0;for(;a;){let l;try{l=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:f}=await s.read();clearTimeout(l),f&&(t(),a=!1)}catch{a=!1}finally{clearTimeout(l)}}clearTimeout(i),s.releaseLock(),n.cancel().then(null,()=>{})}}function C2(e){let t;try{t=e.clone()}catch{return}T2(t,()=>{Hr("fetch-body-resolved",{endTimestamp:cn()*1e3,response:e})})}function eh(e,t){return!!e&&typeof e=="object"&&!!e[t]}function oE(e){return typeof e=="string"?e:e?eh(e,"url")?e.url:e.toString?e.toString():"":""}function R2(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,s]=e;return{url:oE(n),method:eh(s,"method")?String(s.method).toUpperCase():Hv(n)&&eh(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:oE(t),method:eh(t,"method")?String(t.method).toUpperCase():"GET"}}function N2(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(Hv(t))return new Headers(t.headers)}catch{}}function j2(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function A2(){return"npm"}function k2(){return!j2()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function O2(){return typeof window<"u"&&(!k2()||M2())}function M2(){return ct.process?.type==="renderer"}const st=ct;let nv=0;function c1(){return nv>0}function I2(){nv++,setTimeout(()=>{nv--})}function kc(e,t={}){function n(i){return typeof i=="function"}if(!n(e))return e;try{const i=e.__sentry_wrapped__;if(i)return typeof i=="function"?i:e;if(Vv(e))return e}catch{return e}const s=function(...i){try{const a=i.map(l=>kc(l,t));return e.apply(this,a)}catch(a){throw I2(),Pu(l=>{l.addEventProcessor(f=>(t.mechanism&&(Vy(f,void 0),Cc(f,t.mechanism)),f.extra={...f.extra,arguments:i},f)),zR(a)}),a}};try{for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(s[i]=e[i])}catch{}cR(s,e),Yn(e,"__sentry_wrapped__",s);try{Object.getOwnPropertyDescriptor(s,"name").configurable&&Object.defineProperty(s,"name",{get(){return e.name}})}catch{}return s}function ub(){const e=ku(),{referrer:t}=st.document||{},{userAgent:n}=st.navigator||{},s={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:s}}function fb(e,t){const n=db(e,t),s={type:U2(t),value:$2(t)};return n.length&&(s.stacktrace={frames:n}),s.type===void 0&&s.value===""&&(s.value="Unrecoverable error caught"),s}function P2(e,t,n,s){const a=vt()?.getOptions().normalizeDepth,l=V2(t),f={__serialized__:jR(t,a)};if(l)return{exception:{values:[fb(e,l)]},extra:f};const d={exception:{values:[{type:tp(t)?t.constructor.name:s?"UnhandledRejection":"Error",value:H2(t,{isUnhandledRejection:s})}]},extra:f};if(n){const p=db(e,n);p.length&&(d.exception.values[0].stacktrace={frames:p})}return d}function Vg(e,t){return{exception:{values:[fb(e,t)]}}}function db(e,t){const n=t.stacktrace||t.stack||"",s=z2(t),i=L2(t);try{return e(n,s,i)}catch{}return[]}const D2=/Minified React error #\d+;/i;function z2(e){return e&&D2.test(e.message)?1:0}function L2(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function l1(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function U2(e){const t=e?.name;return!t&&l1(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function $2(e){const t=e?.message;return l1(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?Zw(t.error):Zw(e):"No error message"}function B2(e,t,n,s){const i=n?.syntheticException||void 0,a=hb(e,t,i,s);return Cc(a),a.level="error",n?.event_id&&(a.event_id=n.event_id),Lu(a)}function F2(e,t,n="info",s,i){const a=s?.syntheticException||void 0,l=rv(e,t,a,i);return l.level=n,s?.event_id&&(l.event_id=s.event_id),Lu(l)}function hb(e,t,n,s,i){let a;if(oR(t)&&t.error)return Vg(e,t.error);if(hw(t)||FM(t)){const l=t;if("stack"in t)a=Vg(e,t);else{const f=l.name||(hw(l)?"DOMError":"DOMException"),d=l.message?`${f}: ${l.message}`:f;a=rv(e,d,n,s),Vy(a,d)}return"code"in l&&(a.tags={...a.tags,"DOMException.code":`${l.code}`}),a}return Jh(t)?Vg(e,t):yu(t)||tp(t)?(a=P2(e,t,n,i),Cc(a,{synthetic:!0}),a):(a=rv(e,t,n,s),Vy(a,`${t}`),Cc(a,{synthetic:!0}),a)}function rv(e,t,n,s){const i={};if(s&&n){const a=db(e,n);a.length&&(i.exception={values:[{value:t,stacktrace:{frames:a}}]}),Cc(i,{synthetic:!0})}if(ep(t)){const{__sentry_template_string__:a,__sentry_template_values__:l}=t;return i.logentry={message:a,params:l},i}return i.message=t,i}function H2(e,{isUnhandledRejection:t}){const n=ZM(e),s=t?"promise rejection":"exception";return oR(e)?`Event \`ErrorEvent\` captured as ${s} with message \`${e.message}\``:tp(e)?`Event \`${q2(e)}\` (type=${e.type}) captured as ${s}`:`Object captured as ${s} with keys: ${n}`}function q2(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function V2(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}class K2 extends vD{constructor(t){const n=G2(t),s=st.SENTRY_SDK_SOURCE||A2();e1(n,"browser",["browser"],s),n._metadata?.sdk&&(n._metadata.sdk.settings={infer_ip:n.sendDefaultPii?"auto":"never",...n._metadata.sdk.settings}),super(n);const{sendDefaultPii:i,sendClientReports:a,enableLogs:l,_experiments:f,enableMetrics:d}=this._options,p=d??f?.enableMetrics??!0;st.document&&(a||l||p)&&st.document.addEventListener("visibilitychange",()=>{st.document.visibilityState==="hidden"&&(a&&this._flushOutcomes(),l&&rb(this),p&&ob(this))}),i&&this.on("beforeSendSession",kD)}eventFromException(t,n){return B2(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",s){return F2(this._options.stackParser,t,n,s,this._options.attachStacktrace)}_prepareEvent(t,n,s,i){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,s,i)}}function G2(e){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:st.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const Uu=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ge=ct,Z2=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",$u=(e,t,n,s)=>{let i,a;return l=>{t.value>=0&&(l||s)&&(a=t.value-(i??0),(a||i===void 0)&&(i=t.value,t.delta=a,t.rating=Z2(t.value,n),e(t)))}},Bu=(e=!0)=>{const t=Ge.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},Yc=()=>Bu()?.activationStart??0;function Yo(e,t,n){Ge.document&&Ge.addEventListener(e,t,n)}function vh(e,t,n){Ge.document&&Ge.removeEventListener(e,t,n)}let mc=-1;const u1=new Set,Y2=()=>Ge.document?.visibilityState==="hidden"&&!Ge.document?.prerendering?0:1/0,th=e=>{if(X2(e)&&mc>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of u1)t();isFinite(mc)||(mc=e.type==="visibilitychange"?e.timeStamp:0,vh("prerenderingchange",th,!0))}},Fu=()=>{if(Ge.document&&mc<0){const e=Yc();mc=(Ge.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>e)[0]?.startTime)??Y2(),Yo("visibilitychange",th,!0),Yo("pagehide",th,!0),Yo("prerenderingchange",th,!0)}return{get firstHiddenTime(){return mc},onHidden(e){u1.add(e)}}};function X2(e){return e.type==="pagehide"||Ge.document?.visibilityState==="hidden"}const Q2=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,Hu=(e,t=-1)=>{const n=Bu();let s="navigate";return n&&(Ge.document?.prerendering||Yc()>0?s="prerender":Ge.document?.wasDiscarded?s="restore":n.type&&(s=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:Q2(),navigationType:s}},Kg=new WeakMap;function pb(e,t){try{return Kg.get(e)||Kg.set(e,new t),Kg.get(e)}catch{return new t}}class bh{constructor(){bh.prototype.__init.call(this),bh.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(t){if(t.hadRecentInput)return;const n=this._sessionEntries[0],s=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&n&&s&&t.startTime-s.startTime<1e3&&t.startTime-n.startTime<5e3?(this._sessionValue+=t.value,this._sessionEntries.push(t)):(this._sessionValue=t.value,this._sessionEntries=[t]),this._onAfterProcessingUnexpectedShift?.(t)}}const Xc=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const s=new PerformanceObserver(i=>{Promise.resolve().then(()=>{t(i.getEntries())})});return s.observe({type:e,buffered:!0,...n}),s}}catch{}},mb=e=>{let t=!1;return()=>{t||(e(),t=!0)}},rp=e=>{Ge.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},W2=[1800,3e3],J2=(e,t={})=>{rp(()=>{const n=Fu(),s=Hu("FCP");let i;const l=Xc("paint",f=>{for(const d of f)d.name==="first-contentful-paint"&&(l.disconnect(),d.startTime<n.firstHiddenTime&&(s.value=Math.max(d.startTime-Yc(),0),s.entries.push(d),i(!0)))});l&&(i=$u(e,s,W2,t.reportAllChanges))})},ez=[.1,.25],tz=(e,t={})=>{J2(mb(()=>{const n=Hu("CLS",0);let s;const i=Fu(),a=pb(t,bh),l=d=>{for(const p of d)a._processEntry(p);a._sessionValue>n.value&&(n.value=a._sessionValue,n.entries=a._sessionEntries,s())},f=Xc("layout-shift",l);f&&(s=$u(e,n,ez,t.reportAllChanges),i.onHidden(()=>{l(f.takeRecords()),s(!0)}),Ge?.setTimeout?.(s))}))};let f1=0,Gg=1/0,wd=0;const nz=e=>{e.forEach(t=>{t.interactionId&&(Gg=Math.min(Gg,t.interactionId),wd=Math.max(wd,t.interactionId),f1=wd?(wd-Gg)/7+1:0)})};let sv;const d1=()=>sv?f1:performance.interactionCount||0,rz=()=>{"interactionCount"in performance||sv||(sv=Xc("event",nz,{type:"event",buffered:!0,durationThreshold:0}))},Zg=10;let h1=0;const sz=()=>d1()-h1;class xh{constructor(){xh.prototype.__init.call(this),xh.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){h1=d1(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor(sz()/50));return this._longestInteractionList[t]}_processEntry(t){if(this._onBeforeProcessingEntry?.(t),!(t.interactionId||t.entryType==="first-input"))return;const n=this._longestInteractionList.at(-1);let s=this._longestInteractionMap.get(t.interactionId);if(s||this._longestInteractionList.length<Zg||t.duration>n._latency){if(s?t.duration>s._latency?(s.entries=[t],s._latency=t.duration):t.duration===s._latency&&t.startTime===s.entries[0].startTime&&s.entries.push(t):(s={id:t.interactionId,entries:[t],_latency:t.duration},this._longestInteractionMap.set(s.id,s),this._longestInteractionList.push(s)),this._longestInteractionList.sort((i,a)=>a._latency-i._latency),this._longestInteractionList.length>Zg){const i=this._longestInteractionList.splice(Zg);for(const a of i)this._longestInteractionMap.delete(a.id)}this._onAfterProcessingINPCandidate?.(s)}}}const p1=e=>{const t=Ge.requestIdleCallback||Ge.setTimeout;Ge.document?.visibilityState==="hidden"?e():(e=mb(e),Yo("visibilitychange",e,{once:!0,capture:!0}),Yo("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),vh("visibilitychange",e,{capture:!0}),vh("pagehide",e,{capture:!0})}))},oz=[200,500],iz=40,az=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=Fu();rp(()=>{rz();const s=Hu("INP");let i;const a=pb(t,xh),l=d=>{p1(()=>{for(const g of d)a._processEntry(g);const p=a._estimateP98LongestInteraction();p&&p._latency!==s.value&&(s.value=p._latency,s.entries=p.entries,i())})},f=Xc("event",l,{durationThreshold:t.durationThreshold??iz});i=$u(e,s,oz,t.reportAllChanges),f&&(f.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{l(f.takeRecords()),i(!0)}))})};class cz{_processEntry(t){this._onBeforeProcessingEntry?.(t)}}const lz=[2500,4e3],uz=(e,t={})=>{rp(()=>{const n=Fu(),s=Hu("LCP");let i;const a=pb(t,cz),l=d=>{t.reportAllChanges||(d=d.slice(-1));for(const p of d)a._processEntry(p),p.startTime<n.firstHiddenTime&&(s.value=Math.max(p.startTime-Yc(),0),s.entries=[p],i())},f=Xc("largest-contentful-paint",l);if(f){i=$u(e,s,lz,t.reportAllChanges);const d=mb(()=>{l(f.takeRecords()),f.disconnect(),i(!0)}),p=g=>{g.isTrusted&&(p1(d),vh(g.type,p,{capture:!0}))};for(const g of["keydown","click","visibilitychange"])Yo(g,p,{capture:!0})}})},fz=[800,1800],ov=e=>{Ge.document?.prerendering?rp(()=>ov(e)):Ge.document?.readyState!=="complete"?addEventListener("load",()=>ov(e),!0):setTimeout(e)},dz=(e,t={})=>{const n=Hu("TTFB"),s=$u(e,n,fz,t.reportAllChanges);ov(()=>{const i=Bu();i&&(n.value=Math.max(i.responseStart-Yc(),0),n.entries=[i],s(!0))})},uu={},Sh={};let m1,g1,y1,v1;function b1(e,t=!1){return sp("cls",e,mz,m1,t)}function x1(e,t=!1){return sp("lcp",e,gz,g1,t)}function hz(e){return sp("ttfb",e,yz,y1)}function pz(e){return sp("inp",e,vz,v1)}function Oc(e,t){return S1(e,t),Sh[e]||(bz(e),Sh[e]=!0),_1(e,t)}function qu(e,t){const n=uu[e];if(n?.length)for(const s of n)try{s(t)}catch(i){Uu&&be.error(`Error while triggering instrumentation handler.
|
|
18
|
-
Type: ${e}
|
|
19
|
-
Name: ${Qs(s)}
|
|
20
|
-
Error:`,i)}}function mz(){return tz(e=>{qu("cls",{metric:e}),m1=e},{reportAllChanges:!0})}function gz(){return uz(e=>{qu("lcp",{metric:e}),g1=e},{reportAllChanges:!0})}function yz(){return dz(e=>{qu("ttfb",{metric:e}),y1=e})}function vz(){return az(e=>{qu("inp",{metric:e}),v1=e})}function sp(e,t,n,s,i=!1){S1(e,t);let a;return Sh[e]||(a=n(),Sh[e]=!0),s&&t({metric:s}),_1(e,t,i?a:void 0)}function bz(e){const t={};e==="event"&&(t.durationThreshold=0),Xc(e,n=>{qu(e,{entries:n})},t)}function S1(e,t){uu[e]=uu[e]||[],uu[e].push(t)}function _1(e,t,n){return()=>{n&&n();const s=uu[e];if(!s)return;const i=s.indexOf(t);i!==-1&&s.splice(i,1)}}function xz(e){return"duration"in e}const Sz=e=>{const t=n=>{(n.type==="pagehide"||Ge.document?.visibilityState==="hidden")&&e(n)};Yo("visibilitychange",t,{capture:!0,once:!0}),Yo("pagehide",t,{capture:!0,once:!0})};function Yg(e){return typeof e=="number"&&isFinite(e)}function ti(e,t,n,{...s}){const i=yt(e).start_timestamp;return i&&i>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),Jv(e,()=>{const a=Gc({startTime:t,...s});return a&&a.end(n),a})}function gb(e){const t=vt();if(!t)return;const{name:n,transaction:s,attributes:i,startTime:a}=e,{release:l,environment:f,sendDefaultPii:d}=t.getOptions(),g=t.getIntegrationByName("Replay")?.getReplayId(),y=bt(),b=y.getUser(),x=b!==void 0?b.email||b.id||b.ip_address:void 0;let S;try{S=y.getScopeData().contexts.profile.profile_id}catch{}const w={release:l,environment:f,user:x||void 0,profile_id:S||void 0,replay_id:g||void 0,transaction:s,"user_agent.original":Ge.navigator?.userAgent,"client.address":d?"{{auto}}":void 0,...i};return Gc({name:n,attributes:w,startTime:a,experimental:{standalone:!0}})}function Vu(){return Ge.addEventListener&&Ge.performance}function Xt(e){return e/1e3}function _z(e){let t="unknown",n="unknown",s="";for(const i of e){if(i==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(i))){t=s==="h"?"http":s,n=e.split(s)[1];break}s+=i}return s===e&&(t=s),{name:t,version:n}}function w1(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function E1(e,t){let n,s=!1;function i(f){!s&&n&&t(f,n),s=!0}Sz(()=>{i("pagehide")});const a=e.on("beforeStartNavigationSpan",(f,d)=>{d?.isRedirect||(i("navigation"),a(),l())}),l=e.on("afterStartPageLoadSpan",f=>{n=f.spanContext().spanId,l()})}function wz(e){let t=0,n;if(!w1("layout-shift"))return;const s=b1(({metric:i})=>{const a=i.entries[i.entries.length-1];a&&(t=i.value,n=a)},!0);E1(e,(i,a)=>{Ez(t,n,a,i),s()})}function Ez(e,t,n,s){Uu&&be.log(`Sending CLS span (${e})`);const i=t?Xt((Sr()||0)+t.startTime):cn(),a=bt().getScopeData().transactionName,l=t?Vr(t.sources[0]?.node):"Layout shift",f={[gn]:"auto.http.browser.cls",[to]:"ui.webvital.cls",[Vc]:0,"sentry.pageload.span_id":n,"sentry.report_event":s};t?.sources&&t.sources.forEach((p,g)=>{f[`cls.source.${g+1}`]=Vr(p.node)});const d=gb({name:l,transaction:a,attributes:f,startTime:i});d&&(d.addEvent("cls",{[Du]:"",[zu]:e}),d.end(i))}function Tz(e){let t=0,n;if(!w1("largest-contentful-paint"))return;const s=x1(({metric:i})=>{const a=i.entries[i.entries.length-1];a&&(t=i.value,n=a)},!0);E1(e,(i,a)=>{Cz(t,n,a,i),s()})}function Cz(e,t,n,s){Uu&&be.log(`Sending LCP span (${e})`);const i=Xt((Sr()||0)+(t?.startTime||0)),a=bt().getScopeData().transactionName,l=t?Vr(t.element):"Largest contentful paint",f={[gn]:"auto.http.browser.lcp",[to]:"ui.webvital.lcp",[Vc]:0,"sentry.pageload.span_id":n,"sentry.report_event":s};t&&(t.element&&(f["lcp.element"]=Vr(t.element)),t.id&&(f["lcp.id"]=t.id),t.url&&(f["lcp.url"]=t.url),t.loadTime!=null&&(f["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(f["lcp.renderTime"]=t.renderTime),t.size!=null&&(f["lcp.size"]=t.size));const d=gb({name:l,transaction:a,attributes:f,startTime:i});d&&(d.addEvent("lcp",{[Du]:"millisecond",[zu]:e}),d.end(i))}function Pr(e){return e&&((Sr()||performance.timeOrigin)+e)/1e3}function T1(e){const t={};if(e.nextHopProtocol!=null){const{name:n,version:s}=_z(e.nextHopProtocol);t["network.protocol.version"]=s,t["network.protocol.name"]=n}return Sr()||Vu()?.timeOrigin?Rz({...t,"http.request.redirect_start":Pr(e.redirectStart),"http.request.redirect_end":Pr(e.redirectEnd),"http.request.worker_start":Pr(e.workerStart),"http.request.fetch_start":Pr(e.fetchStart),"http.request.domain_lookup_start":Pr(e.domainLookupStart),"http.request.domain_lookup_end":Pr(e.domainLookupEnd),"http.request.connect_start":Pr(e.connectStart),"http.request.secure_connection_start":Pr(e.secureConnectionStart),"http.request.connection_end":Pr(e.connectEnd),"http.request.request_start":Pr(e.requestStart),"http.request.response_start":Pr(e.responseStart),"http.request.response_end":Pr(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function Rz(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const Nz=2147483647;let iE=0,ts={},Kn,_h;function jz({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const s=Vu();if(s&&Sr()){s.mark&&Ge.performance.mark("sentry-tracing-init");const i=t?Tz(n):Iz(),a=Pz(),l=e?wz(n):Mz();return()=>{i?.(),a(),l?.()}}return()=>{}}function Az(){Oc("longtask",({entries:e})=>{const t=Xn();if(!t)return;const{op:n,start_timestamp:s}=yt(t);for(const i of e){const a=Xt(Sr()+i.startTime),l=Xt(i.duration);n==="navigation"&&s&&a<s||ti(t,a,a+l,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[gn]:"auto.ui.browser.metrics"}})}})}function kz(){new PerformanceObserver(t=>{const n=Xn();if(n)for(const s of t.getEntries()){if(!s.scripts[0])continue;const i=Xt(Sr()+s.startTime),{start_timestamp:a,op:l}=yt(n);if(l==="navigation"&&a&&i<a)continue;const f=Xt(s.duration),d={[gn]:"auto.ui.browser.metrics"},p=s.scripts[0],{invoker:g,invokerType:y,sourceURL:b,sourceFunctionName:x,sourceCharPosition:S}=p;d["browser.script.invoker"]=g,d["browser.script.invoker_type"]=y,b&&(d["code.filepath"]=b),x&&(d["code.function"]=x),S!==-1&&(d["browser.script.source_char_position"]=S),ti(n,i,i+f,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:d})}}).observe({type:"long-animation-frame",buffered:!0})}function Oz(){Oc("event",({entries:e})=>{const t=Xn();if(t){for(const n of e)if(n.name==="click"){const s=Xt(Sr()+n.startTime),i=Xt(n.duration),a={name:Vr(n.target),op:`ui.interaction.${n.name}`,startTime:s,attributes:{[gn]:"auto.ui.browser.metrics"}},l=aR(n.target);l&&(a.attributes["ui.component_name"]=l),ti(t,s,s+i,a)}}})}function Mz(){return b1(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(ts.cls={value:e.value,unit:""},_h=t)},!0)}function Iz(){return x1(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(ts.lcp={value:e.value,unit:"millisecond"},Kn=t)},!0)}function Pz(){return hz(({metric:e})=>{e.entries[e.entries.length-1]&&(ts.ttfb={value:e.value,unit:"millisecond"})})}function Dz(e,t){const n=Vu(),s=Sr();if(!n?.getEntries||!s)return;const i=Xt(s),a=n.getEntries(),{op:l,start_timestamp:f}=yt(e);a.slice(iE).forEach(d=>{const p=Xt(d.startTime),g=Xt(Math.max(0,d.duration));if(!(l==="navigation"&&f&&i+p<f))switch(d.entryType){case"navigation":{$z(e,d,i);break}case"mark":case"paint":case"measure":{Lz(e,d,p,g,i,t.ignorePerformanceApiSpans);const y=Fu(),b=d.startTime<y.firstHiddenTime;d.name==="first-paint"&&b&&(ts.fp={value:d.startTime,unit:"millisecond"}),d.name==="first-contentful-paint"&&b&&(ts.fcp={value:d.startTime,unit:"millisecond"});break}case"resource":{Hz(e,d,d.name,p,g,i,t.ignoreResourceSpans);break}}}),iE=Math.max(a.length-1,0),qz(e),l==="pageload"&&(Gz(ts),t.recordClsOnPageloadSpan||delete ts.cls,t.recordLcpOnPageloadSpan||delete ts.lcp,Object.entries(ts).forEach(([d,p])=>{cP(d,p.value,p.unit)}),e.setAttribute("performance.timeOrigin",i),e.setAttribute("performance.activationStart",Yc()),Vz(e,t)),Kn=void 0,_h=void 0,ts={}}function zz(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function Lz(e,t,n,s,i,a){if(zz(t)||["mark","measure"].includes(t.entryType)&&Go(t.name,a))return;const l=Bu(!1),f=Xt(l?l.requestStart:0),d=i+Math.max(n,f),p=i+n,g=p+s,y={[gn]:"auto.resource.browser.metrics"};d!==p&&(y["sentry.browser.measure_happened_before_request"]=!0,y["sentry.browser.measure_start_time"]=d),Uz(y,t),d<=g&&ti(e,d,g,{name:t.name,op:t.entryType,attributes:y})}function Uz(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[s,i]of Object.entries(n))if(i&&Tc(i))e[`sentry.browser.measure.detail.${s}`]=i;else if(i!==void 0)try{e[`sentry.browser.measure.detail.${s}`]=JSON.stringify(i)}catch{}return}if(Tc(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function $z(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(s=>{Ed(e,t,s,n)}),Ed(e,t,"secureConnection",n,"TLS/SSL"),Ed(e,t,"fetch",n,"cache"),Ed(e,t,"domainLookup",n,"DNS"),Fz(e,t,n)}function Ed(e,t,n,s,i=n){const a=Bz(n),l=t[a],f=t[`${n}Start`];!f||!l||ti(e,s+Xt(f),s+Xt(l),{op:`browser.${i}`,name:t.name,attributes:{[gn]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function Bz(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function Fz(e,t,n){const s=n+Xt(t.requestStart),i=n+Xt(t.responseEnd),a=n+Xt(t.responseStart);t.responseEnd&&(ti(e,s,i,{op:"browser.request",name:t.name,attributes:{[gn]:"auto.ui.browser.metrics"}}),ti(e,a,i,{op:"browser.response",name:t.name,attributes:{[gn]:"auto.ui.browser.metrics"}}))}function Hz(e,t,n,s,i,a,l){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const f=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(l?.includes(f))return;const d={[gn]:"auto.resource.browser.metrics"},p=na(n);p.protocol&&(d["url.scheme"]=p.protocol.split(":").pop()),p.host&&(d["server.address"]=p.host),d["url.same_origin"]=n.includes(Ge.location.origin),Kz(t,d,[["responseStatus","http.response.status_code"],["transferSize","http.response_transfer_size"],["encodedBodySize","http.response_content_length"],["decodedBodySize","http.decoded_response_content_length"],["renderBlockingStatus","resource.render_blocking_status"],["deliveryType","http.response_delivery_type"]]);const g={...d,...T1(t)},y=a+s,b=y+i;ti(e,y,b,{name:n.replace(Ge.location.origin,""),op:f,attributes:g})}function qz(e){const t=Ge.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),Yg(n.rtt)&&(ts["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Yg(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),Yg(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function Vz(e,t){Kn&&t.recordLcpOnPageloadSpan&&(Kn.element&&e.setAttribute("lcp.element",Vr(Kn.element)),Kn.id&&e.setAttribute("lcp.id",Kn.id),Kn.url&&e.setAttribute("lcp.url",Kn.url.trim().slice(0,200)),Kn.loadTime!=null&&e.setAttribute("lcp.loadTime",Kn.loadTime),Kn.renderTime!=null&&e.setAttribute("lcp.renderTime",Kn.renderTime),e.setAttribute("lcp.size",Kn.size)),_h?.sources&&t.recordClsOnPageloadSpan&&_h.sources.forEach((n,s)=>e.setAttribute(`cls.source.${s+1}`,Vr(n.node)))}function Kz(e,t,n){n.forEach(([s,i])=>{const a=e[s];a!=null&&(typeof a=="number"&&a<Nz||typeof a=="string")&&(t[i]=a)})}function Gz(e){const t=Bu(!1);if(!t)return;const{responseStart:n,requestStart:s}=t;s<=n&&(e["ttfb.requestTime"]={value:n-s,unit:"millisecond"})}function Zz(){return Vu()&&Sr()?Oc("element",Yz):()=>{}}const Yz=({entries:e})=>{const t=Xn(),n=t?Dn(t):void 0,s=n?yt(n).description:bt().getScopeData().transactionName;e.forEach(i=>{const a=i;if(!a.identifier)return;const l=a.name,f=a.renderTime,d=a.loadTime,[p,g]=d?[Xt(d),"load-time"]:f?[Xt(f),"render-time"]:[cn(),"entry-emission"],y=l==="image-paint"?Xt(Math.max(0,(f??0)-(d??0))):0,b={[gn]:"auto.ui.browser.elementtiming",[to]:"ui.elementtiming",[vs]:"component","sentry.span_start_time_source":g,"sentry.transaction_name":s,"element.id":a.id,"element.type":a.element?.tagName?.toLowerCase()||"unknown","element.size":a.naturalWidth&&a.naturalHeight?`${a.naturalWidth}x${a.naturalHeight}`:void 0,"element.render_time":f,"element.load_time":d,"element.url":a.url||void 0,"element.identifier":a.identifier,"element.paint_type":l};OR({name:`element[${a.identifier}]`,attributes:b,startTime:p,onlyIfParent:!0},x=>{x.end(p+y)})})},Xz=1e3;let aE,iv,av;function Qz(e){ci("dom",e),li("dom",Wz)}function Wz(){if(!Ge.document)return;const e=Hr.bind(null,"dom"),t=cE(e,!0);Ge.document.addEventListener("click",t,!1),Ge.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{const i=Ge[n]?.prototype;i?.hasOwnProperty?.("addEventListener")&&(gr(i,"addEventListener",function(a){return function(l,f,d){if(l==="click"||l=="keypress")try{const p=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},g=p[l]=p[l]||{refCount:0};if(!g.handler){const y=cE(e);g.handler=y,a.call(this,l,y,d)}g.refCount++}catch{}return a.call(this,l,f,d)}}),gr(i,"removeEventListener",function(a){return function(l,f,d){if(l==="click"||l=="keypress")try{const p=this.__sentry_instrumentation_handlers__||{},g=p[l];g&&(g.refCount--,g.refCount<=0&&(a.call(this,l,g.handler,d),g.handler=void 0,delete p[l]),Object.keys(p).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return a.call(this,l,f,d)}}))})}function Jz(e){if(e.type!==iv)return!1;try{if(!e.target||e.target._sentryId!==av)return!1}catch{}return!0}function eL(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function cE(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const s=tL(n);if(eL(n.type,s))return;Yn(n,"_sentryCaptured",!0),s&&!s._sentryId&&Yn(s,"_sentryId",qr());const i=n.type==="keypress"?"input":n.type;Jz(n)||(e({event:n,name:i,global:t}),iv=n.type,av=s?s._sentryId:void 0),clearTimeout(aE),aE=Ge.setTimeout(()=>{av=void 0,iv=void 0},Xz)}}function tL(e){try{return e.target}catch{return null}}let Td;function yb(e){const t="history";ci(t,e),li(t,nL)}function nL(){if(Ge.addEventListener("popstate",()=>{const t=Ge.location.href,n=Td;if(Td=t,n===t)return;Hr("history",{from:n,to:t})}),!S2())return;function e(t){return function(...n){const s=n.length>2?n[2]:void 0;if(s){const i=Td,a=rL(String(s));if(Td=a,i===a)return t.apply(this,n);Hr("history",{from:i,to:a})}return t.apply(this,n)}}gr(Ge.history,"pushState",e),gr(Ge.history,"replaceState",e)}function rL(e){try{return new URL(e,Ge.location.origin).toString()}catch{return e}}const nh={};function sL(e){const t=nh[e];if(t)return t;let n=Ge[e];if(tv(n))return nh[e]=n.bind(Ge);const s=Ge.document;if(s&&typeof s.createElement=="function")try{const i=s.createElement("iframe");i.hidden=!0,s.head.appendChild(i);const a=i.contentWindow;a?.[e]&&(n=a[e]),s.head.removeChild(i)}catch(i){Uu&&be.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,i)}return n&&(nh[e]=n.bind(Ge))}function oL(e){nh[e]=void 0}const uc="__sentry_xhr_v3__";function C1(e){ci("xhr",e),li("xhr",iL)}function iL(){if(!Ge.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,s){const i=new Error,a=cn()*1e3,l=Zs(s[0])?s[0].toUpperCase():void 0,f=aL(s[1]);if(!l||!f)return t.apply(n,s);n[uc]={method:l,url:f,request_headers:{}},l==="POST"&&f.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const d=()=>{const p=n[uc];if(p&&n.readyState===4){try{p.status_code=n.status}catch{}const g={endTimestamp:cn()*1e3,startTimestamp:a,xhr:n,virtualError:i};Hr("xhr",g)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(p,g,y){return d(),p.apply(g,y)}}):n.addEventListener("readystatechange",d),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(p,g,y){const[b,x]=y,S=g[uc];return S&&Zs(b)&&Zs(x)&&(S.request_headers[b.toLowerCase()]=x),p.apply(g,y)}}),t.apply(n,s)}}),e.send=new Proxy(e.send,{apply(t,n,s){const i=n[uc];if(!i)return t.apply(n,s);s[0]!==void 0&&(i.body=s[0]);const a={startTimestamp:cn()*1e3,xhr:n};return Hr("xhr",a),t.apply(n,s)}})}function aL(e){if(Zs(e))return e;try{return e.toString()}catch{}}function cL(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return Uu&&be.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r
|
|
21
|
-
`).reduce((n,s)=>{const[i,a]=s.split(": ");return a&&(n[i.toLowerCase()]=a),n},{}):{}}const Xg=[],rh=new Map,cc=new Map,lL=60;function uL(){if(Vu()&&Sr()){const t=fL();return()=>{t()}}return()=>{}}const cv={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function fL(){return pz(dL)}const dL=({metric:e})=>{if(e.value==null)return;const t=Xt(e.value);if(t>lL)return;const n=e.entries.find(S=>S.duration===e.value&&cv[S.name]);if(!n)return;const{interactionId:s}=n,i=cv[n.name],a=Xt(Sr()+n.startTime),l=Xn(),f=l?Dn(l):void 0,d=s!=null?rh.get(s):void 0,p=d?.span||f,g=p?yt(p).description:bt().getScopeData().transactionName,y=d?.elementName||Vr(n.target),b={[gn]:"auto.http.browser.inp",[to]:`ui.interaction.${i}`,[Vc]:n.duration},x=gb({name:y,transaction:g,attributes:b,startTime:a});x&&(x.addEvent("inp",{[Du]:"millisecond",[zu]:e.value}),x.end(a+t))};function hL(){const e=Object.keys(cv);O2()&&e.forEach(i=>{Ge.addEventListener(i,t,{capture:!0,passive:!0})});function t(i){const a=i.target;if(!a)return;const l=Vr(a),f=Math.round(i.timeStamp);if(cc.set(f,l),cc.size>50){const d=cc.keys().next().value;d!==void 0&&cc.delete(d)}}function n(i){const a=Math.round(i.startTime);let l=cc.get(a);if(!l)for(let f=-5;f<=5;f++){const d=cc.get(a+f);if(d){l=d;break}}return l||"<unknown>"}const s=({entries:i})=>{const a=Xn(),l=a&&Dn(a);i.forEach(f=>{if(!xz(f))return;const d=f.interactionId;if(d==null||rh.has(d))return;const p=f.target?Vr(f.target):n(f);if(Xg.length>10){const g=Xg.shift();rh.delete(g)}Xg.push(d),rh.set(d,{span:l,elementName:p})})};Oc("event",s),Oc("first-input",s)}const pL=40;function mL(e,t=sL("fetch")){let n=0,s=0;async function i(a){const l=a.body.length;n+=l,s++;const f={body:a.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&s<15,...e.fetchOptions};try{const d=await t(e.url,f);return{statusCode:d.status,headers:{"x-sentry-rate-limits":d.headers.get("X-Sentry-Rate-Limits"),"retry-after":d.headers.get("Retry-After")}}}catch(d){throw oL("fetch"),d}finally{n-=l,s--}}return hD(e,i,cb(e.bufferSize||pL))}const Kr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,gL=30,yL=50;function lv(e,t,n,s){const i={filename:e,function:t==="<anonymous>"?oa:t,in_app:!0};return n!==void 0&&(i.lineno=n),s!==void 0&&(i.colno=s),i}const vL=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,bL=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,xL=/\((\S*)(?::(\d+))(?::(\d+))\)/,SL=/at (.+?) ?\(data:(.+?),/,_L=e=>{const t=e.match(SL);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=vL.exec(e);if(n){const[,i,a,l]=n;return lv(i,oa,+a,+l)}const s=bL.exec(e);if(s){if(s[2]&&s[2].indexOf("eval")===0){const f=xL.exec(s[2]);f&&(s[2]=f[1],s[3]=f[2],s[4]=f[3])}const[a,l]=R1(s[1]||oa,s[2]);return lv(l,a,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},wL=[gL,_L],EL=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,TL=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,CL=e=>{const t=EL.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const a=TL.exec(t[3]);a&&(t[1]=t[1]||"eval",t[3]=a[1],t[4]=a[2],t[5]="")}let s=t[3],i=t[1]||oa;return[i,s]=R1(i,s),lv(s,i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},RL=[yL,CL],NL=[wL,RL],jL=eR(...NL),R1=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,s=e.indexOf("safari-web-extension")!==-1;return n||s?[e.indexOf("@")!==-1?e.split("@")[0]:oa,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Cd=1024,AL="Breadcrumbs",kL=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:AL,setup(n){t.console&&XD(PL(n)),t.dom&&Qz(IL(n,t.dom)),t.xhr&&C1(DL(n)),t.fetch&&i1(zL(n)),t.history&&yb(LL(n)),t.sentry&&n.on("beforeSendEvent",ML(n))}}}),OL=kL;function ML(e){return function(n){vt()===e&&ia({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Gi(n)},{event:n})}}function IL(e,t){return function(s){if(vt()!==e)return;let i,a,l=typeof t=="object"?t.serializeAttribute:void 0,f=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;f&&f>Cd&&(Kr&&be.warn(`\`dom.maxStringLength\` cannot exceed ${Cd}, but a value of ${f} was configured. Sentry will use ${Cd} instead.`),f=Cd),typeof l=="string"&&(l=[l]);try{const p=s.event,g=UL(p)?p.target:p;i=Vr(g,{keyAttrs:l,maxStringLength:f}),a=aR(g)}catch{i="<unknown>"}if(i.length===0)return;const d={category:`ui.${s.name}`,message:i};a&&(d.data={"ui.component_name":a}),ia(d,{event:s.event,name:s.name,global:s.global})}}function PL(e){return function(n){if(vt()!==e)return;const s={category:"console",data:{arguments:n.args,logger:"console"},level:WD(n.level),message:gw(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)s.message=`Assertion failed: ${gw(n.args.slice(1)," ")||"console.assert"}`,s.data.arguments=n.args.slice(1);else return;ia(s,{input:n.args,level:n.level})}}function DL(e){return function(n){if(vt()!==e)return;const{startTimestamp:s,endTimestamp:i}=n,a=n.xhr[uc];if(!s||!i||!a)return;const{method:l,url:f,status_code:d,body:p}=a,g={method:l,url:f,status_code:d},y={xhr:n.xhr,input:p,startTimestamp:s,endTimestamp:i},b={category:"xhr",data:g,type:"http",level:o1(d)};e.emit("beforeOutgoingRequestBreadcrumb",b,y),ia(b,y)}}function zL(e){return function(n){if(vt()!==e)return;const{startTimestamp:s,endTimestamp:i}=n;if(i&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.fetchData.method,n.fetchData.url,n.error){const a=n.fetchData,l={data:n.error,input:n.args,startTimestamp:s,endTimestamp:i},f={category:"fetch",data:a,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",f,l),ia(f,l)}else{const a=n.response,l={...n.fetchData,status_code:a?.status};n.fetchData.request_body_size,n.fetchData.response_body_size,a?.status;const f={input:n.args,response:a,startTimestamp:s,endTimestamp:i},d={category:"fetch",data:l,type:"http",level:o1(l.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",d,f),ia(d,f)}}}function LL(e){return function(n){if(vt()!==e)return;let s=n.from,i=n.to;const a=na(st.location.href);let l=s?na(s):void 0;const f=na(i);l?.path||(l=a),a.protocol===f.protocol&&a.host===f.host&&(i=f.relative),a.protocol===l.protocol&&a.host===l.host&&(s=l.relative),ia({category:"navigation",data:{from:s,to:i}})}}function UL(e){return!!e&&!!e.target}const $L=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],BL="BrowserApiErrors",FL=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:BL,setupOnce(){t.setTimeout&&gr(st,"setTimeout",lE),t.setInterval&&gr(st,"setInterval",lE),t.requestAnimationFrame&&gr(st,"requestAnimationFrame",qL),t.XMLHttpRequest&&"XMLHttpRequest"in st&&gr(XMLHttpRequest.prototype,"send",VL);const n=t.eventTarget;n&&(Array.isArray(n)?n:$L).forEach(i=>KL(i,t))}}}),HL=FL;function lE(e){return function(...t){const n=t[0];return t[0]=kc(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Qs(e)}`}}),e.apply(this,t)}}function qL(e){return function(t){return e.apply(this,[kc(t,{mechanism:{data:{handler:Qs(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function VL(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(i=>{i in n&&typeof n[i]=="function"&&gr(n,i,function(a){const l={mechanism:{data:{handler:Qs(a)},handled:!1,type:`auto.browser.browserapierrors.xhr.${i}`}},f=Vv(a);return f&&(l.mechanism.data.handler=Qs(f)),kc(a,l)})}),e.apply(this,t)}}function KL(e,t){const s=st[e]?.prototype;s?.hasOwnProperty?.("addEventListener")&&(gr(s,"addEventListener",function(i){return function(a,l,f){try{GL(l)&&(l.handleEvent=kc(l.handleEvent,{mechanism:{data:{handler:Qs(l),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&ZL(this,a,l),i.apply(this,[a,kc(l,{mechanism:{data:{handler:Qs(l),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),f])}}),gr(s,"removeEventListener",function(i){return function(a,l,f){try{const d=l.__sentry_wrapped__;d&&i.call(this,a,d,f)}catch{}return i.call(this,a,l,f)}}))}function GL(e){return typeof e.handleEvent=="function"}function ZL(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const YL=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof st.document>"u"){Kr&&be.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}zw({ignoreDuration:!0}),Lw(),t==="route"&&yb(({from:n,to:s})=>{n!==void 0&&n!==s&&(zw({ignoreDuration:!0}),Lw())})}}},XL="CultureContext",QL=(()=>({name:XL,preprocessEvent(e){const t=JL();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})}})),WL=QL;function JL(){try{const e=st.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}const e4="GlobalHandlers",t4=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:e4,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(r4(n),uE("onerror")),t.onunhandledrejection&&(s4(n),uE("onunhandledrejection"))}}}),n4=t4;function r4(e){nR(t=>{const{stackParser:n,attachStacktrace:s}=N1();if(vt()!==e||c1())return;const{msg:i,url:a,line:l,column:f,error:d}=t,p=a4(hb(n,d||i,void 0,s,!1),a,l,f);p.level="error",LR(p,{originalException:d,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function s4(e){rR(t=>{const{stackParser:n,attachStacktrace:s}=N1();if(vt()!==e||c1())return;const i=o4(t),a=Tc(i)?i4(i):hb(n,i,void 0,s,!0);a.level="error",LR(a,{originalException:i,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function o4(e){if(Tc(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function i4(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function a4(e,t,n,s){const i=e.exception=e.exception||{},a=i.values=i.values||[],l=a[0]=a[0]||{},f=l.stacktrace=l.stacktrace||{},d=f.frames=f.frames||[],p=s,g=n,y=c4(t)??ku();return d.length===0&&d.push({colno:p,filename:y,function:oa,in_app:!0,lineno:g}),e}function uE(e){Kr&&be.log(`Global Handler attached: ${e}`)}function N1(){return vt()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function c4(e){if(!(!Zs(e)||e.length===0))return e.startsWith("data:")?`<${Zo(e,!1)}>`:e}const l4=()=>({name:"HttpContext",preprocessEvent(e){if(!st.navigator&&!st.location&&!st.document)return;const t=ub(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}}}),u4="cause",f4=5,d4="LinkedErrors",h4=((e={})=>{const t=e.limit||f4,n=e.key||u4;return{name:d4,preprocessEvent(s,i,a){const l=a.getOptions();YD(fb,l.stackParser,n,t,s,i)}}}),p4=h4;function m4(){return g4()?(Kr&&pa(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function g4(){if(typeof st.window>"u")return!1;const e=st;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;const n=ku(),s=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(st===st.top&&s.some(a=>n.startsWith(`${a}://`)))}function y4(e){return[BD(),zD(),a2(),HL(),OL(),n4(),p4(),t2(),l4(),WL(),YL()]}function v4(e={}){const t=!e.skipBrowserExtensionCheck&&m4();let n=e.defaultIntegrations==null?y4():e.defaultIntegrations;const s={...e,enabled:t?!1:e.enabled,stackParser:LM(e.stackParser||jL),integrations:qP({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||mL};return ED(K2,s)}function b4(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function j1(e){try{return new URL(e,st.location.origin).href}catch{return}}function x4(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function A1(e){try{return new Headers(e)}catch{return}}const fE=new WeakMap,Qg=new Map,k1={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function S4(e,t){const{traceFetch:n,traceXHR:s,trackFetchStreamPerformance:i,shouldCreateSpanForRequest:a,enableHTTPTimings:l,tracePropagationTargets:f,onRequestSpanStart:d,onRequestSpanEnd:p}={...k1,...t},g=typeof a=="function"?a:S=>!0,y=S=>_4(S,f),b={},x=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(S=>(S.type==="transaction"&&S.spans&&S.spans.forEach(w=>{if(w.op==="http.client"){const T=Qg.get(w.span_id);T&&(w.timestamp=T/1e3,Qg.delete(w.span_id))}}),S)),i&&E2(S=>{if(S.response){const w=fE.get(S.response);w&&S.endTimestamp&&Qg.set(w,S.endTimestamp)}}),i1(S=>{const w=c2(S,g,y,b,{propagateTraceparent:x,onRequestSpanEnd:p});if(S.response&&S.fetchData.__span&&fE.set(S.response,S.fetchData.__span),w){const T=j1(S.fetchData.url),C=T?na(T).host:void 0;w.setAttributes({"http.url":T?Zo(T):void 0,"server.address":C}),l&&dE(w),d?.(w,{headers:S.headers})}})),s&&C1(S=>{const w=w4(S,g,y,b,x,p);w&&(l&&dE(w),d?.(w,{headers:A1(S.xhr.__sentry_xhr_v3__?.request_headers)}))})}function dE(e){const{url:t}=yt(e).data;if(!t||typeof t!="string")return;const n=Oc("resource",({entries:s})=>{s.forEach(i=>{x4(i)&&i.name.endsWith(t)&&(e.setAttributes(T1(i)),setTimeout(n))})})}function _4(e,t){const n=ku();if(n){let s,i;try{s=new URL(e,n),i=new URL(n).origin}catch{return!1}const a=s.origin===i;return t?Go(s.toString(),t)||a&&Go(s.pathname,t):a}else{const s=!!e.match(/^\/(?!\/)/);return t?Go(e,t):s}}function w4(e,t,n,s,i,a){const l=e.xhr,f=l?.[uc];if(!l||l.__sentry_own_request__||!f)return;const{url:d,method:p}=f,g=rs()&&t(d);if(e.endTimestamp&&g){const C=l.__sentry_xhr_span_id__;if(!C)return;const O=s[C];O&&f.status_code!==void 0&&(pR(O,f.status_code),O.end(),a?.(O,{headers:A1(cL(l)),error:e.error}),delete s[C]);return}const y=j1(d),b=na(y||d),x=Zo(ND(d)),S=!!Xn(),w=g&&S?Gc({name:`${p} ${x}`,attributes:{url:Zo(d),type:"xhr","http.method":p,"http.url":y?Zo(y):void 0,"server.address":b?.host,[gn]:"auto.http.browser",[to]:"http.client",...b?.search&&{"http.query":b?.search},...b?.hash&&{"http.fragment":b?.hash}}}):new ei;l.__sentry_xhr_span_id__=w.spanContext().spanId,s[l.__sentry_xhr_span_id__]=w,n(d)&&E4(l,rs()&&S?w:void 0,i);const T=vt();return T&&T.emit("beforeOutgoingRequestSpan",w,e),w}function E4(e,t,n){const{"sentry-trace":s,baggage:i,traceparent:a}=t1({span:t,propagateTraceparent:n});s&&T4(e,s,i,a)}function T4(e,t,n,s){const i=e.__sentry_xhr_v3__?.request_headers;if(!(i?.["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),s&&!i?.traceparent&&e.setRequestHeader("traceparent",s),n){const a=i?.baggage;(!a||!b4(a))&&e.setRequestHeader("baggage",n)}}catch{}}function C4(){st.document?st.document.addEventListener("visibilitychange",()=>{const e=Xn();if(!e)return;const t=Dn(e);if(st.document.hidden&&t){const n="cancelled",{op:s,status:i}=yt(t);Kr&&be.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${s}`),i||t.setStatus({code:hn,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):Kr&&be.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const R4=3600,O1="sentry_previous_trace",N4="sentry.previous_trace";function j4(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const s=t==="session-storage";let i=s?O4():void 0;e.on("spanStart",l=>{if(Dn(l)!==l)return;const f=bt().getPropagationContext();i=A4(i,l,f),s&&k4(i)});let a=!0;n&&e.on("beforeSampling",l=>{if(!i)return;const f=bt(),d=f.getPropagationContext();if(a&&d.parentSpanId){a=!1;return}f.setPropagationContext({...d,dsc:{...d.dsc,sample_rate:String(i.sampleRate),sampled:String(uv(i.spanContext))},sampleRand:i.sampleRand}),l.parentSampled=uv(i.spanContext),l.parentSampleRate=i.sampleRate,l.spanAttributes={...l.spanAttributes,[hR]:i.sampleRate}})}function A4(e,t,n){const s=yt(t);function i(){try{return Number(n.dsc?.sample_rate)??Number(s.data?.[Kv])}catch{return 0}}const a={spanContext:t.spanContext(),startTimestamp:s.start_timestamp,sampleRate:i(),sampleRand:n.sampleRand};if(!e)return a;const l=e.spanContext;return l.traceId===s.trace_id?e:(Date.now()/1e3-e.startTimestamp<=R4&&(Kr&&be.log(`Adding previous_trace \`${JSON.stringify(l)}\` link to span \`${JSON.stringify({op:s.op,...t.spanContext()})}\``),t.addLink({context:l,attributes:{[fI]:"previous_trace"}}),t.setAttribute(N4,`${l.traceId}-${l.spanId}-${uv(l)?1:0}`)),a)}function k4(e){try{st.sessionStorage.setItem(O1,JSON.stringify(e))}catch(t){Kr&&be.warn("Could not store previous trace in sessionStorage",t)}}function O4(){try{const e=st.sessionStorage?.getItem(O1);return JSON.parse(e)}catch{return}}function uv(e){return e.traceFlags===1}const M4="BrowserTracing",I4={...Wd,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,enableElementTiming:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...k1},P4=((e={})=>{const t={name:void 0,source:void 0},n=st.document,{enableInp:s,enableElementTiming:i,enableLongTask:a,enableLongAnimationFrame:l,_experiments:{enableInteractions:f,enableStandaloneClsSpans:d,enableStandaloneLcpSpans:p},beforeStartSpan:g,idleTimeout:y,finalTimeout:b,childSpanTimeout:x,markBackgroundSpan:S,traceFetch:w,traceXHR:T,trackFetchStreamPerformance:C,shouldCreateSpanForRequest:O,enableHTTPTimings:N,ignoreResourceSpans:R,ignorePerformanceApiSpans:M,instrumentPageLoad:z,instrumentNavigation:j,detectRedirects:A,linkPreviousTrace:P,consistentTraceSampling:Q,enableReportPageLoaded:B,onRequestSpanStart:U,onRequestSpanEnd:Z}={...I4,...e};let K,ee,D;function G(q,V,L=!0){const I=V.op==="pageload",H=V.name,W=g?g(V):V,Y=W.attributes||{};if(H!==W.name&&(Y[vs]="custom",W.attributes=Y),!L){const fe=ma();Gc({...W,startTime:fe}).end(fe);return}t.name=W.name,t.source=Y[vs];const ae=DR(W,{idleTimeout:y,finalTimeout:b,childSpanTimeout:x,disableAutoFinish:I,beforeSpanEnd:fe=>{K?.(),Dz(fe,{recordClsOnPageloadSpan:!d,recordLcpOnPageloadSpan:!p,ignoreResourceSpans:R,ignorePerformanceApiSpans:M}),mE(q,void 0);const Se=bt(),pe=Se.getPropagationContext();Se.setPropagationContext({...pe,traceId:ae.spanContext().traceId,sampled:ui(ae),dsc:no(fe)}),I&&(D=void 0)},trimIdleSpanEndTimestamp:!B});I&&B&&(D=ae),mE(q,ae);function se(){n&&["interactive","complete"].includes(n.readyState)&&q.emit("idleSpanEnableAutoFinish",ae)}I&&!B&&n&&(n.addEventListener("readystatechange",()=>{se()}),se())}return{name:M4,setup(q){if($I(),K=jz({recordClsStandaloneSpans:d||!1,recordLcpStandaloneSpans:p||!1,client:q}),s&&uL(),i&&Zz(),l&&ct.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?kz():a&&Az(),f&&Oz(),A&&n){const L=()=>{ee=cn()};addEventListener("click",L,{capture:!0}),addEventListener("keydown",L,{capture:!0,passive:!0})}function V(){const L=_u(q);L&&!yt(L).timestamp&&(Kr&&be.log(`[Tracing] Finishing current active span with op: ${yt(L).op}`),L.setAttribute(vu,"cancelled"),L.end())}q.on("startNavigationSpan",(L,I)=>{if(vt()!==q)return;if(I?.isRedirect){Kr&&be.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),G(q,{op:"navigation.redirect",...L},!1);return}ee=void 0,V(),os().setPropagationContext({traceId:Js(),sampleRand:Math.random(),propagationSpanId:rs()?void 0:Ys()});const H=bt();H.setPropagationContext({traceId:Js(),sampleRand:Math.random(),propagationSpanId:rs()?void 0:Ys()}),H.setSDKProcessingMetadata({normalizedRequest:void 0}),G(q,{op:"navigation",...L,parentSpan:null,forceTransaction:!0})}),q.on("startPageLoadSpan",(L,I={})=>{if(vt()!==q)return;V();const H=I.sentryTrace||hE("sentry-trace")||pE("sentry-trace"),W=I.baggage||hE("baggage")||pE("baggage"),Y=OI(H,W),ae=bt();ae.setPropagationContext(Y),rs()||(ae.getPropagationContext().propagationSpanId=Ys()),ae.setSDKProcessingMetadata({normalizedRequest:ub()}),G(q,{op:"pageload",...L})}),q.on("endPageloadSpan",()=>{B&&D&&(D.setAttribute(vu,"reportPageLoaded"),D.end())})},afterAllSetup(q){let V=ku();if(P!=="off"&&j4(q,{linkPreviousTrace:P,consistentTraceSampling:Q}),st.location){if(z){const L=Sr();D4(q,{name:st.location.pathname,startTime:L?L/1e3:void 0,attributes:{[vs]:"url",[gn]:"auto.pageload.browser"}})}j&&yb(({to:L,from:I})=>{if(I===void 0&&V?.indexOf(L)!==-1){V=void 0;return}V=void 0;const H=JR(L),W=_u(q),Y=W&&A&&U4(W,ee);z4(q,{name:H?.pathname||st.location.pathname,attributes:{[vs]:"url",[gn]:"auto.navigation.browser"}},{url:L,isRedirect:Y})})}S&&C4(),f&&L4(q,y,b,x,t),s&&hL(),S4(q,{traceFetch:w,traceXHR:T,trackFetchStreamPerformance:C,tracePropagationTargets:q.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:O,enableHTTPTimings:N,onRequestSpanStart:U,onRequestSpanEnd:Z})}}});function D4(e,t,n){e.emit("startPageLoadSpan",t,n),bt().setTransactionName(t.name);const s=_u(e);return s&&e.emit("afterStartPageLoadSpan",s),s}function z4(e,t,n){const{url:s,isRedirect:i}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:i}),e.emit("startNavigationSpan",t,{isRedirect:i});const a=bt();return a.setTransactionName(t.name),s&&!i&&a.setSDKProcessingMetadata({normalizedRequest:{...ub(),url:s}}),_u(e)}function hE(e){return st.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function pE(e){return st.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(s=>s.name===e)?.description}function L4(e,t,n,s,i){const a=st.document;let l;const f=()=>{const d="ui.action.click",p=_u(e);if(p){const g=yt(p).op;if(["navigation","pageload"].includes(g)){Kr&&be.warn(`[Tracing] Did not create ${d} span because a pageload or navigation span is in progress.`);return}}if(l&&(l.setAttribute(vu,"interactionInterrupted"),l.end(),l=void 0),!i.name){Kr&&be.warn(`[Tracing] Did not create ${d} transaction because _latestRouteName is missing.`);return}l=DR({name:i.name,op:d,attributes:{[vs]:i.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:s})};a&&addEventListener("click",f,{capture:!0})}const M1="_sentry_idleSpan";function _u(e){return e[M1]}function mE(e,t){Yn(e,M1,t)}const gE=1.5;function U4(e,t){const n=yt(e),s=ma(),i=n.start_timestamp;return!(s-i>gE||t&&s-t<=gE)}function I1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wg={exports:{}},Ke={};var yE;function $4(){if(yE)return Ke;yE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),b=Symbol.iterator;function x(I){return I===null||typeof I!="object"?null:(I=b&&I[b]||I["@@iterator"],typeof I=="function"?I:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,T={};function C(I,H,W){this.props=I,this.context=H,this.refs=T,this.updater=W||S}C.prototype.isReactComponent={},C.prototype.setState=function(I,H){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,H,"setState")},C.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function O(){}O.prototype=C.prototype;function N(I,H,W){this.props=I,this.context=H,this.refs=T,this.updater=W||S}var R=N.prototype=new O;R.constructor=N,w(R,C.prototype),R.isPureReactComponent=!0;var M=Array.isArray;function z(){}var j={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function P(I,H,W){var Y=W.ref;return{$$typeof:e,type:I,key:H,ref:Y!==void 0?Y:null,props:W}}function Q(I,H){return P(I.type,H,I.props)}function B(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function U(I){var H={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(W){return H[W]})}var Z=/\/+/g;function K(I,H){return typeof I=="object"&&I!==null&&I.key!=null?U(""+I.key):H.toString(36)}function ee(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(z,z):(I.status="pending",I.then(function(H){I.status==="pending"&&(I.status="fulfilled",I.value=H)},function(H){I.status==="pending"&&(I.status="rejected",I.reason=H)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function D(I,H,W,Y,ae){var se=typeof I;(se==="undefined"||se==="boolean")&&(I=null);var fe=!1;if(I===null)fe=!0;else switch(se){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(I.$$typeof){case e:case t:fe=!0;break;case g:return fe=I._init,D(fe(I._payload),H,W,Y,ae)}}if(fe)return ae=ae(I),fe=Y===""?"."+K(I,0):Y,M(ae)?(W="",fe!=null&&(W=fe.replace(Z,"$&/")+"/"),D(ae,H,W,"",function(Oe){return Oe})):ae!=null&&(B(ae)&&(ae=Q(ae,W+(ae.key==null||I&&I.key===ae.key?"":(""+ae.key).replace(Z,"$&/")+"/")+fe)),H.push(ae)),1;fe=0;var Se=Y===""?".":Y+":";if(M(I))for(var pe=0;pe<I.length;pe++)Y=I[pe],se=Se+K(Y,pe),fe+=D(Y,H,W,se,ae);else if(pe=x(I),typeof pe=="function")for(I=pe.call(I),pe=0;!(Y=I.next()).done;)Y=Y.value,se=Se+K(Y,pe++),fe+=D(Y,H,W,se,ae);else if(se==="object"){if(typeof I.then=="function")return D(ee(I),H,W,Y,ae);throw H=String(I),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return fe}function G(I,H,W){if(I==null)return I;var Y=[],ae=0;return D(I,Y,"","",function(se){return H.call(W,se,ae++)}),Y}function q(I){if(I._status===-1){var H=I._result;H=H(),H.then(function(W){(I._status===0||I._status===-1)&&(I._status=1,I._result=W)},function(W){(I._status===0||I._status===-1)&&(I._status=2,I._result=W)}),I._status===-1&&(I._status=0,I._result=H)}if(I._status===1)return I._result.default;throw I._result}var V=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},L={map:G,forEach:function(I,H,W){G(I,function(){H.apply(this,arguments)},W)},count:function(I){var H=0;return G(I,function(){H++}),H},toArray:function(I){return G(I,function(H){return H})||[]},only:function(I){if(!B(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return Ke.Activity=y,Ke.Children=L,Ke.Component=C,Ke.Fragment=n,Ke.Profiler=i,Ke.PureComponent=N,Ke.StrictMode=s,Ke.Suspense=d,Ke.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,Ke.__COMPILER_RUNTIME={__proto__:null,c:function(I){return j.H.useMemoCache(I)}},Ke.cache=function(I){return function(){return I.apply(null,arguments)}},Ke.cacheSignal=function(){return null},Ke.cloneElement=function(I,H,W){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var Y=w({},I.props),ae=I.key;if(H!=null)for(se in H.key!==void 0&&(ae=""+H.key),H)!A.call(H,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&H.ref===void 0||(Y[se]=H[se]);var se=arguments.length-2;if(se===1)Y.children=W;else if(1<se){for(var fe=Array(se),Se=0;Se<se;Se++)fe[Se]=arguments[Se+2];Y.children=fe}return P(I.type,ae,Y)},Ke.createContext=function(I){return I={$$typeof:l,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:a,_context:I},I},Ke.createElement=function(I,H,W){var Y,ae={},se=null;if(H!=null)for(Y in H.key!==void 0&&(se=""+H.key),H)A.call(H,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(ae[Y]=H[Y]);var fe=arguments.length-2;if(fe===1)ae.children=W;else if(1<fe){for(var Se=Array(fe),pe=0;pe<fe;pe++)Se[pe]=arguments[pe+2];ae.children=Se}if(I&&I.defaultProps)for(Y in fe=I.defaultProps,fe)ae[Y]===void 0&&(ae[Y]=fe[Y]);return P(I,se,ae)},Ke.createRef=function(){return{current:null}},Ke.forwardRef=function(I){return{$$typeof:f,render:I}},Ke.isValidElement=B,Ke.lazy=function(I){return{$$typeof:g,_payload:{_status:-1,_result:I},_init:q}},Ke.memo=function(I,H){return{$$typeof:p,type:I,compare:H===void 0?null:H}},Ke.startTransition=function(I){var H=j.T,W={};j.T=W;try{var Y=I(),ae=j.S;ae!==null&&ae(W,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(z,V)}catch(se){V(se)}finally{H!==null&&W.types!==null&&(H.types=W.types),j.T=H}},Ke.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},Ke.use=function(I){return j.H.use(I)},Ke.useActionState=function(I,H,W){return j.H.useActionState(I,H,W)},Ke.useCallback=function(I,H){return j.H.useCallback(I,H)},Ke.useContext=function(I){return j.H.useContext(I)},Ke.useDebugValue=function(){},Ke.useDeferredValue=function(I,H){return j.H.useDeferredValue(I,H)},Ke.useEffect=function(I,H){return j.H.useEffect(I,H)},Ke.useEffectEvent=function(I){return j.H.useEffectEvent(I)},Ke.useId=function(){return j.H.useId()},Ke.useImperativeHandle=function(I,H,W){return j.H.useImperativeHandle(I,H,W)},Ke.useInsertionEffect=function(I,H){return j.H.useInsertionEffect(I,H)},Ke.useLayoutEffect=function(I,H){return j.H.useLayoutEffect(I,H)},Ke.useMemo=function(I,H){return j.H.useMemo(I,H)},Ke.useOptimistic=function(I,H){return j.H.useOptimistic(I,H)},Ke.useReducer=function(I,H,W){return j.H.useReducer(I,H,W)},Ke.useRef=function(I){return j.H.useRef(I)},Ke.useState=function(I){return j.H.useState(I)},Ke.useSyncExternalStore=function(I,H,W){return j.H.useSyncExternalStore(I,H,W)},Ke.useTransition=function(){return j.H.useTransition()},Ke.version="19.2.4",Ke}var vE;function Ku(){return vE||(vE=1,Wg.exports=$4()),Wg.exports}var _=Ku();const Mc=I1(_),P1=AM({__proto__:null,default:Mc},[_]);function B4(e){const t={...e};return e1(t,"react"),DP("react",{version:_.version}),v4(t)}function ue(e,t,n){function s(f,d){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:d,constr:l,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,d);const p=l.prototype,g=Object.keys(p);for(let y=0;y<g.length;y++){const b=g[y];b in f||(f[b]=p[b].bind(f))}}const i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function l(f){var d;const p=n?.Parent?new a:this;s(p,f),(d=p._zod).deferred??(d.deferred=[]);for(const g of p._zod.deferred)g();return p}return Object.defineProperty(l,"init",{value:s}),Object.defineProperty(l,Symbol.hasInstance,{value:f=>n?.Parent&&f instanceof n.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}class gc extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class D1 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const z1={};function ni(e){return z1}function L1(e){const t=Object.values(e).filter(s=>typeof s=="number");return Object.entries(e).filter(([s,i])=>t.indexOf(+s)===-1).map(([s,i])=>i)}function fv(e,t){return typeof t=="bigint"?t.toString():t}function vb(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function bb(e){return e==null}function xb(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function F4(e,t){const n=(e.toString().split(".")[1]||"").length,s=t.toString();let i=(s.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(s)){const d=s.match(/\d?e-(\d?)/);d?.[1]&&(i=Number.parseInt(d[1]))}const a=n>i?n:i,l=Number.parseInt(e.toFixed(a).replace(".","")),f=Number.parseInt(t.toFixed(a).replace(".",""));return l%f/10**a}const bE=Symbol("evaluating");function wt(e,t,n){let s;Object.defineProperty(e,t,{get(){if(s!==bE)return s===void 0&&(s=bE,s=n()),s},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function ya(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function fi(...e){const t={};for(const n of e){const s=Object.getOwnPropertyDescriptors(n);Object.assign(t,s)}return Object.defineProperties({},t)}function xE(e){return JSON.stringify(e)}function H4(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const U1="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function wh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const q4=vb(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ic(e){if(wh(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(wh(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function $1(e){return Ic(e)?{...e}:Array.isArray(e)?[...e]:e}const V4=new Set(["string","number","symbol"]);function Pc(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function di(e,t,n){const s=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(s._zod.parent=e),s}function De(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function K4(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const G4={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Z4(e,t){const n=e._zod.def,s=n.checks;if(s&&s.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const a=fi(e._zod.def,{get shape(){const l={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(l[f]=n.shape[f])}return ya(this,"shape",l),l},checks:[]});return di(e,a)}function Y4(e,t){const n=e._zod.def,s=n.checks;if(s&&s.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const a=fi(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete l[f]}return ya(this,"shape",l),l},checks:[]});return di(e,a)}function X4(e,t){if(!Ic(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const a=e._zod.def.shape;for(const l in t)if(Object.getOwnPropertyDescriptor(a,l)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=fi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return ya(this,"shape",a),a}});return di(e,i)}function Q4(e,t){if(!Ic(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=fi(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return ya(this,"shape",s),s}});return di(e,n)}function W4(e,t){const n=fi(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t._zod.def.shape};return ya(this,"shape",s),s},get catchall(){return t._zod.def.catchall},checks:[]});return di(e,n)}function J4(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const l=fi(t._zod.def,{get shape(){const f=t._zod.def.shape,d={...f};if(n)for(const p in n){if(!(p in f))throw new Error(`Unrecognized key: "${p}"`);n[p]&&(d[p]=e?new e({type:"optional",innerType:f[p]}):f[p])}else for(const p in f)d[p]=e?new e({type:"optional",innerType:f[p]}):f[p];return ya(this,"shape",d),d},checks:[]});return di(t,l)}function e5(e,t,n){const s=fi(t._zod.def,{get shape(){const i=t._zod.def.shape,a={...i};if(n)for(const l in n){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(a[l]=new e({type:"nonoptional",innerType:i[l]}))}else for(const l in i)a[l]=new e({type:"nonoptional",innerType:i[l]});return ya(this,"shape",a),a}});return di(t,s)}function fc(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function dc(e,t){return t.map(n=>{var s;return(s=n).path??(s.path=[]),n.path.unshift(e),n})}function Rd(e){return typeof e=="string"?e:e?.message}function ri(e,t,n){const s={...e,path:e.path??[]};if(!e.message){const i=Rd(e.inst?._zod.def?.error?.(e))??Rd(t?.error?.(e))??Rd(n.customError?.(e))??Rd(n.localeError?.(e))??"Invalid input";s.message=i}return delete s.inst,delete s.continue,t?.reportInput||delete s.input,s}function Sb(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function wu(...e){const[t,n,s]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:s}:{...t}}const B1=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,fv,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},F1=ue("$ZodError",B1),H1=ue("$ZodError",B1,{Parent:Error});function t5(e,t=n=>n.message){const n={},s=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):s.push(t(i));return{formErrors:s,fieldErrors:n}}function n5(e,t=n=>n.message){const n={_errors:[]},s=i=>{for(const a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(l=>s({issues:l}));else if(a.code==="invalid_key")s({issues:a.issues});else if(a.code==="invalid_element")s({issues:a.issues});else if(a.path.length===0)n._errors.push(t(a));else{let l=n,f=0;for(;f<a.path.length;){const d=a.path[f];f===a.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(t(a))):l[d]=l[d]||{_errors:[]},l=l[d],f++}}};return s(e),n}const _b=e=>(t,n,s,i)=>{const a=s?Object.assign(s,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},a);if(l instanceof Promise)throw new gc;if(l.issues.length){const f=new(i?.Err??e)(l.issues.map(d=>ri(d,a,ni())));throw U1(f,i?.callee),f}return l.value},wb=e=>async(t,n,s,i)=>{const a=s?Object.assign(s,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},a);if(l instanceof Promise&&(l=await l),l.issues.length){const f=new(i?.Err??e)(l.issues.map(d=>ri(d,a,ni())));throw U1(f,i?.callee),f}return l.value},op=e=>(t,n,s)=>{const i=s?{...s,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new gc;return a.issues.length?{success:!1,error:new(e??F1)(a.issues.map(l=>ri(l,i,ni())))}:{success:!0,data:a.value}},r5=op(H1),ip=e=>async(t,n,s)=>{const i=s?Object.assign(s,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(l=>ri(l,i,ni())))}:{success:!0,data:a.value}},s5=ip(H1),o5=e=>(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return _b(e)(t,n,i)},i5=e=>(t,n,s)=>_b(e)(t,n,s),a5=e=>async(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return wb(e)(t,n,i)},c5=e=>async(t,n,s)=>wb(e)(t,n,s),l5=e=>(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return op(e)(t,n,i)},u5=e=>(t,n,s)=>op(e)(t,n,s),f5=e=>async(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return ip(e)(t,n,i)},d5=e=>async(t,n,s)=>ip(e)(t,n,s),h5=/^[cC][^\s-]{8,}$/,p5=/^[0-9a-z]+$/,m5=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,g5=/^[0-9a-vA-V]{20}$/,y5=/^[A-Za-z0-9]{27}$/,v5=/^[a-zA-Z0-9_-]{21}$/,b5=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,x5=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,SE=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,S5=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function w5(){return new RegExp(_5,"u")}const E5=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,T5=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,C5=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,R5=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,N5=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,q1=/^[A-Za-z0-9_-]*$/,j5=/^\+[1-9]\d{6,14}$/,V1="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",A5=new RegExp(`^${V1}$`);function K1(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function k5(e){return new RegExp(`^${K1(e)}$`)}function O5(e){const t=K1({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const s=`${t}(?:${n.join("|")})`;return new RegExp(`^${V1}T(?:${s})$`)}const M5=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},I5=/^-?\d+$/,G1=/^-?\d+(?:\.\d+)?$/,P5=/^(?:true|false)$/i,D5=/^[^A-Z]*$/,z5=/^[^a-z]*$/,Qn=ue("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Z1={number:"number",bigint:"bigint",object:"date"},Y1=ue("$ZodCheckLessThan",(e,t)=>{Qn.init(e,t);const n=Z1[typeof t.value];e._zod.onattach.push(s=>{const i=s._zod.bag,a=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=s=>{(t.inclusive?s.value<=t.value:s.value<t.value)||s.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:s.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),X1=ue("$ZodCheckGreaterThan",(e,t)=>{Qn.init(e,t);const n=Z1[typeof t.value];e._zod.onattach.push(s=>{const i=s._zod.bag,a=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=s=>{(t.inclusive?s.value>=t.value:s.value>t.value)||s.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:s.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),L5=ue("$ZodCheckMultipleOf",(e,t)=>{Qn.init(e,t),e._zod.onattach.push(n=>{var s;(s=n._zod.bag).multipleOf??(s.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):F4(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),U5=ue("$ZodCheckNumberFormat",(e,t)=>{Qn.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),s=n?"int":"number",[i,a]=G4[t.format];e._zod.onattach.push(l=>{const f=l._zod.bag;f.format=t.format,f.minimum=i,f.maximum=a,n&&(f.pattern=I5)}),e._zod.check=l=>{const f=l.value;if(n){if(!Number.isInteger(f)){l.issues.push({expected:s,format:t.format,code:"invalid_type",continue:!1,input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?l.issues.push({input:f,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,inclusive:!0,continue:!t.abort}):l.issues.push({input:f,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,inclusive:!0,continue:!t.abort});return}}f<i&&l.issues.push({origin:"number",input:f,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),f>a&&l.issues.push({origin:"number",input:f,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),$5=ue("$ZodCheckMaxLength",(e,t)=>{var n;Qn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!bb(i)&&i.length!==void 0}),e._zod.onattach.push(s=>{const i=s._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(s._zod.bag.maximum=t.maximum)}),e._zod.check=s=>{const i=s.value;if(i.length<=t.maximum)return;const l=Sb(i);s.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),B5=ue("$ZodCheckMinLength",(e,t)=>{var n;Qn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!bb(i)&&i.length!==void 0}),e._zod.onattach.push(s=>{const i=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(s._zod.bag.minimum=t.minimum)}),e._zod.check=s=>{const i=s.value;if(i.length>=t.minimum)return;const l=Sb(i);s.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),F5=ue("$ZodCheckLengthEquals",(e,t)=>{var n;Qn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!bb(i)&&i.length!==void 0}),e._zod.onattach.push(s=>{const i=s._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=s=>{const i=s.value,a=i.length;if(a===t.length)return;const l=Sb(i),f=a>t.length;s.issues.push({origin:l,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:s.value,inst:e,continue:!t.abort})}}),ap=ue("$ZodCheckStringFormat",(e,t)=>{var n,s;Qn.init(e,t),e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(s=e._zod).check??(s.check=()=>{})}),H5=ue("$ZodCheckRegex",(e,t)=>{ap.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),q5=ue("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=D5),ap.init(e,t)}),V5=ue("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=z5),ap.init(e,t)}),K5=ue("$ZodCheckIncludes",(e,t)=>{Qn.init(e,t);const n=Pc(t.includes),s=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=s,e._zod.onattach.push(i=>{const a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(s)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),G5=ue("$ZodCheckStartsWith",(e,t)=>{Qn.init(e,t);const n=new RegExp(`^${Pc(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(s=>{const i=s._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=s=>{s.value.startsWith(t.prefix)||s.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:s.value,inst:e,continue:!t.abort})}}),Z5=ue("$ZodCheckEndsWith",(e,t)=>{Qn.init(e,t);const n=new RegExp(`.*${Pc(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(s=>{const i=s._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=s=>{s.value.endsWith(t.suffix)||s.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:s.value,inst:e,continue:!t.abort})}}),Y5=ue("$ZodCheckOverwrite",(e,t)=>{Qn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class X5{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const s=t.split(`
|
|
22
|
-
`).filter(l=>l),i=Math.min(...s.map(l=>l.length-l.trimStart().length)),a=s.map(l=>l.slice(i)).map(l=>" ".repeat(this.indent*2)+l);for(const l of a)this.content.push(l)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...n,i.join(`
|
|
23
|
-
`))}}const Q5={major:4,minor:3,patch:6},Ft=ue("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Q5;const s=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&s.unshift(e);for(const i of s)for(const a of i._zod.onattach)a(e);if(s.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(l,f,d)=>{let p=fc(l),g;for(const y of f){if(y._zod.def.when){if(!y._zod.def.when(l))continue}else if(p)continue;const b=l.issues.length,x=y._zod.check(l);if(x instanceof Promise&&d?.async===!1)throw new gc;if(g||x instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await x,l.issues.length!==b&&(p||(p=fc(l,b)))});else{if(l.issues.length===b)continue;p||(p=fc(l,b))}}return g?g.then(()=>l):l},a=(l,f,d)=>{if(fc(l))return l.aborted=!0,l;const p=i(f,s,d);if(p instanceof Promise){if(d.async===!1)throw new gc;return p.then(g=>e._zod.parse(g,d))}return e._zod.parse(p,d)};e._zod.run=(l,f)=>{if(f.skipChecks)return e._zod.parse(l,f);if(f.direction==="backward"){const p=e._zod.parse({value:l.value,issues:[]},{...f,skipChecks:!0});return p instanceof Promise?p.then(g=>a(g,l,f)):a(p,l,f)}const d=e._zod.parse(l,f);if(d instanceof Promise){if(f.async===!1)throw new gc;return d.then(p=>i(p,s,f))}return i(d,s,f)}}wt(e,"~standard",()=>({validate:i=>{try{const a=r5(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return s5(e,i).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),Eb=ue("$ZodString",(e,t)=>{Ft.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??M5(e._zod.bag),e._zod.parse=(n,s)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Bt=ue("$ZodStringFormat",(e,t)=>{ap.init(e,t),Eb.init(e,t)}),W5=ue("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=x5),Bt.init(e,t)}),J5=ue("$ZodUUID",(e,t)=>{if(t.version){const s={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(s===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=SE(s))}else t.pattern??(t.pattern=SE());Bt.init(e,t)}),eU=ue("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=S5),Bt.init(e,t)}),tU=ue("$ZodURL",(e,t)=>{Bt.init(e,t),e._zod.check=n=>{try{const s=n.value.trim(),i=new URL(s);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=s;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),nU=ue("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=w5()),Bt.init(e,t)}),rU=ue("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=v5),Bt.init(e,t)}),sU=ue("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=h5),Bt.init(e,t)}),oU=ue("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=p5),Bt.init(e,t)}),iU=ue("$ZodULID",(e,t)=>{t.pattern??(t.pattern=m5),Bt.init(e,t)}),aU=ue("$ZodXID",(e,t)=>{t.pattern??(t.pattern=g5),Bt.init(e,t)}),cU=ue("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=y5),Bt.init(e,t)}),lU=ue("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=O5(t)),Bt.init(e,t)}),uU=ue("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=A5),Bt.init(e,t)}),fU=ue("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=k5(t)),Bt.init(e,t)}),dU=ue("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=b5),Bt.init(e,t)}),hU=ue("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=E5),Bt.init(e,t),e._zod.bag.format="ipv4"}),pU=ue("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=T5),Bt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),mU=ue("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=C5),Bt.init(e,t)}),gU=ue("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=R5),Bt.init(e,t),e._zod.check=n=>{const s=n.value.split("/");try{if(s.length!==2)throw new Error;const[i,a]=s;if(!a)throw new Error;const l=Number(a);if(`${l}`!==a)throw new Error;if(l<0||l>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Q1(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const yU=ue("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=N5),Bt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Q1(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function vU(e){if(!q1.test(e))return!1;const t=e.replace(/[-_]/g,s=>s==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Q1(n)}const bU=ue("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=q1),Bt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{vU(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),xU=ue("$ZodE164",(e,t)=>{t.pattern??(t.pattern=j5),Bt.init(e,t)});function SU(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[s]=n;if(!s)return!1;const i=JSON.parse(atob(s));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const _U=ue("$ZodJWT",(e,t)=>{Bt.init(e,t),e._zod.check=n=>{SU(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),W1=ue("$ZodNumber",(e,t)=>{Ft.init(e,t),e._zod.pattern=e._zod.bag.pattern??G1,e._zod.parse=(n,s)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const a=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...a?{received:a}:{}}),n}}),wU=ue("$ZodNumberFormat",(e,t)=>{U5.init(e,t),W1.init(e,t)}),EU=ue("$ZodBoolean",(e,t)=>{Ft.init(e,t),e._zod.pattern=P5,e._zod.parse=(n,s)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),TU=ue("$ZodUnknown",(e,t)=>{Ft.init(e,t),e._zod.parse=n=>n}),CU=ue("$ZodNever",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,s)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function _E(e,t,n){e.issues.length&&t.issues.push(...dc(n,e.issues)),t.value[n]=e.value}const RU=ue("$ZodArray",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,s)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const a=[];for(let l=0;l<i.length;l++){const f=i[l],d=t.element._zod.run({value:f,issues:[]},s);d instanceof Promise?a.push(d.then(p=>_E(p,n,l))):_E(d,n,l)}return a.length?Promise.all(a).then(()=>n):n}});function Eh(e,t,n,s,i){if(e.issues.length){if(i&&!(n in s))return;t.issues.push(...dc(n,e.issues))}e.value===void 0?n in s&&(t.value[n]=void 0):t.value[n]=e.value}function J1(e){const t=Object.keys(e.shape);for(const s of t)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${s}": expected a Zod schema`);const n=K4(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function eN(e,t,n,s,i,a){const l=[],f=i.keySet,d=i.catchall._zod,p=d.def.type,g=d.optout==="optional";for(const y in t){if(f.has(y))continue;if(p==="never"){l.push(y);continue}const b=d.run({value:t[y],issues:[]},s);b instanceof Promise?e.push(b.then(x=>Eh(x,n,y,t,g))):Eh(b,n,y,t,g)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const NU=ue("$ZodObject",(e,t)=>{if(Ft.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const d={...f};return Object.defineProperty(t,"shape",{value:d}),d}})}const s=vb(()=>J1(t));wt(e._zod,"propValues",()=>{const f=t.shape,d={};for(const p in f){const g=f[p]._zod;if(g.values){d[p]??(d[p]=new Set);for(const y of g.values)d[p].add(y)}}return d});const i=wh,a=t.catchall;let l;e._zod.parse=(f,d)=>{l??(l=s.value);const p=f.value;if(!i(p))return f.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),f;f.value={};const g=[],y=l.shape;for(const b of l.keys){const x=y[b],S=x._zod.optout==="optional",w=x._zod.run({value:p[b],issues:[]},d);w instanceof Promise?g.push(w.then(T=>Eh(T,f,b,p,S))):Eh(w,f,b,p,S)}return a?eN(g,p,f,d,s.value,e):g.length?Promise.all(g).then(()=>f):f}}),jU=ue("$ZodObjectJIT",(e,t)=>{NU.init(e,t);const n=e._zod.parse,s=vb(()=>J1(t)),i=b=>{const x=new X5(["shape","payload","ctx"]),S=s.value,w=N=>{const R=xE(N);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};x.write("const input = payload.value;");const T=Object.create(null);let C=0;for(const N of S.keys)T[N]=`key_${C++}`;x.write("const newResult = {};");for(const N of S.keys){const R=T[N],M=xE(N),j=b[N]?._zod?.optout==="optional";x.write(`const ${R} = ${w(N)};`),j?x.write(`
|
|
24
|
-
if (${R}.issues.length) {
|
|
25
|
-
if (${M} in input) {
|
|
26
|
-
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
27
|
-
...iss,
|
|
28
|
-
path: iss.path ? [${M}, ...iss.path] : [${M}]
|
|
29
|
-
})));
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (${R}.value === undefined) {
|
|
34
|
-
if (${M} in input) {
|
|
35
|
-
newResult[${M}] = undefined;
|
|
36
|
-
}
|
|
37
|
-
} else {
|
|
38
|
-
newResult[${M}] = ${R}.value;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
`):x.write(`
|
|
42
|
-
if (${R}.issues.length) {
|
|
43
|
-
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
44
|
-
...iss,
|
|
45
|
-
path: iss.path ? [${M}, ...iss.path] : [${M}]
|
|
46
|
-
})));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (${R}.value === undefined) {
|
|
50
|
-
if (${M} in input) {
|
|
51
|
-
newResult[${M}] = undefined;
|
|
52
|
-
}
|
|
53
|
-
} else {
|
|
54
|
-
newResult[${M}] = ${R}.value;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
`)}x.write("payload.value = newResult;"),x.write("return payload;");const O=x.compile();return(N,R)=>O(b,N,R)};let a;const l=wh,f=!z1.jitless,p=f&&q4.value,g=t.catchall;let y;e._zod.parse=(b,x)=>{y??(y=s.value);const S=b.value;return l(S)?f&&p&&x?.async===!1&&x.jitless!==!0?(a||(a=i(t.shape)),b=a(b,x),g?eN([],S,b,x,y,e):b):n(b,x):(b.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),b)}});function wE(e,t,n,s){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const i=e.filter(a=>!fc(a));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(a=>a.issues.map(l=>ri(l,s,ni())))}),t)}const AU=ue("$ZodUnion",(e,t)=>{Ft.init(e,t),wt(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),wt(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),wt(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),wt(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${i.map(a=>xb(a.source)).join("|")})$`)}});const n=t.options.length===1,s=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return s(i,a);let l=!1;const f=[];for(const d of t.options){const p=d._zod.run({value:i.value,issues:[]},a);if(p instanceof Promise)f.push(p),l=!0;else{if(p.issues.length===0)return p;f.push(p)}}return l?Promise.all(f).then(d=>wE(d,i,e,a)):wE(f,i,e,a)}}),kU=ue("$ZodIntersection",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,s)=>{const i=n.value,a=t.left._zod.run({value:i,issues:[]},s),l=t.right._zod.run({value:i,issues:[]},s);return a instanceof Promise||l instanceof Promise?Promise.all([a,l]).then(([d,p])=>EE(n,d,p)):EE(n,a,l)}});function dv(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ic(e)&&Ic(t)){const n=Object.keys(t),s=Object.keys(e).filter(a=>n.indexOf(a)!==-1),i={...e,...t};for(const a of s){const l=dv(e[a],t[a]);if(!l.valid)return{valid:!1,mergeErrorPath:[a,...l.mergeErrorPath]};i[a]=l.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let s=0;s<e.length;s++){const i=e[s],a=t[s],l=dv(i,a);if(!l.valid)return{valid:!1,mergeErrorPath:[s,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function EE(e,t,n){const s=new Map;let i;for(const f of t.issues)if(f.code==="unrecognized_keys"){i??(i=f);for(const d of f.keys)s.has(d)||s.set(d,{}),s.get(d).l=!0}else e.issues.push(f);for(const f of n.issues)if(f.code==="unrecognized_keys")for(const d of f.keys)s.has(d)||s.set(d,{}),s.get(d).r=!0;else e.issues.push(f);const a=[...s].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(a.length&&i&&e.issues.push({...i,keys:a}),fc(e))return e;const l=dv(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const OU=ue("$ZodRecord",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,s)=>{const i=n.value;if(!Ic(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const a=[],l=t.keyType._zod.values;if(l){n.value={};const f=new Set;for(const p of l)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){f.add(typeof p=="number"?p.toString():p);const g=t.valueType._zod.run({value:i[p],issues:[]},s);g instanceof Promise?a.push(g.then(y=>{y.issues.length&&n.issues.push(...dc(p,y.issues)),n.value[p]=y.value})):(g.issues.length&&n.issues.push(...dc(p,g.issues)),n.value[p]=g.value)}let d;for(const p in i)f.has(p)||(d=d??[],d.push(p));d&&d.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:d})}else{n.value={};for(const f of Reflect.ownKeys(i)){if(f==="__proto__")continue;let d=t.keyType._zod.run({value:f,issues:[]},s);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&G1.test(f)&&d.issues.length){const y=t.keyType._zod.run({value:Number(f),issues:[]},s);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(d=y)}if(d.issues.length){t.mode==="loose"?n.value[f]=i[f]:n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(y=>ri(y,s,ni())),input:f,path:[f],inst:e});continue}const g=t.valueType._zod.run({value:i[f],issues:[]},s);g instanceof Promise?a.push(g.then(y=>{y.issues.length&&n.issues.push(...dc(f,y.issues)),n.value[d.value]=y.value})):(g.issues.length&&n.issues.push(...dc(f,g.issues)),n.value[d.value]=g.value)}}return a.length?Promise.all(a).then(()=>n):n}}),MU=ue("$ZodEnum",(e,t)=>{Ft.init(e,t);const n=L1(t.entries),s=new Set(n);e._zod.values=s,e._zod.pattern=new RegExp(`^(${n.filter(i=>V4.has(typeof i)).map(i=>typeof i=="string"?Pc(i):i.toString()).join("|")})$`),e._zod.parse=(i,a)=>{const l=i.value;return s.has(l)||i.issues.push({code:"invalid_value",values:n,input:l,inst:e}),i}}),IU=ue("$ZodLiteral",(e,t)=>{if(Ft.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(s=>typeof s=="string"?Pc(s):s?Pc(s.toString()):String(s)).join("|")})$`),e._zod.parse=(s,i)=>{const a=s.value;return n.has(a)||s.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),s}}),PU=ue("$ZodTransform",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,s)=>{if(s.direction==="backward")throw new D1(e.constructor.name);const i=t.transform(n.value,n);if(s.async)return(i instanceof Promise?i:Promise.resolve(i)).then(l=>(n.value=l,n));if(i instanceof Promise)throw new gc;return n.value=i,n}});function TE(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const tN=ue("$ZodOptional",(e,t)=>{Ft.init(e,t),e._zod.optin="optional",e._zod.optout="optional",wt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),wt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${xb(n.source)})?$`):void 0}),e._zod.parse=(n,s)=>{if(t.innerType._zod.optin==="optional"){const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(a=>TE(a,n.value)):TE(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,s)}}),DU=ue("$ZodExactOptional",(e,t)=>{tN.init(e,t),wt(e._zod,"values",()=>t.innerType._zod.values),wt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,s)=>t.innerType._zod.run(n,s)}),zU=ue("$ZodNullable",(e,t)=>{Ft.init(e,t),wt(e._zod,"optin",()=>t.innerType._zod.optin),wt(e._zod,"optout",()=>t.innerType._zod.optout),wt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${xb(n.source)}|null)$`):void 0}),wt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,s)=>n.value===null?n:t.innerType._zod.run(n,s)}),LU=ue("$ZodDefault",(e,t)=>{Ft.init(e,t),e._zod.optin="optional",wt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,s)=>{if(s.direction==="backward")return t.innerType._zod.run(n,s);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(a=>CE(a,t)):CE(i,t)}});function CE(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const UU=ue("$ZodPrefault",(e,t)=>{Ft.init(e,t),e._zod.optin="optional",wt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,s)=>(s.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,s))}),$U=ue("$ZodNonOptional",(e,t)=>{Ft.init(e,t),wt(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(s=>s!==void 0)):void 0}),e._zod.parse=(n,s)=>{const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(a=>RE(a,e)):RE(i,e)}});function RE(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const BU=ue("$ZodCatch",(e,t)=>{Ft.init(e,t),wt(e._zod,"optin",()=>t.innerType._zod.optin),wt(e._zod,"optout",()=>t.innerType._zod.optout),wt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,s)=>{if(s.direction==="backward")return t.innerType._zod.run(n,s);const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(a=>(n.value=a.value,a.issues.length&&(n.value=t.catchValue({...n,error:{issues:a.issues.map(l=>ri(l,s,ni()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>ri(a,s,ni()))},input:n.value}),n.issues=[]),n)}}),FU=ue("$ZodPipe",(e,t)=>{Ft.init(e,t),wt(e._zod,"values",()=>t.in._zod.values),wt(e._zod,"optin",()=>t.in._zod.optin),wt(e._zod,"optout",()=>t.out._zod.optout),wt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,s)=>{if(s.direction==="backward"){const a=t.out._zod.run(n,s);return a instanceof Promise?a.then(l=>Nd(l,t.in,s)):Nd(a,t.in,s)}const i=t.in._zod.run(n,s);return i instanceof Promise?i.then(a=>Nd(a,t.out,s)):Nd(i,t.out,s)}});function Nd(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const HU=ue("$ZodReadonly",(e,t)=>{Ft.init(e,t),wt(e._zod,"propValues",()=>t.innerType._zod.propValues),wt(e._zod,"values",()=>t.innerType._zod.values),wt(e._zod,"optin",()=>t.innerType?._zod?.optin),wt(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,s)=>{if(s.direction==="backward")return t.innerType._zod.run(n,s);const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(NE):NE(i)}});function NE(e){return e.value=Object.freeze(e.value),e}const qU=ue("$ZodCustom",(e,t)=>{Qn.init(e,t),Ft.init(e,t),e._zod.parse=(n,s)=>n,e._zod.check=n=>{const s=n.value,i=t.fn(s);if(i instanceof Promise)return i.then(a=>jE(a,n,s,e));jE(i,n,s,e)}});function jE(e,t,n,s){if(!e){const i={code:"custom",input:n,inst:s,path:[...s._zod.def.path??[]],continue:!s._zod.def.abort};s._zod.def.params&&(i.params=s._zod.def.params),t.issues.push(wu(i))}}var AE;class VU{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const s=n[0];return this._map.set(t,s),s&&typeof s=="object"&&"id"in s&&this._idmap.set(s.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const s={...this.get(n)??{}};delete s.id;const i={...s,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function KU(){return new VU}(AE=globalThis).__zod_globalRegistry??(AE.__zod_globalRegistry=KU());const cu=globalThis.__zod_globalRegistry;function GU(e,t){return new e({type:"string",...De(t)})}function ZU(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...De(t)})}function kE(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...De(t)})}function YU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...De(t)})}function XU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...De(t)})}function QU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...De(t)})}function WU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...De(t)})}function JU(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...De(t)})}function e3(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...De(t)})}function t3(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...De(t)})}function n3(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...De(t)})}function r3(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...De(t)})}function s3(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...De(t)})}function o3(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...De(t)})}function i3(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...De(t)})}function a3(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...De(t)})}function c3(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...De(t)})}function l3(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...De(t)})}function u3(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...De(t)})}function f3(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...De(t)})}function d3(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...De(t)})}function h3(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...De(t)})}function p3(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...De(t)})}function m3(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...De(t)})}function g3(e,t){return new e({type:"string",format:"date",check:"string_format",...De(t)})}function y3(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...De(t)})}function v3(e,t){return new e({type:"string",format:"duration",check:"string_format",...De(t)})}function b3(e,t){return new e({type:"number",checks:[],...De(t)})}function x3(e,t){return new e({type:"number",coerce:!0,checks:[],...De(t)})}function S3(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...De(t)})}function _3(e,t){return new e({type:"boolean",...De(t)})}function w3(e){return new e({type:"unknown"})}function E3(e,t){return new e({type:"never",...De(t)})}function OE(e,t){return new Y1({check:"less_than",...De(t),value:e,inclusive:!1})}function Jg(e,t){return new Y1({check:"less_than",...De(t),value:e,inclusive:!0})}function ME(e,t){return new X1({check:"greater_than",...De(t),value:e,inclusive:!1})}function ey(e,t){return new X1({check:"greater_than",...De(t),value:e,inclusive:!0})}function IE(e,t){return new L5({check:"multiple_of",...De(t),value:e})}function nN(e,t){return new $5({check:"max_length",...De(t),maximum:e})}function Th(e,t){return new B5({check:"min_length",...De(t),minimum:e})}function rN(e,t){return new F5({check:"length_equals",...De(t),length:e})}function T3(e,t){return new H5({check:"string_format",format:"regex",...De(t),pattern:e})}function C3(e){return new q5({check:"string_format",format:"lowercase",...De(e)})}function R3(e){return new V5({check:"string_format",format:"uppercase",...De(e)})}function N3(e,t){return new K5({check:"string_format",format:"includes",...De(t),includes:e})}function j3(e,t){return new G5({check:"string_format",format:"starts_with",...De(t),prefix:e})}function A3(e,t){return new Z5({check:"string_format",format:"ends_with",...De(t),suffix:e})}function Qc(e){return new Y5({check:"overwrite",tx:e})}function k3(e){return Qc(t=>t.normalize(e))}function O3(){return Qc(e=>e.trim())}function M3(){return Qc(e=>e.toLowerCase())}function I3(){return Qc(e=>e.toUpperCase())}function P3(){return Qc(e=>H4(e))}function D3(e,t,n){return new e({type:"array",element:t,...De(n)})}function z3(e,t,n){return new e({type:"custom",check:"custom",fn:t,...De(n)})}function L3(e){const t=U3(n=>(n.addIssue=s=>{if(typeof s=="string")n.issues.push(wu(s,n.value,t._zod.def));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(wu(i))}},e(n.value,n)));return t}function U3(e,t){const n=new Qn({check:"custom",...De(t)});return n._zod.check=e,n}function sN(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??cu,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function ln(e,t,n={path:[],schemaPath:[]}){var s;const i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;const l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const f=e._zod.toJSONSchema?.();if(f)l.schema=f;else{const g={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,g);else{const b=l.schema,x=t.processors[i.type];if(!x)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);x(e,t,b,g)}const y=e._zod.parent;y&&(l.ref||(l.ref=y),ln(y,t,g),t.seen.get(y).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),t.io==="input"&&On(e)&&(delete l.schema.examples,delete l.schema.default),t.io==="input"&&l.schema._prefault&&((s=l.schema).default??(s.default=l.schema._prefault)),delete l.schema._prefault,t.seen.get(e).schema}function oN(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=new Map;for(const l of e.seen.entries()){const f=e.metadataRegistry.get(l[0])?.id;if(f){const d=s.get(f);if(d&&d!==l[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);s.set(f,l[0])}}const i=l=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(l[0])?.id,b=e.external.uri??(S=>S);if(y)return{ref:b(y)};const x=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=x,{defId:x,ref:`${b("__shared")}#/${f}/${x}`}}if(l[1]===n)return{ref:"#"};const p=`#/${f}/`,g=l[1].schema.id??`__schema${e.counter++}`;return{defId:g,ref:p+g}},a=l=>{if(l[1].schema.$ref)return;const f=l[1],{ref:d,defId:p}=i(l);f.def={...f.schema},p&&(f.defId=p);const g=f.schema;for(const y in g)delete g[y];g.$ref=d};if(e.cycles==="throw")for(const l of e.seen.entries()){const f=l[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
|
|
58
|
-
|
|
59
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const f=l[1];if(t===l[0]){a(l);continue}if(e.external){const p=e.external.registry.get(l[0])?.id;if(t!==l[0]&&p){a(l);continue}}if(e.metadataRegistry.get(l[0])?.id){a(l);continue}if(f.cycle){a(l);continue}if(f.count>1&&e.reused==="ref"){a(l);continue}}}function iN(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=l=>{const f=e.seen.get(l);if(f.ref===null)return;const d=f.def??f.schema,p={...d},g=f.ref;if(f.ref=null,g){s(g);const b=e.seen.get(g),x=b.schema;if(x.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(x)):Object.assign(d,x),Object.assign(d,p),l._zod.parent===g)for(const w in d)w==="$ref"||w==="allOf"||w in p||delete d[w];if(x.$ref&&b.def)for(const w in d)w==="$ref"||w==="allOf"||w in b.def&&JSON.stringify(d[w])===JSON.stringify(b.def[w])&&delete d[w]}const y=l._zod.parent;if(y&&y!==g){s(y);const b=e.seen.get(y);if(b?.schema.$ref&&(d.$ref=b.schema.$ref,b.def))for(const x in d)x==="$ref"||x==="allOf"||x in b.def&&JSON.stringify(d[x])===JSON.stringify(b.def[x])&&delete d[x]}e.override({zodSchema:l,jsonSchema:d,path:f.path??[]})};for(const l of[...e.seen.entries()].reverse())s(l[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(l)}Object.assign(i,n.def??n.schema);const a=e.external?.defs??{};for(const l of e.seen.entries()){const f=l[1];f.def&&f.defId&&(a[f.defId]=f.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{const l=JSON.parse(JSON.stringify(i));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ch(t,"input",e.processors),output:Ch(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function On(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const s=e._zod.def;if(s.type==="transform")return!0;if(s.type==="array")return On(s.element,n);if(s.type==="set")return On(s.valueType,n);if(s.type==="lazy")return On(s.getter(),n);if(s.type==="promise"||s.type==="optional"||s.type==="nonoptional"||s.type==="nullable"||s.type==="readonly"||s.type==="default"||s.type==="prefault")return On(s.innerType,n);if(s.type==="intersection")return On(s.left,n)||On(s.right,n);if(s.type==="record"||s.type==="map")return On(s.keyType,n)||On(s.valueType,n);if(s.type==="pipe")return On(s.in,n)||On(s.out,n);if(s.type==="object"){for(const i in s.shape)if(On(s.shape[i],n))return!0;return!1}if(s.type==="union"){for(const i of s.options)if(On(i,n))return!0;return!1}if(s.type==="tuple"){for(const i of s.items)if(On(i,n))return!0;return!!(s.rest&&On(s.rest,n))}return!1}const $3=(e,t={})=>n=>{const s=sN({...n,processors:t});return ln(e,s),oN(s,e),iN(s,e)},Ch=(e,t,n={})=>s=>{const{libraryOptions:i,target:a}=s??{},l=sN({...i??{},target:a,io:t,processors:n});return ln(e,l),oN(l,e),iN(l,e)},B3={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},F3=(e,t,n,s)=>{const i=n;i.type="string";const{minimum:a,maximum:l,format:f,patterns:d,contentEncoding:p}=e._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof l=="number"&&(i.maxLength=l),f&&(i.format=B3[f]??f,i.format===""&&delete i.format,f==="time"&&delete i.format),p&&(i.contentEncoding=p),d&&d.size>0){const g=[...d];g.length===1?i.pattern=g[0].source:g.length>1&&(i.allOf=[...g.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},H3=(e,t,n,s)=>{const i=n,{minimum:a,maximum:l,format:f,multipleOf:d,exclusiveMaximum:p,exclusiveMinimum:g}=e._zod.bag;typeof f=="string"&&f.includes("int")?i.type="integer":i.type="number",typeof g=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=g,i.exclusiveMinimum=!0):i.exclusiveMinimum=g),typeof a=="number"&&(i.minimum=a,typeof g=="number"&&t.target!=="draft-04"&&(g>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=p,i.exclusiveMaximum=!0):i.exclusiveMaximum=p),typeof l=="number"&&(i.maximum=l,typeof p=="number"&&t.target!=="draft-04"&&(p<=l?delete i.maximum:delete i.exclusiveMaximum)),typeof d=="number"&&(i.multipleOf=d)},q3=(e,t,n,s)=>{n.type="boolean"},V3=(e,t,n,s)=>{n.not={}},K3=(e,t,n,s)=>{},G3=(e,t,n,s)=>{const i=e._zod.def,a=L1(i.entries);a.every(l=>typeof l=="number")&&(n.type="number"),a.every(l=>typeof l=="string")&&(n.type="string"),n.enum=a},Z3=(e,t,n,s)=>{const i=e._zod.def,a=[];for(const l of i.values)if(l===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof l=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(l))}else a.push(l);if(a.length!==0)if(a.length===1){const l=a[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else a.every(l=>typeof l=="number")&&(n.type="number"),a.every(l=>typeof l=="string")&&(n.type="string"),a.every(l=>typeof l=="boolean")&&(n.type="boolean"),a.every(l=>l===null)&&(n.type="null"),n.enum=a},Y3=(e,t,n,s)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},X3=(e,t,n,s)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Q3=(e,t,n,s)=>{const i=n,a=e._zod.def,{minimum:l,maximum:f}=e._zod.bag;typeof l=="number"&&(i.minItems=l),typeof f=="number"&&(i.maxItems=f),i.type="array",i.items=ln(a.element,t,{...s,path:[...s.path,"items"]})},W3=(e,t,n,s)=>{const i=n,a=e._zod.def;i.type="object",i.properties={};const l=a.shape;for(const p in l)i.properties[p]=ln(l[p],t,{...s,path:[...s.path,"properties",p]});const f=new Set(Object.keys(l)),d=new Set([...f].filter(p=>{const g=a.shape[p]._zod;return t.io==="input"?g.optin===void 0:g.optout===void 0}));d.size>0&&(i.required=Array.from(d)),a.catchall?._zod.def.type==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=ln(a.catchall,t,{...s,path:[...s.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},J3=(e,t,n,s)=>{const i=e._zod.def,a=i.inclusive===!1,l=i.options.map((f,d)=>ln(f,t,{...s,path:[...s.path,a?"oneOf":"anyOf",d]}));a?n.oneOf=l:n.anyOf=l},e$=(e,t,n,s)=>{const i=e._zod.def,a=ln(i.left,t,{...s,path:[...s.path,"allOf",0]}),l=ln(i.right,t,{...s,path:[...s.path,"allOf",1]}),f=p=>"allOf"in p&&Object.keys(p).length===1,d=[...f(a)?a.allOf:[a],...f(l)?l.allOf:[l]];n.allOf=d},t$=(e,t,n,s)=>{const i=n,a=e._zod.def;i.type="object";const l=a.keyType,d=l._zod.bag?.patterns;if(a.mode==="loose"&&d&&d.size>0){const g=ln(a.valueType,t,{...s,path:[...s.path,"patternProperties","*"]});i.patternProperties={};for(const y of d)i.patternProperties[y.source]=g}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=ln(a.keyType,t,{...s,path:[...s.path,"propertyNames"]})),i.additionalProperties=ln(a.valueType,t,{...s,path:[...s.path,"additionalProperties"]});const p=l._zod.values;if(p){const g=[...p].filter(y=>typeof y=="string"||typeof y=="number");g.length>0&&(i.required=g)}},n$=(e,t,n,s)=>{const i=e._zod.def,a=ln(i.innerType,t,s),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:"null"}]},r$=(e,t,n,s)=>{const i=e._zod.def;ln(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType},s$=(e,t,n,s)=>{const i=e._zod.def;ln(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},o$=(e,t,n,s)=>{const i=e._zod.def;ln(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},i$=(e,t,n,s)=>{const i=e._zod.def;ln(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType;let l;try{l=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},a$=(e,t,n,s)=>{const i=e._zod.def,a=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;ln(a,t,s);const l=t.seen.get(e);l.ref=a},c$=(e,t,n,s)=>{const i=e._zod.def;ln(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},aN=(e,t,n,s)=>{const i=e._zod.def;ln(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType},l$=ue("ZodISODateTime",(e,t)=>{lU.init(e,t),qt.init(e,t)});function u$(e){return m3(l$,e)}const f$=ue("ZodISODate",(e,t)=>{uU.init(e,t),qt.init(e,t)});function d$(e){return g3(f$,e)}const h$=ue("ZodISOTime",(e,t)=>{fU.init(e,t),qt.init(e,t)});function p$(e){return y3(h$,e)}const m$=ue("ZodISODuration",(e,t)=>{dU.init(e,t),qt.init(e,t)});function g$(e){return v3(m$,e)}const y$=(e,t)=>{F1.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>n5(e,n)},flatten:{value:n=>t5(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,fv,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,fv,2)}},isEmpty:{get(){return e.issues.length===0}}})},Zr=ue("ZodError",y$,{Parent:Error}),v$=_b(Zr),b$=wb(Zr),x$=op(Zr),S$=ip(Zr),_$=o5(Zr),w$=i5(Zr),E$=a5(Zr),T$=c5(Zr),C$=l5(Zr),R$=u5(Zr),N$=f5(Zr),j$=d5(Zr),Ht=ue("ZodType",(e,t)=>(Ft.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Ch(e,"input"),output:Ch(e,"output")}}),e.toJSONSchema=$3(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(fi(t,{checks:[...t.checks??[],...n.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0}),e.with=e.check,e.clone=(n,s)=>di(e,n,s),e.brand=()=>e,e.register=((n,s)=>(n.add(e,s),e)),e.parse=(n,s)=>v$(e,n,s,{callee:e.parse}),e.safeParse=(n,s)=>x$(e,n,s),e.parseAsync=async(n,s)=>b$(e,n,s,{callee:e.parseAsync}),e.safeParseAsync=async(n,s)=>S$(e,n,s),e.spa=e.safeParseAsync,e.encode=(n,s)=>_$(e,n,s),e.decode=(n,s)=>w$(e,n,s),e.encodeAsync=async(n,s)=>E$(e,n,s),e.decodeAsync=async(n,s)=>T$(e,n,s),e.safeEncode=(n,s)=>C$(e,n,s),e.safeDecode=(n,s)=>R$(e,n,s),e.safeEncodeAsync=async(n,s)=>N$(e,n,s),e.safeDecodeAsync=async(n,s)=>j$(e,n,s),e.refine=(n,s)=>e.check(_B(n,s)),e.superRefine=n=>e.check(wB(n)),e.overwrite=n=>e.check(Qc(n)),e.optional=()=>zE(e),e.exactOptional=()=>lB(e),e.nullable=()=>LE(e),e.nullish=()=>zE(LE(e)),e.nonoptional=n=>mB(e,n),e.array=()=>Gr(e),e.or=n=>Cb([e,n]),e.and=n=>rB(e,n),e.transform=n=>UE(e,aB(n)),e.default=n=>dB(e,n),e.prefault=n=>pB(e,n),e.catch=n=>yB(e,n),e.pipe=n=>UE(e,n),e.readonly=()=>xB(e),e.describe=n=>{const s=e.clone();return cu.add(s,{description:n}),s},Object.defineProperty(e,"description",{get(){return cu.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return cu.get(e);const s=e.clone();return cu.add(s,n[0]),s},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),cN=ue("_ZodString",(e,t)=>{Eb.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(s,i,a)=>F3(e,s,i);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...s)=>e.check(T3(...s)),e.includes=(...s)=>e.check(N3(...s)),e.startsWith=(...s)=>e.check(j3(...s)),e.endsWith=(...s)=>e.check(A3(...s)),e.min=(...s)=>e.check(Th(...s)),e.max=(...s)=>e.check(nN(...s)),e.length=(...s)=>e.check(rN(...s)),e.nonempty=(...s)=>e.check(Th(1,...s)),e.lowercase=s=>e.check(C3(s)),e.uppercase=s=>e.check(R3(s)),e.trim=()=>e.check(O3()),e.normalize=(...s)=>e.check(k3(...s)),e.toLowerCase=()=>e.check(M3()),e.toUpperCase=()=>e.check(I3()),e.slugify=()=>e.check(P3())}),A$=ue("ZodString",(e,t)=>{Eb.init(e,t),cN.init(e,t),e.email=n=>e.check(ZU(k$,n)),e.url=n=>e.check(JU(O$,n)),e.jwt=n=>e.check(p3(G$,n)),e.emoji=n=>e.check(e3(M$,n)),e.guid=n=>e.check(kE(PE,n)),e.uuid=n=>e.check(YU(jd,n)),e.uuidv4=n=>e.check(XU(jd,n)),e.uuidv6=n=>e.check(QU(jd,n)),e.uuidv7=n=>e.check(WU(jd,n)),e.nanoid=n=>e.check(t3(I$,n)),e.guid=n=>e.check(kE(PE,n)),e.cuid=n=>e.check(n3(P$,n)),e.cuid2=n=>e.check(r3(D$,n)),e.ulid=n=>e.check(s3(z$,n)),e.base64=n=>e.check(f3(q$,n)),e.base64url=n=>e.check(d3(V$,n)),e.xid=n=>e.check(o3(L$,n)),e.ksuid=n=>e.check(i3(U$,n)),e.ipv4=n=>e.check(a3($$,n)),e.ipv6=n=>e.check(c3(B$,n)),e.cidrv4=n=>e.check(l3(F$,n)),e.cidrv6=n=>e.check(u3(H$,n)),e.e164=n=>e.check(h3(K$,n)),e.datetime=n=>e.check(u$(n)),e.date=n=>e.check(d$(n)),e.time=n=>e.check(p$(n)),e.duration=n=>e.check(g$(n))});function Fe(e){return GU(A$,e)}const qt=ue("ZodStringFormat",(e,t)=>{Bt.init(e,t),cN.init(e,t)}),k$=ue("ZodEmail",(e,t)=>{eU.init(e,t),qt.init(e,t)}),PE=ue("ZodGUID",(e,t)=>{W5.init(e,t),qt.init(e,t)}),jd=ue("ZodUUID",(e,t)=>{J5.init(e,t),qt.init(e,t)}),O$=ue("ZodURL",(e,t)=>{tU.init(e,t),qt.init(e,t)}),M$=ue("ZodEmoji",(e,t)=>{nU.init(e,t),qt.init(e,t)}),I$=ue("ZodNanoID",(e,t)=>{rU.init(e,t),qt.init(e,t)}),P$=ue("ZodCUID",(e,t)=>{sU.init(e,t),qt.init(e,t)}),D$=ue("ZodCUID2",(e,t)=>{oU.init(e,t),qt.init(e,t)}),z$=ue("ZodULID",(e,t)=>{iU.init(e,t),qt.init(e,t)}),L$=ue("ZodXID",(e,t)=>{aU.init(e,t),qt.init(e,t)}),U$=ue("ZodKSUID",(e,t)=>{cU.init(e,t),qt.init(e,t)}),$$=ue("ZodIPv4",(e,t)=>{hU.init(e,t),qt.init(e,t)}),B$=ue("ZodIPv6",(e,t)=>{pU.init(e,t),qt.init(e,t)}),F$=ue("ZodCIDRv4",(e,t)=>{mU.init(e,t),qt.init(e,t)}),H$=ue("ZodCIDRv6",(e,t)=>{gU.init(e,t),qt.init(e,t)}),q$=ue("ZodBase64",(e,t)=>{yU.init(e,t),qt.init(e,t)}),V$=ue("ZodBase64URL",(e,t)=>{bU.init(e,t),qt.init(e,t)}),K$=ue("ZodE164",(e,t)=>{xU.init(e,t),qt.init(e,t)}),G$=ue("ZodJWT",(e,t)=>{_U.init(e,t),qt.init(e,t)}),Tb=ue("ZodNumber",(e,t)=>{W1.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(s,i,a)=>H3(e,s,i),e.gt=(s,i)=>e.check(ME(s,i)),e.gte=(s,i)=>e.check(ey(s,i)),e.min=(s,i)=>e.check(ey(s,i)),e.lt=(s,i)=>e.check(OE(s,i)),e.lte=(s,i)=>e.check(Jg(s,i)),e.max=(s,i)=>e.check(Jg(s,i)),e.int=s=>e.check(DE(s)),e.safe=s=>e.check(DE(s)),e.positive=s=>e.check(ME(0,s)),e.nonnegative=s=>e.check(ey(0,s)),e.negative=s=>e.check(OE(0,s)),e.nonpositive=s=>e.check(Jg(0,s)),e.multipleOf=(s,i)=>e.check(IE(s,i)),e.step=(s,i)=>e.check(IE(s,i)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function tn(e){return b3(Tb,e)}const Z$=ue("ZodNumberFormat",(e,t)=>{wU.init(e,t),Tb.init(e,t)});function DE(e){return S3(Z$,e)}const Y$=ue("ZodBoolean",(e,t)=>{EU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>q3(e,n,s)});function ro(e){return _3(Y$,e)}const X$=ue("ZodUnknown",(e,t)=>{TU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>K3()});function aa(){return w3(X$)}const Q$=ue("ZodNever",(e,t)=>{CU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>V3(e,n,s)});function W$(e){return E3(Q$,e)}const J$=ue("ZodArray",(e,t)=>{RU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Q3(e,n,s,i),e.element=t.element,e.min=(n,s)=>e.check(Th(n,s)),e.nonempty=n=>e.check(Th(1,n)),e.max=(n,s)=>e.check(nN(n,s)),e.length=(n,s)=>e.check(rN(n,s)),e.unwrap=()=>e.element});function Gr(e,t){return D3(J$,e,t)}const eB=ue("ZodObject",(e,t)=>{jU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>W3(e,n,s,i),wt(e,"shape",()=>t.shape),e.keyof=()=>Zu(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:aa()}),e.loose=()=>e.clone({...e._zod.def,catchall:aa()}),e.strict=()=>e.clone({...e._zod.def,catchall:W$()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>X4(e,n),e.safeExtend=n=>Q4(e,n),e.merge=n=>W4(e,n),e.pick=n=>Z4(e,n),e.omit=n=>Y4(e,n),e.partial=(...n)=>J4(lN,e,n[0]),e.required=(...n)=>e5(uN,e,n[0])});function At(e,t){const n={type:"object",shape:e??{},...De(t)};return new eB(n)}const tB=ue("ZodUnion",(e,t)=>{AU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>J3(e,n,s,i),e.options=t.options});function Cb(e,t){return new tB({type:"union",options:e,...De(t)})}const nB=ue("ZodIntersection",(e,t)=>{kU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>e$(e,n,s,i)});function rB(e,t){return new nB({type:"intersection",left:e,right:t})}const sB=ue("ZodRecord",(e,t)=>{OU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>t$(e,n,s,i),e.keyType=t.keyType,e.valueType=t.valueType});function Gu(e,t,n){return new sB({type:"record",keyType:e,valueType:t,...De(n)})}const hv=ue("ZodEnum",(e,t)=>{MU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(s,i,a)=>G3(e,s,i),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(s,i)=>{const a={};for(const l of s)if(n.has(l))a[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new hv({...t,checks:[],...De(i),entries:a})},e.exclude=(s,i)=>{const a={...t.entries};for(const l of s)if(n.has(l))delete a[l];else throw new Error(`Key ${l} not found in enum`);return new hv({...t,checks:[],...De(i),entries:a})}});function Zu(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(s=>[s,s])):e;return new hv({type:"enum",entries:n,...De(t)})}const oB=ue("ZodLiteral",(e,t)=>{IU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Z3(e,n,s),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function si(e,t){return new oB({type:"literal",values:Array.isArray(e)?e:[e],...De(t)})}const iB=ue("ZodTransform",(e,t)=>{PU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>X3(e,n),e._zod.parse=(n,s)=>{if(s.direction==="backward")throw new D1(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(wu(a,n.value,t));else{const l=a;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(wu(l))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function aB(e){return new iB({type:"transform",transform:e})}const lN=ue("ZodOptional",(e,t)=>{tN.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>aN(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function zE(e){return new lN({type:"optional",innerType:e})}const cB=ue("ZodExactOptional",(e,t)=>{DU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>aN(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function lB(e){return new cB({type:"optional",innerType:e})}const uB=ue("ZodNullable",(e,t)=>{zU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>n$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function LE(e){return new uB({type:"nullable",innerType:e})}const fB=ue("ZodDefault",(e,t)=>{LU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>s$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function dB(e,t){return new fB({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():$1(t)}})}const hB=ue("ZodPrefault",(e,t)=>{UU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>o$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function pB(e,t){return new hB({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():$1(t)}})}const uN=ue("ZodNonOptional",(e,t)=>{$U.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>r$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function mB(e,t){return new uN({type:"nonoptional",innerType:e,...De(t)})}const gB=ue("ZodCatch",(e,t)=>{BU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>i$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function yB(e,t){return new gB({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const vB=ue("ZodPipe",(e,t)=>{FU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>a$(e,n,s,i),e.in=t.in,e.out=t.out});function UE(e,t){return new vB({type:"pipe",in:e,out:t})}const bB=ue("ZodReadonly",(e,t)=>{HU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>c$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function xB(e){return new bB({type:"readonly",innerType:e})}const SB=ue("ZodCustom",(e,t)=>{qU.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Y3(e,n)});function _B(e,t={}){return z3(SB,e,t)}function wB(e){return L3(e)}function $E(e){return x3(Tb,e)}At({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i,"Invalid blob hash format"),size:tn().int().min(0),mimeType:Fe().min(1),encrypted:ro().optional(),keyId:Fe().optional()});const fN=At({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i),size:tn().int().min(0),mimeType:Fe().min(1),createdAt:Fe(),expiresAt:Fe().optional(),uploadComplete:ro()});At({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i,"Invalid blob hash format"),size:tn().int().min(0),mimeType:Fe().min(1)});At({exists:ro(),uploadId:Fe().optional(),uploadUrl:Fe().url().optional(),uploadMethod:Zu(["PUT","POST"]).optional(),uploadHeaders:Gu(Fe(),Fe()).optional(),chunkSize:tn().int().optional()});At({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i)});At({ok:ro(),metadata:fN.optional(),error:Fe().optional()});At({hash:Fe().regex(/^sha256:[0-9a-f]{64}$/i)});At({url:Fe().url(),expiresAt:Fe(),metadata:fN});At({error:Fe(),message:Fe().optional(),code:Fe().optional()});At({limit:$E().int().min(1).max(100).default(50),offset:$E().int().min(0).default(0)});const EB="json-row-frame-v1",TB="gzip",dN=Zu(["upsert","delete"]),CB=Gu(Fe(),Fe()),hN=Gu(Fe(),Cb([Fe(),Gr(Fe())])),RB=At({table:Fe(),row_id:Fe(),op:dN,payload:Gu(Fe(),aa()).nullable(),base_version:tn().int().nullable().optional()}),NB=At({clientId:Fe().min(1),clientCommitId:Fe().min(1),operations:Gr(RB).min(1),schemaVersion:tn().int().min(1)}),jB=At({opIndex:tn().int(),status:si("applied")}),AB=At({opIndex:tn().int(),status:si("conflict"),message:Fe(),server_version:tn().int(),server_row:aa()}),kB=At({opIndex:tn().int(),status:si("error"),error:Fe(),code:Fe().optional(),retriable:ro().optional()}),OB=Cb([jB,AB,kB]),MB=At({ok:si(!0),status:Zu(["applied","cached","rejected"]),commitSeq:tn().int().optional(),results:Gr(OB)}),pN=At({asOfCommitSeq:tn().int(),tables:Gr(Fe()),tableIndex:tn().int(),rowCursor:Fe().nullable()}),IB=At({id:Fe().min(1),table:Fe().min(1),scopes:hN,params:Gu(Fe(),aa()).optional(),cursor:tn().int(),bootstrapState:pN.nullable().optional()}),PB=At({clientId:Fe().min(1),limitCommits:tn().int().min(1),limitSnapshotRows:tn().int().min(1).optional(),maxSnapshotPages:tn().int().min(1).optional(),dedupeRows:ro().optional(),subscriptions:Gr(IB)}),DB=At({table:Fe(),row_id:Fe(),op:dN,row_json:aa().nullable(),row_version:tn().int().nullable(),scopes:CB}),zB=At({commitSeq:tn().int(),createdAt:Fe(),actorId:Fe(),changes:Gr(DB)}),LB=At({id:Fe(),byteLength:tn().int(),sha256:Fe(),encoding:si(EB),compression:si(TB)}),UB=At({table:Fe(),rows:Gr(aa()),chunks:Gr(LB).optional(),isFirstPage:ro(),isLastPage:ro()}),$B=At({id:Fe(),status:Zu(["active","revoked"]),scopes:hN,bootstrap:ro(),bootstrapState:pN.nullable().optional(),nextCursor:tn().int(),commits:Gr(zB),snapshots:Gr(UB).optional()}),BB=At({ok:si(!0),subscriptions:Gr($B)});At({clientId:Fe().min(1),push:NB.omit({clientId:!0}).optional(),pull:PB.omit({clientId:!0}).optional()});At({ok:si(!0),push:MB.optional(),pull:BB.optional()});new TextEncoder;const FB={setAttribute(){},setAttributes(){},setStatus(){}};function HB(e){return e.level?e.level:e.error?"error":"info"}function ty(e,t){if(!e)return null;switch(t){case"trace":return e.trace??e.debug??e.info??null;case"debug":return e.debug??e.info??null;case"info":return e.info??null;case"warn":return e.warn??e.info??null;case"error":return e.error??e.warn??e.info??null;case"fatal":return e.fatal??e.error??e.warn??e.info??null;default:return e.info??null}}function qB(e){return{setAttribute(t,n){e.setAttribute?.(t,n)},setAttributes(t){if(e.setAttributes){e.setAttributes(t);return}for(const[n,s]of Object.entries(t))e.setAttribute?.(n,s)},setStatus(t){e.setStatus?.(t)}}}function VB(e){if(typeof e=="string")return e;if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(typeof e=="boolean")return e;if(typeof e=="bigint"){const t=Number(e);return Number.isFinite(t)?t:e.toString()}if(e instanceof Date)return e.toISOString();if(e!=null){if(Array.isArray(e)||typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)}}function BE(e){const t={};for(const[n,s]of Object.entries(e)){const i=VB(s);i!==void 0&&(t[n]=i)}return Object.keys(t).length>0?t:null}function KB(e){return{startSpan(t,n){return e.startSpan?e.startSpan(t,s=>n(qB(s))):n(FB)}}}function GB(e){return{count(t,n,s){e.metrics?.count?.(t,n??1,s)},gauge(t,n,s){e.metrics?.gauge?.(t,n,s)},distribution(t,n,s){e.metrics?.distribution?.(t,n,s)}}}function ZB(e){return{log(t){const n=HB(t),{event:s,...i}=t,a=ty(e.logger,n);if(!a)return;const l=BE(i);if(!l){a(s);return}a(s,l)},tracer:KB(e),metrics:GB(e),captureException(t,n){if(e.captureException?.(t),!n)return;const s=ty(e.logger,"error")??ty(e.logger,"info");if(!s)return;const i=BE(n);if(!i){s("sync.exception.context");return}s("sync.exception.context",i)}}}function YB(e){if(e?.attributes)return{attributes:e.attributes}}function FE(e){if(!e)return;const t=!!e.attributes,n=!!e.unit;if(!(!t&&!n))return{attributes:e.attributes,unit:e.unit}}function XB(){return ZB({logger:x2,startSpan(e,t){return OR(e,n=>t({setAttribute(s,i){n.setAttribute(s,i)},setAttributes(s){n.setAttributes(s)},setStatus(s){n.setStatus({code:s==="ok"?1:2})}}))},metrics:{count(e,t,n){const s=YB(n);if(s){nE(e,t,s);return}nE(e,t)},gauge(e,t,n){const s=FE(n);if(s){rE(e,t,s);return}rE(e,t)},distribution(e,t,n){const s=FE(n);if(s){sE(e,t,s);return}sE(e,t)}},captureException(e){zR(e)}})}function QB(){return XB()}function WB(e){const t=JB(e);return B4(t),QB()}function JB(e){const t=e.integrations;if(typeof t=="function")return e;const n=t??[];return n.some(i=>i.name==="BrowserTracing")?e:{...e,integrations:[P4(),...n]}}var ny={exports:{}},Wl={};var HE;function e6(){if(HE)return Wl;HE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(s,i,a){var l=null;if(a!==void 0&&(l=""+a),i.key!==void 0&&(l=""+i.key),"key"in i){a={};for(var f in i)f!=="key"&&(a[f]=i[f])}else a=i;return i=a.ref,{$$typeof:e,type:s,key:l,ref:i!==void 0?i:null,props:a}}return Wl.Fragment=t,Wl.jsx=n,Wl.jsxs=n,Wl}var qE;function t6(){return qE||(qE=1,ny.exports=e6()),ny.exports}var h=t6(),ry={exports:{}},Jl={},sy={exports:{}},oy={};var VE;function n6(){return VE||(VE=1,(function(e){function t(D,G){var q=D.length;D.push(G);e:for(;0<q;){var V=q-1>>>1,L=D[V];if(0<i(L,G))D[V]=G,D[q]=L,q=V;else break e}}function n(D){return D.length===0?null:D[0]}function s(D){if(D.length===0)return null;var G=D[0],q=D.pop();if(q!==G){D[0]=q;e:for(var V=0,L=D.length,I=L>>>1;V<I;){var H=2*(V+1)-1,W=D[H],Y=H+1,ae=D[Y];if(0>i(W,q))Y<L&&0>i(ae,W)?(D[V]=ae,D[Y]=q,V=Y):(D[V]=W,D[H]=q,V=H);else if(Y<L&&0>i(ae,q))D[V]=ae,D[Y]=q,V=Y;else break e}}return G}function i(D,G){var q=D.sortIndex-G.sortIndex;return q!==0?q:D.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,f=l.now();e.unstable_now=function(){return l.now()-f}}var d=[],p=[],g=1,y=null,b=3,x=!1,S=!1,w=!1,T=!1,C=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function R(D){for(var G=n(p);G!==null;){if(G.callback===null)s(p);else if(G.startTime<=D)s(p),G.sortIndex=G.expirationTime,t(d,G);else break;G=n(p)}}function M(D){if(w=!1,R(D),!S)if(n(d)!==null)S=!0,z||(z=!0,U());else{var G=n(p);G!==null&&ee(M,G.startTime-D)}}var z=!1,j=-1,A=5,P=-1;function Q(){return T?!0:!(e.unstable_now()-P<A)}function B(){if(T=!1,z){var D=e.unstable_now();P=D;var G=!0;try{e:{S=!1,w&&(w=!1,O(j),j=-1),x=!0;var q=b;try{t:{for(R(D),y=n(d);y!==null&&!(y.expirationTime>D&&Q());){var V=y.callback;if(typeof V=="function"){y.callback=null,b=y.priorityLevel;var L=V(y.expirationTime<=D);if(D=e.unstable_now(),typeof L=="function"){y.callback=L,R(D),G=!0;break t}y===n(d)&&s(d),R(D)}else s(d);y=n(d)}if(y!==null)G=!0;else{var I=n(p);I!==null&&ee(M,I.startTime-D),G=!1}}break e}finally{y=null,b=q,x=!1}G=void 0}}finally{G?U():z=!1}}}var U;if(typeof N=="function")U=function(){N(B)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,K=Z.port2;Z.port1.onmessage=B,U=function(){K.postMessage(null)}}else U=function(){C(B,0)};function ee(D,G){j=C(function(){D(e.unstable_now())},G)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(D){switch(b){case 1:case 2:case 3:var G=3;break;default:G=b}var q=b;b=G;try{return D()}finally{b=q}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(D,G){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var q=b;b=D;try{return G()}finally{b=q}},e.unstable_scheduleCallback=function(D,G,q){var V=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?V+q:V):q=V,D){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=q+L,D={id:g++,callback:G,priorityLevel:D,startTime:q,expirationTime:L,sortIndex:-1},q>V?(D.sortIndex=q,t(p,D),n(d)===null&&D===n(p)&&(w?(O(j),j=-1):w=!0,ee(M,q-V))):(D.sortIndex=L,t(d,D),S||x||(S=!0,z||(z=!0,U()))),D},e.unstable_shouldYield=Q,e.unstable_wrapCallback=function(D){var G=b;return function(){var q=b;b=G;try{return D.apply(this,arguments)}finally{b=q}}}})(oy)),oy}var KE;function r6(){return KE||(KE=1,sy.exports=n6()),sy.exports}var iy={exports:{}},Rn={};var GE;function s6(){if(GE)return Rn;GE=1;var e=Ku();function t(d){var p="https://react.dev/errors/"+d;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)p+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+d+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var s={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function a(d,p,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:y==null?null:""+y,children:d,containerInfo:p,implementation:g}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(d,p){if(d==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Rn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Rn.createPortal=function(d,p){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return a(d,p,null,g)},Rn.flushSync=function(d){var p=l.T,g=s.p;try{if(l.T=null,s.p=2,d)return d()}finally{l.T=p,s.p=g,s.d.f()}},Rn.preconnect=function(d,p){typeof d=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,s.d.C(d,p))},Rn.prefetchDNS=function(d){typeof d=="string"&&s.d.D(d)},Rn.preinit=function(d,p){if(typeof d=="string"&&p&&typeof p.as=="string"){var g=p.as,y=f(g,p.crossOrigin),b=typeof p.integrity=="string"?p.integrity:void 0,x=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;g==="style"?s.d.S(d,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:y,integrity:b,fetchPriority:x}):g==="script"&&s.d.X(d,{crossOrigin:y,integrity:b,fetchPriority:x,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Rn.preinitModule=function(d,p){if(typeof d=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var g=f(p.as,p.crossOrigin);s.d.M(d,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&s.d.M(d)},Rn.preload=function(d,p){if(typeof d=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var g=p.as,y=f(g,p.crossOrigin);s.d.L(d,g,{crossOrigin:y,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})}},Rn.preloadModule=function(d,p){if(typeof d=="string")if(p){var g=f(p.as,p.crossOrigin);s.d.m(d,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else s.d.m(d)},Rn.requestFormReset=function(d){s.d.r(d)},Rn.unstable_batchedUpdates=function(d,p){return d(p)},Rn.useFormState=function(d,p,g){return l.H.useFormState(d,p,g)},Rn.useFormStatus=function(){return l.H.useHostTransitionStatus()},Rn.version="19.2.4",Rn}var ZE;function mN(){if(ZE)return iy.exports;ZE=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),iy.exports=s6(),iy.exports}var YE;function o6(){if(YE)return Jl;YE=1;var e=r6(),t=Ku(),n=mN();function s(r){var o="https://react.dev/errors/"+r;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)o+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+r+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function a(r){var o=r,c=r;if(r.alternate)for(;o.return;)o=o.return;else{r=o;do o=r,(o.flags&4098)!==0&&(c=o.return),r=o.return;while(r)}return o.tag===3?c:null}function l(r){if(r.tag===13){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function f(r){if(r.tag===31){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function d(r){if(a(r)!==r)throw Error(s(188))}function p(r){var o=r.alternate;if(!o){if(o=a(r),o===null)throw Error(s(188));return o!==r?null:r}for(var c=r,u=o;;){var m=c.return;if(m===null)break;var v=m.alternate;if(v===null){if(u=m.return,u!==null){c=u;continue}break}if(m.child===v.child){for(v=m.child;v;){if(v===c)return d(m),r;if(v===u)return d(m),o;v=v.sibling}throw Error(s(188))}if(c.return!==u.return)c=m,u=v;else{for(var E=!1,k=m.child;k;){if(k===c){E=!0,c=m,u=v;break}if(k===u){E=!0,u=m,c=v;break}k=k.sibling}if(!E){for(k=v.child;k;){if(k===c){E=!0,c=v,u=m;break}if(k===u){E=!0,u=v,c=m;break}k=k.sibling}if(!E)throw Error(s(189))}}if(c.alternate!==u)throw Error(s(190))}if(c.tag!==3)throw Error(s(188));return c.stateNode.current===c?r:o}function g(r){var o=r.tag;if(o===5||o===26||o===27||o===6)return r;for(r=r.child;r!==null;){if(o=g(r),o!==null)return o;r=r.sibling}return null}var y=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),N=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),Q=Symbol.for("react.memo_cache_sentinel"),B=Symbol.iterator;function U(r){return r===null||typeof r!="object"?null:(r=B&&r[B]||r["@@iterator"],typeof r=="function"?r:null)}var Z=Symbol.for("react.client.reference");function K(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===Z?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case w:return"Fragment";case C:return"Profiler";case T:return"StrictMode";case M:return"Suspense";case z:return"SuspenseList";case P:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case S:return"Portal";case N:return r.displayName||"Context";case O:return(r._context.displayName||"Context")+".Consumer";case R:var o=r.render;return r=r.displayName,r||(r=o.displayName||o.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case j:return o=r.displayName||null,o!==null?o:K(r.type)||"Memo";case A:o=r._payload,r=r._init;try{return K(r(o))}catch{}}return null}var ee=Array.isArray,D=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q={pending:!1,data:null,method:null,action:null},V=[],L=-1;function I(r){return{current:r}}function H(r){0>L||(r.current=V[L],V[L]=null,L--)}function W(r,o){L++,V[L]=r.current,r.current=o}var Y=I(null),ae=I(null),se=I(null),fe=I(null);function Se(r,o){switch(W(se,o),W(ae,r),W(Y,null),o.nodeType){case 9:case 11:r=(r=o.documentElement)&&(r=r.namespaceURI)?O_(r):0;break;default:if(r=o.tagName,o=o.namespaceURI)o=O_(o),r=M_(o,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}H(Y),W(Y,r)}function pe(){H(Y),H(ae),H(se)}function Oe(r){r.memoizedState!==null&&W(fe,r);var o=Y.current,c=M_(o,r.type);o!==c&&(W(ae,r),W(Y,c))}function _e(r){ae.current===r&&(H(Y),H(ae)),fe.current===r&&(H(fe),Gl._currentValue=q)}var re,he;function ie(r){if(re===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);re=o&&o[1]||"",he=-1<c.stack.indexOf(`
|
|
60
|
-
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
61
|
-
`+re+r+he}var we=!1;function ye(r,o){if(!r||we)return"";we=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(o){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(oe){var ne=oe}Reflect.construct(r,[],de)}else{try{de.call()}catch(oe){ne=oe}r.call(de.prototype)}}else{try{throw Error()}catch(oe){ne=oe}(de=r())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(oe){if(oe&&ne&&typeof oe.stack=="string")return[oe.stack,ne.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=u.DetermineComponentFrameRoot(),E=v[0],k=v[1];if(E&&k){var $=E.split(`
|
|
62
|
-
`),te=k.split(`
|
|
63
|
-
`);for(m=u=0;u<$.length&&!$[u].includes("DetermineComponentFrameRoot");)u++;for(;m<te.length&&!te[m].includes("DetermineComponentFrameRoot");)m++;if(u===$.length||m===te.length)for(u=$.length-1,m=te.length-1;1<=u&&0<=m&&$[u]!==te[m];)m--;for(;1<=u&&0<=m;u--,m--)if($[u]!==te[m]){if(u!==1||m!==1)do if(u--,m--,0>m||$[u]!==te[m]){var ce=`
|
|
64
|
-
`+$[u].replace(" at new "," at ");return r.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",r.displayName)),ce}while(1<=u&&0<=m);break}}}finally{we=!1,Error.prepareStackTrace=c}return(c=r?r.displayName||r.name:"")?ie(c):""}function xe(r,o){switch(r.tag){case 26:case 27:case 5:return ie(r.type);case 16:return ie("Lazy");case 13:return r.child!==o&&o!==null?ie("Suspense Fallback"):ie("Suspense");case 19:return ie("SuspenseList");case 0:case 15:return ye(r.type,!1);case 11:return ye(r.type.render,!1);case 1:return ye(r.type,!0);case 31:return ie("Activity");default:return""}}function ve(r){try{var o="",c=null;do o+=xe(r,c),c=r,r=r.return;while(r);return o}catch(u){return`
|
|
65
|
-
Error generating stack: `+u.message+`
|
|
66
|
-
`+u.stack}}var Ie=Object.prototype.hasOwnProperty,Ue=e.unstable_scheduleCallback,Ee=e.unstable_cancelCallback,Ve=e.unstable_shouldYield,Qe=e.unstable_requestPaint,Be=e.unstable_now,We=e.unstable_getCurrentPriorityLevel,He=e.unstable_ImmediatePriority,me=e.unstable_UserBlockingPriority,Te=e.unstable_NormalPriority,qe=e.unstable_LowPriority,mt=e.unstable_IdlePriority,lt=e.log,wr=e.unstable_setDisableYieldValue,Er=null,Qt=null;function ut(r){if(typeof lt=="function"&&wr(r),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode(Er,r)}catch{}}var xt=Math.clz32?Math.clz32:vn,ot=Math.log,Wt=Math.LN2;function vn(r){return r>>>=0,r===0?32:31-(ot(r)/Wt|0)|0}var kt=256,Cn=262144,er=4194304;function An(r){var o=r&42;if(o!==0)return o;switch(r&-r){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 r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function as(r,o,c){var u=r.pendingLanes;if(u===0)return 0;var m=0,v=r.suspendedLanes,E=r.pingedLanes;r=r.warmLanes;var k=u&134217727;return k!==0?(u=k&~v,u!==0?m=An(u):(E&=k,E!==0?m=An(E):c||(c=k&~r,c!==0&&(m=An(c))))):(k=u&~v,k!==0?m=An(k):E!==0?m=An(E):c||(c=u&~r,c!==0&&(m=An(c)))),m===0?0:o!==0&&o!==m&&(o&v)===0&&(v=m&-m,c=o&-o,v>=c||v===32&&(c&4194048)!==0)?o:m}function cs(r,o){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&o)===0}function _a(r,o){switch(r){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 wi(){var r=er;return er<<=1,(er&62914560)===0&&(er=4194304),r}function Ei(r){for(var o=[],c=0;31>c;c++)o.push(r);return o}function ws(r,o){r.pendingLanes|=o,o!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function tr(r,o,c,u,m,v){var E=r.pendingLanes;r.pendingLanes=c,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=c,r.entangledLanes&=c,r.errorRecoveryDisabledLanes&=c,r.shellSuspendCounter=0;var k=r.entanglements,$=r.expirationTimes,te=r.hiddenUpdates;for(c=E&~c;0<c;){var ce=31-xt(c),de=1<<ce;k[ce]=0,$[ce]=-1;var ne=te[ce];if(ne!==null)for(te[ce]=null,ce=0;ce<ne.length;ce++){var oe=ne[ce];oe!==null&&(oe.lane&=-536870913)}c&=~de}u!==0&&ls(r,u,0),v!==0&&m===0&&r.tag!==0&&(r.suspendedLanes|=v&~(E&~o))}function ls(r,o,c){r.pendingLanes|=o,r.suspendedLanes&=~o;var u=31-xt(o);r.entangledLanes|=o,r.entanglements[u]=r.entanglements[u]|1073741824|c&261930}function fo(r,o){var c=r.entangledLanes|=o;for(r=r.entanglements;c;){var u=31-xt(c),m=1<<u;m&o|r[u]&o&&(r[u]|=o),c&=~m}}function ho(r,o){var c=o&-o;return c=(c&42)!==0?1:nr(c),(c&(r.suspendedLanes|o))!==0?0:c}function nr(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=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:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function al(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function af(){var r=G.p;return r!==0?r:(r=window.event,r===void 0?32:nw(r.type))}function cf(r,o){var c=G.p;try{return G.p=r,o()}finally{G.p=c}}var po=Math.random().toString(36).slice(2),Sn="__reactFiber$"+po,Un="__reactProps$"+po,wa="__reactContainer$"+po,jp="__reactEvents$"+po,bk="__reactListeners$"+po,xk="__reactHandles$"+po,bx="__reactResources$"+po,cl="__reactMarker$"+po;function Ap(r){delete r[Sn],delete r[Un],delete r[jp],delete r[bk],delete r[xk]}function Ea(r){var o=r[Sn];if(o)return o;for(var c=r.parentNode;c;){if(o=c[wa]||c[Sn]){if(c=o.alternate,o.child!==null||c!==null&&c.child!==null)for(r=$_(r);r!==null;){if(c=r[Sn])return c;r=$_(r)}return o}r=c,c=r.parentNode}return null}function Ta(r){if(r=r[Sn]||r[wa]){var o=r.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return r}return null}function ll(r){var o=r.tag;if(o===5||o===26||o===27||o===6)return r.stateNode;throw Error(s(33))}function Ca(r){var o=r[bx];return o||(o=r[bx]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function bn(r){r[cl]=!0}var xx=new Set,Sx={};function Ti(r,o){Ra(r,o),Ra(r+"Capture",o)}function Ra(r,o){for(Sx[r]=o,r=0;r<o.length;r++)xx.add(o[r])}var Sk=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]*$"),_x={},wx={};function _k(r){return Ie.call(wx,r)?!0:Ie.call(_x,r)?!1:Sk.test(r)?wx[r]=!0:(_x[r]=!0,!1)}function lf(r,o,c){if(_k(o))if(c===null)r.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":r.removeAttribute(o);return;case"boolean":var u=o.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){r.removeAttribute(o);return}}r.setAttribute(o,""+c)}}function uf(r,o,c){if(c===null)r.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(o);return}r.setAttribute(o,""+c)}}function Es(r,o,c,u){if(u===null)r.removeAttribute(c);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(c);return}r.setAttributeNS(o,c,""+u)}}function Tr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Ex(r){var o=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function wk(r,o,c){var u=Object.getOwnPropertyDescriptor(r.constructor.prototype,o);if(!r.hasOwnProperty(o)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var m=u.get,v=u.set;return Object.defineProperty(r,o,{configurable:!0,get:function(){return m.call(this)},set:function(E){c=""+E,v.call(this,E)}}),Object.defineProperty(r,o,{enumerable:u.enumerable}),{getValue:function(){return c},setValue:function(E){c=""+E},stopTracking:function(){r._valueTracker=null,delete r[o]}}}}function kp(r){if(!r._valueTracker){var o=Ex(r)?"checked":"value";r._valueTracker=wk(r,o,""+r[o])}}function Tx(r){if(!r)return!1;var o=r._valueTracker;if(!o)return!0;var c=o.getValue(),u="";return r&&(u=Ex(r)?r.checked?"true":"false":r.value),r=u,r!==c?(o.setValue(r),!0):!1}function ff(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var Ek=/[\n"\\]/g;function Cr(r){return r.replace(Ek,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Op(r,o,c,u,m,v,E,k){r.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?r.type=E:r.removeAttribute("type"),o!=null?E==="number"?(o===0&&r.value===""||r.value!=o)&&(r.value=""+Tr(o)):r.value!==""+Tr(o)&&(r.value=""+Tr(o)):E!=="submit"&&E!=="reset"||r.removeAttribute("value"),o!=null?Mp(r,E,Tr(o)):c!=null?Mp(r,E,Tr(c)):u!=null&&r.removeAttribute("value"),m==null&&v!=null&&(r.defaultChecked=!!v),m!=null&&(r.checked=m&&typeof m!="function"&&typeof m!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?r.name=""+Tr(k):r.removeAttribute("name")}function Cx(r,o,c,u,m,v,E,k){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),o!=null||c!=null){if(!(v!=="submit"&&v!=="reset"||o!=null)){kp(r);return}c=c!=null?""+Tr(c):"",o=o!=null?""+Tr(o):c,k||o===r.value||(r.value=o),r.defaultValue=o}u=u??m,u=typeof u!="function"&&typeof u!="symbol"&&!!u,r.checked=k?r.checked:!!u,r.defaultChecked=!!u,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(r.name=E),kp(r)}function Mp(r,o,c){o==="number"&&ff(r.ownerDocument)===r||r.defaultValue===""+c||(r.defaultValue=""+c)}function Na(r,o,c,u){if(r=r.options,o){o={};for(var m=0;m<c.length;m++)o["$"+c[m]]=!0;for(c=0;c<r.length;c++)m=o.hasOwnProperty("$"+r[c].value),r[c].selected!==m&&(r[c].selected=m),m&&u&&(r[c].defaultSelected=!0)}else{for(c=""+Tr(c),o=null,m=0;m<r.length;m++){if(r[m].value===c){r[m].selected=!0,u&&(r[m].defaultSelected=!0);return}o!==null||r[m].disabled||(o=r[m])}o!==null&&(o.selected=!0)}}function Rx(r,o,c){if(o!=null&&(o=""+Tr(o),o!==r.value&&(r.value=o),c==null)){r.defaultValue!==o&&(r.defaultValue=o);return}r.defaultValue=c!=null?""+Tr(c):""}function Nx(r,o,c,u){if(o==null){if(u!=null){if(c!=null)throw Error(s(92));if(ee(u)){if(1<u.length)throw Error(s(93));u=u[0]}c=u}c==null&&(c=""),o=c}c=Tr(o),r.defaultValue=c,u=r.textContent,u===c&&u!==""&&u!==null&&(r.value=u),kp(r)}function ja(r,o){if(o){var c=r.firstChild;if(c&&c===r.lastChild&&c.nodeType===3){c.nodeValue=o;return}}r.textContent=o}var Tk=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 jx(r,o,c){var u=o.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?u?r.setProperty(o,""):o==="float"?r.cssFloat="":r[o]="":u?r.setProperty(o,c):typeof c!="number"||c===0||Tk.has(o)?o==="float"?r.cssFloat=c:r[o]=(""+c).trim():r[o]=c+"px"}function Ax(r,o,c){if(o!=null&&typeof o!="object")throw Error(s(62));if(r=r.style,c!=null){for(var u in c)!c.hasOwnProperty(u)||o!=null&&o.hasOwnProperty(u)||(u.indexOf("--")===0?r.setProperty(u,""):u==="float"?r.cssFloat="":r[u]="");for(var m in o)u=o[m],o.hasOwnProperty(m)&&c[m]!==u&&jx(r,m,u)}else for(var v in o)o.hasOwnProperty(v)&&jx(r,v,o[v])}function Ip(r){if(r.indexOf("-")===-1)return!1;switch(r){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 Ck=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"]]),Rk=/^[\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 df(r){return Rk.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Ts(){}var Pp=null;function Dp(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Aa=null,ka=null;function kx(r){var o=Ta(r);if(o&&(r=o.stateNode)){var c=r[Un]||null;e:switch(r=o.stateNode,o.type){case"input":if(Op(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),o=c.name,c.type==="radio"&&o!=null){for(c=r;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Cr(""+o)+'"][type="radio"]'),o=0;o<c.length;o++){var u=c[o];if(u!==r&&u.form===r.form){var m=u[Un]||null;if(!m)throw Error(s(90));Op(u,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(o=0;o<c.length;o++)u=c[o],u.form===r.form&&Tx(u)}break e;case"textarea":Rx(r,c.value,c.defaultValue);break e;case"select":o=c.value,o!=null&&Na(r,!!c.multiple,o,!1)}}}var zp=!1;function Ox(r,o,c){if(zp)return r(o,c);zp=!0;try{var u=r(o);return u}finally{if(zp=!1,(Aa!==null||ka!==null)&&(Jf(),Aa&&(o=Aa,r=ka,ka=Aa=null,kx(o),r)))for(o=0;o<r.length;o++)kx(r[o])}}function ul(r,o){var c=r.stateNode;if(c===null)return null;var u=c[Un]||null;if(u===null)return null;c=u[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(r=r.type,u=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!u;break e;default:r=!1}if(r)return null;if(c&&typeof c!="function")throw Error(s(231,o,typeof c));return c}var Cs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Lp=!1;if(Cs)try{var fl={};Object.defineProperty(fl,"passive",{get:function(){Lp=!0}}),window.addEventListener("test",fl,fl),window.removeEventListener("test",fl,fl)}catch{Lp=!1}var mo=null,Up=null,hf=null;function Mx(){if(hf)return hf;var r,o=Up,c=o.length,u,m="value"in mo?mo.value:mo.textContent,v=m.length;for(r=0;r<c&&o[r]===m[r];r++);var E=c-r;for(u=1;u<=E&&o[c-u]===m[v-u];u++);return hf=m.slice(r,1<u?1-u:void 0)}function pf(r){var o=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&o===13&&(r=13)):r=o,r===10&&(r=13),32<=r||r===13?r:0}function mf(){return!0}function Ix(){return!1}function $n(r){function o(c,u,m,v,E){this._reactName=c,this._targetInst=m,this.type=u,this.nativeEvent=v,this.target=E,this.currentTarget=null;for(var k in r)r.hasOwnProperty(k)&&(c=r[k],this[k]=c?c(v):v[k]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?mf:Ix,this.isPropagationStopped=Ix,this}return y(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=mf)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=mf)},persist:function(){},isPersistent:mf}),o}var Ci={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gf=$n(Ci),dl=y({},Ci,{view:0,detail:0}),Nk=$n(dl),$p,Bp,hl,yf=y({},dl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hp,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==hl&&(hl&&r.type==="mousemove"?($p=r.screenX-hl.screenX,Bp=r.screenY-hl.screenY):Bp=$p=0,hl=r),$p)},movementY:function(r){return"movementY"in r?r.movementY:Bp}}),Px=$n(yf),jk=y({},yf,{dataTransfer:0}),Ak=$n(jk),kk=y({},dl,{relatedTarget:0}),Fp=$n(kk),Ok=y({},Ci,{animationName:0,elapsedTime:0,pseudoElement:0}),Mk=$n(Ok),Ik=y({},Ci,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Pk=$n(Ik),Dk=y({},Ci,{data:0}),Dx=$n(Dk),zk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Lk={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"},Uk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $k(r){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(r):(r=Uk[r])?!!o[r]:!1}function Hp(){return $k}var Bk=y({},dl,{key:function(r){if(r.key){var o=zk[r.key]||r.key;if(o!=="Unidentified")return o}return r.type==="keypress"?(r=pf(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?Lk[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hp,charCode:function(r){return r.type==="keypress"?pf(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?pf(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),Fk=$n(Bk),Hk=y({},yf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zx=$n(Hk),qk=y({},dl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hp}),Vk=$n(qk),Kk=y({},Ci,{propertyName:0,elapsedTime:0,pseudoElement:0}),Gk=$n(Kk),Zk=y({},yf,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),Yk=$n(Zk),Xk=y({},Ci,{newState:0,oldState:0}),Qk=$n(Xk),Wk=[9,13,27,32],qp=Cs&&"CompositionEvent"in window,pl=null;Cs&&"documentMode"in document&&(pl=document.documentMode);var Jk=Cs&&"TextEvent"in window&&!pl,Lx=Cs&&(!qp||pl&&8<pl&&11>=pl),Ux=" ",$x=!1;function Bx(r,o){switch(r){case"keyup":return Wk.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fx(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Oa=!1;function eO(r,o){switch(r){case"compositionend":return Fx(o);case"keypress":return o.which!==32?null:($x=!0,Ux);case"textInput":return r=o.data,r===Ux&&$x?null:r;default:return null}}function tO(r,o){if(Oa)return r==="compositionend"||!qp&&Bx(r,o)?(r=Mx(),hf=Up=mo=null,Oa=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Lx&&o.locale!=="ko"?null:o.data;default:return null}}var nO={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 Hx(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o==="input"?!!nO[r.type]:o==="textarea"}function qx(r,o,c,u){Aa?ka?ka.push(u):ka=[u]:Aa=u,o=id(o,"onChange"),0<o.length&&(c=new gf("onChange","change",null,c,u),r.push({event:c,listeners:o}))}var ml=null,gl=null;function rO(r){C_(r,0)}function vf(r){var o=ll(r);if(Tx(o))return r}function Vx(r,o){if(r==="change")return o}var Kx=!1;if(Cs){var Vp;if(Cs){var Kp="oninput"in document;if(!Kp){var Gx=document.createElement("div");Gx.setAttribute("oninput","return;"),Kp=typeof Gx.oninput=="function"}Vp=Kp}else Vp=!1;Kx=Vp&&(!document.documentMode||9<document.documentMode)}function Zx(){ml&&(ml.detachEvent("onpropertychange",Yx),gl=ml=null)}function Yx(r){if(r.propertyName==="value"&&vf(gl)){var o=[];qx(o,gl,r,Dp(r)),Ox(rO,o)}}function sO(r,o,c){r==="focusin"?(Zx(),ml=o,gl=c,ml.attachEvent("onpropertychange",Yx)):r==="focusout"&&Zx()}function oO(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return vf(gl)}function iO(r,o){if(r==="click")return vf(o)}function aO(r,o){if(r==="input"||r==="change")return vf(o)}function cO(r,o){return r===o&&(r!==0||1/r===1/o)||r!==r&&o!==o}var rr=typeof Object.is=="function"?Object.is:cO;function yl(r,o){if(rr(r,o))return!0;if(typeof r!="object"||r===null||typeof o!="object"||o===null)return!1;var c=Object.keys(r),u=Object.keys(o);if(c.length!==u.length)return!1;for(u=0;u<c.length;u++){var m=c[u];if(!Ie.call(o,m)||!rr(r[m],o[m]))return!1}return!0}function Xx(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Qx(r,o){var c=Xx(r);r=0;for(var u;c;){if(c.nodeType===3){if(u=r+c.textContent.length,r<=o&&u>=o)return{node:c,offset:o-r};r=u}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Xx(c)}}function Wx(r,o){return r&&o?r===o?!0:r&&r.nodeType===3?!1:o&&o.nodeType===3?Wx(r,o.parentNode):"contains"in r?r.contains(o):r.compareDocumentPosition?!!(r.compareDocumentPosition(o)&16):!1:!1}function Jx(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var o=ff(r.document);o instanceof r.HTMLIFrameElement;){try{var c=typeof o.contentWindow.location.href=="string"}catch{c=!1}if(c)r=o.contentWindow;else break;o=ff(r.document)}return o}function Gp(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o&&(o==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||o==="textarea"||r.contentEditable==="true")}var lO=Cs&&"documentMode"in document&&11>=document.documentMode,Ma=null,Zp=null,vl=null,Yp=!1;function e0(r,o,c){var u=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Yp||Ma==null||Ma!==ff(u)||(u=Ma,"selectionStart"in u&&Gp(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),vl&&yl(vl,u)||(vl=u,u=id(Zp,"onSelect"),0<u.length&&(o=new gf("onSelect","select",null,o,c),r.push({event:o,listeners:u}),o.target=Ma)))}function Ri(r,o){var c={};return c[r.toLowerCase()]=o.toLowerCase(),c["Webkit"+r]="webkit"+o,c["Moz"+r]="moz"+o,c}var Ia={animationend:Ri("Animation","AnimationEnd"),animationiteration:Ri("Animation","AnimationIteration"),animationstart:Ri("Animation","AnimationStart"),transitionrun:Ri("Transition","TransitionRun"),transitionstart:Ri("Transition","TransitionStart"),transitioncancel:Ri("Transition","TransitionCancel"),transitionend:Ri("Transition","TransitionEnd")},Xp={},t0={};Cs&&(t0=document.createElement("div").style,"AnimationEvent"in window||(delete Ia.animationend.animation,delete Ia.animationiteration.animation,delete Ia.animationstart.animation),"TransitionEvent"in window||delete Ia.transitionend.transition);function Ni(r){if(Xp[r])return Xp[r];if(!Ia[r])return r;var o=Ia[r],c;for(c in o)if(o.hasOwnProperty(c)&&c in t0)return Xp[r]=o[c];return r}var n0=Ni("animationend"),r0=Ni("animationiteration"),s0=Ni("animationstart"),uO=Ni("transitionrun"),fO=Ni("transitionstart"),dO=Ni("transitioncancel"),o0=Ni("transitionend"),i0=new Map,Qp="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(" ");Qp.push("scrollEnd");function Xr(r,o){i0.set(r,o),Ti(o,[r])}var bf=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Rr=[],Pa=0,Wp=0;function xf(){for(var r=Pa,o=Wp=Pa=0;o<r;){var c=Rr[o];Rr[o++]=null;var u=Rr[o];Rr[o++]=null;var m=Rr[o];Rr[o++]=null;var v=Rr[o];if(Rr[o++]=null,u!==null&&m!==null){var E=u.pending;E===null?m.next=m:(m.next=E.next,E.next=m),u.pending=m}v!==0&&a0(c,m,v)}}function Sf(r,o,c,u){Rr[Pa++]=r,Rr[Pa++]=o,Rr[Pa++]=c,Rr[Pa++]=u,Wp|=u,r.lanes|=u,r=r.alternate,r!==null&&(r.lanes|=u)}function Jp(r,o,c,u){return Sf(r,o,c,u),_f(r)}function ji(r,o){return Sf(r,null,null,o),_f(r)}function a0(r,o,c){r.lanes|=c;var u=r.alternate;u!==null&&(u.lanes|=c);for(var m=!1,v=r.return;v!==null;)v.childLanes|=c,u=v.alternate,u!==null&&(u.childLanes|=c),v.tag===22&&(r=v.stateNode,r===null||r._visibility&1||(m=!0)),r=v,v=v.return;return r.tag===3?(v=r.stateNode,m&&o!==null&&(m=31-xt(c),r=v.hiddenUpdates,u=r[m],u===null?r[m]=[o]:u.push(o),o.lane=c|536870912),v):null}function _f(r){if(50<$l)throw $l=0,cg=null,Error(s(185));for(var o=r.return;o!==null;)r=o,o=r.return;return r.tag===3?r.stateNode:null}var Da={};function hO(r,o,c,u){this.tag=r,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sr(r,o,c,u){return new hO(r,o,c,u)}function em(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Rs(r,o){var c=r.alternate;return c===null?(c=sr(r.tag,o,r.key,r.mode),c.elementType=r.elementType,c.type=r.type,c.stateNode=r.stateNode,c.alternate=r,r.alternate=c):(c.pendingProps=o,c.type=r.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=r.flags&65011712,c.childLanes=r.childLanes,c.lanes=r.lanes,c.child=r.child,c.memoizedProps=r.memoizedProps,c.memoizedState=r.memoizedState,c.updateQueue=r.updateQueue,o=r.dependencies,c.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},c.sibling=r.sibling,c.index=r.index,c.ref=r.ref,c.refCleanup=r.refCleanup,c}function c0(r,o){r.flags&=65011714;var c=r.alternate;return c===null?(r.childLanes=0,r.lanes=o,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=c.childLanes,r.lanes=c.lanes,r.child=c.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=c.memoizedProps,r.memoizedState=c.memoizedState,r.updateQueue=c.updateQueue,r.type=c.type,o=c.dependencies,r.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),r}function wf(r,o,c,u,m,v){var E=0;if(u=r,typeof r=="function")em(r)&&(E=1);else if(typeof r=="string")E=vM(r,c,Y.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case P:return r=sr(31,c,o,m),r.elementType=P,r.lanes=v,r;case w:return Ai(c.children,m,v,o);case T:E=8,m|=24;break;case C:return r=sr(12,c,o,m|2),r.elementType=C,r.lanes=v,r;case M:return r=sr(13,c,o,m),r.elementType=M,r.lanes=v,r;case z:return r=sr(19,c,o,m),r.elementType=z,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case N:E=10;break e;case O:E=9;break e;case R:E=11;break e;case j:E=14;break e;case A:E=16,u=null;break e}E=29,c=Error(s(130,r===null?"null":typeof r,"")),u=null}return o=sr(E,c,o,m),o.elementType=r,o.type=u,o.lanes=v,o}function Ai(r,o,c,u){return r=sr(7,r,u,o),r.lanes=c,r}function tm(r,o,c){return r=sr(6,r,null,o),r.lanes=c,r}function l0(r){var o=sr(18,null,null,0);return o.stateNode=r,o}function nm(r,o,c){return o=sr(4,r.children!==null?r.children:[],r.key,o),o.lanes=c,o.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},o}var u0=new WeakMap;function Nr(r,o){if(typeof r=="object"&&r!==null){var c=u0.get(r);return c!==void 0?c:(o={value:r,source:o,stack:ve(o)},u0.set(r,o),o)}return{value:r,source:o,stack:ve(o)}}var za=[],La=0,Ef=null,bl=0,jr=[],Ar=0,go=null,us=1,fs="";function Ns(r,o){za[La++]=bl,za[La++]=Ef,Ef=r,bl=o}function f0(r,o,c){jr[Ar++]=us,jr[Ar++]=fs,jr[Ar++]=go,go=r;var u=us;r=fs;var m=32-xt(u)-1;u&=~(1<<m),c+=1;var v=32-xt(o)+m;if(30<v){var E=m-m%5;v=(u&(1<<E)-1).toString(32),u>>=E,m-=E,us=1<<32-xt(o)+m|c<<m|u,fs=v+r}else us=1<<v|c<<m|u,fs=r}function rm(r){r.return!==null&&(Ns(r,1),f0(r,1,0))}function sm(r){for(;r===Ef;)Ef=za[--La],za[La]=null,bl=za[--La],za[La]=null;for(;r===go;)go=jr[--Ar],jr[Ar]=null,fs=jr[--Ar],jr[Ar]=null,us=jr[--Ar],jr[Ar]=null}function d0(r,o){jr[Ar++]=us,jr[Ar++]=fs,jr[Ar++]=go,us=o.id,fs=o.overflow,go=r}var _n=null,Mt=null,rt=!1,yo=null,kr=!1,om=Error(s(519));function vo(r){var o=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw xl(Nr(o,r)),om}function h0(r){var o=r.stateNode,c=r.type,u=r.memoizedProps;switch(o[Sn]=r,o[Un]=u,c){case"dialog":et("cancel",o),et("close",o);break;case"iframe":case"object":case"embed":et("load",o);break;case"video":case"audio":for(c=0;c<Fl.length;c++)et(Fl[c],o);break;case"source":et("error",o);break;case"img":case"image":case"link":et("error",o),et("load",o);break;case"details":et("toggle",o);break;case"input":et("invalid",o),Cx(o,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":et("invalid",o);break;case"textarea":et("invalid",o),Nx(o,u.value,u.defaultValue,u.children)}c=u.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||o.textContent===""+c||u.suppressHydrationWarning===!0||A_(o.textContent,c)?(u.popover!=null&&(et("beforetoggle",o),et("toggle",o)),u.onScroll!=null&&et("scroll",o),u.onScrollEnd!=null&&et("scrollend",o),u.onClick!=null&&(o.onclick=Ts),o=!0):o=!1,o||vo(r,!0)}function p0(r){for(_n=r.return;_n;)switch(_n.tag){case 5:case 31:case 13:kr=!1;return;case 27:case 3:kr=!0;return;default:_n=_n.return}}function Ua(r){if(r!==_n)return!1;if(!rt)return p0(r),rt=!0,!1;var o=r.tag,c;if((c=o!==3&&o!==27)&&((c=o===5)&&(c=r.type,c=!(c!=="form"&&c!=="button")||wg(r.type,r.memoizedProps)),c=!c),c&&Mt&&vo(r),p0(r),o===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));Mt=U_(r)}else if(o===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));Mt=U_(r)}else o===27?(o=Mt,Oo(r.type)?(r=Ng,Ng=null,Mt=r):Mt=o):Mt=_n?Mr(r.stateNode.nextSibling):null;return!0}function ki(){Mt=_n=null,rt=!1}function im(){var r=yo;return r!==null&&(qn===null?qn=r:qn.push.apply(qn,r),yo=null),r}function xl(r){yo===null?yo=[r]:yo.push(r)}var am=I(null),Oi=null,js=null;function bo(r,o,c){W(am,o._currentValue),o._currentValue=c}function As(r){r._currentValue=am.current,H(am)}function cm(r,o,c){for(;r!==null;){var u=r.alternate;if((r.childLanes&o)!==o?(r.childLanes|=o,u!==null&&(u.childLanes|=o)):u!==null&&(u.childLanes&o)!==o&&(u.childLanes|=o),r===c)break;r=r.return}}function lm(r,o,c,u){var m=r.child;for(m!==null&&(m.return=r);m!==null;){var v=m.dependencies;if(v!==null){var E=m.child;v=v.firstContext;e:for(;v!==null;){var k=v;v=m;for(var $=0;$<o.length;$++)if(k.context===o[$]){v.lanes|=c,k=v.alternate,k!==null&&(k.lanes|=c),cm(v.return,c,r),u||(E=null);break e}v=k.next}}else if(m.tag===18){if(E=m.return,E===null)throw Error(s(341));E.lanes|=c,v=E.alternate,v!==null&&(v.lanes|=c),cm(E,c,r),E=null}else E=m.child;if(E!==null)E.return=m;else for(E=m;E!==null;){if(E===r){E=null;break}if(m=E.sibling,m!==null){m.return=E.return,E=m;break}E=E.return}m=E}}function $a(r,o,c,u){r=null;for(var m=o,v=!1;m!==null;){if(!v){if((m.flags&524288)!==0)v=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var E=m.alternate;if(E===null)throw Error(s(387));if(E=E.memoizedProps,E!==null){var k=m.type;rr(m.pendingProps.value,E.value)||(r!==null?r.push(k):r=[k])}}else if(m===fe.current){if(E=m.alternate,E===null)throw Error(s(387));E.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(r!==null?r.push(Gl):r=[Gl])}m=m.return}r!==null&&lm(o,r,c,u),o.flags|=262144}function Tf(r){for(r=r.firstContext;r!==null;){if(!rr(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Mi(r){Oi=r,js=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function wn(r){return m0(Oi,r)}function Cf(r,o){return Oi===null&&Mi(r),m0(r,o)}function m0(r,o){var c=o._currentValue;if(o={context:o,memoizedValue:c,next:null},js===null){if(r===null)throw Error(s(308));js=o,r.dependencies={lanes:0,firstContext:o},r.flags|=524288}else js=js.next=o;return c}var pO=typeof AbortController<"u"?AbortController:function(){var r=[],o=this.signal={aborted:!1,addEventListener:function(c,u){r.push(u)}};this.abort=function(){o.aborted=!0,r.forEach(function(c){return c()})}},mO=e.unstable_scheduleCallback,gO=e.unstable_NormalPriority,nn={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function um(){return{controller:new pO,data:new Map,refCount:0}}function Sl(r){r.refCount--,r.refCount===0&&mO(gO,function(){r.controller.abort()})}var _l=null,fm=0,Ba=0,Fa=null;function yO(r,o){if(_l===null){var c=_l=[];fm=0,Ba=pg(),Fa={status:"pending",value:void 0,then:function(u){c.push(u)}}}return fm++,o.then(g0,g0),o}function g0(){if(--fm===0&&_l!==null){Fa!==null&&(Fa.status="fulfilled");var r=_l;_l=null,Ba=0,Fa=null;for(var o=0;o<r.length;o++)(0,r[o])()}}function vO(r,o){var c=[],u={status:"pending",value:null,reason:null,then:function(m){c.push(m)}};return r.then(function(){u.status="fulfilled",u.value=o;for(var m=0;m<c.length;m++)(0,c[m])(o)},function(m){for(u.status="rejected",u.reason=m,m=0;m<c.length;m++)(0,c[m])(void 0)}),u}var y0=D.S;D.S=function(r,o){e_=Be(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&yO(r,o),y0!==null&&y0(r,o)};var Ii=I(null);function dm(){var r=Ii.current;return r!==null?r:Nt.pooledCache}function Rf(r,o){o===null?W(Ii,Ii.current):W(Ii,o.pool)}function v0(){var r=dm();return r===null?null:{parent:nn._currentValue,pool:r}}var Ha=Error(s(460)),hm=Error(s(474)),Nf=Error(s(542)),jf={then:function(){}};function b0(r){return r=r.status,r==="fulfilled"||r==="rejected"}function x0(r,o,c){switch(c=r[c],c===void 0?r.push(o):c!==o&&(o.then(Ts,Ts),o=c),o.status){case"fulfilled":return o.value;case"rejected":throw r=o.reason,_0(r),r;default:if(typeof o.status=="string")o.then(Ts,Ts);else{if(r=Nt,r!==null&&100<r.shellSuspendCounter)throw Error(s(482));r=o,r.status="pending",r.then(function(u){if(o.status==="pending"){var m=o;m.status="fulfilled",m.value=u}},function(u){if(o.status==="pending"){var m=o;m.status="rejected",m.reason=u}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw r=o.reason,_0(r),r}throw Di=o,Ha}}function Pi(r){try{var o=r._init;return o(r._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Di=c,Ha):c}}var Di=null;function S0(){if(Di===null)throw Error(s(459));var r=Di;return Di=null,r}function _0(r){if(r===Ha||r===Nf)throw Error(s(483))}var qa=null,wl=0;function Af(r){var o=wl;return wl+=1,qa===null&&(qa=[]),x0(qa,r,o)}function El(r,o){o=o.props.ref,r.ref=o!==void 0?o:null}function kf(r,o){throw o.$$typeof===b?Error(s(525)):(r=Object.prototype.toString.call(o),Error(s(31,r==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":r)))}function w0(r){function o(X,F){if(r){var J=X.deletions;J===null?(X.deletions=[F],X.flags|=16):J.push(F)}}function c(X,F){if(!r)return null;for(;F!==null;)o(X,F),F=F.sibling;return null}function u(X){for(var F=new Map;X!==null;)X.key!==null?F.set(X.key,X):F.set(X.index,X),X=X.sibling;return F}function m(X,F){return X=Rs(X,F),X.index=0,X.sibling=null,X}function v(X,F,J){return X.index=J,r?(J=X.alternate,J!==null?(J=J.index,J<F?(X.flags|=67108866,F):J):(X.flags|=67108866,F)):(X.flags|=1048576,F)}function E(X){return r&&X.alternate===null&&(X.flags|=67108866),X}function k(X,F,J,le){return F===null||F.tag!==6?(F=tm(J,X.mode,le),F.return=X,F):(F=m(F,J),F.return=X,F)}function $(X,F,J,le){var ze=J.type;return ze===w?ce(X,F,J.props.children,le,J.key):F!==null&&(F.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===A&&Pi(ze)===F.type)?(F=m(F,J.props),El(F,J),F.return=X,F):(F=wf(J.type,J.key,J.props,null,X.mode,le),El(F,J),F.return=X,F)}function te(X,F,J,le){return F===null||F.tag!==4||F.stateNode.containerInfo!==J.containerInfo||F.stateNode.implementation!==J.implementation?(F=nm(J,X.mode,le),F.return=X,F):(F=m(F,J.children||[]),F.return=X,F)}function ce(X,F,J,le,ze){return F===null||F.tag!==7?(F=Ai(J,X.mode,le,ze),F.return=X,F):(F=m(F,J),F.return=X,F)}function de(X,F,J){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=tm(""+F,X.mode,J),F.return=X,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case x:return J=wf(F.type,F.key,F.props,null,X.mode,J),El(J,F),J.return=X,J;case S:return F=nm(F,X.mode,J),F.return=X,F;case A:return F=Pi(F),de(X,F,J)}if(ee(F)||U(F))return F=Ai(F,X.mode,J,null),F.return=X,F;if(typeof F.then=="function")return de(X,Af(F),J);if(F.$$typeof===N)return de(X,Cf(X,F),J);kf(X,F)}return null}function ne(X,F,J,le){var ze=F!==null?F.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return ze!==null?null:k(X,F,""+J,le);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case x:return J.key===ze?$(X,F,J,le):null;case S:return J.key===ze?te(X,F,J,le):null;case A:return J=Pi(J),ne(X,F,J,le)}if(ee(J)||U(J))return ze!==null?null:ce(X,F,J,le,null);if(typeof J.then=="function")return ne(X,F,Af(J),le);if(J.$$typeof===N)return ne(X,F,Cf(X,J),le);kf(X,J)}return null}function oe(X,F,J,le,ze){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return X=X.get(J)||null,k(F,X,""+le,ze);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case x:return X=X.get(le.key===null?J:le.key)||null,$(F,X,le,ze);case S:return X=X.get(le.key===null?J:le.key)||null,te(F,X,le,ze);case A:return le=Pi(le),oe(X,F,J,le,ze)}if(ee(le)||U(le))return X=X.get(J)||null,ce(F,X,le,ze,null);if(typeof le.then=="function")return oe(X,F,J,Af(le),ze);if(le.$$typeof===N)return oe(X,F,J,Cf(F,le),ze);kf(F,le)}return null}function Re(X,F,J,le){for(var ze=null,ft=null,ke=F,Ye=F=0,nt=null;ke!==null&&Ye<J.length;Ye++){ke.index>Ye?(nt=ke,ke=null):nt=ke.sibling;var dt=ne(X,ke,J[Ye],le);if(dt===null){ke===null&&(ke=nt);break}r&&ke&&dt.alternate===null&&o(X,ke),F=v(dt,F,Ye),ft===null?ze=dt:ft.sibling=dt,ft=dt,ke=nt}if(Ye===J.length)return c(X,ke),rt&&Ns(X,Ye),ze;if(ke===null){for(;Ye<J.length;Ye++)ke=de(X,J[Ye],le),ke!==null&&(F=v(ke,F,Ye),ft===null?ze=ke:ft.sibling=ke,ft=ke);return rt&&Ns(X,Ye),ze}for(ke=u(ke);Ye<J.length;Ye++)nt=oe(ke,X,Ye,J[Ye],le),nt!==null&&(r&&nt.alternate!==null&&ke.delete(nt.key===null?Ye:nt.key),F=v(nt,F,Ye),ft===null?ze=nt:ft.sibling=nt,ft=nt);return r&&ke.forEach(function(zo){return o(X,zo)}),rt&&Ns(X,Ye),ze}function $e(X,F,J,le){if(J==null)throw Error(s(151));for(var ze=null,ft=null,ke=F,Ye=F=0,nt=null,dt=J.next();ke!==null&&!dt.done;Ye++,dt=J.next()){ke.index>Ye?(nt=ke,ke=null):nt=ke.sibling;var zo=ne(X,ke,dt.value,le);if(zo===null){ke===null&&(ke=nt);break}r&&ke&&zo.alternate===null&&o(X,ke),F=v(zo,F,Ye),ft===null?ze=zo:ft.sibling=zo,ft=zo,ke=nt}if(dt.done)return c(X,ke),rt&&Ns(X,Ye),ze;if(ke===null){for(;!dt.done;Ye++,dt=J.next())dt=de(X,dt.value,le),dt!==null&&(F=v(dt,F,Ye),ft===null?ze=dt:ft.sibling=dt,ft=dt);return rt&&Ns(X,Ye),ze}for(ke=u(ke);!dt.done;Ye++,dt=J.next())dt=oe(ke,X,Ye,dt.value,le),dt!==null&&(r&&dt.alternate!==null&&ke.delete(dt.key===null?Ye:dt.key),F=v(dt,F,Ye),ft===null?ze=dt:ft.sibling=dt,ft=dt);return r&&ke.forEach(function(jM){return o(X,jM)}),rt&&Ns(X,Ye),ze}function Ct(X,F,J,le){if(typeof J=="object"&&J!==null&&J.type===w&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case x:e:{for(var ze=J.key;F!==null;){if(F.key===ze){if(ze=J.type,ze===w){if(F.tag===7){c(X,F.sibling),le=m(F,J.props.children),le.return=X,X=le;break e}}else if(F.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===A&&Pi(ze)===F.type){c(X,F.sibling),le=m(F,J.props),El(le,J),le.return=X,X=le;break e}c(X,F);break}else o(X,F);F=F.sibling}J.type===w?(le=Ai(J.props.children,X.mode,le,J.key),le.return=X,X=le):(le=wf(J.type,J.key,J.props,null,X.mode,le),El(le,J),le.return=X,X=le)}return E(X);case S:e:{for(ze=J.key;F!==null;){if(F.key===ze)if(F.tag===4&&F.stateNode.containerInfo===J.containerInfo&&F.stateNode.implementation===J.implementation){c(X,F.sibling),le=m(F,J.children||[]),le.return=X,X=le;break e}else{c(X,F);break}else o(X,F);F=F.sibling}le=nm(J,X.mode,le),le.return=X,X=le}return E(X);case A:return J=Pi(J),Ct(X,F,J,le)}if(ee(J))return Re(X,F,J,le);if(U(J)){if(ze=U(J),typeof ze!="function")throw Error(s(150));return J=ze.call(J),$e(X,F,J,le)}if(typeof J.then=="function")return Ct(X,F,Af(J),le);if(J.$$typeof===N)return Ct(X,F,Cf(X,J),le);kf(X,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,F!==null&&F.tag===6?(c(X,F.sibling),le=m(F,J),le.return=X,X=le):(c(X,F),le=tm(J,X.mode,le),le.return=X,X=le),E(X)):c(X,F)}return function(X,F,J,le){try{wl=0;var ze=Ct(X,F,J,le);return qa=null,ze}catch(ke){if(ke===Ha||ke===Nf)throw ke;var ft=sr(29,ke,null,X.mode);return ft.lanes=le,ft.return=X,ft}}}var zi=w0(!0),E0=w0(!1),xo=!1;function pm(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mm(r,o){r=r.updateQueue,o.updateQueue===r&&(o.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function So(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function _o(r,o,c){var u=r.updateQueue;if(u===null)return null;if(u=u.shared,(gt&2)!==0){var m=u.pending;return m===null?o.next=o:(o.next=m.next,m.next=o),u.pending=o,o=_f(r),a0(r,null,c),o}return Sf(r,u,o,c),_f(r)}function Tl(r,o,c){if(o=o.updateQueue,o!==null&&(o=o.shared,(c&4194048)!==0)){var u=o.lanes;u&=r.pendingLanes,c|=u,o.lanes=c,fo(r,c)}}function gm(r,o){var c=r.updateQueue,u=r.alternate;if(u!==null&&(u=u.updateQueue,c===u)){var m=null,v=null;if(c=c.firstBaseUpdate,c!==null){do{var E={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};v===null?m=v=E:v=v.next=E,c=c.next}while(c!==null);v===null?m=v=o:v=v.next=o}else m=v=o;c={baseState:u.baseState,firstBaseUpdate:m,lastBaseUpdate:v,shared:u.shared,callbacks:u.callbacks},r.updateQueue=c;return}r=c.lastBaseUpdate,r===null?c.firstBaseUpdate=o:r.next=o,c.lastBaseUpdate=o}var ym=!1;function Cl(){if(ym){var r=Fa;if(r!==null)throw r}}function Rl(r,o,c,u){ym=!1;var m=r.updateQueue;xo=!1;var v=m.firstBaseUpdate,E=m.lastBaseUpdate,k=m.shared.pending;if(k!==null){m.shared.pending=null;var $=k,te=$.next;$.next=null,E===null?v=te:E.next=te,E=$;var ce=r.alternate;ce!==null&&(ce=ce.updateQueue,k=ce.lastBaseUpdate,k!==E&&(k===null?ce.firstBaseUpdate=te:k.next=te,ce.lastBaseUpdate=$))}if(v!==null){var de=m.baseState;E=0,ce=te=$=null,k=v;do{var ne=k.lane&-536870913,oe=ne!==k.lane;if(oe?(tt&ne)===ne:(u&ne)===ne){ne!==0&&ne===Ba&&(ym=!0),ce!==null&&(ce=ce.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var Re=r,$e=k;ne=o;var Ct=c;switch($e.tag){case 1:if(Re=$e.payload,typeof Re=="function"){de=Re.call(Ct,de,ne);break e}de=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=$e.payload,ne=typeof Re=="function"?Re.call(Ct,de,ne):Re,ne==null)break e;de=y({},de,ne);break e;case 2:xo=!0}}ne=k.callback,ne!==null&&(r.flags|=64,oe&&(r.flags|=8192),oe=m.callbacks,oe===null?m.callbacks=[ne]:oe.push(ne))}else oe={lane:ne,tag:k.tag,payload:k.payload,callback:k.callback,next:null},ce===null?(te=ce=oe,$=de):ce=ce.next=oe,E|=ne;if(k=k.next,k===null){if(k=m.shared.pending,k===null)break;oe=k,k=oe.next,oe.next=null,m.lastBaseUpdate=oe,m.shared.pending=null}}while(!0);ce===null&&($=de),m.baseState=$,m.firstBaseUpdate=te,m.lastBaseUpdate=ce,v===null&&(m.shared.lanes=0),Ro|=E,r.lanes=E,r.memoizedState=de}}function T0(r,o){if(typeof r!="function")throw Error(s(191,r));r.call(o)}function C0(r,o){var c=r.callbacks;if(c!==null)for(r.callbacks=null,r=0;r<c.length;r++)T0(c[r],o)}var Va=I(null),Of=I(0);function R0(r,o){r=Us,W(Of,r),W(Va,o),Us=r|o.baseLanes}function vm(){W(Of,Us),W(Va,Va.current)}function bm(){Us=Of.current,H(Va),H(Of)}var or=I(null),Or=null;function wo(r){var o=r.alternate;W(Jt,Jt.current&1),W(or,r),Or===null&&(o===null||Va.current!==null||o.memoizedState!==null)&&(Or=r)}function xm(r){W(Jt,Jt.current),W(or,r),Or===null&&(Or=r)}function N0(r){r.tag===22?(W(Jt,Jt.current),W(or,r),Or===null&&(Or=r)):Eo()}function Eo(){W(Jt,Jt.current),W(or,or.current)}function ir(r){H(or),Or===r&&(Or=null),H(Jt)}var Jt=I(0);function Mf(r){for(var o=r;o!==null;){if(o.tag===13){var c=o.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Cg(c)||Rg(c)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var ks=0,Ze=null,Et=null,rn=null,If=!1,Ka=!1,Li=!1,Pf=0,Nl=0,Ga=null,bO=0;function Kt(){throw Error(s(321))}function Sm(r,o){if(o===null)return!1;for(var c=0;c<o.length&&c<r.length;c++)if(!rr(r[c],o[c]))return!1;return!0}function _m(r,o,c,u,m,v){return ks=v,Ze=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,D.H=r===null||r.memoizedState===null?fS:zm,Li=!1,v=c(u,m),Li=!1,Ka&&(v=A0(o,c,u,m)),j0(r),v}function j0(r){D.H=kl;var o=Et!==null&&Et.next!==null;if(ks=0,rn=Et=Ze=null,If=!1,Nl=0,Ga=null,o)throw Error(s(300));r===null||sn||(r=r.dependencies,r!==null&&Tf(r)&&(sn=!0))}function A0(r,o,c,u){Ze=r;var m=0;do{if(Ka&&(Ga=null),Nl=0,Ka=!1,25<=m)throw Error(s(301));if(m+=1,rn=Et=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}D.H=dS,v=o(c,u)}while(Ka);return v}function xO(){var r=D.H,o=r.useState()[0];return o=typeof o.then=="function"?jl(o):o,r=r.useState()[0],(Et!==null?Et.memoizedState:null)!==r&&(Ze.flags|=1024),o}function wm(){var r=Pf!==0;return Pf=0,r}function Em(r,o,c){o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~c}function Tm(r){if(If){for(r=r.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}If=!1}ks=0,rn=Et=Ze=null,Ka=!1,Nl=Pf=0,Ga=null}function kn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rn===null?Ze.memoizedState=rn=r:rn=rn.next=r,rn}function en(){if(Et===null){var r=Ze.alternate;r=r!==null?r.memoizedState:null}else r=Et.next;var o=rn===null?Ze.memoizedState:rn.next;if(o!==null)rn=o,Et=r;else{if(r===null)throw Ze.alternate===null?Error(s(467)):Error(s(310));Et=r,r={memoizedState:Et.memoizedState,baseState:Et.baseState,baseQueue:Et.baseQueue,queue:Et.queue,next:null},rn===null?Ze.memoizedState=rn=r:rn=rn.next=r}return rn}function Df(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function jl(r){var o=Nl;return Nl+=1,Ga===null&&(Ga=[]),r=x0(Ga,r,o),o=Ze,(rn===null?o.memoizedState:rn.next)===null&&(o=o.alternate,D.H=o===null||o.memoizedState===null?fS:zm),r}function zf(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return jl(r);if(r.$$typeof===N)return wn(r)}throw Error(s(438,String(r)))}function Cm(r){var o=null,c=Ze.updateQueue;if(c!==null&&(o=c.memoCache),o==null){var u=Ze.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(o={data:u.data.map(function(m){return m.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),c===null&&(c=Df(),Ze.updateQueue=c),c.memoCache=o,c=o.data[o.index],c===void 0)for(c=o.data[o.index]=Array(r),u=0;u<r;u++)c[u]=Q;return o.index++,c}function Os(r,o){return typeof o=="function"?o(r):o}function Lf(r){var o=en();return Rm(o,Et,r)}function Rm(r,o,c){var u=r.queue;if(u===null)throw Error(s(311));u.lastRenderedReducer=c;var m=r.baseQueue,v=u.pending;if(v!==null){if(m!==null){var E=m.next;m.next=v.next,v.next=E}o.baseQueue=m=v,u.pending=null}if(v=r.baseState,m===null)r.memoizedState=v;else{o=m.next;var k=E=null,$=null,te=o,ce=!1;do{var de=te.lane&-536870913;if(de!==te.lane?(tt&de)===de:(ks&de)===de){var ne=te.revertLane;if(ne===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),de===Ba&&(ce=!0);else if((ks&ne)===ne){te=te.next,ne===Ba&&(ce=!0);continue}else de={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},$===null?(k=$=de,E=v):$=$.next=de,Ze.lanes|=ne,Ro|=ne;de=te.action,Li&&c(v,de),v=te.hasEagerState?te.eagerState:c(v,de)}else ne={lane:de,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},$===null?(k=$=ne,E=v):$=$.next=ne,Ze.lanes|=de,Ro|=de;te=te.next}while(te!==null&&te!==o);if($===null?E=v:$.next=k,!rr(v,r.memoizedState)&&(sn=!0,ce&&(c=Fa,c!==null)))throw c;r.memoizedState=v,r.baseState=E,r.baseQueue=$,u.lastRenderedState=v}return m===null&&(u.lanes=0),[r.memoizedState,u.dispatch]}function Nm(r){var o=en(),c=o.queue;if(c===null)throw Error(s(311));c.lastRenderedReducer=r;var u=c.dispatch,m=c.pending,v=o.memoizedState;if(m!==null){c.pending=null;var E=m=m.next;do v=r(v,E.action),E=E.next;while(E!==m);rr(v,o.memoizedState)||(sn=!0),o.memoizedState=v,o.baseQueue===null&&(o.baseState=v),c.lastRenderedState=v}return[v,u]}function k0(r,o,c){var u=Ze,m=en(),v=rt;if(v){if(c===void 0)throw Error(s(407));c=c()}else c=o();var E=!rr((Et||m).memoizedState,c);if(E&&(m.memoizedState=c,sn=!0),m=m.queue,km(I0.bind(null,u,m,r),[r]),m.getSnapshot!==o||E||rn!==null&&rn.memoizedState.tag&1){if(u.flags|=2048,Za(9,{destroy:void 0},M0.bind(null,u,m,c,o),null),Nt===null)throw Error(s(349));v||(ks&127)!==0||O0(u,o,c)}return c}function O0(r,o,c){r.flags|=16384,r={getSnapshot:o,value:c},o=Ze.updateQueue,o===null?(o=Df(),Ze.updateQueue=o,o.stores=[r]):(c=o.stores,c===null?o.stores=[r]:c.push(r))}function M0(r,o,c,u){o.value=c,o.getSnapshot=u,P0(o)&&D0(r)}function I0(r,o,c){return c(function(){P0(o)&&D0(r)})}function P0(r){var o=r.getSnapshot;r=r.value;try{var c=o();return!rr(r,c)}catch{return!0}}function D0(r){var o=ji(r,2);o!==null&&Vn(o,r,2)}function jm(r){var o=kn();if(typeof r=="function"){var c=r;if(r=c(),Li){ut(!0);try{c()}finally{ut(!1)}}}return o.memoizedState=o.baseState=r,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:r},o}function z0(r,o,c,u){return r.baseState=c,Rm(r,Et,typeof u=="function"?u:Os)}function SO(r,o,c,u,m){if(Bf(r))throw Error(s(485));if(r=o.action,r!==null){var v={payload:m,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){v.listeners.push(E)}};D.T!==null?c(!0):v.isTransition=!1,u(v),c=o.pending,c===null?(v.next=o.pending=v,L0(o,v)):(v.next=c.next,o.pending=c.next=v)}}function L0(r,o){var c=o.action,u=o.payload,m=r.state;if(o.isTransition){var v=D.T,E={};D.T=E;try{var k=c(m,u),$=D.S;$!==null&&$(E,k),U0(r,o,k)}catch(te){Am(r,o,te)}finally{v!==null&&E.types!==null&&(v.types=E.types),D.T=v}}else try{v=c(m,u),U0(r,o,v)}catch(te){Am(r,o,te)}}function U0(r,o,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(u){$0(r,o,u)},function(u){return Am(r,o,u)}):$0(r,o,c)}function $0(r,o,c){o.status="fulfilled",o.value=c,B0(o),r.state=c,o=r.pending,o!==null&&(c=o.next,c===o?r.pending=null:(c=c.next,o.next=c,L0(r,c)))}function Am(r,o,c){var u=r.pending;if(r.pending=null,u!==null){u=u.next;do o.status="rejected",o.reason=c,B0(o),o=o.next;while(o!==u)}r.action=null}function B0(r){r=r.listeners;for(var o=0;o<r.length;o++)(0,r[o])()}function F0(r,o){return o}function H0(r,o){if(rt){var c=Nt.formState;if(c!==null){e:{var u=Ze;if(rt){if(Mt){t:{for(var m=Mt,v=kr;m.nodeType!==8;){if(!v){m=null;break t}if(m=Mr(m.nextSibling),m===null){m=null;break t}}v=m.data,m=v==="F!"||v==="F"?m:null}if(m){Mt=Mr(m.nextSibling),u=m.data==="F!";break e}}vo(u)}u=!1}u&&(o=c[0])}}return c=kn(),c.memoizedState=c.baseState=o,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:F0,lastRenderedState:o},c.queue=u,c=cS.bind(null,Ze,u),u.dispatch=c,u=jm(!1),v=Dm.bind(null,Ze,!1,u.queue),u=kn(),m={state:o,dispatch:null,action:r,pending:null},u.queue=m,c=SO.bind(null,Ze,m,v,c),m.dispatch=c,u.memoizedState=r,[o,c,!1]}function q0(r){var o=en();return V0(o,Et,r)}function V0(r,o,c){if(o=Rm(r,o,F0)[0],r=Lf(Os)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var u=jl(o)}catch(E){throw E===Ha?Nf:E}else u=o;o=en();var m=o.queue,v=m.dispatch;return c!==o.memoizedState&&(Ze.flags|=2048,Za(9,{destroy:void 0},_O.bind(null,m,c),null)),[u,v,r]}function _O(r,o){r.action=o}function K0(r){var o=en(),c=Et;if(c!==null)return V0(o,c,r);en(),o=o.memoizedState,c=en();var u=c.queue.dispatch;return c.memoizedState=r,[o,u,!1]}function Za(r,o,c,u){return r={tag:r,create:c,deps:u,inst:o,next:null},o=Ze.updateQueue,o===null&&(o=Df(),Ze.updateQueue=o),c=o.lastEffect,c===null?o.lastEffect=r.next=r:(u=c.next,c.next=r,r.next=u,o.lastEffect=r),r}function G0(){return en().memoizedState}function Uf(r,o,c,u){var m=kn();Ze.flags|=r,m.memoizedState=Za(1|o,{destroy:void 0},c,u===void 0?null:u)}function $f(r,o,c,u){var m=en();u=u===void 0?null:u;var v=m.memoizedState.inst;Et!==null&&u!==null&&Sm(u,Et.memoizedState.deps)?m.memoizedState=Za(o,v,c,u):(Ze.flags|=r,m.memoizedState=Za(1|o,v,c,u))}function Z0(r,o){Uf(8390656,8,r,o)}function km(r,o){$f(2048,8,r,o)}function wO(r){Ze.flags|=4;var o=Ze.updateQueue;if(o===null)o=Df(),Ze.updateQueue=o,o.events=[r];else{var c=o.events;c===null?o.events=[r]:c.push(r)}}function Y0(r){var o=en().memoizedState;return wO({ref:o,nextImpl:r}),function(){if((gt&2)!==0)throw Error(s(440));return o.impl.apply(void 0,arguments)}}function X0(r,o){return $f(4,2,r,o)}function Q0(r,o){return $f(4,4,r,o)}function W0(r,o){if(typeof o=="function"){r=r();var c=o(r);return function(){typeof c=="function"?c():o(null)}}if(o!=null)return r=r(),o.current=r,function(){o.current=null}}function J0(r,o,c){c=c!=null?c.concat([r]):null,$f(4,4,W0.bind(null,o,r),c)}function Om(){}function eS(r,o){var c=en();o=o===void 0?null:o;var u=c.memoizedState;return o!==null&&Sm(o,u[1])?u[0]:(c.memoizedState=[r,o],r)}function tS(r,o){var c=en();o=o===void 0?null:o;var u=c.memoizedState;if(o!==null&&Sm(o,u[1]))return u[0];if(u=r(),Li){ut(!0);try{r()}finally{ut(!1)}}return c.memoizedState=[u,o],u}function Mm(r,o,c){return c===void 0||(ks&1073741824)!==0&&(tt&261930)===0?r.memoizedState=o:(r.memoizedState=c,r=n_(),Ze.lanes|=r,Ro|=r,c)}function nS(r,o,c,u){return rr(c,o)?c:Va.current!==null?(r=Mm(r,c,u),rr(r,o)||(sn=!0),r):(ks&42)===0||(ks&1073741824)!==0&&(tt&261930)===0?(sn=!0,r.memoizedState=c):(r=n_(),Ze.lanes|=r,Ro|=r,o)}function rS(r,o,c,u,m){var v=G.p;G.p=v!==0&&8>v?v:8;var E=D.T,k={};D.T=k,Dm(r,!1,o,c);try{var $=m(),te=D.S;if(te!==null&&te(k,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var ce=vO($,u);Al(r,o,ce,lr(r))}else Al(r,o,u,lr(r))}catch(de){Al(r,o,{then:function(){},status:"rejected",reason:de},lr())}finally{G.p=v,E!==null&&k.types!==null&&(E.types=k.types),D.T=E}}function EO(){}function Im(r,o,c,u){if(r.tag!==5)throw Error(s(476));var m=sS(r).queue;rS(r,m,o,q,c===null?EO:function(){return oS(r),c(u)})}function sS(r){var o=r.memoizedState;if(o!==null)return o;o={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:q},next:null};var c={};return o.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:c},next:null},r.memoizedState=o,r=r.alternate,r!==null&&(r.memoizedState=o),o}function oS(r){var o=sS(r);o.next===null&&(o=r.alternate.memoizedState),Al(r,o.next.queue,{},lr())}function Pm(){return wn(Gl)}function iS(){return en().memoizedState}function aS(){return en().memoizedState}function TO(r){for(var o=r.return;o!==null;){switch(o.tag){case 24:case 3:var c=lr();r=So(c);var u=_o(o,r,c);u!==null&&(Vn(u,o,c),Tl(u,o,c)),o={cache:um()},r.payload=o;return}o=o.return}}function CO(r,o,c){var u=lr();c={lane:u,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Bf(r)?lS(o,c):(c=Jp(r,o,c,u),c!==null&&(Vn(c,r,u),uS(c,o,u)))}function cS(r,o,c){var u=lr();Al(r,o,c,u)}function Al(r,o,c,u){var m={lane:u,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Bf(r))lS(o,m);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=o.lastRenderedReducer,v!==null))try{var E=o.lastRenderedState,k=v(E,c);if(m.hasEagerState=!0,m.eagerState=k,rr(k,E))return Sf(r,o,m,0),Nt===null&&xf(),!1}catch{}if(c=Jp(r,o,m,u),c!==null)return Vn(c,r,u),uS(c,o,u),!0}return!1}function Dm(r,o,c,u){if(u={lane:2,revertLane:pg(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Bf(r)){if(o)throw Error(s(479))}else o=Jp(r,c,u,2),o!==null&&Vn(o,r,2)}function Bf(r){var o=r.alternate;return r===Ze||o!==null&&o===Ze}function lS(r,o){Ka=If=!0;var c=r.pending;c===null?o.next=o:(o.next=c.next,c.next=o),r.pending=o}function uS(r,o,c){if((c&4194048)!==0){var u=o.lanes;u&=r.pendingLanes,c|=u,o.lanes=c,fo(r,c)}}var kl={readContext:wn,use:zf,useCallback:Kt,useContext:Kt,useEffect:Kt,useImperativeHandle:Kt,useLayoutEffect:Kt,useInsertionEffect:Kt,useMemo:Kt,useReducer:Kt,useRef:Kt,useState:Kt,useDebugValue:Kt,useDeferredValue:Kt,useTransition:Kt,useSyncExternalStore:Kt,useId:Kt,useHostTransitionStatus:Kt,useFormState:Kt,useActionState:Kt,useOptimistic:Kt,useMemoCache:Kt,useCacheRefresh:Kt};kl.useEffectEvent=Kt;var fS={readContext:wn,use:zf,useCallback:function(r,o){return kn().memoizedState=[r,o===void 0?null:o],r},useContext:wn,useEffect:Z0,useImperativeHandle:function(r,o,c){c=c!=null?c.concat([r]):null,Uf(4194308,4,W0.bind(null,o,r),c)},useLayoutEffect:function(r,o){return Uf(4194308,4,r,o)},useInsertionEffect:function(r,o){Uf(4,2,r,o)},useMemo:function(r,o){var c=kn();o=o===void 0?null:o;var u=r();if(Li){ut(!0);try{r()}finally{ut(!1)}}return c.memoizedState=[u,o],u},useReducer:function(r,o,c){var u=kn();if(c!==void 0){var m=c(o);if(Li){ut(!0);try{c(o)}finally{ut(!1)}}}else m=o;return u.memoizedState=u.baseState=m,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:m},u.queue=r,r=r.dispatch=CO.bind(null,Ze,r),[u.memoizedState,r]},useRef:function(r){var o=kn();return r={current:r},o.memoizedState=r},useState:function(r){r=jm(r);var o=r.queue,c=cS.bind(null,Ze,o);return o.dispatch=c,[r.memoizedState,c]},useDebugValue:Om,useDeferredValue:function(r,o){var c=kn();return Mm(c,r,o)},useTransition:function(){var r=jm(!1);return r=rS.bind(null,Ze,r.queue,!0,!1),kn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,o,c){var u=Ze,m=kn();if(rt){if(c===void 0)throw Error(s(407));c=c()}else{if(c=o(),Nt===null)throw Error(s(349));(tt&127)!==0||O0(u,o,c)}m.memoizedState=c;var v={value:c,getSnapshot:o};return m.queue=v,Z0(I0.bind(null,u,v,r),[r]),u.flags|=2048,Za(9,{destroy:void 0},M0.bind(null,u,v,c,o),null),c},useId:function(){var r=kn(),o=Nt.identifierPrefix;if(rt){var c=fs,u=us;c=(u&~(1<<32-xt(u)-1)).toString(32)+c,o="_"+o+"R_"+c,c=Pf++,0<c&&(o+="H"+c.toString(32)),o+="_"}else c=bO++,o="_"+o+"r_"+c.toString(32)+"_";return r.memoizedState=o},useHostTransitionStatus:Pm,useFormState:H0,useActionState:H0,useOptimistic:function(r){var o=kn();o.memoizedState=o.baseState=r;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=c,o=Dm.bind(null,Ze,!0,c),c.dispatch=o,[r,o]},useMemoCache:Cm,useCacheRefresh:function(){return kn().memoizedState=TO.bind(null,Ze)},useEffectEvent:function(r){var o=kn(),c={impl:r};return o.memoizedState=c,function(){if((gt&2)!==0)throw Error(s(440));return c.impl.apply(void 0,arguments)}}},zm={readContext:wn,use:zf,useCallback:eS,useContext:wn,useEffect:km,useImperativeHandle:J0,useInsertionEffect:X0,useLayoutEffect:Q0,useMemo:tS,useReducer:Lf,useRef:G0,useState:function(){return Lf(Os)},useDebugValue:Om,useDeferredValue:function(r,o){var c=en();return nS(c,Et.memoizedState,r,o)},useTransition:function(){var r=Lf(Os)[0],o=en().memoizedState;return[typeof r=="boolean"?r:jl(r),o]},useSyncExternalStore:k0,useId:iS,useHostTransitionStatus:Pm,useFormState:q0,useActionState:q0,useOptimistic:function(r,o){var c=en();return z0(c,Et,r,o)},useMemoCache:Cm,useCacheRefresh:aS};zm.useEffectEvent=Y0;var dS={readContext:wn,use:zf,useCallback:eS,useContext:wn,useEffect:km,useImperativeHandle:J0,useInsertionEffect:X0,useLayoutEffect:Q0,useMemo:tS,useReducer:Nm,useRef:G0,useState:function(){return Nm(Os)},useDebugValue:Om,useDeferredValue:function(r,o){var c=en();return Et===null?Mm(c,r,o):nS(c,Et.memoizedState,r,o)},useTransition:function(){var r=Nm(Os)[0],o=en().memoizedState;return[typeof r=="boolean"?r:jl(r),o]},useSyncExternalStore:k0,useId:iS,useHostTransitionStatus:Pm,useFormState:K0,useActionState:K0,useOptimistic:function(r,o){var c=en();return Et!==null?z0(c,Et,r,o):(c.baseState=r,[r,c.queue.dispatch])},useMemoCache:Cm,useCacheRefresh:aS};dS.useEffectEvent=Y0;function Lm(r,o,c,u){o=r.memoizedState,c=c(u,o),c=c==null?o:y({},o,c),r.memoizedState=c,r.lanes===0&&(r.updateQueue.baseState=c)}var Um={enqueueSetState:function(r,o,c){r=r._reactInternals;var u=lr(),m=So(u);m.payload=o,c!=null&&(m.callback=c),o=_o(r,m,u),o!==null&&(Vn(o,r,u),Tl(o,r,u))},enqueueReplaceState:function(r,o,c){r=r._reactInternals;var u=lr(),m=So(u);m.tag=1,m.payload=o,c!=null&&(m.callback=c),o=_o(r,m,u),o!==null&&(Vn(o,r,u),Tl(o,r,u))},enqueueForceUpdate:function(r,o){r=r._reactInternals;var c=lr(),u=So(c);u.tag=2,o!=null&&(u.callback=o),o=_o(r,u,c),o!==null&&(Vn(o,r,c),Tl(o,r,c))}};function hS(r,o,c,u,m,v,E){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(u,v,E):o.prototype&&o.prototype.isPureReactComponent?!yl(c,u)||!yl(m,v):!0}function pS(r,o,c,u){r=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(c,u),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(c,u),o.state!==r&&Um.enqueueReplaceState(o,o.state,null)}function Ui(r,o){var c=o;if("ref"in o){c={};for(var u in o)u!=="ref"&&(c[u]=o[u])}if(r=r.defaultProps){c===o&&(c=y({},c));for(var m in r)c[m]===void 0&&(c[m]=r[m])}return c}function mS(r){bf(r)}function gS(r){console.error(r)}function yS(r){bf(r)}function Ff(r,o){try{var c=r.onUncaughtError;c(o.value,{componentStack:o.stack})}catch(u){setTimeout(function(){throw u})}}function vS(r,o,c){try{var u=r.onCaughtError;u(c.value,{componentStack:c.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function $m(r,o,c){return c=So(c),c.tag=3,c.payload={element:null},c.callback=function(){Ff(r,o)},c}function bS(r){return r=So(r),r.tag=3,r}function xS(r,o,c,u){var m=c.type.getDerivedStateFromError;if(typeof m=="function"){var v=u.value;r.payload=function(){return m(v)},r.callback=function(){vS(o,c,u)}}var E=c.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(r.callback=function(){vS(o,c,u),typeof m!="function"&&(No===null?No=new Set([this]):No.add(this));var k=u.stack;this.componentDidCatch(u.value,{componentStack:k!==null?k:""})})}function RO(r,o,c,u,m){if(c.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(o=c.alternate,o!==null&&$a(o,c,m,!0),c=or.current,c!==null){switch(c.tag){case 31:case 13:return Or===null?ed():c.alternate===null&&Gt===0&&(Gt=3),c.flags&=-257,c.flags|=65536,c.lanes=m,u===jf?c.flags|=16384:(o=c.updateQueue,o===null?c.updateQueue=new Set([u]):o.add(u),fg(r,u,m)),!1;case 22:return c.flags|=65536,u===jf?c.flags|=16384:(o=c.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([u])},c.updateQueue=o):(c=o.retryQueue,c===null?o.retryQueue=new Set([u]):c.add(u)),fg(r,u,m)),!1}throw Error(s(435,c.tag))}return fg(r,u,m),ed(),!1}if(rt)return o=or.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=m,u!==om&&(r=Error(s(422),{cause:u}),xl(Nr(r,c)))):(u!==om&&(o=Error(s(423),{cause:u}),xl(Nr(o,c))),r=r.current.alternate,r.flags|=65536,m&=-m,r.lanes|=m,u=Nr(u,c),m=$m(r.stateNode,u,m),gm(r,m),Gt!==4&&(Gt=2)),!1;var v=Error(s(520),{cause:u});if(v=Nr(v,c),Ul===null?Ul=[v]:Ul.push(v),Gt!==4&&(Gt=2),o===null)return!0;u=Nr(u,c),c=o;do{switch(c.tag){case 3:return c.flags|=65536,r=m&-m,c.lanes|=r,r=$m(c.stateNode,u,r),gm(c,r),!1;case 1:if(o=c.type,v=c.stateNode,(c.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(No===null||!No.has(v))))return c.flags|=65536,m&=-m,c.lanes|=m,m=bS(m),xS(m,r,c,u),gm(c,m),!1}c=c.return}while(c!==null);return!1}var Bm=Error(s(461)),sn=!1;function En(r,o,c,u){o.child=r===null?E0(o,null,c,u):zi(o,r.child,c,u)}function SS(r,o,c,u,m){c=c.render;var v=o.ref;if("ref"in u){var E={};for(var k in u)k!=="ref"&&(E[k]=u[k])}else E=u;return Mi(o),u=_m(r,o,c,E,v,m),k=wm(),r!==null&&!sn?(Em(r,o,m),Ms(r,o,m)):(rt&&k&&rm(o),o.flags|=1,En(r,o,u,m),o.child)}function _S(r,o,c,u,m){if(r===null){var v=c.type;return typeof v=="function"&&!em(v)&&v.defaultProps===void 0&&c.compare===null?(o.tag=15,o.type=v,wS(r,o,v,u,m)):(r=wf(c.type,null,u,o,o.mode,m),r.ref=o.ref,r.return=o,o.child=r)}if(v=r.child,!Ym(r,m)){var E=v.memoizedProps;if(c=c.compare,c=c!==null?c:yl,c(E,u)&&r.ref===o.ref)return Ms(r,o,m)}return o.flags|=1,r=Rs(v,u),r.ref=o.ref,r.return=o,o.child=r}function wS(r,o,c,u,m){if(r!==null){var v=r.memoizedProps;if(yl(v,u)&&r.ref===o.ref)if(sn=!1,o.pendingProps=u=v,Ym(r,m))(r.flags&131072)!==0&&(sn=!0);else return o.lanes=r.lanes,Ms(r,o,m)}return Fm(r,o,c,u,m)}function ES(r,o,c,u){var m=u.children,v=r!==null?r.memoizedState:null;if(r===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((o.flags&128)!==0){if(v=v!==null?v.baseLanes|c:c,r!==null){for(u=o.child=r.child,m=0;u!==null;)m=m|u.lanes|u.childLanes,u=u.sibling;u=m&~v}else u=0,o.child=null;return TS(r,o,v,c,u)}if((c&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},r!==null&&Rf(o,v!==null?v.cachePool:null),v!==null?R0(o,v):vm(),N0(o);else return u=o.lanes=536870912,TS(r,o,v!==null?v.baseLanes|c:c,c,u)}else v!==null?(Rf(o,v.cachePool),R0(o,v),Eo(),o.memoizedState=null):(r!==null&&Rf(o,null),vm(),Eo());return En(r,o,m,c),o.child}function Ol(r,o){return r!==null&&r.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function TS(r,o,c,u,m){var v=dm();return v=v===null?null:{parent:nn._currentValue,pool:v},o.memoizedState={baseLanes:c,cachePool:v},r!==null&&Rf(o,null),vm(),N0(o),r!==null&&$a(r,o,u,!0),o.childLanes=m,null}function Hf(r,o){return o=Vf({mode:o.mode,children:o.children},r.mode),o.ref=r.ref,r.child=o,o.return=r,o}function CS(r,o,c){return zi(o,r.child,null,c),r=Hf(o,o.pendingProps),r.flags|=2,ir(o),o.memoizedState=null,r}function NO(r,o,c){var u=o.pendingProps,m=(o.flags&128)!==0;if(o.flags&=-129,r===null){if(rt){if(u.mode==="hidden")return r=Hf(o,u),o.lanes=536870912,Ol(null,r);if(xm(o),(r=Mt)?(r=L_(r,kr),r=r!==null&&r.data==="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:go!==null?{id:us,overflow:fs}:null,retryLane:536870912,hydrationErrors:null},c=l0(r),c.return=o,o.child=c,_n=o,Mt=null)):r=null,r===null)throw vo(o);return o.lanes=536870912,null}return Hf(o,u)}var v=r.memoizedState;if(v!==null){var E=v.dehydrated;if(xm(o),m)if(o.flags&256)o.flags&=-257,o=CS(r,o,c);else if(o.memoizedState!==null)o.child=r.child,o.flags|=128,o=null;else throw Error(s(558));else if(sn||$a(r,o,c,!1),m=(c&r.childLanes)!==0,sn||m){if(u=Nt,u!==null&&(E=ho(u,c),E!==0&&E!==v.retryLane))throw v.retryLane=E,ji(r,E),Vn(u,r,E),Bm;ed(),o=CS(r,o,c)}else r=v.treeContext,Mt=Mr(E.nextSibling),_n=o,rt=!0,yo=null,kr=!1,r!==null&&d0(o,r),o=Hf(o,u),o.flags|=4096;return o}return r=Rs(r.child,{mode:u.mode,children:u.children}),r.ref=o.ref,o.child=r,r.return=o,r}function qf(r,o){var c=o.ref;if(c===null)r!==null&&r.ref!==null&&(o.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(s(284));(r===null||r.ref!==c)&&(o.flags|=4194816)}}function Fm(r,o,c,u,m){return Mi(o),c=_m(r,o,c,u,void 0,m),u=wm(),r!==null&&!sn?(Em(r,o,m),Ms(r,o,m)):(rt&&u&&rm(o),o.flags|=1,En(r,o,c,m),o.child)}function RS(r,o,c,u,m,v){return Mi(o),o.updateQueue=null,c=A0(o,u,c,m),j0(r),u=wm(),r!==null&&!sn?(Em(r,o,v),Ms(r,o,v)):(rt&&u&&rm(o),o.flags|=1,En(r,o,c,v),o.child)}function NS(r,o,c,u,m){if(Mi(o),o.stateNode===null){var v=Da,E=c.contextType;typeof E=="object"&&E!==null&&(v=wn(E)),v=new c(u,v),o.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Um,o.stateNode=v,v._reactInternals=o,v=o.stateNode,v.props=u,v.state=o.memoizedState,v.refs={},pm(o),E=c.contextType,v.context=typeof E=="object"&&E!==null?wn(E):Da,v.state=o.memoizedState,E=c.getDerivedStateFromProps,typeof E=="function"&&(Lm(o,c,E,u),v.state=o.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(E=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),E!==v.state&&Um.enqueueReplaceState(v,v.state,null),Rl(o,u,v,m),Cl(),v.state=o.memoizedState),typeof v.componentDidMount=="function"&&(o.flags|=4194308),u=!0}else if(r===null){v=o.stateNode;var k=o.memoizedProps,$=Ui(c,k);v.props=$;var te=v.context,ce=c.contextType;E=Da,typeof ce=="object"&&ce!==null&&(E=wn(ce));var de=c.getDerivedStateFromProps;ce=typeof de=="function"||typeof v.getSnapshotBeforeUpdate=="function",k=o.pendingProps!==k,ce||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(k||te!==E)&&pS(o,v,u,E),xo=!1;var ne=o.memoizedState;v.state=ne,Rl(o,u,v,m),Cl(),te=o.memoizedState,k||ne!==te||xo?(typeof de=="function"&&(Lm(o,c,de,u),te=o.memoizedState),($=xo||hS(o,c,$,u,ne,te,E))?(ce||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(o.flags|=4194308)):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=u,o.memoizedState=te),v.props=u,v.state=te,v.context=E,u=$):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),u=!1)}else{v=o.stateNode,mm(r,o),E=o.memoizedProps,ce=Ui(c,E),v.props=ce,de=o.pendingProps,ne=v.context,te=c.contextType,$=Da,typeof te=="object"&&te!==null&&($=wn(te)),k=c.getDerivedStateFromProps,(te=typeof k=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(E!==de||ne!==$)&&pS(o,v,u,$),xo=!1,ne=o.memoizedState,v.state=ne,Rl(o,u,v,m),Cl();var oe=o.memoizedState;E!==de||ne!==oe||xo||r!==null&&r.dependencies!==null&&Tf(r.dependencies)?(typeof k=="function"&&(Lm(o,c,k,u),oe=o.memoizedState),(ce=xo||hS(o,c,ce,u,ne,oe,$)||r!==null&&r.dependencies!==null&&Tf(r.dependencies))?(te||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(u,oe,$),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(u,oe,$)),typeof v.componentDidUpdate=="function"&&(o.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof v.componentDidUpdate!="function"||E===r.memoizedProps&&ne===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&ne===r.memoizedState||(o.flags|=1024),o.memoizedProps=u,o.memoizedState=oe),v.props=u,v.state=oe,v.context=$,u=ce):(typeof v.componentDidUpdate!="function"||E===r.memoizedProps&&ne===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&ne===r.memoizedState||(o.flags|=1024),u=!1)}return v=u,qf(r,o),u=(o.flags&128)!==0,v||u?(v=o.stateNode,c=u&&typeof c.getDerivedStateFromError!="function"?null:v.render(),o.flags|=1,r!==null&&u?(o.child=zi(o,r.child,null,m),o.child=zi(o,null,c,m)):En(r,o,c,m),o.memoizedState=v.state,r=o.child):r=Ms(r,o,m),r}function jS(r,o,c,u){return ki(),o.flags|=256,En(r,o,c,u),o.child}var Hm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qm(r){return{baseLanes:r,cachePool:v0()}}function Vm(r,o,c){return r=r!==null?r.childLanes&~c:0,o&&(r|=cr),r}function AS(r,o,c){var u=o.pendingProps,m=!1,v=(o.flags&128)!==0,E;if((E=v)||(E=r!==null&&r.memoizedState===null?!1:(Jt.current&2)!==0),E&&(m=!0,o.flags&=-129),E=(o.flags&32)!==0,o.flags&=-33,r===null){if(rt){if(m?wo(o):Eo(),(r=Mt)?(r=L_(r,kr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:go!==null?{id:us,overflow:fs}:null,retryLane:536870912,hydrationErrors:null},c=l0(r),c.return=o,o.child=c,_n=o,Mt=null)):r=null,r===null)throw vo(o);return Rg(r)?o.lanes=32:o.lanes=536870912,null}var k=u.children;return u=u.fallback,m?(Eo(),m=o.mode,k=Vf({mode:"hidden",children:k},m),u=Ai(u,m,c,null),k.return=o,u.return=o,k.sibling=u,o.child=k,u=o.child,u.memoizedState=qm(c),u.childLanes=Vm(r,E,c),o.memoizedState=Hm,Ol(null,u)):(wo(o),Km(o,k))}var $=r.memoizedState;if($!==null&&(k=$.dehydrated,k!==null)){if(v)o.flags&256?(wo(o),o.flags&=-257,o=Gm(r,o,c)):o.memoizedState!==null?(Eo(),o.child=r.child,o.flags|=128,o=null):(Eo(),k=u.fallback,m=o.mode,u=Vf({mode:"visible",children:u.children},m),k=Ai(k,m,c,null),k.flags|=2,u.return=o,k.return=o,u.sibling=k,o.child=u,zi(o,r.child,null,c),u=o.child,u.memoizedState=qm(c),u.childLanes=Vm(r,E,c),o.memoizedState=Hm,o=Ol(null,u));else if(wo(o),Rg(k)){if(E=k.nextSibling&&k.nextSibling.dataset,E)var te=E.dgst;E=te,u=Error(s(419)),u.stack="",u.digest=E,xl({value:u,source:null,stack:null}),o=Gm(r,o,c)}else if(sn||$a(r,o,c,!1),E=(c&r.childLanes)!==0,sn||E){if(E=Nt,E!==null&&(u=ho(E,c),u!==0&&u!==$.retryLane))throw $.retryLane=u,ji(r,u),Vn(E,r,u),Bm;Cg(k)||ed(),o=Gm(r,o,c)}else Cg(k)?(o.flags|=192,o.child=r.child,o=null):(r=$.treeContext,Mt=Mr(k.nextSibling),_n=o,rt=!0,yo=null,kr=!1,r!==null&&d0(o,r),o=Km(o,u.children),o.flags|=4096);return o}return m?(Eo(),k=u.fallback,m=o.mode,$=r.child,te=$.sibling,u=Rs($,{mode:"hidden",children:u.children}),u.subtreeFlags=$.subtreeFlags&65011712,te!==null?k=Rs(te,k):(k=Ai(k,m,c,null),k.flags|=2),k.return=o,u.return=o,u.sibling=k,o.child=u,Ol(null,u),u=o.child,k=r.child.memoizedState,k===null?k=qm(c):(m=k.cachePool,m!==null?($=nn._currentValue,m=m.parent!==$?{parent:$,pool:$}:m):m=v0(),k={baseLanes:k.baseLanes|c,cachePool:m}),u.memoizedState=k,u.childLanes=Vm(r,E,c),o.memoizedState=Hm,Ol(r.child,u)):(wo(o),c=r.child,r=c.sibling,c=Rs(c,{mode:"visible",children:u.children}),c.return=o,c.sibling=null,r!==null&&(E=o.deletions,E===null?(o.deletions=[r],o.flags|=16):E.push(r)),o.child=c,o.memoizedState=null,c)}function Km(r,o){return o=Vf({mode:"visible",children:o},r.mode),o.return=r,r.child=o}function Vf(r,o){return r=sr(22,r,null,o),r.lanes=0,r}function Gm(r,o,c){return zi(o,r.child,null,c),r=Km(o,o.pendingProps.children),r.flags|=2,o.memoizedState=null,r}function kS(r,o,c){r.lanes|=o;var u=r.alternate;u!==null&&(u.lanes|=o),cm(r.return,o,c)}function Zm(r,o,c,u,m,v){var E=r.memoizedState;E===null?r.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:u,tail:c,tailMode:m,treeForkCount:v}:(E.isBackwards=o,E.rendering=null,E.renderingStartTime=0,E.last=u,E.tail=c,E.tailMode=m,E.treeForkCount=v)}function OS(r,o,c){var u=o.pendingProps,m=u.revealOrder,v=u.tail;u=u.children;var E=Jt.current,k=(E&2)!==0;if(k?(E=E&1|2,o.flags|=128):E&=1,W(Jt,E),En(r,o,u,c),u=rt?bl:0,!k&&r!==null&&(r.flags&128)!==0)e:for(r=o.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&kS(r,c,o);else if(r.tag===19)kS(r,c,o);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===o)break e;for(;r.sibling===null;){if(r.return===null||r.return===o)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(m){case"forwards":for(c=o.child,m=null;c!==null;)r=c.alternate,r!==null&&Mf(r)===null&&(m=c),c=c.sibling;c=m,c===null?(m=o.child,o.child=null):(m=c.sibling,c.sibling=null),Zm(o,!1,m,c,v,u);break;case"backwards":case"unstable_legacy-backwards":for(c=null,m=o.child,o.child=null;m!==null;){if(r=m.alternate,r!==null&&Mf(r)===null){o.child=m;break}r=m.sibling,m.sibling=c,c=m,m=r}Zm(o,!0,c,null,v,u);break;case"together":Zm(o,!1,null,null,void 0,u);break;default:o.memoizedState=null}return o.child}function Ms(r,o,c){if(r!==null&&(o.dependencies=r.dependencies),Ro|=o.lanes,(c&o.childLanes)===0)if(r!==null){if($a(r,o,c,!1),(c&o.childLanes)===0)return null}else return null;if(r!==null&&o.child!==r.child)throw Error(s(153));if(o.child!==null){for(r=o.child,c=Rs(r,r.pendingProps),o.child=c,c.return=o;r.sibling!==null;)r=r.sibling,c=c.sibling=Rs(r,r.pendingProps),c.return=o;c.sibling=null}return o.child}function Ym(r,o){return(r.lanes&o)!==0?!0:(r=r.dependencies,!!(r!==null&&Tf(r)))}function jO(r,o,c){switch(o.tag){case 3:Se(o,o.stateNode.containerInfo),bo(o,nn,r.memoizedState.cache),ki();break;case 27:case 5:Oe(o);break;case 4:Se(o,o.stateNode.containerInfo);break;case 10:bo(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,xm(o),null;break;case 13:var u=o.memoizedState;if(u!==null)return u.dehydrated!==null?(wo(o),o.flags|=128,null):(c&o.child.childLanes)!==0?AS(r,o,c):(wo(o),r=Ms(r,o,c),r!==null?r.sibling:null);wo(o);break;case 19:var m=(r.flags&128)!==0;if(u=(c&o.childLanes)!==0,u||($a(r,o,c,!1),u=(c&o.childLanes)!==0),m){if(u)return OS(r,o,c);o.flags|=128}if(m=o.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),W(Jt,Jt.current),u)break;return null;case 22:return o.lanes=0,ES(r,o,c,o.pendingProps);case 24:bo(o,nn,r.memoizedState.cache)}return Ms(r,o,c)}function MS(r,o,c){if(r!==null)if(r.memoizedProps!==o.pendingProps)sn=!0;else{if(!Ym(r,c)&&(o.flags&128)===0)return sn=!1,jO(r,o,c);sn=(r.flags&131072)!==0}else sn=!1,rt&&(o.flags&1048576)!==0&&f0(o,bl,o.index);switch(o.lanes=0,o.tag){case 16:e:{var u=o.pendingProps;if(r=Pi(o.elementType),o.type=r,typeof r=="function")em(r)?(u=Ui(r,u),o.tag=1,o=NS(null,o,r,u,c)):(o.tag=0,o=Fm(null,o,r,u,c));else{if(r!=null){var m=r.$$typeof;if(m===R){o.tag=11,o=SS(null,o,r,u,c);break e}else if(m===j){o.tag=14,o=_S(null,o,r,u,c);break e}}throw o=K(r)||r,Error(s(306,o,""))}}return o;case 0:return Fm(r,o,o.type,o.pendingProps,c);case 1:return u=o.type,m=Ui(u,o.pendingProps),NS(r,o,u,m,c);case 3:e:{if(Se(o,o.stateNode.containerInfo),r===null)throw Error(s(387));u=o.pendingProps;var v=o.memoizedState;m=v.element,mm(r,o),Rl(o,u,null,c);var E=o.memoizedState;if(u=E.cache,bo(o,nn,u),u!==v.cache&&lm(o,[nn],c,!0),Cl(),u=E.element,v.isDehydrated)if(v={element:u,isDehydrated:!1,cache:E.cache},o.updateQueue.baseState=v,o.memoizedState=v,o.flags&256){o=jS(r,o,u,c);break e}else if(u!==m){m=Nr(Error(s(424)),o),xl(m),o=jS(r,o,u,c);break e}else for(r=o.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,Mt=Mr(r.firstChild),_n=o,rt=!0,yo=null,kr=!0,c=E0(o,null,u,c),o.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(ki(),u===m){o=Ms(r,o,c);break e}En(r,o,u,c)}o=o.child}return o;case 26:return qf(r,o),r===null?(c=q_(o.type,null,o.pendingProps,null))?o.memoizedState=c:rt||(c=o.type,r=o.pendingProps,u=ad(se.current).createElement(c),u[Sn]=o,u[Un]=r,Tn(u,c,r),bn(u),o.stateNode=u):o.memoizedState=q_(o.type,r.memoizedProps,o.pendingProps,r.memoizedState),null;case 27:return Oe(o),r===null&&rt&&(u=o.stateNode=B_(o.type,o.pendingProps,se.current),_n=o,kr=!0,m=Mt,Oo(o.type)?(Ng=m,Mt=Mr(u.firstChild)):Mt=m),En(r,o,o.pendingProps.children,c),qf(r,o),r===null&&(o.flags|=4194304),o.child;case 5:return r===null&&rt&&((m=u=Mt)&&(u=oM(u,o.type,o.pendingProps,kr),u!==null?(o.stateNode=u,_n=o,Mt=Mr(u.firstChild),kr=!1,m=!0):m=!1),m||vo(o)),Oe(o),m=o.type,v=o.pendingProps,E=r!==null?r.memoizedProps:null,u=v.children,wg(m,v)?u=null:E!==null&&wg(m,E)&&(o.flags|=32),o.memoizedState!==null&&(m=_m(r,o,xO,null,null,c),Gl._currentValue=m),qf(r,o),En(r,o,u,c),o.child;case 6:return r===null&&rt&&((r=c=Mt)&&(c=iM(c,o.pendingProps,kr),c!==null?(o.stateNode=c,_n=o,Mt=null,r=!0):r=!1),r||vo(o)),null;case 13:return AS(r,o,c);case 4:return Se(o,o.stateNode.containerInfo),u=o.pendingProps,r===null?o.child=zi(o,null,u,c):En(r,o,u,c),o.child;case 11:return SS(r,o,o.type,o.pendingProps,c);case 7:return En(r,o,o.pendingProps,c),o.child;case 8:return En(r,o,o.pendingProps.children,c),o.child;case 12:return En(r,o,o.pendingProps.children,c),o.child;case 10:return u=o.pendingProps,bo(o,o.type,u.value),En(r,o,u.children,c),o.child;case 9:return m=o.type._context,u=o.pendingProps.children,Mi(o),m=wn(m),u=u(m),o.flags|=1,En(r,o,u,c),o.child;case 14:return _S(r,o,o.type,o.pendingProps,c);case 15:return wS(r,o,o.type,o.pendingProps,c);case 19:return OS(r,o,c);case 31:return NO(r,o,c);case 22:return ES(r,o,c,o.pendingProps);case 24:return Mi(o),u=wn(nn),r===null?(m=dm(),m===null&&(m=Nt,v=um(),m.pooledCache=v,v.refCount++,v!==null&&(m.pooledCacheLanes|=c),m=v),o.memoizedState={parent:u,cache:m},pm(o),bo(o,nn,m)):((r.lanes&c)!==0&&(mm(r,o),Rl(o,null,null,c),Cl()),m=r.memoizedState,v=o.memoizedState,m.parent!==u?(m={parent:u,cache:u},o.memoizedState=m,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=m),bo(o,nn,u)):(u=v.cache,bo(o,nn,u),u!==m.cache&&lm(o,[nn],c,!0))),En(r,o,o.pendingProps.children,c),o.child;case 29:throw o.pendingProps}throw Error(s(156,o.tag))}function Is(r){r.flags|=4}function Xm(r,o,c,u,m){if((o=(r.mode&32)!==0)&&(o=!1),o){if(r.flags|=16777216,(m&335544128)===m)if(r.stateNode.complete)r.flags|=8192;else if(i_())r.flags|=8192;else throw Di=jf,hm}else r.flags&=-16777217}function IS(r,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Y_(o))if(i_())r.flags|=8192;else throw Di=jf,hm}function Kf(r,o){o!==null&&(r.flags|=4),r.flags&16384&&(o=r.tag!==22?wi():536870912,r.lanes|=o,Wa|=o)}function Ml(r,o){if(!rt)switch(r.tailMode){case"hidden":o=r.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?r.tail=null:c.sibling=null;break;case"collapsed":c=r.tail;for(var u=null;c!==null;)c.alternate!==null&&(u=c),c=c.sibling;u===null?o||r.tail===null?r.tail=null:r.tail.sibling=null:u.sibling=null}}function It(r){var o=r.alternate!==null&&r.alternate.child===r.child,c=0,u=0;if(o)for(var m=r.child;m!==null;)c|=m.lanes|m.childLanes,u|=m.subtreeFlags&65011712,u|=m.flags&65011712,m.return=r,m=m.sibling;else for(m=r.child;m!==null;)c|=m.lanes|m.childLanes,u|=m.subtreeFlags,u|=m.flags,m.return=r,m=m.sibling;return r.subtreeFlags|=u,r.childLanes=c,o}function AO(r,o,c){var u=o.pendingProps;switch(sm(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return It(o),null;case 1:return It(o),null;case 3:return c=o.stateNode,u=null,r!==null&&(u=r.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),As(nn),pe(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(r===null||r.child===null)&&(Ua(o)?Is(o):r===null||r.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,im())),It(o),null;case 26:var m=o.type,v=o.memoizedState;return r===null?(Is(o),v!==null?(It(o),IS(o,v)):(It(o),Xm(o,m,null,u,c))):v?v!==r.memoizedState?(Is(o),It(o),IS(o,v)):(It(o),o.flags&=-16777217):(r=r.memoizedProps,r!==u&&Is(o),It(o),Xm(o,m,r,u,c)),null;case 27:if(_e(o),c=se.current,m=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==u&&Is(o);else{if(!u){if(o.stateNode===null)throw Error(s(166));return It(o),null}r=Y.current,Ua(o)?h0(o):(r=B_(m,u,c),o.stateNode=r,Is(o))}return It(o),null;case 5:if(_e(o),m=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==u&&Is(o);else{if(!u){if(o.stateNode===null)throw Error(s(166));return It(o),null}if(v=Y.current,Ua(o))h0(o);else{var E=ad(se.current);switch(v){case 1:v=E.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:v=E.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":v=E.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":v=E.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":v=E.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof u.is=="string"?E.createElement("select",{is:u.is}):E.createElement("select"),u.multiple?v.multiple=!0:u.size&&(v.size=u.size);break;default:v=typeof u.is=="string"?E.createElement(m,{is:u.is}):E.createElement(m)}}v[Sn]=o,v[Un]=u;e:for(E=o.child;E!==null;){if(E.tag===5||E.tag===6)v.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===o)break e;for(;E.sibling===null;){if(E.return===null||E.return===o)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}o.stateNode=v;e:switch(Tn(v,m,u),m){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&Is(o)}}return It(o),Xm(o,o.type,r===null?null:r.memoizedProps,o.pendingProps,c),null;case 6:if(r&&o.stateNode!=null)r.memoizedProps!==u&&Is(o);else{if(typeof u!="string"&&o.stateNode===null)throw Error(s(166));if(r=se.current,Ua(o)){if(r=o.stateNode,c=o.memoizedProps,u=null,m=_n,m!==null)switch(m.tag){case 27:case 5:u=m.memoizedProps}r[Sn]=o,r=!!(r.nodeValue===c||u!==null&&u.suppressHydrationWarning===!0||A_(r.nodeValue,c)),r||vo(o,!0)}else r=ad(r).createTextNode(u),r[Sn]=o,o.stateNode=r}return It(o),null;case 31:if(c=o.memoizedState,r===null||r.memoizedState!==null){if(u=Ua(o),c!==null){if(r===null){if(!u)throw Error(s(318));if(r=o.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(557));r[Sn]=o}else ki(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;It(o),r=!1}else c=im(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=c),r=!0;if(!r)return o.flags&256?(ir(o),o):(ir(o),null);if((o.flags&128)!==0)throw Error(s(558))}return It(o),null;case 13:if(u=o.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(m=Ua(o),u!==null&&u.dehydrated!==null){if(r===null){if(!m)throw Error(s(318));if(m=o.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(s(317));m[Sn]=o}else ki(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;It(o),m=!1}else m=im(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=m),m=!0;if(!m)return o.flags&256?(ir(o),o):(ir(o),null)}return ir(o),(o.flags&128)!==0?(o.lanes=c,o):(c=u!==null,r=r!==null&&r.memoizedState!==null,c&&(u=o.child,m=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(m=u.alternate.memoizedState.cachePool.pool),v=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(v=u.memoizedState.cachePool.pool),v!==m&&(u.flags|=2048)),c!==r&&c&&(o.child.flags|=8192),Kf(o,o.updateQueue),It(o),null);case 4:return pe(),r===null&&vg(o.stateNode.containerInfo),It(o),null;case 10:return As(o.type),It(o),null;case 19:if(H(Jt),u=o.memoizedState,u===null)return It(o),null;if(m=(o.flags&128)!==0,v=u.rendering,v===null)if(m)Ml(u,!1);else{if(Gt!==0||r!==null&&(r.flags&128)!==0)for(r=o.child;r!==null;){if(v=Mf(r),v!==null){for(o.flags|=128,Ml(u,!1),r=v.updateQueue,o.updateQueue=r,Kf(o,r),o.subtreeFlags=0,r=c,c=o.child;c!==null;)c0(c,r),c=c.sibling;return W(Jt,Jt.current&1|2),rt&&Ns(o,u.treeForkCount),o.child}r=r.sibling}u.tail!==null&&Be()>Qf&&(o.flags|=128,m=!0,Ml(u,!1),o.lanes=4194304)}else{if(!m)if(r=Mf(v),r!==null){if(o.flags|=128,m=!0,r=r.updateQueue,o.updateQueue=r,Kf(o,r),Ml(u,!0),u.tail===null&&u.tailMode==="hidden"&&!v.alternate&&!rt)return It(o),null}else 2*Be()-u.renderingStartTime>Qf&&c!==536870912&&(o.flags|=128,m=!0,Ml(u,!1),o.lanes=4194304);u.isBackwards?(v.sibling=o.child,o.child=v):(r=u.last,r!==null?r.sibling=v:o.child=v,u.last=v)}return u.tail!==null?(r=u.tail,u.rendering=r,u.tail=r.sibling,u.renderingStartTime=Be(),r.sibling=null,c=Jt.current,W(Jt,m?c&1|2:c&1),rt&&Ns(o,u.treeForkCount),r):(It(o),null);case 22:case 23:return ir(o),bm(),u=o.memoizedState!==null,r!==null?r.memoizedState!==null!==u&&(o.flags|=8192):u&&(o.flags|=8192),u?(c&536870912)!==0&&(o.flags&128)===0&&(It(o),o.subtreeFlags&6&&(o.flags|=8192)):It(o),c=o.updateQueue,c!==null&&Kf(o,c.retryQueue),c=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),u=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(u=o.memoizedState.cachePool.pool),u!==c&&(o.flags|=2048),r!==null&&H(Ii),null;case 24:return c=null,r!==null&&(c=r.memoizedState.cache),o.memoizedState.cache!==c&&(o.flags|=2048),As(nn),It(o),null;case 25:return null;case 30:return null}throw Error(s(156,o.tag))}function kO(r,o){switch(sm(o),o.tag){case 1:return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 3:return As(nn),pe(),r=o.flags,(r&65536)!==0&&(r&128)===0?(o.flags=r&-65537|128,o):null;case 26:case 27:case 5:return _e(o),null;case 31:if(o.memoizedState!==null){if(ir(o),o.alternate===null)throw Error(s(340));ki()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 13:if(ir(o),r=o.memoizedState,r!==null&&r.dehydrated!==null){if(o.alternate===null)throw Error(s(340));ki()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 19:return H(Jt),null;case 4:return pe(),null;case 10:return As(o.type),null;case 22:case 23:return ir(o),bm(),r!==null&&H(Ii),r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 24:return As(nn),null;case 25:return null;default:return null}}function PS(r,o){switch(sm(o),o.tag){case 3:As(nn),pe();break;case 26:case 27:case 5:_e(o);break;case 4:pe();break;case 31:o.memoizedState!==null&&ir(o);break;case 13:ir(o);break;case 19:H(Jt);break;case 10:As(o.type);break;case 22:case 23:ir(o),bm(),r!==null&&H(Ii);break;case 24:As(nn)}}function Il(r,o){try{var c=o.updateQueue,u=c!==null?c.lastEffect:null;if(u!==null){var m=u.next;c=m;do{if((c.tag&r)===r){u=void 0;var v=c.create,E=c.inst;u=v(),E.destroy=u}c=c.next}while(c!==m)}}catch(k){_t(o,o.return,k)}}function To(r,o,c){try{var u=o.updateQueue,m=u!==null?u.lastEffect:null;if(m!==null){var v=m.next;u=v;do{if((u.tag&r)===r){var E=u.inst,k=E.destroy;if(k!==void 0){E.destroy=void 0,m=o;var $=c,te=k;try{te()}catch(ce){_t(m,$,ce)}}}u=u.next}while(u!==v)}}catch(ce){_t(o,o.return,ce)}}function DS(r){var o=r.updateQueue;if(o!==null){var c=r.stateNode;try{C0(o,c)}catch(u){_t(r,r.return,u)}}}function zS(r,o,c){c.props=Ui(r.type,r.memoizedProps),c.state=r.memoizedState;try{c.componentWillUnmount()}catch(u){_t(r,o,u)}}function Pl(r,o){try{var c=r.ref;if(c!==null){switch(r.tag){case 26:case 27:case 5:var u=r.stateNode;break;case 30:u=r.stateNode;break;default:u=r.stateNode}typeof c=="function"?r.refCleanup=c(u):c.current=u}}catch(m){_t(r,o,m)}}function ds(r,o){var c=r.ref,u=r.refCleanup;if(c!==null)if(typeof u=="function")try{u()}catch(m){_t(r,o,m)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(m){_t(r,o,m)}else c.current=null}function LS(r){var o=r.type,c=r.memoizedProps,u=r.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":c.autoFocus&&u.focus();break e;case"img":c.src?u.src=c.src:c.srcSet&&(u.srcset=c.srcSet)}}catch(m){_t(r,r.return,m)}}function Qm(r,o,c){try{var u=r.stateNode;JO(u,r.type,c,o),u[Un]=o}catch(m){_t(r,r.return,m)}}function US(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Oo(r.type)||r.tag===4}function Wm(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||US(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Oo(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Jm(r,o,c){var u=r.tag;if(u===5||u===6)r=r.stateNode,o?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(r,o):(o=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,o.appendChild(r),c=c._reactRootContainer,c!=null||o.onclick!==null||(o.onclick=Ts));else if(u!==4&&(u===27&&Oo(r.type)&&(c=r.stateNode,o=null),r=r.child,r!==null))for(Jm(r,o,c),r=r.sibling;r!==null;)Jm(r,o,c),r=r.sibling}function Gf(r,o,c){var u=r.tag;if(u===5||u===6)r=r.stateNode,o?c.insertBefore(r,o):c.appendChild(r);else if(u!==4&&(u===27&&Oo(r.type)&&(c=r.stateNode),r=r.child,r!==null))for(Gf(r,o,c),r=r.sibling;r!==null;)Gf(r,o,c),r=r.sibling}function $S(r){var o=r.stateNode,c=r.memoizedProps;try{for(var u=r.type,m=o.attributes;m.length;)o.removeAttributeNode(m[0]);Tn(o,u,c),o[Sn]=r,o[Un]=c}catch(v){_t(r,r.return,v)}}var Ps=!1,on=!1,eg=!1,BS=typeof WeakSet=="function"?WeakSet:Set,xn=null;function OO(r,o){if(r=r.containerInfo,Sg=pd,r=Jx(r),Gp(r)){if("selectionStart"in r)var c={start:r.selectionStart,end:r.selectionEnd};else e:{c=(c=r.ownerDocument)&&c.defaultView||window;var u=c.getSelection&&c.getSelection();if(u&&u.rangeCount!==0){c=u.anchorNode;var m=u.anchorOffset,v=u.focusNode;u=u.focusOffset;try{c.nodeType,v.nodeType}catch{c=null;break e}var E=0,k=-1,$=-1,te=0,ce=0,de=r,ne=null;t:for(;;){for(var oe;de!==c||m!==0&&de.nodeType!==3||(k=E+m),de!==v||u!==0&&de.nodeType!==3||($=E+u),de.nodeType===3&&(E+=de.nodeValue.length),(oe=de.firstChild)!==null;)ne=de,de=oe;for(;;){if(de===r)break t;if(ne===c&&++te===m&&(k=E),ne===v&&++ce===u&&($=E),(oe=de.nextSibling)!==null)break;de=ne,ne=de.parentNode}de=oe}c=k===-1||$===-1?null:{start:k,end:$}}else c=null}c=c||{start:0,end:0}}else c=null;for(_g={focusedElem:r,selectionRange:c},pd=!1,xn=o;xn!==null;)if(o=xn,r=o.child,(o.subtreeFlags&1028)!==0&&r!==null)r.return=o,xn=r;else for(;xn!==null;){switch(o=xn,v=o.alternate,r=o.flags,o.tag){case 0:if((r&4)!==0&&(r=o.updateQueue,r=r!==null?r.events:null,r!==null))for(c=0;c<r.length;c++)m=r[c],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&v!==null){r=void 0,c=o,m=v.memoizedProps,v=v.memoizedState,u=c.stateNode;try{var Re=Ui(c.type,m);r=u.getSnapshotBeforeUpdate(Re,v),u.__reactInternalSnapshotBeforeUpdate=r}catch($e){_t(c,c.return,$e)}}break;case 3:if((r&1024)!==0){if(r=o.stateNode.containerInfo,c=r.nodeType,c===9)Tg(r);else if(c===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Tg(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(s(163))}if(r=o.sibling,r!==null){r.return=o.return,xn=r;break}xn=o.return}}function FS(r,o,c){var u=c.flags;switch(c.tag){case 0:case 11:case 15:zs(r,c),u&4&&Il(5,c);break;case 1:if(zs(r,c),u&4)if(r=c.stateNode,o===null)try{r.componentDidMount()}catch(E){_t(c,c.return,E)}else{var m=Ui(c.type,o.memoizedProps);o=o.memoizedState;try{r.componentDidUpdate(m,o,r.__reactInternalSnapshotBeforeUpdate)}catch(E){_t(c,c.return,E)}}u&64&&DS(c),u&512&&Pl(c,c.return);break;case 3:if(zs(r,c),u&64&&(r=c.updateQueue,r!==null)){if(o=null,c.child!==null)switch(c.child.tag){case 27:case 5:o=c.child.stateNode;break;case 1:o=c.child.stateNode}try{C0(r,o)}catch(E){_t(c,c.return,E)}}break;case 27:o===null&&u&4&&$S(c);case 26:case 5:zs(r,c),o===null&&u&4&&LS(c),u&512&&Pl(c,c.return);break;case 12:zs(r,c);break;case 31:zs(r,c),u&4&&VS(r,c);break;case 13:zs(r,c),u&4&&KS(r,c),u&64&&(r=c.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(c=BO.bind(null,c),aM(r,c))));break;case 22:if(u=c.memoizedState!==null||Ps,!u){o=o!==null&&o.memoizedState!==null||on,m=Ps;var v=on;Ps=u,(on=o)&&!v?Ls(r,c,(c.subtreeFlags&8772)!==0):zs(r,c),Ps=m,on=v}break;case 30:break;default:zs(r,c)}}function HS(r){var o=r.alternate;o!==null&&(r.alternate=null,HS(o)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(o=r.stateNode,o!==null&&Ap(o)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var Ut=null,Bn=!1;function Ds(r,o,c){for(c=c.child;c!==null;)qS(r,o,c),c=c.sibling}function qS(r,o,c){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(Er,c)}catch{}switch(c.tag){case 26:on||ds(c,o),Ds(r,o,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:on||ds(c,o);var u=Ut,m=Bn;Oo(c.type)&&(Ut=c.stateNode,Bn=!1),Ds(r,o,c),ql(c.stateNode),Ut=u,Bn=m;break;case 5:on||ds(c,o);case 6:if(u=Ut,m=Bn,Ut=null,Ds(r,o,c),Ut=u,Bn=m,Ut!==null)if(Bn)try{(Ut.nodeType===9?Ut.body:Ut.nodeName==="HTML"?Ut.ownerDocument.body:Ut).removeChild(c.stateNode)}catch(v){_t(c,o,v)}else try{Ut.removeChild(c.stateNode)}catch(v){_t(c,o,v)}break;case 18:Ut!==null&&(Bn?(r=Ut,D_(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,c.stateNode),ic(r)):D_(Ut,c.stateNode));break;case 4:u=Ut,m=Bn,Ut=c.stateNode.containerInfo,Bn=!0,Ds(r,o,c),Ut=u,Bn=m;break;case 0:case 11:case 14:case 15:To(2,c,o),on||To(4,c,o),Ds(r,o,c);break;case 1:on||(ds(c,o),u=c.stateNode,typeof u.componentWillUnmount=="function"&&zS(c,o,u)),Ds(r,o,c);break;case 21:Ds(r,o,c);break;case 22:on=(u=on)||c.memoizedState!==null,Ds(r,o,c),on=u;break;default:Ds(r,o,c)}}function VS(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{ic(r)}catch(c){_t(o,o.return,c)}}}function KS(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{ic(r)}catch(c){_t(o,o.return,c)}}function MO(r){switch(r.tag){case 31:case 13:case 19:var o=r.stateNode;return o===null&&(o=r.stateNode=new BS),o;case 22:return r=r.stateNode,o=r._retryCache,o===null&&(o=r._retryCache=new BS),o;default:throw Error(s(435,r.tag))}}function Zf(r,o){var c=MO(r);o.forEach(function(u){if(!c.has(u)){c.add(u);var m=FO.bind(null,r,u);u.then(m,m)}})}function Fn(r,o){var c=o.deletions;if(c!==null)for(var u=0;u<c.length;u++){var m=c[u],v=r,E=o,k=E;e:for(;k!==null;){switch(k.tag){case 27:if(Oo(k.type)){Ut=k.stateNode,Bn=!1;break e}break;case 5:Ut=k.stateNode,Bn=!1;break e;case 3:case 4:Ut=k.stateNode.containerInfo,Bn=!0;break e}k=k.return}if(Ut===null)throw Error(s(160));qS(v,E,m),Ut=null,Bn=!1,v=m.alternate,v!==null&&(v.return=null),m.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)GS(o,r),o=o.sibling}var Qr=null;function GS(r,o){var c=r.alternate,u=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Fn(o,r),Hn(r),u&4&&(To(3,r,r.return),Il(3,r),To(5,r,r.return));break;case 1:Fn(o,r),Hn(r),u&512&&(on||c===null||ds(c,c.return)),u&64&&Ps&&(r=r.updateQueue,r!==null&&(u=r.callbacks,u!==null&&(c=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=c===null?u:c.concat(u))));break;case 26:var m=Qr;if(Fn(o,r),Hn(r),u&512&&(on||c===null||ds(c,c.return)),u&4){var v=c!==null?c.memoizedState:null;if(u=r.memoizedState,c===null)if(u===null)if(r.stateNode===null){e:{u=r.type,c=r.memoizedProps,m=m.ownerDocument||m;t:switch(u){case"title":v=m.getElementsByTagName("title")[0],(!v||v[cl]||v[Sn]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=m.createElement(u),m.head.insertBefore(v,m.querySelector("head > title"))),Tn(v,u,c),v[Sn]=r,bn(v),u=v;break e;case"link":var E=G_("link","href",m).get(u+(c.href||""));if(E){for(var k=0;k<E.length;k++)if(v=E[k],v.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&v.getAttribute("rel")===(c.rel==null?null:c.rel)&&v.getAttribute("title")===(c.title==null?null:c.title)&&v.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){E.splice(k,1);break t}}v=m.createElement(u),Tn(v,u,c),m.head.appendChild(v);break;case"meta":if(E=G_("meta","content",m).get(u+(c.content||""))){for(k=0;k<E.length;k++)if(v=E[k],v.getAttribute("content")===(c.content==null?null:""+c.content)&&v.getAttribute("name")===(c.name==null?null:c.name)&&v.getAttribute("property")===(c.property==null?null:c.property)&&v.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&v.getAttribute("charset")===(c.charSet==null?null:c.charSet)){E.splice(k,1);break t}}v=m.createElement(u),Tn(v,u,c),m.head.appendChild(v);break;default:throw Error(s(468,u))}v[Sn]=r,bn(v),u=v}r.stateNode=u}else Z_(m,r.type,r.stateNode);else r.stateNode=K_(m,u,r.memoizedProps);else v!==u?(v===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):v.count--,u===null?Z_(m,r.type,r.stateNode):K_(m,u,r.memoizedProps)):u===null&&r.stateNode!==null&&Qm(r,r.memoizedProps,c.memoizedProps)}break;case 27:Fn(o,r),Hn(r),u&512&&(on||c===null||ds(c,c.return)),c!==null&&u&4&&Qm(r,r.memoizedProps,c.memoizedProps);break;case 5:if(Fn(o,r),Hn(r),u&512&&(on||c===null||ds(c,c.return)),r.flags&32){m=r.stateNode;try{ja(m,"")}catch(Re){_t(r,r.return,Re)}}u&4&&r.stateNode!=null&&(m=r.memoizedProps,Qm(r,m,c!==null?c.memoizedProps:m)),u&1024&&(eg=!0);break;case 6:if(Fn(o,r),Hn(r),u&4){if(r.stateNode===null)throw Error(s(162));u=r.memoizedProps,c=r.stateNode;try{c.nodeValue=u}catch(Re){_t(r,r.return,Re)}}break;case 3:if(ud=null,m=Qr,Qr=cd(o.containerInfo),Fn(o,r),Qr=m,Hn(r),u&4&&c!==null&&c.memoizedState.isDehydrated)try{ic(o.containerInfo)}catch(Re){_t(r,r.return,Re)}eg&&(eg=!1,ZS(r));break;case 4:u=Qr,Qr=cd(r.stateNode.containerInfo),Fn(o,r),Hn(r),Qr=u;break;case 12:Fn(o,r),Hn(r);break;case 31:Fn(o,r),Hn(r),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,Zf(r,u)));break;case 13:Fn(o,r),Hn(r),r.child.flags&8192&&r.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Xf=Be()),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,Zf(r,u)));break;case 22:m=r.memoizedState!==null;var $=c!==null&&c.memoizedState!==null,te=Ps,ce=on;if(Ps=te||m,on=ce||$,Fn(o,r),on=ce,Ps=te,Hn(r),u&8192)e:for(o=r.stateNode,o._visibility=m?o._visibility&-2:o._visibility|1,m&&(c===null||$||Ps||on||$i(r)),c=null,o=r;;){if(o.tag===5||o.tag===26){if(c===null){$=c=o;try{if(v=$.stateNode,m)E=v.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{k=$.stateNode;var de=$.memoizedProps.style,ne=de!=null&&de.hasOwnProperty("display")?de.display:null;k.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(Re){_t($,$.return,Re)}}}else if(o.tag===6){if(c===null){$=o;try{$.stateNode.nodeValue=m?"":$.memoizedProps}catch(Re){_t($,$.return,Re)}}}else if(o.tag===18){if(c===null){$=o;try{var oe=$.stateNode;m?z_(oe,!0):z_($.stateNode,!1)}catch(Re){_t($,$.return,Re)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===r)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break e;for(;o.sibling===null;){if(o.return===null||o.return===r)break e;c===o&&(c=null),o=o.return}c===o&&(c=null),o.sibling.return=o.return,o=o.sibling}u&4&&(u=r.updateQueue,u!==null&&(c=u.retryQueue,c!==null&&(u.retryQueue=null,Zf(r,c))));break;case 19:Fn(o,r),Hn(r),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,Zf(r,u)));break;case 30:break;case 21:break;default:Fn(o,r),Hn(r)}}function Hn(r){var o=r.flags;if(o&2){try{for(var c,u=r.return;u!==null;){if(US(u)){c=u;break}u=u.return}if(c==null)throw Error(s(160));switch(c.tag){case 27:var m=c.stateNode,v=Wm(r);Gf(r,v,m);break;case 5:var E=c.stateNode;c.flags&32&&(ja(E,""),c.flags&=-33);var k=Wm(r);Gf(r,k,E);break;case 3:case 4:var $=c.stateNode.containerInfo,te=Wm(r);Jm(r,te,$);break;default:throw Error(s(161))}}catch(ce){_t(r,r.return,ce)}r.flags&=-3}o&4096&&(r.flags&=-4097)}function ZS(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var o=r;ZS(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),r=r.sibling}}function zs(r,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)FS(r,o.alternate,o),o=o.sibling}function $i(r){for(r=r.child;r!==null;){var o=r;switch(o.tag){case 0:case 11:case 14:case 15:To(4,o,o.return),$i(o);break;case 1:ds(o,o.return);var c=o.stateNode;typeof c.componentWillUnmount=="function"&&zS(o,o.return,c),$i(o);break;case 27:ql(o.stateNode);case 26:case 5:ds(o,o.return),$i(o);break;case 22:o.memoizedState===null&&$i(o);break;case 30:$i(o);break;default:$i(o)}r=r.sibling}}function Ls(r,o,c){for(c=c&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var u=o.alternate,m=r,v=o,E=v.flags;switch(v.tag){case 0:case 11:case 15:Ls(m,v,c),Il(4,v);break;case 1:if(Ls(m,v,c),u=v,m=u.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(te){_t(u,u.return,te)}if(u=v,m=u.updateQueue,m!==null){var k=u.stateNode;try{var $=m.shared.hiddenCallbacks;if($!==null)for(m.shared.hiddenCallbacks=null,m=0;m<$.length;m++)T0($[m],k)}catch(te){_t(u,u.return,te)}}c&&E&64&&DS(v),Pl(v,v.return);break;case 27:$S(v);case 26:case 5:Ls(m,v,c),c&&u===null&&E&4&&LS(v),Pl(v,v.return);break;case 12:Ls(m,v,c);break;case 31:Ls(m,v,c),c&&E&4&&VS(m,v);break;case 13:Ls(m,v,c),c&&E&4&&KS(m,v);break;case 22:v.memoizedState===null&&Ls(m,v,c),Pl(v,v.return);break;case 30:break;default:Ls(m,v,c)}o=o.sibling}}function tg(r,o){var c=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),r=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(r=o.memoizedState.cachePool.pool),r!==c&&(r!=null&&r.refCount++,c!=null&&Sl(c))}function ng(r,o){r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&Sl(r))}function Wr(r,o,c,u){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)YS(r,o,c,u),o=o.sibling}function YS(r,o,c,u){var m=o.flags;switch(o.tag){case 0:case 11:case 15:Wr(r,o,c,u),m&2048&&Il(9,o);break;case 1:Wr(r,o,c,u);break;case 3:Wr(r,o,c,u),m&2048&&(r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&Sl(r)));break;case 12:if(m&2048){Wr(r,o,c,u),r=o.stateNode;try{var v=o.memoizedProps,E=v.id,k=v.onPostCommit;typeof k=="function"&&k(E,o.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch($){_t(o,o.return,$)}}else Wr(r,o,c,u);break;case 31:Wr(r,o,c,u);break;case 13:Wr(r,o,c,u);break;case 23:break;case 22:v=o.stateNode,E=o.alternate,o.memoizedState!==null?v._visibility&2?Wr(r,o,c,u):Dl(r,o):v._visibility&2?Wr(r,o,c,u):(v._visibility|=2,Ya(r,o,c,u,(o.subtreeFlags&10256)!==0||!1)),m&2048&&tg(E,o);break;case 24:Wr(r,o,c,u),m&2048&&ng(o.alternate,o);break;default:Wr(r,o,c,u)}}function Ya(r,o,c,u,m){for(m=m&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var v=r,E=o,k=c,$=u,te=E.flags;switch(E.tag){case 0:case 11:case 15:Ya(v,E,k,$,m),Il(8,E);break;case 23:break;case 22:var ce=E.stateNode;E.memoizedState!==null?ce._visibility&2?Ya(v,E,k,$,m):Dl(v,E):(ce._visibility|=2,Ya(v,E,k,$,m)),m&&te&2048&&tg(E.alternate,E);break;case 24:Ya(v,E,k,$,m),m&&te&2048&&ng(E.alternate,E);break;default:Ya(v,E,k,$,m)}o=o.sibling}}function Dl(r,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var c=r,u=o,m=u.flags;switch(u.tag){case 22:Dl(c,u),m&2048&&tg(u.alternate,u);break;case 24:Dl(c,u),m&2048&&ng(u.alternate,u);break;default:Dl(c,u)}o=o.sibling}}var zl=8192;function Xa(r,o,c){if(r.subtreeFlags&zl)for(r=r.child;r!==null;)XS(r,o,c),r=r.sibling}function XS(r,o,c){switch(r.tag){case 26:Xa(r,o,c),r.flags&zl&&r.memoizedState!==null&&bM(c,Qr,r.memoizedState,r.memoizedProps);break;case 5:Xa(r,o,c);break;case 3:case 4:var u=Qr;Qr=cd(r.stateNode.containerInfo),Xa(r,o,c),Qr=u;break;case 22:r.memoizedState===null&&(u=r.alternate,u!==null&&u.memoizedState!==null?(u=zl,zl=16777216,Xa(r,o,c),zl=u):Xa(r,o,c));break;default:Xa(r,o,c)}}function QS(r){var o=r.alternate;if(o!==null&&(r=o.child,r!==null)){o.child=null;do o=r.sibling,r.sibling=null,r=o;while(r!==null)}}function Ll(r){var o=r.deletions;if((r.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var u=o[c];xn=u,JS(u,r)}QS(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)WS(r),r=r.sibling}function WS(r){switch(r.tag){case 0:case 11:case 15:Ll(r),r.flags&2048&&To(9,r,r.return);break;case 3:Ll(r);break;case 12:Ll(r);break;case 22:var o=r.stateNode;r.memoizedState!==null&&o._visibility&2&&(r.return===null||r.return.tag!==13)?(o._visibility&=-3,Yf(r)):Ll(r);break;default:Ll(r)}}function Yf(r){var o=r.deletions;if((r.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var u=o[c];xn=u,JS(u,r)}QS(r)}for(r=r.child;r!==null;){switch(o=r,o.tag){case 0:case 11:case 15:To(8,o,o.return),Yf(o);break;case 22:c=o.stateNode,c._visibility&2&&(c._visibility&=-3,Yf(o));break;default:Yf(o)}r=r.sibling}}function JS(r,o){for(;xn!==null;){var c=xn;switch(c.tag){case 0:case 11:case 15:To(8,c,o);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var u=c.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:Sl(c.memoizedState.cache)}if(u=c.child,u!==null)u.return=c,xn=u;else e:for(c=r;xn!==null;){u=xn;var m=u.sibling,v=u.return;if(HS(u),u===c){xn=null;break e}if(m!==null){m.return=v,xn=m;break e}xn=v}}}var IO={getCacheForType:function(r){var o=wn(nn),c=o.data.get(r);return c===void 0&&(c=r(),o.data.set(r,c)),c},cacheSignal:function(){return wn(nn).controller.signal}},PO=typeof WeakMap=="function"?WeakMap:Map,gt=0,Nt=null,Je=null,tt=0,St=0,ar=null,Co=!1,Qa=!1,rg=!1,Us=0,Gt=0,Ro=0,Bi=0,sg=0,cr=0,Wa=0,Ul=null,qn=null,og=!1,Xf=0,e_=0,Qf=1/0,Wf=null,No=null,fn=0,jo=null,Ja=null,$s=0,ig=0,ag=null,t_=null,$l=0,cg=null;function lr(){return(gt&2)!==0&&tt!==0?tt&-tt:D.T!==null?pg():af()}function n_(){if(cr===0)if((tt&536870912)===0||rt){var r=Cn;Cn<<=1,(Cn&3932160)===0&&(Cn=262144),cr=r}else cr=536870912;return r=or.current,r!==null&&(r.flags|=32),cr}function Vn(r,o,c){(r===Nt&&(St===2||St===9)||r.cancelPendingCommit!==null)&&(ec(r,0),Ao(r,tt,cr,!1)),ws(r,c),((gt&2)===0||r!==Nt)&&(r===Nt&&((gt&2)===0&&(Bi|=c),Gt===4&&Ao(r,tt,cr,!1)),hs(r))}function r_(r,o,c){if((gt&6)!==0)throw Error(s(327));var u=!c&&(o&127)===0&&(o&r.expiredLanes)===0||cs(r,o),m=u?LO(r,o):ug(r,o,!0),v=u;do{if(m===0){Qa&&!u&&Ao(r,o,0,!1);break}else{if(c=r.current.alternate,v&&!DO(c)){m=ug(r,o,!1),v=!1;continue}if(m===2){if(v=o,r.errorRecoveryDisabledLanes&v)var E=0;else E=r.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){o=E;e:{var k=r;m=Ul;var $=k.current.memoizedState.isDehydrated;if($&&(ec(k,E).flags|=256),E=ug(k,E,!1),E!==2){if(rg&&!$){k.errorRecoveryDisabledLanes|=v,Bi|=v,m=4;break e}v=qn,qn=m,v!==null&&(qn===null?qn=v:qn.push.apply(qn,v))}m=E}if(v=!1,m!==2)continue}}if(m===1){ec(r,0),Ao(r,o,0,!0);break}e:{switch(u=r,v=m,v){case 0:case 1:throw Error(s(345));case 4:if((o&4194048)!==o)break;case 6:Ao(u,o,cr,!Co);break e;case 2:qn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((o&62914560)===o&&(m=Xf+300-Be(),10<m)){if(Ao(u,o,cr,!Co),as(u,0,!0)!==0)break e;$s=o,u.timeoutHandle=I_(s_.bind(null,u,c,qn,Wf,og,o,cr,Bi,Wa,Co,v,"Throttled",-0,0),m);break e}s_(u,c,qn,Wf,og,o,cr,Bi,Wa,Co,v,null,-0,0)}}break}while(!0);hs(r)}function s_(r,o,c,u,m,v,E,k,$,te,ce,de,ne,oe){if(r.timeoutHandle=-1,de=o.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ts},XS(o,v,de);var Re=(v&62914560)===v?Xf-Be():(v&4194048)===v?e_-Be():0;if(Re=xM(de,Re),Re!==null){$s=v,r.cancelPendingCommit=Re(d_.bind(null,r,o,v,c,u,m,E,k,$,ce,de,null,ne,oe)),Ao(r,v,E,!te);return}}d_(r,o,v,c,u,m,E,k,$)}function DO(r){for(var o=r;;){var c=o.tag;if((c===0||c===11||c===15)&&o.flags&16384&&(c=o.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var u=0;u<c.length;u++){var m=c[u],v=m.getSnapshot;m=m.value;try{if(!rr(v(),m))return!1}catch{return!1}}if(c=o.child,o.subtreeFlags&16384&&c!==null)c.return=o,o=c;else{if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Ao(r,o,c,u){o&=~sg,o&=~Bi,r.suspendedLanes|=o,r.pingedLanes&=~o,u&&(r.warmLanes|=o),u=r.expirationTimes;for(var m=o;0<m;){var v=31-xt(m),E=1<<v;u[v]=-1,m&=~E}c!==0&&ls(r,c,o)}function Jf(){return(gt&6)===0?(Bl(0),!1):!0}function lg(){if(Je!==null){if(St===0)var r=Je.return;else r=Je,js=Oi=null,Tm(r),qa=null,wl=0,r=Je;for(;r!==null;)PS(r.alternate,r),r=r.return;Je=null}}function ec(r,o){var c=r.timeoutHandle;c!==-1&&(r.timeoutHandle=-1,nM(c)),c=r.cancelPendingCommit,c!==null&&(r.cancelPendingCommit=null,c()),$s=0,lg(),Nt=r,Je=c=Rs(r.current,null),tt=o,St=0,ar=null,Co=!1,Qa=cs(r,o),rg=!1,Wa=cr=sg=Bi=Ro=Gt=0,qn=Ul=null,og=!1,(o&8)!==0&&(o|=o&32);var u=r.entangledLanes;if(u!==0)for(r=r.entanglements,u&=o;0<u;){var m=31-xt(u),v=1<<m;o|=r[m],u&=~v}return Us=o,xf(),c}function o_(r,o){Ze=null,D.H=kl,o===Ha||o===Nf?(o=S0(),St=3):o===hm?(o=S0(),St=4):St=o===Bm?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,ar=o,Je===null&&(Gt=1,Ff(r,Nr(o,r.current)))}function i_(){var r=or.current;return r===null?!0:(tt&4194048)===tt?Or===null:(tt&62914560)===tt||(tt&536870912)!==0?r===Or:!1}function a_(){var r=D.H;return D.H=kl,r===null?kl:r}function c_(){var r=D.A;return D.A=IO,r}function ed(){Gt=4,Co||(tt&4194048)!==tt&&or.current!==null||(Qa=!0),(Ro&134217727)===0&&(Bi&134217727)===0||Nt===null||Ao(Nt,tt,cr,!1)}function ug(r,o,c){var u=gt;gt|=2;var m=a_(),v=c_();(Nt!==r||tt!==o)&&(Wf=null,ec(r,o)),o=!1;var E=Gt;e:do try{if(St!==0&&Je!==null){var k=Je,$=ar;switch(St){case 8:lg(),E=6;break e;case 3:case 2:case 9:case 6:or.current===null&&(o=!0);var te=St;if(St=0,ar=null,tc(r,k,$,te),c&&Qa){E=0;break e}break;default:te=St,St=0,ar=null,tc(r,k,$,te)}}zO(),E=Gt;break}catch(ce){o_(r,ce)}while(!0);return o&&r.shellSuspendCounter++,js=Oi=null,gt=u,D.H=m,D.A=v,Je===null&&(Nt=null,tt=0,xf()),E}function zO(){for(;Je!==null;)l_(Je)}function LO(r,o){var c=gt;gt|=2;var u=a_(),m=c_();Nt!==r||tt!==o?(Wf=null,Qf=Be()+500,ec(r,o)):Qa=cs(r,o);e:do try{if(St!==0&&Je!==null){o=Je;var v=ar;t:switch(St){case 1:St=0,ar=null,tc(r,o,v,1);break;case 2:case 9:if(b0(v)){St=0,ar=null,u_(o);break}o=function(){St!==2&&St!==9||Nt!==r||(St=7),hs(r)},v.then(o,o);break e;case 3:St=7;break e;case 4:St=5;break e;case 7:b0(v)?(St=0,ar=null,u_(o)):(St=0,ar=null,tc(r,o,v,7));break;case 5:var E=null;switch(Je.tag){case 26:E=Je.memoizedState;case 5:case 27:var k=Je;if(E?Y_(E):k.stateNode.complete){St=0,ar=null;var $=k.sibling;if($!==null)Je=$;else{var te=k.return;te!==null?(Je=te,td(te)):Je=null}break t}}St=0,ar=null,tc(r,o,v,5);break;case 6:St=0,ar=null,tc(r,o,v,6);break;case 8:lg(),Gt=6;break e;default:throw Error(s(462))}}UO();break}catch(ce){o_(r,ce)}while(!0);return js=Oi=null,D.H=u,D.A=m,gt=c,Je!==null?0:(Nt=null,tt=0,xf(),Gt)}function UO(){for(;Je!==null&&!Ve();)l_(Je)}function l_(r){var o=MS(r.alternate,r,Us);r.memoizedProps=r.pendingProps,o===null?td(r):Je=o}function u_(r){var o=r,c=o.alternate;switch(o.tag){case 15:case 0:o=RS(c,o,o.pendingProps,o.type,void 0,tt);break;case 11:o=RS(c,o,o.pendingProps,o.type.render,o.ref,tt);break;case 5:Tm(o);default:PS(c,o),o=Je=c0(o,Us),o=MS(c,o,Us)}r.memoizedProps=r.pendingProps,o===null?td(r):Je=o}function tc(r,o,c,u){js=Oi=null,Tm(o),qa=null,wl=0;var m=o.return;try{if(RO(r,m,o,c,tt)){Gt=1,Ff(r,Nr(c,r.current)),Je=null;return}}catch(v){if(m!==null)throw Je=m,v;Gt=1,Ff(r,Nr(c,r.current)),Je=null;return}o.flags&32768?(rt||u===1?r=!0:Qa||(tt&536870912)!==0?r=!1:(Co=r=!0,(u===2||u===9||u===3||u===6)&&(u=or.current,u!==null&&u.tag===13&&(u.flags|=16384))),f_(o,r)):td(o)}function td(r){var o=r;do{if((o.flags&32768)!==0){f_(o,Co);return}r=o.return;var c=AO(o.alternate,o,Us);if(c!==null){Je=c;return}if(o=o.sibling,o!==null){Je=o;return}Je=o=r}while(o!==null);Gt===0&&(Gt=5)}function f_(r,o){do{var c=kO(r.alternate,r);if(c!==null){c.flags&=32767,Je=c;return}if(c=r.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!o&&(r=r.sibling,r!==null)){Je=r;return}Je=r=c}while(r!==null);Gt=6,Je=null}function d_(r,o,c,u,m,v,E,k,$){r.cancelPendingCommit=null;do nd();while(fn!==0);if((gt&6)!==0)throw Error(s(327));if(o!==null){if(o===r.current)throw Error(s(177));if(v=o.lanes|o.childLanes,v|=Wp,tr(r,c,v,E,k,$),r===Nt&&(Je=Nt=null,tt=0),Ja=o,jo=r,$s=c,ig=v,ag=m,t_=u,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,HO(Te,function(){return y_(),null})):(r.callbackNode=null,r.callbackPriority=0),u=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||u){u=D.T,D.T=null,m=G.p,G.p=2,E=gt,gt|=4;try{OO(r,o,c)}finally{gt=E,G.p=m,D.T=u}}fn=1,h_(),p_(),m_()}}function h_(){if(fn===1){fn=0;var r=jo,o=Ja,c=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||c){c=D.T,D.T=null;var u=G.p;G.p=2;var m=gt;gt|=4;try{GS(o,r);var v=_g,E=Jx(r.containerInfo),k=v.focusedElem,$=v.selectionRange;if(E!==k&&k&&k.ownerDocument&&Wx(k.ownerDocument.documentElement,k)){if($!==null&&Gp(k)){var te=$.start,ce=$.end;if(ce===void 0&&(ce=te),"selectionStart"in k)k.selectionStart=te,k.selectionEnd=Math.min(ce,k.value.length);else{var de=k.ownerDocument||document,ne=de&&de.defaultView||window;if(ne.getSelection){var oe=ne.getSelection(),Re=k.textContent.length,$e=Math.min($.start,Re),Ct=$.end===void 0?$e:Math.min($.end,Re);!oe.extend&&$e>Ct&&(E=Ct,Ct=$e,$e=E);var X=Qx(k,$e),F=Qx(k,Ct);if(X&&F&&(oe.rangeCount!==1||oe.anchorNode!==X.node||oe.anchorOffset!==X.offset||oe.focusNode!==F.node||oe.focusOffset!==F.offset)){var J=de.createRange();J.setStart(X.node,X.offset),oe.removeAllRanges(),$e>Ct?(oe.addRange(J),oe.extend(F.node,F.offset)):(J.setEnd(F.node,F.offset),oe.addRange(J))}}}}for(de=[],oe=k;oe=oe.parentNode;)oe.nodeType===1&&de.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<de.length;k++){var le=de[k];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}pd=!!Sg,_g=Sg=null}finally{gt=m,G.p=u,D.T=c}}r.current=o,fn=2}}function p_(){if(fn===2){fn=0;var r=jo,o=Ja,c=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||c){c=D.T,D.T=null;var u=G.p;G.p=2;var m=gt;gt|=4;try{FS(r,o.alternate,o)}finally{gt=m,G.p=u,D.T=c}}fn=3}}function m_(){if(fn===4||fn===3){fn=0,Qe();var r=jo,o=Ja,c=$s,u=t_;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?fn=5:(fn=0,Ja=jo=null,g_(r,r.pendingLanes));var m=r.pendingLanes;if(m===0&&(No=null),al(c),o=o.stateNode,Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot(Er,o,void 0,(o.current.flags&128)===128)}catch{}if(u!==null){o=D.T,m=G.p,G.p=2,D.T=null;try{for(var v=r.onRecoverableError,E=0;E<u.length;E++){var k=u[E];v(k.value,{componentStack:k.stack})}}finally{D.T=o,G.p=m}}($s&3)!==0&&nd(),hs(r),m=r.pendingLanes,(c&261930)!==0&&(m&42)!==0?r===cg?$l++:($l=0,cg=r):$l=0,Bl(0)}}function g_(r,o){(r.pooledCacheLanes&=o)===0&&(o=r.pooledCache,o!=null&&(r.pooledCache=null,Sl(o)))}function nd(){return h_(),p_(),m_(),y_()}function y_(){if(fn!==5)return!1;var r=jo,o=ig;ig=0;var c=al($s),u=D.T,m=G.p;try{G.p=32>c?32:c,D.T=null,c=ag,ag=null;var v=jo,E=$s;if(fn=0,Ja=jo=null,$s=0,(gt&6)!==0)throw Error(s(331));var k=gt;if(gt|=4,WS(v.current),YS(v,v.current,E,c),gt=k,Bl(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(Er,v)}catch{}return!0}finally{G.p=m,D.T=u,g_(r,o)}}function v_(r,o,c){o=Nr(c,o),o=$m(r.stateNode,o,2),r=_o(r,o,2),r!==null&&(ws(r,2),hs(r))}function _t(r,o,c){if(r.tag===3)v_(r,r,c);else for(;o!==null;){if(o.tag===3){v_(o,r,c);break}else if(o.tag===1){var u=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(No===null||!No.has(u))){r=Nr(c,r),c=bS(2),u=_o(o,c,2),u!==null&&(xS(c,u,o,r),ws(u,2),hs(u));break}}o=o.return}}function fg(r,o,c){var u=r.pingCache;if(u===null){u=r.pingCache=new PO;var m=new Set;u.set(o,m)}else m=u.get(o),m===void 0&&(m=new Set,u.set(o,m));m.has(c)||(rg=!0,m.add(c),r=$O.bind(null,r,o,c),o.then(r,r))}function $O(r,o,c){var u=r.pingCache;u!==null&&u.delete(o),r.pingedLanes|=r.suspendedLanes&c,r.warmLanes&=~c,Nt===r&&(tt&c)===c&&(Gt===4||Gt===3&&(tt&62914560)===tt&&300>Be()-Xf?(gt&2)===0&&ec(r,0):sg|=c,Wa===tt&&(Wa=0)),hs(r)}function b_(r,o){o===0&&(o=wi()),r=ji(r,o),r!==null&&(ws(r,o),hs(r))}function BO(r){var o=r.memoizedState,c=0;o!==null&&(c=o.retryLane),b_(r,c)}function FO(r,o){var c=0;switch(r.tag){case 31:case 13:var u=r.stateNode,m=r.memoizedState;m!==null&&(c=m.retryLane);break;case 19:u=r.stateNode;break;case 22:u=r.stateNode._retryCache;break;default:throw Error(s(314))}u!==null&&u.delete(o),b_(r,c)}function HO(r,o){return Ue(r,o)}var rd=null,nc=null,dg=!1,sd=!1,hg=!1,ko=0;function hs(r){r!==nc&&r.next===null&&(nc===null?rd=nc=r:nc=nc.next=r),sd=!0,dg||(dg=!0,VO())}function Bl(r,o){if(!hg&&sd){hg=!0;do for(var c=!1,u=rd;u!==null;){if(r!==0){var m=u.pendingLanes;if(m===0)var v=0;else{var E=u.suspendedLanes,k=u.pingedLanes;v=(1<<31-xt(42|r)+1)-1,v&=m&~(E&~k),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(c=!0,w_(u,v))}else v=tt,v=as(u,u===Nt?v:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(v&3)===0||cs(u,v)||(c=!0,w_(u,v));u=u.next}while(c);hg=!1}}function qO(){x_()}function x_(){sd=dg=!1;var r=0;ko!==0&&tM()&&(r=ko);for(var o=Be(),c=null,u=rd;u!==null;){var m=u.next,v=S_(u,o);v===0?(u.next=null,c===null?rd=m:c.next=m,m===null&&(nc=c)):(c=u,(r!==0||(v&3)!==0)&&(sd=!0)),u=m}fn!==0&&fn!==5||Bl(r),ko!==0&&(ko=0)}function S_(r,o){for(var c=r.suspendedLanes,u=r.pingedLanes,m=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var E=31-xt(v),k=1<<E,$=m[E];$===-1?((k&c)===0||(k&u)!==0)&&(m[E]=_a(k,o)):$<=o&&(r.expiredLanes|=k),v&=~k}if(o=Nt,c=tt,c=as(r,r===o?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),u=r.callbackNode,c===0||r===o&&(St===2||St===9)||r.cancelPendingCommit!==null)return u!==null&&u!==null&&Ee(u),r.callbackNode=null,r.callbackPriority=0;if((c&3)===0||cs(r,c)){if(o=c&-c,o===r.callbackPriority)return o;switch(u!==null&&Ee(u),al(c)){case 2:case 8:c=me;break;case 32:c=Te;break;case 268435456:c=mt;break;default:c=Te}return u=__.bind(null,r),c=Ue(c,u),r.callbackPriority=o,r.callbackNode=c,o}return u!==null&&u!==null&&Ee(u),r.callbackPriority=2,r.callbackNode=null,2}function __(r,o){if(fn!==0&&fn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var c=r.callbackNode;if(nd()&&r.callbackNode!==c)return null;var u=tt;return u=as(r,r===Nt?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),u===0?null:(r_(r,u,o),S_(r,Be()),r.callbackNode!=null&&r.callbackNode===c?__.bind(null,r):null)}function w_(r,o){if(nd())return null;r_(r,o,!0)}function VO(){rM(function(){(gt&6)!==0?Ue(He,qO):x_()})}function pg(){if(ko===0){var r=Ba;r===0&&(r=kt,kt<<=1,(kt&261888)===0&&(kt=256)),ko=r}return ko}function E_(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:df(""+r)}function T_(r,o){var c=o.ownerDocument.createElement("input");return c.name=o.name,c.value=o.value,r.id&&c.setAttribute("form",r.id),o.parentNode.insertBefore(c,o),r=new FormData(r),c.parentNode.removeChild(c),r}function KO(r,o,c,u,m){if(o==="submit"&&c&&c.stateNode===m){var v=E_((m[Un]||null).action),E=u.submitter;E&&(o=(o=E[Un]||null)?E_(o.formAction):E.getAttribute("formAction"),o!==null&&(v=o,E=null));var k=new gf("action","action",null,u,m);r.push({event:k,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(ko!==0){var $=E?T_(m,E):new FormData(m);Im(c,{pending:!0,data:$,method:m.method,action:v},null,$)}}else typeof v=="function"&&(k.preventDefault(),$=E?T_(m,E):new FormData(m),Im(c,{pending:!0,data:$,method:m.method,action:v},v,$))},currentTarget:m}]})}}for(var mg=0;mg<Qp.length;mg++){var gg=Qp[mg],GO=gg.toLowerCase(),ZO=gg[0].toUpperCase()+gg.slice(1);Xr(GO,"on"+ZO)}Xr(n0,"onAnimationEnd"),Xr(r0,"onAnimationIteration"),Xr(s0,"onAnimationStart"),Xr("dblclick","onDoubleClick"),Xr("focusin","onFocus"),Xr("focusout","onBlur"),Xr(uO,"onTransitionRun"),Xr(fO,"onTransitionStart"),Xr(dO,"onTransitionCancel"),Xr(o0,"onTransitionEnd"),Ra("onMouseEnter",["mouseout","mouseover"]),Ra("onMouseLeave",["mouseout","mouseover"]),Ra("onPointerEnter",["pointerout","pointerover"]),Ra("onPointerLeave",["pointerout","pointerover"]),Ti("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ti("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ti("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ti("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ti("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ti("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fl="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(" "),YO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Fl));function C_(r,o){o=(o&4)!==0;for(var c=0;c<r.length;c++){var u=r[c],m=u.event;u=u.listeners;e:{var v=void 0;if(o)for(var E=u.length-1;0<=E;E--){var k=u[E],$=k.instance,te=k.currentTarget;if(k=k.listener,$!==v&&m.isPropagationStopped())break e;v=k,m.currentTarget=te;try{v(m)}catch(ce){bf(ce)}m.currentTarget=null,v=$}else for(E=0;E<u.length;E++){if(k=u[E],$=k.instance,te=k.currentTarget,k=k.listener,$!==v&&m.isPropagationStopped())break e;v=k,m.currentTarget=te;try{v(m)}catch(ce){bf(ce)}m.currentTarget=null,v=$}}}}function et(r,o){var c=o[jp];c===void 0&&(c=o[jp]=new Set);var u=r+"__bubble";c.has(u)||(R_(o,r,2,!1),c.add(u))}function yg(r,o,c){var u=0;o&&(u|=4),R_(c,r,u,o)}var od="_reactListening"+Math.random().toString(36).slice(2);function vg(r){if(!r[od]){r[od]=!0,xx.forEach(function(c){c!=="selectionchange"&&(YO.has(c)||yg(c,!1,r),yg(c,!0,r))});var o=r.nodeType===9?r:r.ownerDocument;o===null||o[od]||(o[od]=!0,yg("selectionchange",!1,o))}}function R_(r,o,c,u){switch(nw(o)){case 2:var m=wM;break;case 8:m=EM;break;default:m=Mg}c=m.bind(null,o,c,r),m=void 0,!Lp||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(m=!0),u?m!==void 0?r.addEventListener(o,c,{capture:!0,passive:m}):r.addEventListener(o,c,!0):m!==void 0?r.addEventListener(o,c,{passive:m}):r.addEventListener(o,c,!1)}function bg(r,o,c,u,m){var v=u;if((o&1)===0&&(o&2)===0&&u!==null)e:for(;;){if(u===null)return;var E=u.tag;if(E===3||E===4){var k=u.stateNode.containerInfo;if(k===m)break;if(E===4)for(E=u.return;E!==null;){var $=E.tag;if(($===3||$===4)&&E.stateNode.containerInfo===m)return;E=E.return}for(;k!==null;){if(E=Ea(k),E===null)return;if($=E.tag,$===5||$===6||$===26||$===27){u=v=E;continue e}k=k.parentNode}}u=u.return}Ox(function(){var te=v,ce=Dp(c),de=[];e:{var ne=i0.get(r);if(ne!==void 0){var oe=gf,Re=r;switch(r){case"keypress":if(pf(c)===0)break e;case"keydown":case"keyup":oe=Fk;break;case"focusin":Re="focus",oe=Fp;break;case"focusout":Re="blur",oe=Fp;break;case"beforeblur":case"afterblur":oe=Fp;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=Px;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=Ak;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=Vk;break;case n0:case r0:case s0:oe=Mk;break;case o0:oe=Gk;break;case"scroll":case"scrollend":oe=Nk;break;case"wheel":oe=Yk;break;case"copy":case"cut":case"paste":oe=Pk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=zx;break;case"toggle":case"beforetoggle":oe=Qk}var $e=(o&4)!==0,Ct=!$e&&(r==="scroll"||r==="scrollend"),X=$e?ne!==null?ne+"Capture":null:ne;$e=[];for(var F=te,J;F!==null;){var le=F;if(J=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||J===null||X===null||(le=ul(F,X),le!=null&&$e.push(Hl(F,le,J))),Ct)break;F=F.return}0<$e.length&&(ne=new oe(ne,Re,null,c,ce),de.push({event:ne,listeners:$e}))}}if((o&7)===0){e:{if(ne=r==="mouseover"||r==="pointerover",oe=r==="mouseout"||r==="pointerout",ne&&c!==Pp&&(Re=c.relatedTarget||c.fromElement)&&(Ea(Re)||Re[wa]))break e;if((oe||ne)&&(ne=ce.window===ce?ce:(ne=ce.ownerDocument)?ne.defaultView||ne.parentWindow:window,oe?(Re=c.relatedTarget||c.toElement,oe=te,Re=Re?Ea(Re):null,Re!==null&&(Ct=a(Re),$e=Re.tag,Re!==Ct||$e!==5&&$e!==27&&$e!==6)&&(Re=null)):(oe=null,Re=te),oe!==Re)){if($e=Px,le="onMouseLeave",X="onMouseEnter",F="mouse",(r==="pointerout"||r==="pointerover")&&($e=zx,le="onPointerLeave",X="onPointerEnter",F="pointer"),Ct=oe==null?ne:ll(oe),J=Re==null?ne:ll(Re),ne=new $e(le,F+"leave",oe,c,ce),ne.target=Ct,ne.relatedTarget=J,le=null,Ea(ce)===te&&($e=new $e(X,F+"enter",Re,c,ce),$e.target=J,$e.relatedTarget=Ct,le=$e),Ct=le,oe&&Re)t:{for($e=XO,X=oe,F=Re,J=0,le=X;le;le=$e(le))J++;le=0;for(var ze=F;ze;ze=$e(ze))le++;for(;0<J-le;)X=$e(X),J--;for(;0<le-J;)F=$e(F),le--;for(;J--;){if(X===F||F!==null&&X===F.alternate){$e=X;break t}X=$e(X),F=$e(F)}$e=null}else $e=null;oe!==null&&N_(de,ne,oe,$e,!1),Re!==null&&Ct!==null&&N_(de,Ct,Re,$e,!0)}}e:{if(ne=te?ll(te):window,oe=ne.nodeName&&ne.nodeName.toLowerCase(),oe==="select"||oe==="input"&&ne.type==="file")var ft=Vx;else if(Hx(ne))if(Kx)ft=aO;else{ft=oO;var ke=sO}else oe=ne.nodeName,!oe||oe.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?te&&Ip(te.elementType)&&(ft=Vx):ft=iO;if(ft&&(ft=ft(r,te))){qx(de,ft,c,ce);break e}ke&&ke(r,ne,te),r==="focusout"&&te&&ne.type==="number"&&te.memoizedProps.value!=null&&Mp(ne,"number",ne.value)}switch(ke=te?ll(te):window,r){case"focusin":(Hx(ke)||ke.contentEditable==="true")&&(Ma=ke,Zp=te,vl=null);break;case"focusout":vl=Zp=Ma=null;break;case"mousedown":Yp=!0;break;case"contextmenu":case"mouseup":case"dragend":Yp=!1,e0(de,c,ce);break;case"selectionchange":if(lO)break;case"keydown":case"keyup":e0(de,c,ce)}var Ye;if(qp)e:{switch(r){case"compositionstart":var nt="onCompositionStart";break e;case"compositionend":nt="onCompositionEnd";break e;case"compositionupdate":nt="onCompositionUpdate";break e}nt=void 0}else Oa?Bx(r,c)&&(nt="onCompositionEnd"):r==="keydown"&&c.keyCode===229&&(nt="onCompositionStart");nt&&(Lx&&c.locale!=="ko"&&(Oa||nt!=="onCompositionStart"?nt==="onCompositionEnd"&&Oa&&(Ye=Mx()):(mo=ce,Up="value"in mo?mo.value:mo.textContent,Oa=!0)),ke=id(te,nt),0<ke.length&&(nt=new Dx(nt,r,null,c,ce),de.push({event:nt,listeners:ke}),Ye?nt.data=Ye:(Ye=Fx(c),Ye!==null&&(nt.data=Ye)))),(Ye=Jk?eO(r,c):tO(r,c))&&(nt=id(te,"onBeforeInput"),0<nt.length&&(ke=new Dx("onBeforeInput","beforeinput",null,c,ce),de.push({event:ke,listeners:nt}),ke.data=Ye)),KO(de,r,te,c,ce)}C_(de,o)})}function Hl(r,o,c){return{instance:r,listener:o,currentTarget:c}}function id(r,o){for(var c=o+"Capture",u=[];r!==null;){var m=r,v=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||v===null||(m=ul(r,c),m!=null&&u.unshift(Hl(r,m,v)),m=ul(r,o),m!=null&&u.push(Hl(r,m,v))),r.tag===3)return u;r=r.return}return[]}function XO(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function N_(r,o,c,u,m){for(var v=o._reactName,E=[];c!==null&&c!==u;){var k=c,$=k.alternate,te=k.stateNode;if(k=k.tag,$!==null&&$===u)break;k!==5&&k!==26&&k!==27||te===null||($=te,m?(te=ul(c,v),te!=null&&E.unshift(Hl(c,te,$))):m||(te=ul(c,v),te!=null&&E.push(Hl(c,te,$)))),c=c.return}E.length!==0&&r.push({event:o,listeners:E})}var QO=/\r\n?/g,WO=/\u0000|\uFFFD/g;function j_(r){return(typeof r=="string"?r:""+r).replace(QO,`
|
|
67
|
-
`).replace(WO,"")}function A_(r,o){return o=j_(o),j_(r)===o}function Tt(r,o,c,u,m,v){switch(c){case"children":typeof u=="string"?o==="body"||o==="textarea"&&u===""||ja(r,u):(typeof u=="number"||typeof u=="bigint")&&o!=="body"&&ja(r,""+u);break;case"className":uf(r,"class",u);break;case"tabIndex":uf(r,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":uf(r,c,u);break;case"style":Ax(r,u,v);break;case"data":if(o!=="object"){uf(r,"data",u);break}case"src":case"href":if(u===""&&(o!=="a"||c!=="href")){r.removeAttribute(c);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){r.removeAttribute(c);break}u=df(""+u),r.setAttribute(c,u);break;case"action":case"formAction":if(typeof u=="function"){r.setAttribute(c,"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 v=="function"&&(c==="formAction"?(o!=="input"&&Tt(r,o,"name",m.name,m,null),Tt(r,o,"formEncType",m.formEncType,m,null),Tt(r,o,"formMethod",m.formMethod,m,null),Tt(r,o,"formTarget",m.formTarget,m,null)):(Tt(r,o,"encType",m.encType,m,null),Tt(r,o,"method",m.method,m,null),Tt(r,o,"target",m.target,m,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){r.removeAttribute(c);break}u=df(""+u),r.setAttribute(c,u);break;case"onClick":u!=null&&(r.onclick=Ts);break;case"onScroll":u!=null&&et("scroll",r);break;case"onScrollEnd":u!=null&&et("scrollend",r);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(s(61));if(c=u.__html,c!=null){if(m.children!=null)throw Error(s(60));r.innerHTML=c}}break;case"multiple":r.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":r.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){r.removeAttribute("xlink:href");break}c=df(""+u),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(c,""+u):r.removeAttribute(c);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":u&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(c,""):r.removeAttribute(c);break;case"capture":case"download":u===!0?r.setAttribute(c,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(c,u):r.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?r.setAttribute(c,u):r.removeAttribute(c);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?r.removeAttribute(c):r.setAttribute(c,u);break;case"popover":et("beforetoggle",r),et("toggle",r),lf(r,"popover",u);break;case"xlinkActuate":Es(r,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Es(r,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Es(r,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Es(r,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Es(r,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Es(r,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Es(r,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Es(r,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Es(r,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":lf(r,"is",u);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=Ck.get(c)||c,lf(r,c,u))}}function xg(r,o,c,u,m,v){switch(c){case"style":Ax(r,u,v);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(s(61));if(c=u.__html,c!=null){if(m.children!=null)throw Error(s(60));r.innerHTML=c}}break;case"children":typeof u=="string"?ja(r,u):(typeof u=="number"||typeof u=="bigint")&&ja(r,""+u);break;case"onScroll":u!=null&&et("scroll",r);break;case"onScrollEnd":u!=null&&et("scrollend",r);break;case"onClick":u!=null&&(r.onclick=Ts);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Sx.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(m=c.endsWith("Capture"),o=c.slice(2,m?c.length-7:void 0),v=r[Un]||null,v=v!=null?v[c]:null,typeof v=="function"&&r.removeEventListener(o,v,m),typeof u=="function")){typeof v!="function"&&v!==null&&(c in r?r[c]=null:r.hasAttribute(c)&&r.removeAttribute(c)),r.addEventListener(o,u,m);break e}c in r?r[c]=u:u===!0?r.setAttribute(c,""):lf(r,c,u)}}}function Tn(r,o,c){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":et("error",r),et("load",r);var u=!1,m=!1,v;for(v in c)if(c.hasOwnProperty(v)){var E=c[v];if(E!=null)switch(v){case"src":u=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,o));default:Tt(r,o,v,E,c,null)}}m&&Tt(r,o,"srcSet",c.srcSet,c,null),u&&Tt(r,o,"src",c.src,c,null);return;case"input":et("invalid",r);var k=v=E=m=null,$=null,te=null;for(u in c)if(c.hasOwnProperty(u)){var ce=c[u];if(ce!=null)switch(u){case"name":m=ce;break;case"type":E=ce;break;case"checked":$=ce;break;case"defaultChecked":te=ce;break;case"value":v=ce;break;case"defaultValue":k=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(s(137,o));break;default:Tt(r,o,u,ce,c,null)}}Cx(r,v,k,$,te,E,m,!1);return;case"select":et("invalid",r),u=E=v=null;for(m in c)if(c.hasOwnProperty(m)&&(k=c[m],k!=null))switch(m){case"value":v=k;break;case"defaultValue":E=k;break;case"multiple":u=k;default:Tt(r,o,m,k,c,null)}o=v,c=E,r.multiple=!!u,o!=null?Na(r,!!u,o,!1):c!=null&&Na(r,!!u,c,!0);return;case"textarea":et("invalid",r),v=m=u=null;for(E in c)if(c.hasOwnProperty(E)&&(k=c[E],k!=null))switch(E){case"value":u=k;break;case"defaultValue":m=k;break;case"children":v=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(s(91));break;default:Tt(r,o,E,k,c,null)}Nx(r,u,m,v);return;case"option":for($ in c)c.hasOwnProperty($)&&(u=c[$],u!=null)&&($==="selected"?r.selected=u&&typeof u!="function"&&typeof u!="symbol":Tt(r,o,$,u,c,null));return;case"dialog":et("beforetoggle",r),et("toggle",r),et("cancel",r),et("close",r);break;case"iframe":case"object":et("load",r);break;case"video":case"audio":for(u=0;u<Fl.length;u++)et(Fl[u],r);break;case"image":et("error",r),et("load",r);break;case"details":et("toggle",r);break;case"embed":case"source":case"link":et("error",r),et("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(te in c)if(c.hasOwnProperty(te)&&(u=c[te],u!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,o));default:Tt(r,o,te,u,c,null)}return;default:if(Ip(o)){for(ce in c)c.hasOwnProperty(ce)&&(u=c[ce],u!==void 0&&xg(r,o,ce,u,c,void 0));return}}for(k in c)c.hasOwnProperty(k)&&(u=c[k],u!=null&&Tt(r,o,k,u,c,null))}function JO(r,o,c,u){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,v=null,E=null,k=null,$=null,te=null,ce=null;for(oe in c){var de=c[oe];if(c.hasOwnProperty(oe)&&de!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":$=de;default:u.hasOwnProperty(oe)||Tt(r,o,oe,null,u,de)}}for(var ne in u){var oe=u[ne];if(de=c[ne],u.hasOwnProperty(ne)&&(oe!=null||de!=null))switch(ne){case"type":v=oe;break;case"name":m=oe;break;case"checked":te=oe;break;case"defaultChecked":ce=oe;break;case"value":E=oe;break;case"defaultValue":k=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(s(137,o));break;default:oe!==de&&Tt(r,o,ne,oe,u,de)}}Op(r,E,k,$,te,ce,v,m);return;case"select":oe=E=k=ne=null;for(v in c)if($=c[v],c.hasOwnProperty(v)&&$!=null)switch(v){case"value":break;case"multiple":oe=$;default:u.hasOwnProperty(v)||Tt(r,o,v,null,u,$)}for(m in u)if(v=u[m],$=c[m],u.hasOwnProperty(m)&&(v!=null||$!=null))switch(m){case"value":ne=v;break;case"defaultValue":k=v;break;case"multiple":E=v;default:v!==$&&Tt(r,o,m,v,u,$)}o=k,c=E,u=oe,ne!=null?Na(r,!!c,ne,!1):!!u!=!!c&&(o!=null?Na(r,!!c,o,!0):Na(r,!!c,c?[]:"",!1));return;case"textarea":oe=ne=null;for(k in c)if(m=c[k],c.hasOwnProperty(k)&&m!=null&&!u.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:Tt(r,o,k,null,u,m)}for(E in u)if(m=u[E],v=c[E],u.hasOwnProperty(E)&&(m!=null||v!=null))switch(E){case"value":ne=m;break;case"defaultValue":oe=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(s(91));break;default:m!==v&&Tt(r,o,E,m,u,v)}Rx(r,ne,oe);return;case"option":for(var Re in c)ne=c[Re],c.hasOwnProperty(Re)&&ne!=null&&!u.hasOwnProperty(Re)&&(Re==="selected"?r.selected=!1:Tt(r,o,Re,null,u,ne));for($ in u)ne=u[$],oe=c[$],u.hasOwnProperty($)&&ne!==oe&&(ne!=null||oe!=null)&&($==="selected"?r.selected=ne&&typeof ne!="function"&&typeof ne!="symbol":Tt(r,o,$,ne,u,oe));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 $e in c)ne=c[$e],c.hasOwnProperty($e)&&ne!=null&&!u.hasOwnProperty($e)&&Tt(r,o,$e,null,u,ne);for(te in u)if(ne=u[te],oe=c[te],u.hasOwnProperty(te)&&ne!==oe&&(ne!=null||oe!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(s(137,o));break;default:Tt(r,o,te,ne,u,oe)}return;default:if(Ip(o)){for(var Ct in c)ne=c[Ct],c.hasOwnProperty(Ct)&&ne!==void 0&&!u.hasOwnProperty(Ct)&&xg(r,o,Ct,void 0,u,ne);for(ce in u)ne=u[ce],oe=c[ce],!u.hasOwnProperty(ce)||ne===oe||ne===void 0&&oe===void 0||xg(r,o,ce,ne,u,oe);return}}for(var X in c)ne=c[X],c.hasOwnProperty(X)&&ne!=null&&!u.hasOwnProperty(X)&&Tt(r,o,X,null,u,ne);for(de in u)ne=u[de],oe=c[de],!u.hasOwnProperty(de)||ne===oe||ne==null&&oe==null||Tt(r,o,de,ne,u,oe)}function k_(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function eM(){if(typeof performance.getEntriesByType=="function"){for(var r=0,o=0,c=performance.getEntriesByType("resource"),u=0;u<c.length;u++){var m=c[u],v=m.transferSize,E=m.initiatorType,k=m.duration;if(v&&k&&k_(E)){for(E=0,k=m.responseEnd,u+=1;u<c.length;u++){var $=c[u],te=$.startTime;if(te>k)break;var ce=$.transferSize,de=$.initiatorType;ce&&k_(de)&&($=$.responseEnd,E+=ce*($<k?1:(k-te)/($-te)))}if(--u,o+=8*(v+E)/(m.duration/1e3),r++,10<r)break}}if(0<r)return o/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var Sg=null,_g=null;function ad(r){return r.nodeType===9?r:r.ownerDocument}function O_(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function M_(r,o){if(r===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&o==="foreignObject"?0:r}function wg(r,o){return r==="textarea"||r==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Eg=null;function tM(){var r=window.event;return r&&r.type==="popstate"?r===Eg?!1:(Eg=r,!0):(Eg=null,!1)}var I_=typeof setTimeout=="function"?setTimeout:void 0,nM=typeof clearTimeout=="function"?clearTimeout:void 0,P_=typeof Promise=="function"?Promise:void 0,rM=typeof queueMicrotask=="function"?queueMicrotask:typeof P_<"u"?function(r){return P_.resolve(null).then(r).catch(sM)}:I_;function sM(r){setTimeout(function(){throw r})}function Oo(r){return r==="head"}function D_(r,o){var c=o,u=0;do{var m=c.nextSibling;if(r.removeChild(c),m&&m.nodeType===8)if(c=m.data,c==="/$"||c==="/&"){if(u===0){r.removeChild(m),ic(o);return}u--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")u++;else if(c==="html")ql(r.ownerDocument.documentElement);else if(c==="head"){c=r.ownerDocument.head,ql(c);for(var v=c.firstChild;v;){var E=v.nextSibling,k=v.nodeName;v[cl]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&v.rel.toLowerCase()==="stylesheet"||c.removeChild(v),v=E}}else c==="body"&&ql(r.ownerDocument.body);c=m}while(c);ic(o)}function z_(r,o){var c=r;r=0;do{var u=c.nextSibling;if(c.nodeType===1?o?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(o?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),u&&u.nodeType===8)if(c=u.data,c==="/$"){if(r===0)break;r--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||r++;c=u}while(c)}function Tg(r){var o=r.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var c=o;switch(o=o.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Tg(c),Ap(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}r.removeChild(c)}}function oM(r,o,c,u){for(;r.nodeType===1;){var m=c;if(r.nodeName.toLowerCase()!==o.toLowerCase()){if(!u&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(u){if(!r[cl])switch(o){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(v=r.getAttribute("rel"),v==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(v!==m.rel||r.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||r.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||r.getAttribute("title")!==(m.title==null?null:m.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(v=r.getAttribute("src"),(v!==(m.src==null?null:m.src)||r.getAttribute("type")!==(m.type==null?null:m.type)||r.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&v&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(o==="input"&&r.type==="hidden"){var v=m.name==null?null:""+m.name;if(m.type==="hidden"&&r.getAttribute("name")===v)return r}else return r;if(r=Mr(r.nextSibling),r===null)break}return null}function iM(r,o,c){if(o==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!c||(r=Mr(r.nextSibling),r===null))return null;return r}function L_(r,o){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!o||(r=Mr(r.nextSibling),r===null))return null;return r}function Cg(r){return r.data==="$?"||r.data==="$~"}function Rg(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function aM(r,o){var c=r.ownerDocument;if(r.data==="$~")r._reactRetry=o;else if(r.data!=="$?"||c.readyState!=="loading")o();else{var u=function(){o(),c.removeEventListener("DOMContentLoaded",u)};c.addEventListener("DOMContentLoaded",u),r._reactRetry=u}}function Mr(r){for(;r!=null;r=r.nextSibling){var o=r.nodeType;if(o===1||o===3)break;if(o===8){if(o=r.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return r}var Ng=null;function U_(r){r=r.nextSibling;for(var o=0;r;){if(r.nodeType===8){var c=r.data;if(c==="/$"||c==="/&"){if(o===0)return Mr(r.nextSibling);o--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||o++}r=r.nextSibling}return null}function $_(r){r=r.previousSibling;for(var o=0;r;){if(r.nodeType===8){var c=r.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(o===0)return r;o--}else c!=="/$"&&c!=="/&"||o++}r=r.previousSibling}return null}function B_(r,o,c){switch(o=ad(c),r){case"html":if(r=o.documentElement,!r)throw Error(s(452));return r;case"head":if(r=o.head,!r)throw Error(s(453));return r;case"body":if(r=o.body,!r)throw Error(s(454));return r;default:throw Error(s(451))}}function ql(r){for(var o=r.attributes;o.length;)r.removeAttributeNode(o[0]);Ap(r)}var Ir=new Map,F_=new Set;function cd(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Bs=G.d;G.d={f:cM,r:lM,D:uM,C:fM,L:dM,m:hM,X:mM,S:pM,M:gM};function cM(){var r=Bs.f(),o=Jf();return r||o}function lM(r){var o=Ta(r);o!==null&&o.tag===5&&o.type==="form"?oS(o):Bs.r(r)}var rc=typeof document>"u"?null:document;function H_(r,o,c){var u=rc;if(u&&typeof o=="string"&&o){var m=Cr(o);m='link[rel="'+r+'"][href="'+m+'"]',typeof c=="string"&&(m+='[crossorigin="'+c+'"]'),F_.has(m)||(F_.add(m),r={rel:r,crossOrigin:c,href:o},u.querySelector(m)===null&&(o=u.createElement("link"),Tn(o,"link",r),bn(o),u.head.appendChild(o)))}}function uM(r){Bs.D(r),H_("dns-prefetch",r,null)}function fM(r,o){Bs.C(r,o),H_("preconnect",r,o)}function dM(r,o,c){Bs.L(r,o,c);var u=rc;if(u&&r&&o){var m='link[rel="preload"][as="'+Cr(o)+'"]';o==="image"&&c&&c.imageSrcSet?(m+='[imagesrcset="'+Cr(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(m+='[imagesizes="'+Cr(c.imageSizes)+'"]')):m+='[href="'+Cr(r)+'"]';var v=m;switch(o){case"style":v=sc(r);break;case"script":v=oc(r)}Ir.has(v)||(r=y({rel:"preload",href:o==="image"&&c&&c.imageSrcSet?void 0:r,as:o},c),Ir.set(v,r),u.querySelector(m)!==null||o==="style"&&u.querySelector(Vl(v))||o==="script"&&u.querySelector(Kl(v))||(o=u.createElement("link"),Tn(o,"link",r),bn(o),u.head.appendChild(o)))}}function hM(r,o){Bs.m(r,o);var c=rc;if(c&&r){var u=o&&typeof o.as=="string"?o.as:"script",m='link[rel="modulepreload"][as="'+Cr(u)+'"][href="'+Cr(r)+'"]',v=m;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=oc(r)}if(!Ir.has(v)&&(r=y({rel:"modulepreload",href:r},o),Ir.set(v,r),c.querySelector(m)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Kl(v)))return}u=c.createElement("link"),Tn(u,"link",r),bn(u),c.head.appendChild(u)}}}function pM(r,o,c){Bs.S(r,o,c);var u=rc;if(u&&r){var m=Ca(u).hoistableStyles,v=sc(r);o=o||"default";var E=m.get(v);if(!E){var k={loading:0,preload:null};if(E=u.querySelector(Vl(v)))k.loading=5;else{r=y({rel:"stylesheet",href:r,"data-precedence":o},c),(c=Ir.get(v))&&jg(r,c);var $=E=u.createElement("link");bn($),Tn($,"link",r),$._p=new Promise(function(te,ce){$.onload=te,$.onerror=ce}),$.addEventListener("load",function(){k.loading|=1}),$.addEventListener("error",function(){k.loading|=2}),k.loading|=4,ld(E,o,u)}E={type:"stylesheet",instance:E,count:1,state:k},m.set(v,E)}}}function mM(r,o){Bs.X(r,o);var c=rc;if(c&&r){var u=Ca(c).hoistableScripts,m=oc(r),v=u.get(m);v||(v=c.querySelector(Kl(m)),v||(r=y({src:r,async:!0},o),(o=Ir.get(m))&&Ag(r,o),v=c.createElement("script"),bn(v),Tn(v,"link",r),c.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(m,v))}}function gM(r,o){Bs.M(r,o);var c=rc;if(c&&r){var u=Ca(c).hoistableScripts,m=oc(r),v=u.get(m);v||(v=c.querySelector(Kl(m)),v||(r=y({src:r,async:!0,type:"module"},o),(o=Ir.get(m))&&Ag(r,o),v=c.createElement("script"),bn(v),Tn(v,"link",r),c.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(m,v))}}function q_(r,o,c,u){var m=(m=se.current)?cd(m):null;if(!m)throw Error(s(446));switch(r){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(o=sc(c.href),c=Ca(m).hoistableStyles,u=c.get(o),u||(u={type:"style",instance:null,count:0,state:null},c.set(o,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){r=sc(c.href);var v=Ca(m).hoistableStyles,E=v.get(r);if(E||(m=m.ownerDocument||m,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,E),(v=m.querySelector(Vl(r)))&&!v._p&&(E.instance=v,E.state.loading=5),Ir.has(r)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},Ir.set(r,c),v||yM(m,r,c,E.state))),o&&u===null)throw Error(s(528,""));return E}if(o&&u!==null)throw Error(s(529,""));return null;case"script":return o=c.async,c=c.src,typeof c=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=oc(c),c=Ca(m).hoistableScripts,u=c.get(o),u||(u={type:"script",instance:null,count:0,state:null},c.set(o,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,r))}}function sc(r){return'href="'+Cr(r)+'"'}function Vl(r){return'link[rel="stylesheet"]['+r+"]"}function V_(r){return y({},r,{"data-precedence":r.precedence,precedence:null})}function yM(r,o,c,u){r.querySelector('link[rel="preload"][as="style"]['+o+"]")?u.loading=1:(o=r.createElement("link"),u.preload=o,o.addEventListener("load",function(){return u.loading|=1}),o.addEventListener("error",function(){return u.loading|=2}),Tn(o,"link",c),bn(o),r.head.appendChild(o))}function oc(r){return'[src="'+Cr(r)+'"]'}function Kl(r){return"script[async]"+r}function K_(r,o,c){if(o.count++,o.instance===null)switch(o.type){case"style":var u=r.querySelector('style[data-href~="'+Cr(c.href)+'"]');if(u)return o.instance=u,bn(u),u;var m=y({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return u=(r.ownerDocument||r).createElement("style"),bn(u),Tn(u,"style",m),ld(u,c.precedence,r),o.instance=u;case"stylesheet":m=sc(c.href);var v=r.querySelector(Vl(m));if(v)return o.state.loading|=4,o.instance=v,bn(v),v;u=V_(c),(m=Ir.get(m))&&jg(u,m),v=(r.ownerDocument||r).createElement("link"),bn(v);var E=v;return E._p=new Promise(function(k,$){E.onload=k,E.onerror=$}),Tn(v,"link",u),o.state.loading|=4,ld(v,c.precedence,r),o.instance=v;case"script":return v=oc(c.src),(m=r.querySelector(Kl(v)))?(o.instance=m,bn(m),m):(u=c,(m=Ir.get(v))&&(u=y({},c),Ag(u,m)),r=r.ownerDocument||r,m=r.createElement("script"),bn(m),Tn(m,"link",u),r.head.appendChild(m),o.instance=m);case"void":return null;default:throw Error(s(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(u=o.instance,o.state.loading|=4,ld(u,c.precedence,r));return o.instance}function ld(r,o,c){for(var u=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=u.length?u[u.length-1]:null,v=m,E=0;E<u.length;E++){var k=u[E];if(k.dataset.precedence===o)v=k;else if(v!==m)break}v?v.parentNode.insertBefore(r,v.nextSibling):(o=c.nodeType===9?c.head:c,o.insertBefore(r,o.firstChild))}function jg(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.title==null&&(r.title=o.title)}function Ag(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.integrity==null&&(r.integrity=o.integrity)}var ud=null;function G_(r,o,c){if(ud===null){var u=new Map,m=ud=new Map;m.set(c,u)}else m=ud,u=m.get(c),u||(u=new Map,m.set(c,u));if(u.has(r))return u;for(u.set(r,null),c=c.getElementsByTagName(r),m=0;m<c.length;m++){var v=c[m];if(!(v[cl]||v[Sn]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var E=v.getAttribute(o)||"";E=r+E;var k=u.get(E);k?k.push(v):u.set(E,[v])}}return u}function Z_(r,o,c){r=r.ownerDocument||r,r.head.insertBefore(c,o==="title"?r.querySelector("head > title"):null)}function vM(r,o,c){if(c===1||o.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;return o.rel==="stylesheet"?(r=o.disabled,typeof o.precedence=="string"&&r==null):!0;case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function Y_(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function bM(r,o,c,u){if(c.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var m=sc(u.href),v=o.querySelector(Vl(m));if(v){o=v._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(r.count++,r=fd.bind(r),o.then(r,r)),c.state.loading|=4,c.instance=v,bn(v);return}v=o.ownerDocument||o,u=V_(u),(m=Ir.get(m))&&jg(u,m),v=v.createElement("link"),bn(v);var E=v;E._p=new Promise(function(k,$){E.onload=k,E.onerror=$}),Tn(v,"link",u),c.instance=v}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(c,o),(o=c.state.preload)&&(c.state.loading&3)===0&&(r.count++,c=fd.bind(r),o.addEventListener("load",c),o.addEventListener("error",c))}}var kg=0;function xM(r,o){return r.stylesheets&&r.count===0&&hd(r,r.stylesheets),0<r.count||0<r.imgCount?function(c){var u=setTimeout(function(){if(r.stylesheets&&hd(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+o);0<r.imgBytes&&kg===0&&(kg=62500*eM());var m=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&hd(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>kg?50:800)+o);return r.unsuspend=c,function(){r.unsuspend=null,clearTimeout(u),clearTimeout(m)}}:null}function fd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)hd(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var dd=null;function hd(r,o){r.stylesheets=null,r.unsuspend!==null&&(r.count++,dd=new Map,o.forEach(SM,r),dd=null,fd.call(r))}function SM(r,o){if(!(o.state.loading&4)){var c=dd.get(r);if(c)var u=c.get(null);else{c=new Map,dd.set(r,c);for(var m=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<m.length;v++){var E=m[v];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(c.set(E.dataset.precedence,E),u=E)}u&&c.set(null,u)}m=o.instance,E=m.getAttribute("data-precedence"),v=c.get(E)||u,v===u&&c.set(null,m),c.set(E,m),this.count++,u=fd.bind(this),m.addEventListener("load",u),m.addEventListener("error",u),v?v.parentNode.insertBefore(m,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(m,r.firstChild)),o.state.loading|=4}}var Gl={$$typeof:N,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function _M(r,o,c,u,m,v,E,k,$){this.tag=1,this.containerInfo=r,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=Ei(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ei(0),this.hiddenUpdates=Ei(null),this.identifierPrefix=u,this.onUncaughtError=m,this.onCaughtError=v,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function X_(r,o,c,u,m,v,E,k,$,te,ce,de){return r=new _M(r,o,c,E,$,te,ce,de,k),o=1,v===!0&&(o|=24),v=sr(3,null,null,o),r.current=v,v.stateNode=r,o=um(),o.refCount++,r.pooledCache=o,o.refCount++,v.memoizedState={element:u,isDehydrated:c,cache:o},pm(v),r}function Q_(r){return r?(r=Da,r):Da}function W_(r,o,c,u,m,v){m=Q_(m),u.context===null?u.context=m:u.pendingContext=m,u=So(o),u.payload={element:c},v=v===void 0?null:v,v!==null&&(u.callback=v),c=_o(r,u,o),c!==null&&(Vn(c,r,o),Tl(c,r,o))}function J_(r,o){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var c=r.retryLane;r.retryLane=c!==0&&c<o?c:o}}function Og(r,o){J_(r,o),(r=r.alternate)&&J_(r,o)}function ew(r){if(r.tag===13||r.tag===31){var o=ji(r,67108864);o!==null&&Vn(o,r,67108864),Og(r,67108864)}}function tw(r){if(r.tag===13||r.tag===31){var o=lr();o=nr(o);var c=ji(r,o);c!==null&&Vn(c,r,o),Og(r,o)}}var pd=!0;function wM(r,o,c,u){var m=D.T;D.T=null;var v=G.p;try{G.p=2,Mg(r,o,c,u)}finally{G.p=v,D.T=m}}function EM(r,o,c,u){var m=D.T;D.T=null;var v=G.p;try{G.p=8,Mg(r,o,c,u)}finally{G.p=v,D.T=m}}function Mg(r,o,c,u){if(pd){var m=Ig(u);if(m===null)bg(r,o,u,md,c),rw(r,u);else if(CM(m,r,o,c,u))u.stopPropagation();else if(rw(r,u),o&4&&-1<TM.indexOf(r)){for(;m!==null;){var v=Ta(m);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var E=An(v.pendingLanes);if(E!==0){var k=v;for(k.pendingLanes|=2,k.entangledLanes|=2;E;){var $=1<<31-xt(E);k.entanglements[1]|=$,E&=~$}hs(v),(gt&6)===0&&(Qf=Be()+500,Bl(0))}}break;case 31:case 13:k=ji(v,2),k!==null&&Vn(k,v,2),Jf(),Og(v,2)}if(v=Ig(u),v===null&&bg(r,o,u,md,c),v===m)break;m=v}m!==null&&u.stopPropagation()}else bg(r,o,u,null,c)}}function Ig(r){return r=Dp(r),Pg(r)}var md=null;function Pg(r){if(md=null,r=Ea(r),r!==null){var o=a(r);if(o===null)r=null;else{var c=o.tag;if(c===13){if(r=l(o),r!==null)return r;r=null}else if(c===31){if(r=f(o),r!==null)return r;r=null}else if(c===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;r=null}else o!==r&&(r=null)}}return md=r,null}function nw(r){switch(r){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(We()){case He:return 2;case me:return 8;case Te:case qe:return 32;case mt:return 268435456;default:return 32}default:return 32}}var Dg=!1,Mo=null,Io=null,Po=null,Zl=new Map,Yl=new Map,Do=[],TM="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 rw(r,o){switch(r){case"focusin":case"focusout":Mo=null;break;case"dragenter":case"dragleave":Io=null;break;case"mouseover":case"mouseout":Po=null;break;case"pointerover":case"pointerout":Zl.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yl.delete(o.pointerId)}}function Xl(r,o,c,u,m,v){return r===null||r.nativeEvent!==v?(r={blockedOn:o,domEventName:c,eventSystemFlags:u,nativeEvent:v,targetContainers:[m]},o!==null&&(o=Ta(o),o!==null&&ew(o)),r):(r.eventSystemFlags|=u,o=r.targetContainers,m!==null&&o.indexOf(m)===-1&&o.push(m),r)}function CM(r,o,c,u,m){switch(o){case"focusin":return Mo=Xl(Mo,r,o,c,u,m),!0;case"dragenter":return Io=Xl(Io,r,o,c,u,m),!0;case"mouseover":return Po=Xl(Po,r,o,c,u,m),!0;case"pointerover":var v=m.pointerId;return Zl.set(v,Xl(Zl.get(v)||null,r,o,c,u,m)),!0;case"gotpointercapture":return v=m.pointerId,Yl.set(v,Xl(Yl.get(v)||null,r,o,c,u,m)),!0}return!1}function sw(r){var o=Ea(r.target);if(o!==null){var c=a(o);if(c!==null){if(o=c.tag,o===13){if(o=l(c),o!==null){r.blockedOn=o,cf(r.priority,function(){tw(c)});return}}else if(o===31){if(o=f(c),o!==null){r.blockedOn=o,cf(r.priority,function(){tw(c)});return}}else if(o===3&&c.stateNode.current.memoizedState.isDehydrated){r.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}r.blockedOn=null}function gd(r){if(r.blockedOn!==null)return!1;for(var o=r.targetContainers;0<o.length;){var c=Ig(r.nativeEvent);if(c===null){c=r.nativeEvent;var u=new c.constructor(c.type,c);Pp=u,c.target.dispatchEvent(u),Pp=null}else return o=Ta(c),o!==null&&ew(o),r.blockedOn=c,!1;o.shift()}return!0}function ow(r,o,c){gd(r)&&c.delete(o)}function RM(){Dg=!1,Mo!==null&&gd(Mo)&&(Mo=null),Io!==null&&gd(Io)&&(Io=null),Po!==null&&gd(Po)&&(Po=null),Zl.forEach(ow),Yl.forEach(ow)}function yd(r,o){r.blockedOn===o&&(r.blockedOn=null,Dg||(Dg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,RM)))}var vd=null;function iw(r){vd!==r&&(vd=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){vd===r&&(vd=null);for(var o=0;o<r.length;o+=3){var c=r[o],u=r[o+1],m=r[o+2];if(typeof u!="function"){if(Pg(u||c)===null)continue;break}var v=Ta(c);v!==null&&(r.splice(o,3),o-=3,Im(v,{pending:!0,data:m,method:c.method,action:u},u,m))}}))}function ic(r){function o($){return yd($,r)}Mo!==null&&yd(Mo,r),Io!==null&&yd(Io,r),Po!==null&&yd(Po,r),Zl.forEach(o),Yl.forEach(o);for(var c=0;c<Do.length;c++){var u=Do[c];u.blockedOn===r&&(u.blockedOn=null)}for(;0<Do.length&&(c=Do[0],c.blockedOn===null);)sw(c),c.blockedOn===null&&Do.shift();if(c=(r.ownerDocument||r).$$reactFormReplay,c!=null)for(u=0;u<c.length;u+=3){var m=c[u],v=c[u+1],E=m[Un]||null;if(typeof v=="function")E||iw(c);else if(E){var k=null;if(v&&v.hasAttribute("formAction")){if(m=v,E=v[Un]||null)k=E.formAction;else if(Pg(m)!==null)continue}else k=E.action;typeof k=="function"?c[u+1]=k:(c.splice(u,3),u-=3),iw(c)}}}function aw(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(E){return m=E})},focusReset:"manual",scroll:"manual"})}function o(){m!==null&&(m(),m=null),u||setTimeout(c,20)}function c(){if(!u&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,m=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(c,100),function(){u=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),m!==null&&(m(),m=null)}}}function zg(r){this._internalRoot=r}bd.prototype.render=zg.prototype.render=function(r){var o=this._internalRoot;if(o===null)throw Error(s(409));var c=o.current,u=lr();W_(c,u,r,o,null,null)},bd.prototype.unmount=zg.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var o=r.containerInfo;W_(r.current,2,null,r,null,null),Jf(),o[wa]=null}};function bd(r){this._internalRoot=r}bd.prototype.unstable_scheduleHydration=function(r){if(r){var o=af();r={blockedOn:null,target:r,priority:o};for(var c=0;c<Do.length&&o!==0&&o<Do[c].priority;c++);Do.splice(c,0,r),c===0&&sw(r)}};var cw=t.version;if(cw!=="19.2.4")throw Error(s(527,cw,"19.2.4"));G.findDOMNode=function(r){var o=r._reactInternals;if(o===void 0)throw typeof r.render=="function"?Error(s(188)):(r=Object.keys(r).join(","),Error(s(268,r)));return r=p(o),r=r!==null?g(r):null,r=r===null?null:r.stateNode,r};var NM={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var xd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xd.isDisabled&&xd.supportsFiber)try{Er=xd.inject(NM),Qt=xd}catch{}}return Jl.createRoot=function(r,o){if(!i(r))throw Error(s(299));var c=!1,u="",m=mS,v=gS,E=yS;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(u=o.identifierPrefix),o.onUncaughtError!==void 0&&(m=o.onUncaughtError),o.onCaughtError!==void 0&&(v=o.onCaughtError),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),o=X_(r,1,!1,null,null,c,u,null,m,v,E,aw),r[wa]=o.current,vg(r),new zg(o)},Jl.hydrateRoot=function(r,o,c){if(!i(r))throw Error(s(299));var u=!1,m="",v=mS,E=gS,k=yS,$=null;return c!=null&&(c.unstable_strictMode===!0&&(u=!0),c.identifierPrefix!==void 0&&(m=c.identifierPrefix),c.onUncaughtError!==void 0&&(v=c.onUncaughtError),c.onCaughtError!==void 0&&(E=c.onCaughtError),c.onRecoverableError!==void 0&&(k=c.onRecoverableError),c.formState!==void 0&&($=c.formState)),o=X_(r,1,!0,o,c??null,u,m,$,v,E,k,aw),o.context=Q_(null),c=o.current,u=lr(),u=nr(u),m=So(u),m.callback=null,_o(c,m,u),c=u,o.current.lanes=c,ws(o,c),hs(o),r[wa]=o.current,vg(r),new bd(o)},Jl.version="19.2.4",Jl}var XE;function i6(){if(XE)return ry.exports;XE=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ry.exports=o6(),ry.exports}var a6=i6(),Wc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},c6={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},l6=class{#e=c6;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Zi=new l6;function u6(e){setTimeout(e,0)}var ca=typeof window>"u"||"Deno"in globalThis;function Mn(){}function f6(e,t){return typeof e=="function"?e(t):e}function pv(e){return typeof e=="number"&&e>=0&&e!==1/0}function gN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xo(e,t){return typeof e=="function"?e(t):e}function zr(e,t){return typeof e=="function"?e(t):e}function QE(e,t){const{type:n="all",exact:s,fetchStatus:i,predicate:a,queryKey:l,stale:f}=e;if(l){if(s){if(t.queryHash!==Rb(l,t.options))return!1}else if(!Eu(t.queryKey,l))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||i&&i!==t.state.fetchStatus||a&&!a(t))}function WE(e,t){const{exact:n,status:s,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(la(t.options.mutationKey)!==la(a))return!1}else if(!Eu(t.options.mutationKey,a))return!1}return!(s&&t.state.status!==s||i&&!i(t))}function Rb(e,t){return(t?.queryKeyHashFn||la)(e)}function la(e){return JSON.stringify(e,(t,n)=>mv(n)?Object.keys(n).sort().reduce((s,i)=>(s[i]=n[i],s),{}):n)}function Eu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Eu(e[n],t[n])):!1}var d6=Object.prototype.hasOwnProperty;function yN(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=JE(e)&&JE(t);if(!s&&!(mv(e)&&mv(t)))return t;const a=(s?e:Object.keys(e)).length,l=s?t:Object.keys(t),f=l.length,d=s?new Array(f):{};let p=0;for(let g=0;g<f;g++){const y=s?g:l[g],b=e[y],x=t[y];if(b===x){d[y]=b,(s?g<a:d6.call(e,y))&&p++;continue}if(b===null||x===null||typeof b!="object"||typeof x!="object"){d[y]=x;continue}const S=yN(b,x,n+1);d[y]=S,S===b&&p++}return a===f&&p===a?e:d}function Rh(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function JE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function mv(e){if(!eT(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!eT(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function eT(e){return Object.prototype.toString.call(e)==="[object Object]"}function h6(e){return new Promise(t=>{Zi.setTimeout(t,e)})}function gv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?yN(e,t):t}function p6(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function m6(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var Nb=Symbol();function vN(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Nb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function jb(e,t){return typeof e=="function"?e(...t):!!e}function g6(e,t,n){let s=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),s||(s=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var y6=class extends Wc{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!ca&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Ab=new y6;function yv(){let e,t;const n=new Promise((i,a)=>{e=i,t=a});n.status="pending",n.catch(()=>{});function s(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{s({status:"fulfilled",value:i}),e(i)},n.reject=i=>{s({status:"rejected",reason:i}),t(i)},n}var v6=u6;function b6(){let e=[],t=0,n=f=>{f()},s=f=>{f()},i=v6;const a=f=>{t?e.push(f):i(()=>{n(f)})},l=()=>{const f=e;e=[],f.length&&i(()=>{s(()=>{f.forEach(d=>{n(d)})})})};return{batch:f=>{let d;t++;try{d=f()}finally{t--,t||l()}return d},batchCalls:f=>(...d)=>{a(()=>{f(...d)})},schedule:a,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{s=f},setScheduler:f=>{i=f}}}var pn=b6(),x6=class extends Wc{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!ca&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Nh=new x6;function S6(e){return Math.min(1e3*2**e,3e4)}function bN(e){return(e??"online")==="online"?Nh.isOnline():!0}var vv=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function xN(e){let t=!1,n=0,s;const i=yv(),a=()=>i.status!=="pending",l=w=>{if(!a()){const T=new vv(w);b(T),e.onCancel?.(T)}},f=()=>{t=!0},d=()=>{t=!1},p=()=>Ab.isFocused()&&(e.networkMode==="always"||Nh.isOnline())&&e.canRun(),g=()=>bN(e.networkMode)&&e.canRun(),y=w=>{a()||(s?.(),i.resolve(w))},b=w=>{a()||(s?.(),i.reject(w))},x=()=>new Promise(w=>{s=T=>{(a()||p())&&w(T)},e.onPause?.()}).then(()=>{s=void 0,a()||e.onContinue?.()}),S=()=>{if(a())return;let w;const T=n===0?e.initialPromise:void 0;try{w=T??e.fn()}catch(C){w=Promise.reject(C)}Promise.resolve(w).then(y).catch(C=>{if(a())return;const O=e.retry??(ca?0:3),N=e.retryDelay??S6,R=typeof N=="function"?N(n,C):N,M=O===!0||typeof O=="number"&&n<O||typeof O=="function"&&O(n,C);if(t||!M){b(C);return}n++,e.onFail?.(n,C),h6(R).then(()=>p()?void 0:x()).then(()=>{t?b(C):S()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(s?.(),i),cancelRetry:f,continueRetry:d,canStart:g,start:()=>(g()?S():x().then(S),i)}}var SN=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),pv(this.gcTime)&&(this.#e=Zi.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ca?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Zi.clearTimeout(this.#e),this.#e=void 0)}},_6=class extends SN{#e;#t;#n;#s;#r;#i;#a;constructor(e){super(),this.#a=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#n=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=nT(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#i,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=nT(this.options);t.data!==void 0&&(this.setState(tT(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=gv(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Mn).catch(Mn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>zr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Nb||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Xo(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!gN(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#a?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(d=>d.options.queryFn);f&&this.setOptions(f.options)}const n=new AbortController,s=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},i=()=>{const f=vN(this.options,t),p=(()=>{const g={client:this.#s,queryKey:this.queryKey,meta:this.meta};return s(g),g})();return this.#a=!1,this.options.persister?this.options.persister(f,p,this):f(p)},l=(()=>{const f={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:i};return s(f),f})();this.options.behavior?.onFetch(l,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#o({type:"fetch",meta:l.fetchOptions?.meta}),this.#r=xN({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:f=>{f instanceof vv&&f.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(f,d)=>{this.#o({type:"failed",failureCount:f,error:d})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{const f=await this.#r.start();if(f===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(f),this.#n.config.onSuccess?.(f,this),this.#n.config.onSettled?.(f,this.state.error,this),f}catch(f){if(f instanceof vv){if(f.silent)return this.#r.promise;if(f.revert){if(this.state.data===void 0)throw f;return this.state.data}}throw this.#o({type:"error",error:f}),this.#n.config.onError?.(f,this),this.#n.config.onSettled?.(this.state.data,f,this),f}finally{this.scheduleGc()}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,..._N(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,...tT(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?s:void 0,s;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),pn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function _N(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:bN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function tT(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function nT(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,s=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var w6=class extends Wc{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.#a=yv(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#s=void 0;#r;#i;#a;#o;#m;#d;#h;#l;#u;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),rT(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return bv(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return bv(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof zr(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#_(),this.#t.setOptions(this.options),t._defaulted&&!Rh(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&sT(this.#t,n,this.options,t)&&this.#f(),this.updateResult(),s&&(this.#t!==n||zr(this.options.enabled,this.#t)!==zr(t.enabled,this.#t)||Xo(this.options.staleTime,this.#t)!==Xo(t.staleTime,this.#t))&&this.#g();const i=this.#y();s&&(this.#t!==n||zr(this.options.enabled,this.#t)!==zr(t.enabled,this.#t)||i!==this.#c)&&this.#v(i)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return T6(this,n)&&(this.#s=n,this.#i=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(n,s)=>(this.trackProp(s),t?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#f(e){this.#_();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Mn)),t}#g(){this.#x();const e=Xo(this.options.staleTime,this.#t);if(ca||this.#s.isStale||!pv(e))return;const n=gN(this.#s.dataUpdatedAt,e)+1;this.#l=Zi.setTimeout(()=>{this.#s.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#S(),this.#c=e,!(ca||zr(this.options.enabled,this.#t)===!1||!pv(this.#c)||this.#c===0)&&(this.#u=Zi.setInterval(()=>{(this.options.refetchIntervalInBackground||Ab.isFocused())&&this.#f()},this.#c))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#l&&(Zi.clearTimeout(this.#l),this.#l=void 0)}#S(){this.#u&&(Zi.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,s=this.options,i=this.#s,a=this.#r,l=this.#i,d=e!==n?e.state:this.#n,{state:p}=e;let g={...p},y=!1,b;if(t._optimisticResults){const A=this.hasListeners(),P=!A&&rT(e,t),Q=A&&sT(e,n,t,s);(P||Q)&&(g={...g,..._N(p.data,e.options)}),t._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:x,errorUpdatedAt:S,status:w}=g;b=g.data;let T=!1;if(t.placeholderData!==void 0&&b===void 0&&w==="pending"){let A;i?.isPlaceholderData&&t.placeholderData===l?.placeholderData?(A=i.data,T=!0):A=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,A!==void 0&&(w="success",b=gv(i?.data,A,t),y=!0)}if(t.select&&b!==void 0&&!T)if(i&&b===a?.data&&t.select===this.#m)b=this.#d;else try{this.#m=t.select,b=t.select(b),b=gv(i?.data,b,t),this.#d=b,this.#o=null}catch(A){this.#o=A}this.#o&&(x=this.#o,b=this.#d,S=Date.now(),w="error");const C=g.fetchStatus==="fetching",O=w==="pending",N=w==="error",R=O&&C,M=b!==void 0,j={status:w,fetchStatus:g.fetchStatus,isPending:O,isSuccess:w==="success",isError:N,isInitialLoading:R,isLoading:R,data:b,dataUpdatedAt:g.dataUpdatedAt,error:x,errorUpdatedAt:S,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>d.dataUpdateCount||g.errorUpdateCount>d.errorUpdateCount,isFetching:C,isRefetching:C&&!O,isLoadingError:N&&!M,isPaused:g.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:N&&M,isStale:kb(e,t),refetch:this.refetch,promise:this.#a,isEnabled:zr(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const A=j.data!==void 0,P=j.status==="error"&&!A,Q=Z=>{P?Z.reject(j.error):A&&Z.resolve(j.data)},B=()=>{const Z=this.#a=j.promise=yv();Q(Z)},U=this.#a;switch(U.status){case"pending":e.queryHash===n.queryHash&&Q(U);break;case"fulfilled":(P||j.data!==U.value)&&B();break;case"rejected":(!P||j.error!==U.reason)&&B();break}}return j}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#i=this.options,this.#r.data!==void 0&&(this.#h=this.#t),Rh(t,e))return;this.#s=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!this.#p.size)return!0;const a=new Set(i??this.#p);return this.options.throwOnError&&a.add("error"),Object.keys(this.#s).some(l=>{const f=l;return this.#s[f]!==e[f]&&a.has(f)})};this.#w({listeners:n()})}#_(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#w(e){pn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function E6(e,t){return zr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function rT(e,t){return E6(e,t)||e.state.data!==void 0&&bv(e,t,t.refetchOnMount)}function bv(e,t,n){if(zr(t.enabled,e)!==!1&&Xo(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&kb(e,t)}return!1}function sT(e,t,n,s){return(e!==t||zr(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&kb(e,n)}function kb(e,t){return zr(t.enabled,e)!==!1&&e.isStaleByTime(Xo(t.staleTime,e))}function T6(e,t){return!Rh(e.getCurrentResult(),t)}function oT(e){return{onFetch:(t,n)=>{const s=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],l=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},d=0;const p=async()=>{let g=!1;const y=S=>{g6(S,()=>t.signal,()=>g=!0)},b=vN(t.options,t.fetchOptions),x=async(S,w,T)=>{if(g)return Promise.reject();if(w==null&&S.pages.length)return Promise.resolve(S);const O=(()=>{const z={client:t.client,queryKey:t.queryKey,pageParam:w,direction:T?"backward":"forward",meta:t.options.meta};return y(z),z})(),N=await b(O),{maxPages:R}=t.options,M=T?m6:p6;return{pages:M(S.pages,N,R),pageParams:M(S.pageParams,w,R)}};if(i&&a.length){const S=i==="backward",w=S?C6:iT,T={pages:a,pageParams:l},C=w(s,T);f=await x(T,C,S)}else{const S=e??a.length;do{const w=d===0?l[0]??s.initialPageParam:iT(s,f);if(d>0&&w==null)break;f=await x(f,w),d++}while(d<S)}return f};t.options.persister?t.fetchFn=()=>t.options.persister?.(p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=p}}}function iT(e,{pages:t,pageParams:n}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,n[s],n):void 0}function C6(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var R6=class extends SN{#e;#t;#n;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||wN(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=xN({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,l)=>{this.#r({type:"failed",failureCount:a,error:l})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const s=this.state.status==="pending",i=!this.#s.canStart();try{if(s)t();else{this.#r({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const l=await this.options.onMutate?.(e,n);l!==this.state.context&&this.#r({type:"pending",context:l,variables:e,isPaused:i})}const a=await this.#s.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#r({type:"success",data:a}),a}catch(a){try{await this.#n.config.onError?.(a,e,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onError?.(a,e,this.state.context,n)}catch(l){Promise.reject(l)}try{await this.#n.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,n)}catch(l){Promise.reject(l)}throw this.#r({type:"error",error:a}),a}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),pn.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function wN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var N6=class extends Wc{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const s=new R6({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(s),s}add(e){this.#e.add(e);const t=Ad(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Ad(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Ad(e);if(typeof t=="string"){const s=this.#t.get(t)?.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){const t=Ad(e);return typeof t=="string"?this.#t.get(t)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){pn.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>WE(t,n))}findAll(e={}){return this.getAll().filter(t=>WE(e,t))}notify(e){pn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return pn.batch(()=>Promise.all(e.map(t=>t.continue().catch(Mn))))}};function Ad(e){return e.options.scope?.id}var j6=class extends Wc{#e;#t=void 0;#n;#s;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),Rh(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&la(n.mutationKey)!==la(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#i(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#i()}mutate(t,n){return this.#s=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??wN();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#i(t){pn.batch(()=>{if(this.#s&&this.hasListeners()){const n=this.#t.variables,s=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#s.onSuccess?.(t.data,n,s,i)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(t.data,null,n,s,i)}catch(a){Promise.reject(a)}}else if(t?.type==="error"){try{this.#s.onError?.(t.error,n,s,i)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(void 0,t.error,n,s,i)}catch(a){Promise.reject(a)}}}this.listeners.forEach(n=>{n(this.#t)})})}},A6=class extends Wc{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const s=t.queryKey,i=t.queryHash??Rb(s,t);let a=this.get(i);return a||(a=new _6({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){pn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>QE(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>QE(e,n)):t}notify(e){pn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){pn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){pn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},k6=class{#e;#t;#n;#s;#r;#i;#a;#o;constructor(e={}){this.#e=e.queryCache||new A6,this.#t=e.mutationCache||new N6,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=Ab.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=Nh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#a?.(),this.#a=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),s=n.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Xo(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const s=n.data;return[t,s]})}setQueryData(e,t,n){const s=this.defaultQueryOptions({queryKey:e}),a=this.#e.get(s.queryHash)?.state.data,l=f6(t,a);if(l!==void 0)return this.#e.build(this,s).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return pn.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;pn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return pn.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},s=pn.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(s).then(Mn).catch(Mn)}invalidateQueries(e,t={}){return pn.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},s=pn.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(Mn)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(s).then(Mn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Xo(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Mn).catch(Mn)}fetchInfiniteQuery(e){return e.behavior=oT(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Mn).catch(Mn)}ensureInfiniteQueryData(e){return e.behavior=oT(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Nh.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#s.set(la(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(s=>{Eu(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(la(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(s=>{Eu(e,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Rb(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Nb&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},EN=_.createContext(void 0),_r=e=>{const t=_.useContext(EN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},O6=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(EN.Provider,{value:e,children:t})),TN=_.createContext(!1),M6=()=>_.useContext(TN);TN.Provider;function I6(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var P6=_.createContext(I6()),D6=()=>_.useContext(P6),z6=(e,t,n)=>{const s=n?.state.error&&typeof e.throwOnError=="function"?jb(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(t.isReset()||(e.retryOnMount=!1))},L6=e=>{_.useEffect(()=>{e.clearReset()},[e])},U6=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(i&&e.data===void 0||jb(n,[e.error,s])),$6=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...i)=>n(s(...i)):n(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},B6=(e,t)=>e.isLoading&&e.isFetching&&!t,F6=(e,t)=>e?.suspense&&t.isPending,aT=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function H6(e,t,n){const s=M6(),i=D6(),a=_r(),l=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(l);const f=a.getQueryCache().get(l.queryHash);l._optimisticResults=s?"isRestoring":"optimistic",$6(l),z6(l,i,f),L6(i);const d=!a.getQueryCache().get(l.queryHash),[p]=_.useState(()=>new t(a,l)),g=p.getOptimisticResult(l),y=!s&&e.subscribed!==!1;if(_.useSyncExternalStore(_.useCallback(b=>{const x=y?p.subscribe(pn.batchCalls(b)):Mn;return p.updateResult(),x},[p,y]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),_.useEffect(()=>{p.setOptions(l)},[l,p]),F6(l,g))throw aT(l,p,i);if(U6({result:g,errorResetBoundary:i,throwOnError:l.throwOnError,query:f,suspense:l.suspense}))throw g.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(l,g),l.experimental_prefetchInRender&&!ca&&B6(g,s)&&(d?aT(l,p,i):f?.promise)?.catch(Mn).finally(()=>{p.updateResult()}),l.notifyOnChangeProps?g:p.trackResult(g)}function Wn(e,t){return H6(e,w6)}function is(e,t){const n=_r(),[s]=_.useState(()=>new j6(n,e));_.useEffect(()=>{s.setOptions(e)},[s,e]);const i=_.useSyncExternalStore(_.useCallback(l=>s.subscribe(pn.batchCalls(l)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),a=_.useCallback((l,f)=>{s.mutate(l,f).catch(Mn)},[s]);if(i.error&&jb(s.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var $t=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))($t||{});function CN({update:e,notify:t,unwatched:n}){return{link:s,unlink:i,propagate:a,checkDirty:l,shallowPropagate:f};function s(p,g,y){const b=g.depsTail;if(b!==void 0&&b.dep===p)return;const x=b!==void 0?b.nextDep:g.deps;if(x!==void 0&&x.dep===p){x.version=y,g.depsTail=x;return}const S=p.subsTail;if(S!==void 0&&S.version===y&&S.sub===g)return;const w=g.depsTail=p.subsTail={version:y,dep:p,sub:g,prevDep:b,nextDep:x,prevSub:S,nextSub:void 0};x!==void 0&&(x.prevDep=w),b!==void 0?b.nextDep=w:g.deps=w,S!==void 0?S.nextSub=w:p.subs=w}function i(p,g=p.sub){const y=p.dep,b=p.prevDep,x=p.nextDep,S=p.nextSub,w=p.prevSub;return x!==void 0?x.prevDep=b:g.depsTail=b,b!==void 0?b.nextDep=x:g.deps=x,S!==void 0?S.prevSub=w:y.subsTail=w,w!==void 0?w.nextSub=S:(y.subs=S)===void 0&&n(y),x}function a(p){let g=p.nextSub,y;e:do{const b=p.sub;let x=b.flags;if(x&60?x&12?x&4?!(x&48)&&d(p,b)?(b.flags=x|40,x&=1):x=0:b.flags=x&-9|32:x=0:b.flags=x|32,x&2&&t(b),x&1){const S=b.subs;if(S!==void 0){const w=(p=S).nextSub;w!==void 0&&(y={value:g,prev:y},g=w);continue}}if((p=g)!==void 0){g=p.nextSub;continue}for(;y!==void 0;)if(p=y.value,y=y.prev,p!==void 0){g=p.nextSub;continue e}break}while(!0)}function l(p,g){let y,b=0,x=!1;e:do{const S=p.dep,w=S.flags;if(g.flags&16)x=!0;else if((w&17)===17){if(e(S)){const T=S.subs;T.nextSub!==void 0&&f(T),x=!0}}else if((w&33)===33){(p.nextSub!==void 0||p.prevSub!==void 0)&&(y={value:p,prev:y}),p=S.deps,g=S,++b;continue}if(!x){const T=p.nextDep;if(T!==void 0){p=T;continue}}for(;b--;){const T=g.subs,C=T.nextSub!==void 0;if(C?(p=y.value,y=y.prev):p=T,x){if(e(g)){C&&f(T),g=p.sub;continue}x=!1}else g.flags&=-33;g=p.sub;const O=p.nextDep;if(O!==void 0){p=O;continue e}}return x}while(!0)}function f(p){do{const g=p.sub,y=g.flags;(y&48)===32&&(g.flags=y|16,(y&6)===2&&t(g))}while((p=p.nextSub)!==void 0)}function d(p,g){let y=g.depsTail;for(;y!==void 0;){if(y===p)return!0;y=y.prevDep}return!1}}let Ob=0,Hi=0,fu=0;const Ks=[],{link:SQ,unlink:RN,propagate:_Q,checkDirty:q6,shallowPropagate:wQ}=CN({update(e){return e.depsTail!==void 0?Z6(e):Y6(e)},notify(e){let t=fu,n=t;do if(Ks[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(fu=t;n<--t;){const s=Ks[n];Ks[n++]=Ks[t],Ks[t]=s}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,cp(e)):W6.call(e)}});function V6(){return Ob}function K6(){++Ob}function G6(){--Ob||Q6()}function Z6(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,cp(e)}}function Y6(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function X6(e){const t=e.flags;if(t&16||t&32&&q6(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,cp(e)}}else e.flags=2}function Q6(){try{for(;Hi<fu;){const e=Ks[Hi];Ks[Hi++]=void 0,X6(e)}}finally{for(;Hi<fu;){const e=Ks[Hi];Ks[Hi++]=void 0,e.flags|=10}Hi=0,fu=0}}function W6(){this.depsTail=void 0,this.flags=0,cp(this);const e=this.subs;e!==void 0&&RN(e)}function cp(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=RN(n,e)}function NN(e,t,n){const s=typeof e=="object",i=s?e:void 0;return{next:(s?e.next:e)?.bind(i),error:(s?e.error:t)?.bind(i),complete:(s?e.complete:n)?.bind(i)}}const xv=[];let sh=0;const{link:cT,unlink:J6,propagate:eF,checkDirty:jN,shallowPropagate:lT}=CN({update(e){return e._update()},notify(e){xv[Sv++]=e,e.flags&=~$t.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=$t.Mutable|$t.Dirty,jh(e))}});let kd=0,Sv=0,gs;function jh(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=J6(n,e)}function AN(){if(!(V6()>0)){for(;kd<Sv;){const e=xv[kd];xv[kd++]=void 0,e.notify()}kd=0,Sv=0}}function tF(e,t){const n=typeof e=="function",s=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?$t.None:$t.Mutable,get(){return gs!==void 0&&cT(i,gs,sh),i._snapshot},subscribe(a){const l=NN(a),f={current:!1},d=nF(()=>{i.get(),f.current?l.next?.(i._snapshot):f.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const l=gs,f=Object.is;gs=i,++sh,i.depsTail=void 0,n&&(i.flags=$t.Mutable|$t.RecursedCheck);try{const d=i._snapshot,p=typeof a=="function"?a(d):a===void 0&&n?s(d):a;return d===void 0||!f(d,p)?(i._snapshot=p,!0):!1}finally{gs=l,n&&(i.flags&=~$t.RecursedCheck),jh(i)}}};return n?(i.flags=$t.Mutable|$t.Dirty,i.get=function(){const a=i.flags;if(a&$t.Dirty||a&$t.Pending&&jN(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&lT(l)}}else a&$t.Pending&&(i.flags=a&~$t.Pending);return gs!==void 0&&cT(i,gs,sh),i._snapshot}):i.set=function(a){if(i._update(a)){const l=i.subs;l!==void 0&&(eF(l),lT(l),AN())}},i}function nF(e){const t=()=>{const s=gs;gs=n,++sh,n.depsTail=void 0,n.flags=$t.Watching|$t.RecursedCheck;try{return e()}finally{gs=s,n.flags&=~$t.RecursedCheck,jh(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:$t.Watching|$t.RecursedCheck,notify(){const s=this.flags;s&$t.Dirty||s&$t.Pending&&jN(this.deps,this)?t():this.flags=$t.Watching},stop(){this.flags=$t.None,this.depsTail=void 0,jh(this)}};return t(),n}let rF=class{constructor(t){this.atom=tF(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(NN(t))}};function sF(e){try{K6(),e()}finally{G6(),AN()}}const Qo="__TSR_index",uT="popstate",fT="beforeunload";function oF(e){let t=e.getLocation();const n=new Set,s=l=>{t=e.getLocation(),n.forEach(f=>f({location:t,action:l}))},i=l=>{e.notifyOnIndexChange??!0?s(l):t=e.getLocation()},a=async({task:l,navigateOpts:f,...d})=>{if(f?.ignoreBlocker??!1){l();return}const g=e.getBlockers?.()??[],y=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&g.length&&y)for(const b of g){const x=Ah(d.path,d.state);if(await b.blockerFn({currentLocation:t,nextLocation:x,action:d.type})){e.onBlocked?.();return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,f,d)=>{const p=t.state[Qo];f=dT(p+1,f),a({task:()=>{e.pushState(l,f),s({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:l,state:f})},replace:(l,f,d)=>{const p=t.state[Qo];f=dT(p,f),a({task:()=>{e.replaceState(l,f),s({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:l,state:f})},go:(l,f)=>{a({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:f,type:"GO"})},back:l=>{a({task:()=>{e.back(l?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{a({task:()=>{e.forward(l?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[Qo]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const f=e.getBlockers?.()??[];return e.setBlockers([...f,l]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(p=>p!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:s}}function dT(e,t){t||(t={});const n=Mb();return{...t,key:n,__TSR_key:n,[Qo]:e}}function iF(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,s=t.history.replaceState;let i=[];const a=()=>i,l=A=>i=A,f=(A=>A),d=(()=>Ah(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const A=Mb();t.history.replaceState({[Qo]:0,key:A,__TSR_key:A},"")}let p=d(),g,y=!1,b=!1,x=!1,S=!1;const w=()=>p;let T,C;const O=()=>{T&&(j._ignoreSubscribers=!0,(T.isPush?t.history.pushState:t.history.replaceState)(T.state,"",T.href),j._ignoreSubscribers=!1,T=void 0,C=void 0,g=void 0)},N=(A,P,Q)=>{const B=f(P);C||(g=p),p=Ah(P,Q),T={href:B,state:Q,isPush:T?.isPush||A==="push"},C||(C=Promise.resolve().then(()=>O()))},R=A=>{p=d(),j.notify({type:A})},M=async()=>{if(b){b=!1;return}const A=d(),P=A.state[Qo]-p.state[Qo],Q=P===1,B=P===-1,U=!Q&&!B||y;y=!1;const Z=U?"GO":B?"BACK":"FORWARD",K=U?{type:"GO",index:P}:{type:B?"BACK":"FORWARD"};if(x)x=!1;else{const ee=a();if(typeof document<"u"&&ee.length){for(const D of ee)if(await D.blockerFn({currentLocation:p,nextLocation:A,action:Z})){b=!0,t.history.go(1),j.notify(K);return}}}p=d(),j.notify(K)},z=A=>{if(S){S=!1;return}let P=!1;const Q=a();if(typeof document<"u"&&Q.length)for(const B of Q){const U=B.enableBeforeUnload??!0;if(U===!0){P=!0;break}if(typeof U=="function"&&U()===!0){P=!0;break}}if(P)return A.preventDefault(),A.returnValue=""},j=oF({getLocation:w,getLength:()=>t.history.length,pushState:(A,P)=>N("push",A,P),replaceState:(A,P)=>N("replace",A,P),back:A=>(A&&(x=!0),S=!0,t.history.back()),forward:A=>{A&&(x=!0),S=!0,t.history.forward()},go:A=>{y=!0,t.history.go(A)},createHref:A=>f(A),flush:O,destroy:()=>{t.history.pushState=n,t.history.replaceState=s,t.removeEventListener(fT,z,{capture:!0}),t.removeEventListener(uT,M)},onBlocked:()=>{g&&p!==g&&(p=g)},getBlockers:a,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(fT,z,{capture:!0}),t.addEventListener(uT,M),t.history.pushState=function(...A){const P=n.apply(t.history,A);return j._ignoreSubscribers||R("PUSH"),P},t.history.replaceState=function(...A){const P=s.apply(t.history,A);return j._ignoreSubscribers||R("REPLACE"),P},j}function aF(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Ah(e,t){const n=aF(e),s=n.indexOf("#"),i=n.indexOf("?"),a=Mb();return{href:n,pathname:n.substring(0,s>0?i>0?Math.min(s,i):s:i>0?i:n.length),hash:s>-1?n.substring(s):"",search:i>-1?n.slice(i,s===-1?void 0:s):"",state:t||{[Qo]:0,key:a,__TSR_key:a}}}function Mb(){return(Math.random()+1).toString(36).substring(7)}const cF=!1;function du(e){let t;return sF(()=>{t=e()}),t}function Tu(e){return e[e.length-1]}function lF(e){return typeof e=="function"}function Ho(e,t){return lF(e)?e(t):e}const uF=Object.prototype.hasOwnProperty,hT=Object.prototype.propertyIsEnumerable;function ur(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=t,i=gT(e)&&gT(s);if(!i&&!(kh(e)&&kh(s)))return s;const a=i?e:pT(e);if(!a)return s;const l=i?s:pT(s);if(!l)return s;const f=a.length,d=l.length,p=i?new Array(d):{};let g=0;for(let y=0;y<d;y++){const b=i?y:l[y],x=e[b],S=s[b];if(x===S){p[b]=x,(i?y<f:uF.call(e,b))&&g++;continue}if(x===null||S===null||typeof x!="object"||typeof S!="object"){p[b]=S;continue}const w=ur(x,S,n+1);p[b]=w,w===x&&g++}return f===d&&g===f?e:p}function pT(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!hT.call(e,i))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const s=t;for(const i of n){if(!hT.call(e,i))return!1;s.push(i)}return s}function kh(e){if(!mT(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!mT(n)||!n.hasOwnProperty("isPrototypeOf"))}function mT(e){return Object.prototype.toString.call(e)==="[object Object]"}function gT(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ra(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let s=0,i=e.length;s<i;s++)if(!ra(e[s],t[s],n))return!1;return!0}if(kh(e)&&kh(t)){const s=n?.ignoreUndefined??!0;if(n?.partial){for(const l in t)if((!s||t[l]!==void 0)&&!ra(e[l],t[l],n))return!1;return!0}let i=0;if(!s)i=Object.keys(e).length;else for(const l in e)e[l]!==void 0&&i++;let a=0;for(const l in t)if((!s||t[l]!==void 0)&&(a++,a>i||!ra(e[l],t[l],n)))return!1;return i===a}return!1}function Dc(e){let t,n;const s=new Promise((i,a)=>{t=i,n=a});return s.status="pending",s.resolve=i=>{s.status="resolved",s.value=i,t(i),e?.(i)},s.reject=i=>{s.status="rejected",n(i)},s}function yc(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function fF(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function yT(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return fF(t)}const dF=["http:","https:","mailto:","tel:"];function Oh(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function eu(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,s="",i;for(;(i=t.exec(e))!==null;)s+=yT(e.slice(n,i.index))+i[0],n=t.lastIndex;s=s+yT(n?e.slice(n):e);let a=!1;return s.startsWith("//")&&(a=!0,s="/"+s.replace(/^\/+/,"")),{path:s,handledProtocolRelativeURL:a}}function hF(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var pF="Invariant failed";function so(e,t){if(!e)throw new Error(pF)}function Mh(e){const t=new Map;let n,s;const i=a=>{a.next&&(a.prev?(a.prev.next=a.next,a.next.prev=a.prev,a.next=void 0,s&&(s.next=a,a.prev=s)):(a.next.prev=void 0,n=a.next,a.next=void 0,s&&(a.prev=s,s.next=a)),s=a)};return{get(a){const l=t.get(a);if(l)return i(l),l.value},set(a,l){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===s&&(s=void 0)}const f=t.get(a);if(f)f.value=l,i(f);else{const d={key:a,value:l,prev:s};s&&(s.next=d),s=d,n||(n=d),t.set(a,d)}},clear(){t.clear(),n=void 0,s=void 0}}}const zc=0,ua=1,fa=2,Cu=3,Yi=4,kN=5;function mF(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function Ib(e,t,n=new Uint16Array(6)){const s=e.indexOf("/",t),i=s===-1?e.length:s,a=e.substring(t,i);if(!a||!a.includes("$"))return n[0]=zc,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a==="$"){const f=e.length;return n[0]=fa,n[1]=t,n[2]=t,n[3]=f,n[4]=f,n[5]=f,n}if(a.charCodeAt(0)===36)return n[0]=ua,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const l=mF(a);if(l){const[f,d]=l,p=a.charCodeAt(f+1);if(p===45){if(f+2<a.length&&a.charCodeAt(f+2)===36){const g=f+3,y=d;if(g<y)return n[0]=Cu,n[1]=t+f,n[2]=t+g,n[3]=t+y,n[4]=t+d+1,n[5]=i,n}}else if(p===36){const g=f+1,y=f+2;return y===d?(n[0]=fa,n[1]=t+f,n[2]=t+g,n[3]=t+y,n[4]=t+d+1,n[5]=e.length,n):(n[0]=ua,n[1]=t+f,n[2]=t+y,n[3]=t+d,n[4]=t+d+1,n[5]=i,n)}}return n[0]=zc,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function lp(e,t,n,s,i,a,l){l?.(n);let f=s;{const d=n.fullPath??n.from,p=d.length,g=n.options?.caseSensitive??e,y=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;f<p;){const x=Ib(d,f,t);let S;const w=f,T=x[5];switch(f=T+1,a++,x[0]){case zc:{const O=d.substring(x[2],x[3]);if(g){const N=i.static?.get(O);if(N)S=N;else{i.static??=new Map;const R=Xi(n.fullPath??n.from);R.parent=i,R.depth=a,S=R,i.static.set(O,R)}}else{const N=O.toLowerCase(),R=i.staticInsensitive?.get(N);if(R)S=R;else{i.staticInsensitive??=new Map;const M=Xi(n.fullPath??n.from);M.parent=i,M.depth=a,S=M,i.staticInsensitive.set(N,M)}}break}case ua:{const O=d.substring(w,x[1]),N=d.substring(x[4],T),R=g&&!!(O||N),M=O?R?O:O.toLowerCase():void 0,z=N?R?N:N.toLowerCase():void 0,j=!y&&i.dynamic?.find(A=>!A.skipOnParamError&&A.caseSensitive===R&&A.prefix===M&&A.suffix===z);if(j)S=j;else{const A=cy(ua,n.fullPath??n.from,R,M,z);S=A,A.depth=a,A.parent=i,i.dynamic??=[],i.dynamic.push(A)}break}case Cu:{const O=d.substring(w,x[1]),N=d.substring(x[4],T),R=g&&!!(O||N),M=O?R?O:O.toLowerCase():void 0,z=N?R?N:N.toLowerCase():void 0,j=!y&&i.optional?.find(A=>!A.skipOnParamError&&A.caseSensitive===R&&A.prefix===M&&A.suffix===z);if(j)S=j;else{const A=cy(Cu,n.fullPath??n.from,R,M,z);S=A,A.parent=i,A.depth=a,i.optional??=[],i.optional.push(A)}break}case fa:{const O=d.substring(w,x[1]),N=d.substring(x[4],T),R=g&&!!(O||N),M=O?R?O:O.toLowerCase():void 0,z=N?R?N:N.toLowerCase():void 0,j=cy(fa,n.fullPath??n.from,R,M,z);S=j,j.parent=i,j.depth=a,i.wildcard??=[],i.wildcard.push(j)}}i=S}if(y&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const x=Xi(n.fullPath??n.from);x.kind=kN,x.parent=i,a++,x.depth=a,i.pathless??=[],i.pathless.push(x),i=x}const b=(n.path||!n.children)&&!n.isRoot;if(b&&d.endsWith("/")){const x=Xi(n.fullPath??n.from);x.kind=Yi,x.parent=i,a++,x.depth=a,i.index=x,i=x}i.parse=n.options?.params?.parse??null,i.skipOnParamError=y,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,b&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const d of n.children)lp(e,t,d,f,i,a,l)}function ay(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Bo(e){if(e.pathless)for(const t of e.pathless)Bo(t);if(e.static)for(const t of e.static.values())Bo(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Bo(t);if(e.dynamic?.length){e.dynamic.sort(ay);for(const t of e.dynamic)Bo(t)}if(e.optional?.length){e.optional.sort(ay);for(const t of e.optional)Bo(t)}if(e.wildcard?.length){e.wildcard.sort(ay);for(const t of e.wildcard)Bo(t)}}function Xi(e){return{kind:zc,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function cy(e,t,n,s,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:s,suffix:i}}function gF(e,t){const n=Xi("/"),s=new Uint16Array(6);for(const i of e)lp(!1,s,i,1,n,0);Bo(n),t.masksTree=n,t.flatCache=Mh(1e3)}function yF(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const s=Pb(e,t.masksTree);return t.flatCache.set(e,s),s}function vF(e,t,n,s,i){e||="/",s||="/";const a=t?`case\0${e}`:e;let l=i.singleCache.get(a);if(!l){l=Xi("/");const f=new Uint16Array(6);lp(t,f,{from:e},1,l,0),i.singleCache.set(a,l)}return Pb(s,l,n)}function bF(e,t,n=!1){const s=n?e:`nofuzz\0${e}`,i=t.matchCache.get(s);if(i!==void 0)return i;e||="/";let a;try{a=Pb(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)a=null;else throw l}return a&&(a.branch=_F(a.route)),t.matchCache.set(s,a),a}function xF(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function SF(e,t=!1,n){const s=Xi(e.fullPath),i=new Uint16Array(6),a={},l={};let f=0;return lp(t,i,e,1,s,0,p=>{if(n?.(p,f),so(!(p.id in a),`Duplicate routes found with id: ${String(p.id)}`),a[p.id]=p,f!==0&&p.path){const g=xF(p.fullPath);(!l[g]||p.fullPath.endsWith("/"))&&(l[g]=p)}f++}),Bo(s),{processedTree:{segmentTree:s,singleCache:Mh(1e3),matchCache:Mh(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:l}}function Pb(e,t,n=!1){const s=e.split("/"),i=EF(e,s,t,n);if(!i)return null;const[a]=ON(e,s,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function ON(e,t,n){const s=wF(n.node);let i=null;const a={};let l=n.extract?.part??0,f=n.extract?.node??0,d=n.extract?.path??0,p=n.extract?.segment??0;for(;f<s.length;l++,f++,d++,p++){const g=s[f];if(g.kind===Yi)break;if(g.kind===kN){p--,l--,d--;continue}const y=t[l],b=d;if(y&&(d+=y.length),g.kind===ua){i??=n.node.fullPath.split("/");const x=i[p],S=g.prefix?.length??0;if(x.charCodeAt(S)===123){const T=g.suffix?.length??0,C=x.substring(S+2,x.length-T-1),O=y.substring(S,y.length-T);a[C]=decodeURIComponent(O)}else{const T=x.substring(1);a[T]=decodeURIComponent(y)}}else if(g.kind===Cu){if(n.skipped&1<<f){l--,d=b-1;continue}i??=n.node.fullPath.split("/");const x=i[p],S=g.prefix?.length??0,w=g.suffix?.length??0,T=x.substring(S+3,x.length-w-1),C=g.suffix||g.prefix?y.substring(S,y.length-w):y;C&&(a[T]=decodeURIComponent(C))}else if(g.kind===fa){const x=g,S=e.substring(b+(x.prefix?.length??0),e.length-(x.suffix?.length??0)),w=decodeURIComponent(S);a["*"]=w,a._splat=w;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:l,node:f,path:d,segment:p}]}function _F(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function wF(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function EF(e,t,n,s){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!Tu(t),a=i&&e!=="/",l=t.length-(i?1:0),f=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let d=null,p=null,g=null;for(;f.length;){const y=f.pop(),{node:b,index:x,skipped:S,depth:w,statics:T,dynamics:C,optionals:O}=y;let{extract:N,rawParams:R,parsedParams:M}=y;if(b.skipOnParamError){if(!ly(e,t,y))continue;R=y.rawParams,N=y.extract,M=y.parsedParams}s&&b.route&&b.kind!==Yi&&tu(p,y)&&(p=y);const z=x===l;if(z&&(b.route&&!a&&tu(g,y)&&(g=y),!b.optional&&!b.wildcard&&!b.index&&!b.pathless))continue;const j=z?void 0:t[x];let A;if(z&&b.index){const P={node:b.index,index:x,skipped:S,depth:w+1,statics:T,dynamics:C,optionals:O,extract:N,rawParams:R,parsedParams:M};let Q=!0;if(b.index.skipOnParamError&&(ly(e,t,P)||(Q=!1)),Q){if(T===l&&!C&&!O&&!S)return P;tu(g,P)&&(g=P)}}if(b.wildcard&&tu(d,y))for(const P of b.wildcard){const{prefix:Q,suffix:B}=P;if(Q&&(z||!(P.caseSensitive?j:A??=j.toLowerCase()).startsWith(Q)))continue;if(B){if(z)continue;const Z=t.slice(x).join("/").slice(-B.length);if((P.caseSensitive?Z:Z.toLowerCase())!==B)continue}const U={node:P,index:l,skipped:S,depth:w,statics:T,dynamics:C,optionals:O,extract:N,rawParams:R,parsedParams:M};if(!(P.skipOnParamError&&!ly(e,t,U))){d=U;break}}if(b.optional){const P=S|1<<w,Q=w+1;for(let B=b.optional.length-1;B>=0;B--){const U=b.optional[B];f.push({node:U,index:x,skipped:P,depth:Q,statics:T,dynamics:C,optionals:O,extract:N,rawParams:R,parsedParams:M})}if(!z)for(let B=b.optional.length-1;B>=0;B--){const U=b.optional[B],{prefix:Z,suffix:K}=U;if(Z||K){const ee=U.caseSensitive?j:A??=j.toLowerCase();if(Z&&!ee.startsWith(Z)||K&&!ee.endsWith(K))continue}f.push({node:U,index:x+1,skipped:S,depth:Q,statics:T,dynamics:C,optionals:O+1,extract:N,rawParams:R,parsedParams:M})}}if(!z&&b.dynamic&&j)for(let P=b.dynamic.length-1;P>=0;P--){const Q=b.dynamic[P],{prefix:B,suffix:U}=Q;if(B||U){const Z=Q.caseSensitive?j:A??=j.toLowerCase();if(B&&!Z.startsWith(B)||U&&!Z.endsWith(U))continue}f.push({node:Q,index:x+1,skipped:S,depth:w+1,statics:T,dynamics:C+1,optionals:O,extract:N,rawParams:R,parsedParams:M})}if(!z&&b.staticInsensitive){const P=b.staticInsensitive.get(A??=j.toLowerCase());P&&f.push({node:P,index:x+1,skipped:S,depth:w+1,statics:T+1,dynamics:C,optionals:O,extract:N,rawParams:R,parsedParams:M})}if(!z&&b.static){const P=b.static.get(j);P&&f.push({node:P,index:x+1,skipped:S,depth:w+1,statics:T+1,dynamics:C,optionals:O,extract:N,rawParams:R,parsedParams:M})}if(b.pathless){const P=w+1;for(let Q=b.pathless.length-1;Q>=0;Q--){const B=b.pathless[Q];f.push({node:B,index:x,skipped:S,depth:P,statics:T,dynamics:C,optionals:O,extract:N,rawParams:R,parsedParams:M})}}}if(g&&d)return tu(d,g)?g:d;if(g)return g;if(d)return d;if(s&&p){let y=p.index;for(let x=0;x<p.index;x++)y+=t[x].length;const b=y===e.length?"/":e.slice(y);return p.rawParams??={},p.rawParams["**"]=decodeURIComponent(b),p}return null}function ly(e,t,n){try{const[s,i]=ON(e,t,n);n.rawParams=s,n.extract=i;const a=n.node.parse(s);return n.parsedParams=Object.assign({},n.parsedParams,a),!0}catch{return null}}function tu(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Yi)>(e.node.kind===Yi)||t.node.kind===Yi==(e.node.kind===Yi)&&t.depth>e.depth))):!0}function oh(e){return Db(e.filter(t=>t!==void 0).join("/"))}function Db(e){return e.replace(/\/{2,}/g,"/")}function MN(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Gs(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function IN(e){return Gs(MN(e))}function Ih(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function TF(e,t,n){return Ih(e,n)===Ih(t,n)}function CF({base:e,to:t,trailingSlash:n="never",cache:s}){const i=t.startsWith("/"),a=!i&&t===".";let l;if(s){l=i?t:a?e:e+"\0"+t;const y=s.get(l);if(y)return y}let f;if(a)f=e.split("/");else if(i)f=t.split("/");else{for(f=e.split("/");f.length>1&&Tu(f)==="";)f.pop();const y=t.split("/");for(let b=0,x=y.length;b<x;b++){const S=y[b];S===""?b?b===x-1&&f.push(S):f=[S]:S===".."?f.pop():S==="."||f.push(S)}}f.length>1&&(Tu(f)===""?n==="never"&&f.pop():n==="always"&&f.push(""));let d,p="";for(let y=0;y<f.length;y++){y>0&&(p+="/");const b=f[y];if(!b)continue;d=Ib(b,0,d);const x=d[0];if(x===zc){p+=b;continue}const S=d[5],w=b.substring(0,d[1]),T=b.substring(d[4],S),C=b.substring(d[2],d[3]);x===ua?p+=w||T?`${w}{$${C}}${T}`:`$${C}`:x===fa?p+=w||T?`${w}{$}${T}`:"$":p+=`${w}{-$${C}}${T}`}p=Db(p);const g=p||"/";return l&&s&&s.set(l,g),g}function RF(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),n=Array.from(t.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),s=new RegExp(n,"g");return i=>i.replace(s,a=>t.get(a)??a)}function uy(e,t,n){const s=t[e];return typeof s!="string"?s:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(s)?s:s.split("/").map(i=>vT(i,n)).join("/"):vT(s,n)}function fy({path:e,params:t,decoder:n,...s}){let i=!1;const a={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:a,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:a,isMissingParams:i};const l=e.length;let f=0,d,p="";for(;f<l;){const y=f;d=Ib(e,y,d);const b=d[5];if(f=b+1,y===b)continue;const x=d[0];if(x===zc){p+="/"+e.substring(y,b);continue}if(x===fa){const S=t._splat;a._splat=S,a["*"]=S;const w=e.substring(y,d[1]),T=e.substring(d[4],b);if(!S){i=!0,(w||T)&&(p+="/"+w+T);continue}const C=uy("_splat",t,n);p+="/"+w+C+T;continue}if(x===ua){const S=e.substring(d[2],d[3]);!i&&!(S in t)&&(i=!0),a[S]=t[S];const w=e.substring(y,d[1]),T=e.substring(d[4],b),C=uy(S,t,n)??"undefined";p+="/"+w+C+T;continue}if(x===Cu){const S=e.substring(d[2],d[3]),w=t[S];if(w==null)continue;a[S]=w;const T=e.substring(y,d[1]),C=e.substring(d[4],b),O=uy(S,t,n)??"";p+="/"+T+O+C;continue}}return e.endsWith("/")&&(p+="/"),{usedParams:a,interpolatedPath:p||"/",isMissingParams:i}}function vT(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function yr(e){return!!e?.isNotFound}function NF(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const _v="tsr-scroll-restoration-v1_3",jF=(e,t)=>{let n;return(...s)=>{n||(n=setTimeout(()=>{e(...s),n=null},t))}};function AF(){const e=NF();if(!e)return null;const t=e.getItem(_v);let n=t?JSON.parse(t):{};return{state:n,set:s=>{n=Ho(s,n)||n;try{e.setItem(_v,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Od=AF(),kF=e=>e.state.__TSR_key||e.href;function OF(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let Ph=!1;function MF({storageKey:e,key:t,behavior:n,shouldScrollRestoration:s,scrollToTopSelectors:i,location:a}){let l;try{l=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(p){console.error(p);return}const f=t||window.history.state?.__TSR_key,d=l[f];Ph=!0;e:{if(s&&d&&Object.keys(d).length>0){for(const y in d){const b=d[y];if(y==="window")window.scrollTo({top:b.scrollY,left:b.scrollX,behavior:n});else if(y){const x=document.querySelector(y);x&&(x.scrollLeft=b.scrollX,x.scrollTop=b.scrollY)}}break e}const p=(a??window.location).hash.split("#",2)[1];if(p){const y=window.history.state?.__hashScrollIntoViewOptions??!0;if(y){const b=document.getElementById(p);b&&b.scrollIntoView(y)}break e}const g={top:0,left:0,behavior:n};if(window.scrollTo(g),i)for(const y of i){if(y==="window")continue;const b=typeof y=="function"?y():document.querySelector(y);b&&b.scrollTo(g)}}Ph=!1}function IF(e,t){if(!Od||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Od))return;e.isScrollRestorationSetup=!0,Ph=!1;const s=e.options.getScrollRestorationKey||kF;window.history.scrollRestoration="manual";const i=a=>{if(Ph||!e.isScrollRestoring)return;let l="";if(a.target===document||a.target===window)l="window";else{const d=a.target.getAttribute("data-scroll-restoration-id");d?l=`[data-scroll-restoration-id="${d}"]`:l=OF(a.target)}const f=s(e.state.location);Od.set(d=>{const p=d[f]||={},g=p[l]||={};if(l==="window")g.scrollX=window.scrollX||0,g.scrollY=window.scrollY||0;else if(l){const y=document.querySelector(l);y&&(g.scrollX=y.scrollLeft||0,g.scrollY=y.scrollTop||0)}return d})};typeof document<"u"&&document.addEventListener("scroll",jF(i,100),!0),e.subscribe("onRendered",a=>{const l=s(a.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(MF({storageKey:_v,key:l,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Od.set(f=>(f[l]||={},f)))})}function PF(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function DF(e,t=String){const n=new URLSearchParams;for(const s in e){const i=e[s];i!==void 0&&n.set(s,t(i))}return n.toString()}function dy(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function zF(e){const t=new URLSearchParams(e),n={};for(const[s,i]of t.entries()){const a=n[s];a==null?n[s]=dy(i):Array.isArray(a)?a.push(dy(i)):n[s]=[a,dy(i)]}return n}const LF=$F(JSON.parse),UF=BF(JSON.stringify,JSON.parse);function $F(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=zF(t);for(const s in n){const i=n[s];if(typeof i=="string")try{n[s]=e(i)}catch{}}return n}}function BF(e,t){const n=typeof t=="function";function s(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const a=DF(i,s);return a?`?${a}`:""}}const Lr="__root__";function FF(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Br(e){return e instanceof Response&&!!e.options}const ih=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},up=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),vc=(e,t,n=!0)=>{const s={...e.router.options.context??{}},i=n?t:t-1;for(let a=0;a<=i;a++){const l=e.matches[a];if(!l)continue;const f=e.router.getMatch(l.id);f&&Object.assign(s,f.__routeContext,f.__beforeLoadContext)}return s},PN=(e,t,n)=>{const s=e.router.routesById[t.routeId??""]??e.router.routeTree;!s.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(s.options.notFoundComponent=e.router.options.defaultNotFoundComponent);const i=n==="BEFORE_LOAD"&&s.parentRoute;i||so(s.options.notFoundComponent);const a=e.matches.find(l=>l.routeId===s.id);so(a,"Could not find match for route: "+s.id),e.updateMatch(a.id,l=>({...l,status:"notFound",error:t,isFetching:!1})),i&&(t.routeId=s.parentRoute.id,PN(e,t,n))},qo=(e,t,n,s)=>{if(!(!Br(n)&&!yr(n))){if(Br(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const i=Br(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,a=>({...a,status:i,context:vc(e,t.index),isFetching:!1,error:n})),yr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw Br(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(PN(e,n,s),n)}},DN=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,nu=(e,t,n,s)=>{const{id:i,routeId:a}=e.matches[t],l=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=s,e.firstBadMatchIndex??=t,qo(e,e.router.getMatch(i),n,s);try{l.options.onError?.(n)}catch(f){n=f,qo(e,e.router.getMatch(i),n,s)}e.updateMatch(i,f=>(f._nonReactive.beforeLoadPromise?.resolve(),f._nonReactive.beforeLoadPromise=void 0,f._nonReactive.loadPromise?.resolve(),{...f,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},zN=(e,t,n,s)=>{if(s._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!up(e,t)&&(n.options.loader||n.options.beforeLoad||$N(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const l=setTimeout(()=>{ih(e)},i);s._nonReactive.pendingTimeout=l}},HF=(e,t,n)=>{const s=e.router.getMatch(t);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;zN(e,t,n,s);const i=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&qo(e,a,a.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(i):i()},qF=(e,t,n,s)=>{const i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Dc(()=>{a?.resolve()});const{paramsError:l,searchError:f}=i;l&&nu(e,n,l,"PARSE_PARAMS"),f&&nu(e,n,f,"VALIDATE_SEARCH"),zN(e,t,s,i);const d=new AbortController;let p=!1;const g=()=>{p||(p=!0,e.updateMatch(t,R=>({...R,isFetching:"beforeLoad",fetchCount:R.fetchCount+1,abortController:d})))},y=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,R=>({...R,isFetching:!1}))};if(!s.options.beforeLoad){du(()=>{g(),y()});return}i._nonReactive.beforeLoadPromise=Dc();const b={...vc(e,n,!1),...i.__routeContext},{search:x,params:S,cause:w}=i,T=up(e,t),C={search:x,abortController:d,params:S,preload:T,context:b,location:e.location,navigate:R=>e.router.navigate({...R,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:T?"preload":w,matches:e.matches,routeId:s.id,...e.router.options.additionalContext},O=R=>{if(R===void 0){du(()=>{g(),y()});return}(Br(R)||yr(R))&&(g(),nu(e,n,R,"BEFORE_LOAD")),du(()=>{g(),e.updateMatch(t,M=>({...M,__beforeLoadContext:R})),y()})};let N;try{if(N=s.options.beforeLoad(C),yc(N))return g(),N.catch(R=>{nu(e,n,R,"BEFORE_LOAD")}).then(O)}catch(R){g(),nu(e,n,R,"BEFORE_LOAD")}O(N)},VF=(e,t)=>{const{id:n,routeId:s}=e.matches[t],i=e.router.looseRoutesById[s],a=()=>f(),l=()=>qF(e,n,t,i),f=()=>{if(DN(e,n))return;const d=HF(e,n,i);return yc(d)?d.then(l):l()};return a()},KF=(e,t,n)=>{const s=e.router.getMatch(t);if(!s||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([a,l,f])=>{const d=a?.meta,p=a?.links,g=a?.scripts,y=a?.styles;return{meta:d,links:p,headScripts:g,headers:f,scripts:l,styles:y}})},LN=(e,t,n,s)=>{const i=e.matchPromises[n-1],{params:a,loaderDeps:l,abortController:f,cause:d}=e.router.getMatch(t),p=vc(e,n),g=up(e,t);return{params:a,deps:l,preload:!!g,parentMatchPromise:i,abortController:f,context:p,location:e.location,navigate:y=>e.router.navigate({...y,_fromLocation:e.location}),cause:g?"preload":d,route:s,...e.router.options.additionalContext}},bT=async(e,t,n,s)=>{try{const i=e.router.getMatch(t);try{(!(cF??e.router.isServer)||i.ssr===!0)&&UN(s);const a=s.options.loader?.(LN(e,t,n,s)),l=s.options.loader&&yc(a);if((l||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||i._nonReactive.minPendingPromise)&&e.updateMatch(t,p=>({...p,isFetching:"loader"})),s.options.loader){const p=l?await a:a;qo(e,e.router.getMatch(t),p),p!==void 0&&e.updateMatch(t,g=>({...g,loaderData:p}))}s._lazyPromise&&await s._lazyPromise;const d=i._nonReactive.minPendingPromise;d&&await d,s._componentsPromise&&await s._componentsPromise,e.updateMatch(t,p=>({...p,error:void 0,context:vc(e,n),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(a){let l=a;if(l?.name==="AbortError"){if(i.abortController.signal.aborted){i._nonReactive.loaderPromise?.resolve(),i._nonReactive.loaderPromise=void 0;return}e.updateMatch(t,d=>({...d,status:d.status==="pending"?"success":d.status,isFetching:!1,context:vc(e,n)}));return}const f=i._nonReactive.minPendingPromise;f&&await f,yr(a)&&await s.options.notFoundComponent?.preload?.(),qo(e,e.router.getMatch(t),a);try{s.options.onError?.(a)}catch(d){l=d,qo(e,e.router.getMatch(t),d)}e.updateMatch(t,d=>({...d,error:l,context:vc(e,n),status:"error",isFetching:!1}))}}catch(i){const a=e.router.getMatch(t);a&&(a._nonReactive.loaderPromise=void 0),qo(e,a,i)}},GF=async(e,t)=>{async function n(g,y,b,x){const S=Date.now()-y.updatedAt,w=g?x.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:x.options.staleTime??e.router.options.defaultStaleTime??0,T=x.options.shouldReload,C=typeof T=="function"?T(LN(e,s,t,x)):T,{status:O,invalid:N}=b;a=O==="success"&&(N||(C??S>w)),g&&x.options.preload===!1||(a&&!e.sync?(l=!0,(async()=>{try{await bT(e,s,t,x);const R=e.router.getMatch(s);R._nonReactive.loaderPromise?.resolve(),R._nonReactive.loadPromise?.resolve(),R._nonReactive.loaderPromise=void 0}catch(R){Br(R)&&await e.router.navigate(R.options)}})()):(O!=="success"||a&&e.sync)&&await bT(e,s,t,x))}const{id:s,routeId:i}=e.matches[t];let a=!1,l=!1;const f=e.router.looseRoutesById[i];if(!DN(e,s)){const g=e.router.getMatch(s),y=up(e,s);if(g._nonReactive.loaderPromise){if(g.status==="success"&&!e.sync&&!g.preload)return g;await g._nonReactive.loaderPromise;const b=e.router.getMatch(s),x=b._nonReactive.error||b.error;x&&qo(e,b,x),b.status==="pending"&&await n(y,g,b,f)}else{const b=y&&!e.router.state.matches.some(S=>S.id===s),x=e.router.getMatch(s);x._nonReactive.loaderPromise=Dc(),b!==x.preload&&e.updateMatch(s,S=>({...S,preload:b})),await n(y,g,x,f)}}const d=e.router.getMatch(s);l||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve()),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,l||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;const p=l?d.isFetching:!1;return p!==d.isFetching||d.invalid!==!1?(e.updateMatch(s,g=>({...g,isFetching:p,invalid:!1})),e.router.getMatch(s)):d};async function xT(e){const t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(n=>n._forcePending)&&ih(t);try{for(let f=0;f<t.matches.length;f++){const d=VF(t,f);yc(d)&&await d}const n=t.firstBadMatchIndex??t.matches.length;for(let f=0;f<n;f++)t.matchPromises.push(GF(t,f));const i=(await Promise.allSettled(t.matchPromises)).filter(f=>f.status==="rejected").map(f=>f.reason);let a;for(const f of i){if(Br(f))throw f;!a&&yr(f)&&(a=f)}for(const f of t.matches){const{id:d,routeId:p}=f,g=t.router.looseRoutesById[p];try{const y=KF(t,d,g);if(y){const b=await y;t.updateMatch(d,x=>({...x,...b}))}}catch(y){console.error(`Error executing head for route ${p}:`,y)}}if(a)throw a;const l=ih(t);yc(l)&&await l}catch(n){if(yr(n)&&!t.preload){const s=ih(t);throw yc(s)&&await s,n}if(Br(n))throw n}return t.matches}async function UN(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...s}=t.options;Object.assign(e.options,s),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const s of BN){const i=e.options[s]?.preload;i&&n.push(i())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function $N(e){for(const t of BN)if(e.options[t]?.preload)return!0;return!1}const BN=["component","errorComponent","pendingComponent","notFoundComponent"];function ZF(e){return{input:({url:t})=>{for(const n of e)t=wv(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=FN(e[n],t);return t}}}function YF(e){const t=IN(e.basepath),n=`/${t}`,s=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?s:s.toLowerCase();return{input:({url:l})=>{const f=e.caseSensitive?l.pathname:l.pathname.toLowerCase();return f===i?l.pathname="/":f.startsWith(a)&&(l.pathname=l.pathname.slice(n.length)),l},output:({url:l})=>(l.pathname=oh(["/",t,l.pathname]),l)}}function wv(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function FN(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function sa(e){const t=e.resolvedLocation,n=e.location,s=t?.pathname!==n.pathname,i=t?.href!==n.href,a=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:s,hrefChanged:i,hashChanged:a}}function XF(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}class QF{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const s=this.options,i=this.basepath??s?.basepath??"/",a=this.basepath===void 0,l=s?.rewrite;if(this.options={...s,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=RF(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=iF()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let b;this.resolvePathCache=Mh(1e3),b=this.buildRouteTree(),this.setRoutes(b)}!this.__store&&this.latestLocation&&(this.__store=new rF(JF(this.latestLocation)),IF(this));let f=!1;const d=this.options.basepath??"/",p=this.options.rewrite;if(a||i!==d||l!==p){this.basepath=d;const b=[],x=IN(d);x&&x!=="/"&&b.push(YF({basepath:d})),p&&b.push(p),this.rewrite=b.length===0?void 0:b.length===1?b[0]:ZF(b),this.history&&this.updateLatestLocation(),f=!0}f&&this.__store&&this.__store.setState(b=>({...b,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=SF(this.routeTree,this.options.caseSensitive,(s,i)=>{s.init({originalIndex:i})});return this.options.routeMasks&&gF(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,s)=>{const i={eventType:n,fn:s};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=n=>{this.subscribers.forEach(s=>{s.eventType===n.type&&s.fn(n)})},this.parseLocation=(n,s)=>{const i=({pathname:d,search:p,hash:g,href:y,state:b})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(d)){const O=this.options.parseSearch(p),N=this.options.stringifySearch(O);return{href:d+N+g,publicHref:y,pathname:eu(d).path,external:!1,searchStr:N,search:ur(s?.search,O),hash:eu(g.slice(1)).path,state:ur(s?.state,b)}}const x=new URL(y,this.origin),S=wv(this.rewrite,x),w=this.options.parseSearch(S.search),T=this.options.stringifySearch(w);return S.search=T,{href:S.href.replace(S.origin,""),publicHref:y,pathname:eu(S.pathname).path,external:!!this.rewrite&&S.origin!==this.origin,searchStr:T,search:ur(s?.search,w),hash:eu(S.hash.slice(1)).path,state:ur(s?.state,b)}},a=i(n),{__tempLocation:l,__tempKey:f}=a.state;if(l&&(!f||f===this.tempLocationKey)){const d=i(l);return d.state.key=a.state.key,d.state.__TSR_key=a.state.__TSR_key,delete d.state.__tempLocation,{...d,maskedLocation:a}}return a},this.resolvePathWithBase=(n,s)=>CF({base:n,to:Db(s),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,s,i)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:s},i):this.matchRoutesInternal(n,s),this.getMatchedRoutes=n=>eH({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const s=this.getMatch(n);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(a=>a.status==="pending"),s=this.state.matches.filter(a=>a.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...s]).forEach(a=>{this.cancelMatch(a.id)})},this.buildLocation=n=>{const s=(a={})=>{const l=a._fromLocation||this.pendingBuiltLocation||this.latestLocation,f=this.matchRoutesLightweight(l);a.from;const d=a.unsafeRelative==="path"?l.pathname:a.from??f.fullPath,p=this.resolvePathWithBase(d,"."),g=f.search,y={...f.params},b=a.to?this.resolvePathWithBase(p,`${a.to}`):this.resolvePathWithBase(p,"."),x=a.params===!1||a.params===null?{}:(a.params??!0)===!0?y:Object.assign(y,Ho(a.params,y)),S=fy({path:b,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,w=this.getMatchedRoutes(S);let T=w.matchedRoutes;(w.foundRoute?w.foundRoute.path!=="/"&&w.routeParams["**"]:Gs(S))&&this.options.notFoundRoute&&(T=[...T,this.options.notFoundRoute]);let O=!1;if(Object.keys(x).length>0)for(const Z of T){const K=Z.options.params?.stringify??Z.options.stringifyParams;K&&(O=!0,Object.assign(x,K(x)))}const N=n.leaveParams?b:eu(O?fy({path:b,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:S).path;let R=g;if(n._includeValidateSearch&&this.options.search?.strict){const Z={};T.forEach(K=>{if(K.options.validateSearch)try{Object.assign(Z,ah(K.options.validateSearch,{...Z,...R}))}catch{}}),R=Z}R=tH({search:R,dest:a,destRoutes:T,_includeValidateSearch:n._includeValidateSearch}),R=ur(g,R);const M=this.options.stringifySearch(R),z=a.hash===!0?l.hash:a.hash?Ho(a.hash,l.hash):void 0,j=z?`#${z}`:"";let A=a.state===!0?l.state:a.state?Ho(a.state,l.state):{};A=ur(l.state,A);const P=`${N}${M}${j}`;let Q,B,U=!1;if(this.rewrite){const Z=new URL(P,this.origin),K=FN(this.rewrite,Z);Q=Z.href.replace(Z.origin,""),K.origin!==this.origin?(B=K.href,U=!0):B=K.pathname+K.search+K.hash}else Q=hF(P),B=Q;return{publicHref:B,href:Q,pathname:N,search:R,searchStr:M,state:A,hash:z??"",external:U,unmaskOnReload:a.unmaskOnReload}},i=(a={},l)=>{const f=s(a);let d=l?s(l):void 0;if(!d){const p={};if(this.options.routeMasks){const g=yF(f.pathname,this.processedTree);if(g){Object.assign(p,g.rawParams);const{from:y,params:b,...x}=g.route,S=b===!1||b===null?{}:(b??!0)===!0?p:Object.assign(p,Ho(b,p));l={from:n.from,...x,params:S},d=s(l)}}}return d&&(f.maskedLocation=d),f};return n.mask?i(n,{from:n.from,...n.mask}):i(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:s,...i})=>{const a=()=>{const d=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];d.forEach(g=>{i.state[g]=this.latestLocation.state[g]});const p=ra(i.state,this.latestLocation.state);return d.forEach(g=>{delete i.state[g]}),p},l=Gs(this.latestLocation.href)===Gs(i.href),f=this.commitLocationPromise;if(this.commitLocationPromise=Dc(()=>{f?.resolve()}),l&&a())this.load();else{let{maskedLocation:d,hashScrollIntoView:p,...g}=i;d&&(g={...d,state:{...d.state,__tempKey:void 0,__tempLocation:{...g,search:g.searchStr,state:{...g.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(g.unmaskOnReload??this.options.unmaskOnReload??!1)&&(g.state.__tempKey=this.tempLocationKey)),g.state.__hashScrollIntoViewOptions=p??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[i.replace?"replace":"push"](g.publicHref,g.state,{ignoreBlocker:s})}return this.resetNextScroll=i.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:s,hashScrollIntoView:i,viewTransition:a,ignoreBlocker:l,href:f,...d}={})=>{if(f){const y=this.history.location.state.__TSR_index,b=Ah(f,{__TSR_index:n?y:y+1}),x=new URL(b.pathname,this.origin),S=wv(this.rewrite,x);d.to=S.pathname,d.search=this.options.parseSearch(b.search),d.hash=b.hash.slice(1)}const p=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=p;const g=this.commitLocation({...p,viewTransition:a,replace:n,resetScroll:s,hashScrollIntoView:i,ignoreBlocker:l});return Promise.resolve().then(()=>{this.pendingBuiltLocation===p&&(this.pendingBuiltLocation=void 0)}),g},this.navigate=async({to:n,reloadDocument:s,href:i,publicHref:a,...l})=>{let f=!1;if(i)try{new URL(`${i}`),f=!0}catch{}if(f&&!s&&(s=!0),s){if(n!==void 0||!i){const p=this.buildLocation({to:n,...l});i=i??p.publicHref,a=a??p.publicHref}const d=!f&&a?a:i;if(Oh(d,this.protocolAllowlist))return Promise.resolve();if(!l.ignoreBlocker){const g=this.history.getBlockers?.()??[];for(const y of g)if(y?.blockerFn&&await y.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return l.replace?window.location.replace(d):window.location.href=d,Promise.resolve()}return this.buildAndCommitLocation({...l,href:i,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:s.cachedMatches.filter(i=>!n.some(a=>a.id===i.id))}))},this.load=async n=>{let s,i,a;for(a=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,p=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...sa({resolvedLocation:p,location:d})}),this.emit({type:"onBeforeLoad",...sa({resolvedLocation:p,location:d})}),await xT({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let g=[],y=[],b=[];du(()=>{this.__store.setState(x=>{const S=x.matches,w=x.pendingMatches||x.matches;return g=S.filter(T=>!w.some(C=>C.id===T.id)),y=w.filter(T=>!S.some(C=>C.id===T.id)),b=w.filter(T=>S.some(C=>C.id===T.id)),{...x,isLoading:!1,loadedAt:Date.now(),matches:w,pendingMatches:void 0,cachedMatches:[...x.cachedMatches,...g.filter(T=>T.status!=="error"&&T.status!=="notFound"&&T.status!=="redirected")]}}),this.clearExpiredCache()}),[[g,"onLeave"],[y,"onEnter"],[b,"onStay"]].forEach(([x,S])=>{x.forEach(w=>{this.looseRoutesById[w.routeId].options[S]?.(w)})})})})}})}catch(d){Br(d)?(s=d,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):yr(d)&&(i=d),this.__store.setState(p=>({...p,statusCode:s?s.status:i?404:p.matches.some(g=>g.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===a&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=a,await a;this.latestLoadPromise&&a!==this.latestLoadPromise;)await this.latestLoadPromise;let l;this.hasNotFoundMatch()?l=404:this.__store.state.matches.some(f=>f.status==="error")&&(l=500),l!==void 0&&this.__store.setState(f=>({...f,statusCode:l}))},this.startViewTransition=n=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let i;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const a=this.latestLocation,l=this.state.resolvedLocation,f=typeof s.types=="function"?s.types(sa({resolvedLocation:l,location:a})):s.types;if(f===!1){n();return}i={update:n,types:f}}else i=n;document.startViewTransition(i)}else n()},this.updateMatch=(n,s)=>{this.startTransition(()=>{const i=this.state.pendingMatches?.some(a=>a.id===n)?"pendingMatches":this.state.matches.some(a=>a.id===n)?"matches":this.state.cachedMatches.some(a=>a.id===n)?"cachedMatches":"";i&&(i==="cachedMatches"?this.__store.setState(a=>({...a,cachedMatches:XF(a.cachedMatches.map(l=>l.id===n?s(l):l))})):this.__store.setState(a=>({...a,[i]:a[i]?.map(l=>l.id===n?s(l):l)})))})},this.getMatch=n=>{const s=i=>i.id===n;return this.state.cachedMatches.find(s)??this.state.pendingMatches?.find(s)??this.state.matches.find(s)},this.invalidate=n=>{const s=i=>n?.filter?.(i)??!0?{...i,invalid:!0,...n?.forcePending||i.status==="error"||i.status==="notFound"?{status:"pending",error:void 0}:void 0}:i;return this.__store.setState(i=>({...i,matches:i.matches.map(s),cachedMatches:i.cachedMatches.map(s),pendingMatches:i.pendingMatches?.map(s)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const s=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const i=n.options._builtLocation??this.buildLocation(n.options),a=this.getParsedLocationHref(i);n.options.href=a,n.headers.set("Location",a)}else if(s)try{const i=new URL(s);if(this.origin&&i.origin===this.origin){const a=i.pathname+i.search+i.hash;n.options.href=a,n.headers.set("Location",a)}}catch{}if(n.options.href&&!n.options._builtLocation&&Oh(n.options.href,this.protocolAllowlist))throw new Error(`Redirect blocked: unsafe protocol in href "${n.options.href}". Allowed protocols: ${Array.from(this.protocolAllowlist).join(", ")}.`);return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const s=n?.filter;s!==void 0?this.__store.setState(i=>({...i,cachedMatches:i.cachedMatches.filter(a=>!s(a))})):this.__store.setState(i=>({...i,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=s=>{const i=this.looseRoutesById[s.routeId];if(!i.options.loader)return!0;const a=(s.preload?i.options.preloadGcTime??this.options.defaultPreloadGcTime:i.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=a};this.clearCache({filter:n})},this.loadRouteChunk=UN,this.preloadRoute=async n=>{const s=n._builtLocation??this.buildLocation(n);let i=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:n});const a=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(f=>f.id)),l=new Set([...a,...this.state.cachedMatches.map(f=>f.id)]);du(()=>{i.forEach(f=>{l.has(f.id)||this.__store.setState(d=>({...d,cachedMatches:[...d.cachedMatches,f]}))})});try{return i=await xT({router:this,matches:i,location:s,preload:!0,updateMatch:(f,d)=>{a.has(f)?i=i.map(p=>p.id===f?d(p):p):this.updateMatch(f,d)}}),i}catch(f){if(Br(f))return f.options.reloadDocument?void 0:await this.preloadRoute({...f.options,_fromLocation:s});yr(f)||console.error(f);return}},this.matchRoute=(n,s)=>{const i={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},a=this.buildLocation(i);if(s?.pending&&this.state.status!=="pending")return!1;const f=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,d=vF(a.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,f.pathname,this.processedTree);return!d||n.params&&!ra(d.rawParams,n.params,{partial:!0})?!1:s?.includeSearch??!0?ra(f.search,a.search,{partial:!0})?d.rawParams:!1:d.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??UF,parseSearch:t.parseSearch??LF,protocolAllowlist:t.protocolAllowlist??dF}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:n,processedTree:s}){this.routesById=t,this.routesByPath=n,this.processedTree=s;const i=this.options.notFoundRoute;i&&(i.init({originalIndex:99999999999}),this.routesById[i.id]=i)}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,n){const s=this.getMatchedRoutes(t.pathname),{foundRoute:i,routeParams:a,parsedParams:l}=s;let{matchedRoutes:f}=s,d=!1;(i?i.path!=="/"&&a["**"]:Gs(t.pathname))&&(this.options.notFoundRoute?f=[...f,this.options.notFoundRoute]:d=!0);const p=d?rH(this.options.notFoundMode,f):void 0,g=new Array(f.length),y=new Map(this.state.matches.map(b=>[b.routeId,b]));for(let b=0;b<f.length;b++){const x=f[b],S=g[b-1];let w,T,C;{const K=S?.search??t.search,ee=S?._strictSearch??void 0;try{const D=ah(x.options.validateSearch,{...K})??void 0;w={...K,...D},T={...ee,...D},C=void 0}catch(D){let G=D;if(D instanceof Dh||(G=new Dh(D.message,{cause:D})),n?.throwOnError)throw G;w=K,T={},C=G}}const O=x.options.loaderDeps?.({search:w})??"",N=O?JSON.stringify(O):"",{interpolatedPath:R,usedParams:M}=fy({path:x.fullPath,params:a,decoder:this.pathParamsDecoder,server:this.isServer}),z=x.id+R+N,j=this.getMatch(z),A=y.get(x.id),P=j?._strictParams??M;let Q;if(!j)try{ST(x,M,l,P)}catch(K){if(yr(K)||Br(K)?Q=K:Q=new WF(K.message,{cause:K}),n?.throwOnError)throw Q}Object.assign(a,P);const B=A?"stay":"enter";let U;if(j)U={...j,cause:B,params:A?.params??a,_strictParams:P,search:ur(A?A.search:j.search,w),_strictSearch:T};else{const K=x.options.loader||x.options.beforeLoad||x.lazyFn||$N(x)?"pending":"success";U={id:z,ssr:x.options.ssr,index:b,routeId:x.id,params:A?.params??a,_strictParams:P,pathname:R,updatedAt:Date.now(),search:A?ur(A.search,w):w,_strictSearch:T,searchError:void 0,status:K,isFetching:!1,error:void 0,paramsError:Q,__routeContext:void 0,_nonReactive:{loadPromise:Dc()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:B,loaderDeps:A?ur(A.loaderDeps,O):O,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:x.options.staticData||{},fullPath:x.fullPath}}n?.preload||(U.globalNotFound=p===x.id),U.searchError=C;const Z=this.getParentContext(S);U.context={...Z,...U.__routeContext,...U.__beforeLoadContext},g[b]=U}for(let b=0;b<g.length;b++){const x=g[b],S=this.looseRoutesById[x.routeId],w=this.getMatch(x.id),T=y.get(x.routeId);if(x.params=T?ur(T.params,a):a,!w){const C=g[b-1],O=this.getParentContext(C);if(S.options.context){const N={deps:x.loaderDeps,params:x.params,context:O??{},location:t,navigate:R=>this.navigate({...R,_fromLocation:t}),buildLocation:this.buildLocation,cause:x.cause,abortController:x.abortController,preload:!!x.preload,matches:g,routeId:S.id};x.__routeContext=S.options.context(N)??void 0}x.context={...O,...x.__routeContext,...x.__beforeLoadContext}}}return g}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:s,parsedParams:i}=this.getMatchedRoutes(t.pathname),a=Tu(n),l={...t.search};for(const g of n)try{Object.assign(l,ah(g.options.validateSearch,l))}catch{}const f=Tu(this.state.matches),d=f&&f.routeId===a.id&&t.pathname===this.state.location.pathname;let p;if(d)p=f.params;else{const g={...s};for(const y of n)try{ST(y,s,i??{},g)}catch{}p=g}return{matchedRoutes:n,fullPath:a.fullPath,search:l,params:p}}}class Dh extends Error{}class WF extends Error{}function JF(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function ah(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Dh("Async validation not supported");if(n.issues)throw new Dh(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function eH({pathname:e,routesById:t,processedTree:n}){const s={},i=Gs(e);let a,l;const f=bF(i,n,!0);return f&&(a=f.route,Object.assign(s,f.rawParams),l=Object.assign({},f.parsedParams)),{matchedRoutes:f?.branch||[t[Lr]],routeParams:s,foundRoute:a,parsedParams:l}}function tH({search:e,dest:t,destRoutes:n,_includeValidateSearch:s}){return nH(n)(e,t,s??!1)}function nH(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)i.options.search?.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const a=({search:l,next:f})=>{let d=l;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(d=i.options.preSearchFilters.reduce((g,y)=>y(g),l));const p=f(d);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((g,y)=>y(g),p):p};t.middlewares.push(a)}if(i.options.validateSearch){const a=({search:l,next:f})=>{const d=f(l);if(!t._includeValidateSearch)return d;try{return{...d,...ah(i.options.validateSearch,d)??void 0}}catch{return d}};t.middlewares.push(a)}}const n=({search:i})=>{const a=t.dest;return a.search?a.search===!0?i:Ho(a.search,i):{}};t.middlewares.push(n);const s=(i,a,l)=>{if(i>=l.length)return a;const f=l[i];return f({search:a,next:p=>s(i+1,p,l)})};return function(a,l,f){return t.dest=l,t._includeValidateSearch=f,s(0,a,t.middlewares)}}function rH(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const s=t[n];if(s.children)return s.id}return Lr}function ST(e,t,n,s){const i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(const a in t)a in n&&(s[a]=n[a]);else{const a=i(s);Object.assign(s,a)}}const sH="Error preloading route! ☝️";class HN{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const s=this.options,i=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),i?this._path=Lr:this.parentRoute||so(!1);let a=i?Lr:s?.path;a&&a!=="/"&&(a=MN(a));const l=s?.id||a;let f=i?Lr:oh([this.parentRoute.id===Lr?"":this.parentRoute.id,l]);a===Lr&&(a="/"),f!==Lr&&(f=oh(["/",f]));const d=f===Lr?"/":oh([this.parentRoute.fullPath,a]);this._path=a,this._id=f,this._fullPath=d,this._to=Gs(d)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>FF({from:this.fullPath,...n}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class oH extends HN{constructor(t){super(t)}}const Md=typeof window<"u"?_.useLayoutEffect:_.useEffect;function hy(e){const t=_.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function iH(e,t,n={},s={}){_.useEffect(()=>{if(!e.current||s.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([a])=>{t(a)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,s.disabled,e])}function aH(e){const t=_.useRef(null);return _.useImperativeHandle(e,()=>t.current,[]),t}function zb(e){const t=e.errorComponent??Lb;return h.jsx(cH,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:s})=>n?_.createElement(t,{error:n,reset:s}):e.children})}class cH extends _.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Lb({error:e}){const[t,n]=_.useState(!1);return h.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[h.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),h.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(s=>!s),children:t?"Hide Error":"Show Error"})]}),h.jsx("div",{style:{height:".25rem"}}),t?h.jsx("div",{children:h.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?h.jsx("code",{children:e.message}):null})}):null]})}function lH({children:e,fallback:t=null}){return qN()?h.jsx(Mc.Fragment,{children:e}):h.jsx(Mc.Fragment,{children:t})}function qN(){return Mc.useSyncExternalStore(uH,()=>!0,()=>!1)}function uH(){return()=>{}}var py={exports:{}},my={},gy={exports:{}},yy={};var _T;function fH(){if(_T)return yy;_T=1;var e=Ku();function t(y,b){return y===b&&(y!==0||1/y===1/b)||y!==y&&b!==b}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function f(y,b){var x=b(),S=s({inst:{value:x,getSnapshot:b}}),w=S[0].inst,T=S[1];return a(function(){w.value=x,w.getSnapshot=b,d(w)&&T({inst:w})},[y,x,b]),i(function(){return d(w)&&T({inst:w}),y(function(){d(w)&&T({inst:w})})},[y]),l(x),x}function d(y){var b=y.getSnapshot;y=y.value;try{var x=b();return!n(y,x)}catch{return!0}}function p(y,b){return b()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:f;return yy.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,yy}var wT;function VN(){return wT||(wT=1,gy.exports=fH()),gy.exports}var ET;function dH(){if(ET)return my;ET=1;var e=Ku(),t=VN();function n(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var s=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,l=e.useEffect,f=e.useMemo,d=e.useDebugValue;return my.useSyncExternalStoreWithSelector=function(p,g,y,b,x){var S=a(null);if(S.current===null){var w={hasValue:!1,value:null};S.current=w}else w=S.current;S=f(function(){function C(z){if(!O){if(O=!0,N=z,z=b(z),x!==void 0&&w.hasValue){var j=w.value;if(x(j,z))return R=j}return R=z}if(j=R,s(N,z))return j;var A=b(z);return x!==void 0&&x(j,A)?(N=z,j):(N=z,R=A)}var O=!1,N,R,M=y===void 0?null:y;return[function(){return C(g())},M===null?void 0:function(){return C(M())}]},[g,y,b,x]);var T=i(p,S[0],S[1]);return l(function(){w.hasValue=!0,w.value=T},[T]),d(T),T},my}var TT;function hH(){return TT||(TT=1,py.exports=dH()),py.exports}var KN=hH();function pH(e,t){return e===t}function mH(e,t,n=pH){const s=_.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(l);return f},[e]),i=_.useCallback(()=>e?.get(),[e]);return KN.useSyncExternalStoreWithSelector(s,i,i,t,n)}const vy=_.createContext(null);function GN(){return typeof document>"u"?vy:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=vy,vy)}function Yr(e){const t=_.useContext(GN());return e?.warn,t}function vr(e){const t=Yr({warn:e?.router===void 0}),n=e?.router||t,s=_.useRef(void 0);return mH(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const a=ur(s.current,e.select(i));return s.current=a,a}return e.select(i)}return i})}const fp=_.createContext(void 0),gH=_.createContext(void 0);function Ss(e){const t=_.useContext(e.from?gH:fp);return vr({select:s=>{const i=s.matches.find(a=>e.from?e.from===a.routeId:a.id===t);if(so(!((e.shouldThrow??!0)&&!i),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),i!==void 0)return e.select?e.select(i):i},structuralSharing:e.structuralSharing})}function Ub(e){return Ss({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function $b(e){const{select:t,...n}=e;return Ss({...n,select:s=>t?t(s.loaderDeps):s.loaderDeps})}function Bb(e){return Ss({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Fb(e){return Ss({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function dp(e){const t=Yr();return _.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var hi=mN();function yH(e,t){const n=Yr(),s=aH(t),{activeProps:i,inactiveProps:a,activeOptions:l,to:f,preload:d,preloadDelay:p,hashScrollIntoView:g,replace:y,startTransition:b,resetScroll:x,viewTransition:S,children:w,target:T,disabled:C,style:O,className:N,onClick:R,onFocus:M,onMouseEnter:z,onMouseLeave:j,onTouchStart:A,ignoreBlocker:P,params:Q,search:B,hash:U,state:Z,mask:K,reloadDocument:ee,unsafeRelative:D,from:G,_fromLocation:q,...V}=e,L=qN(),I=vr({select:He=>{const me=He.matches[He.matches.length-1];return{search:me?.search,hash:He.location.hash,path:me?.pathname}},structuralSharing:!0}),H=e.from,W=_.useMemo(()=>({...e,from:H}),[n,I,H,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),Y=_.useMemo(()=>n.buildLocation({...W}),[n,W]),ae=Y.maskedLocation?Y.maskedLocation.publicHref:Y.publicHref,se=Y.maskedLocation?Y.maskedLocation.external:Y.external,fe=_.useMemo(()=>wH(ae,se,n.history,C),[C,se,ae,n.history]),Se=_.useMemo(()=>{if(fe?.external)return Oh(fe.href,n.protocolAllowlist)?void 0:fe.href;if(!EH(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),Oh(f,n.protocolAllowlist)?void 0:f}catch{}},[f,fe,n.protocolAllowlist]),pe=vr({select:He=>{if(Se)return!1;if(l?.exact){if(!TF(He.location.pathname,Y.pathname,n.basepath))return!1}else{const me=Ih(He.location.pathname,n.basepath),Te=Ih(Y.pathname,n.basepath);if(!(me.startsWith(Te)&&(me.length===Te.length||me[Te.length]==="/")))return!1}return(l?.includeSearch??!0)&&!ra(He.location.search,Y.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?L&&He.location.hash===Y.hash:!0}}),Oe=pe?Ho(i,{})??vH:by,_e=pe?by:Ho(a,{})??by,re=[N,Oe.className,_e.className].filter(Boolean).join(" "),he=(O||Oe.style||_e.style)&&{...O,...Oe.style,..._e.style},[ie,we]=_.useState(!1),ye=_.useRef(!1),xe=e.reloadDocument||Se?!1:d??n.options.defaultPreload,ve=p??n.options.defaultPreloadDelay??0,Ie=_.useCallback(()=>{n.preloadRoute({...W,_builtLocation:Y}).catch(He=>{console.warn(He),console.warn(sH)})},[n,W,Y]),Ue=_.useCallback(He=>{He?.isIntersecting&&Ie()},[Ie]);iH(s,Ue,_H,{disabled:!!C||xe!=="viewport"}),_.useEffect(()=>{ye.current||!C&&xe==="render"&&(Ie(),ye.current=!0)},[C,Ie,xe]);const Ee=He=>{const me=He.currentTarget.getAttribute("target"),Te=T!==void 0?T:me;if(!C&&!TH(He)&&!He.defaultPrevented&&(!Te||Te==="_self")&&He.button===0){He.preventDefault(),hi.flushSync(()=>{we(!0)});const qe=n.subscribe("onResolved",()=>{qe(),we(!1)});n.navigate({...W,replace:y,resetScroll:x,hashScrollIntoView:g,startTransition:b,viewTransition:S,ignoreBlocker:P})}};if(Se)return{...V,ref:s,href:Se,...w&&{children:w},...T&&{target:T},...C&&{disabled:C},...O&&{style:O},...N&&{className:N},...R&&{onClick:R},...M&&{onFocus:M},...z&&{onMouseEnter:z},...j&&{onMouseLeave:j},...A&&{onTouchStart:A}};const Ve=He=>{C||xe&&Ie()},Qe=Ve,Be=He=>{if(!(C||!xe))if(!ve)Ie();else{const me=He.target;if(ru.has(me))return;const Te=setTimeout(()=>{ru.delete(me),Ie()},ve);ru.set(me,Te)}},We=He=>{if(C||!xe||!ve)return;const me=He.target,Te=ru.get(me);Te&&(clearTimeout(Te),ru.delete(me))};return{...V,...Oe,..._e,href:fe?.href,ref:s,onClick:su([R,Ee]),onFocus:su([M,Ve]),onMouseEnter:su([z,Be]),onMouseLeave:su([j,We]),onTouchStart:su([A,Qe]),disabled:!!C,target:T,...he&&{style:he},...re&&{className:re},...C&&bH,...pe&&xH,...L&&ie&&SH}}const by={},vH={className:"active"},bH={role:"link","aria-disabled":!0},xH={"data-status":"active","aria-current":"page"},SH={"data-transitioning":"transitioning"},ru=new WeakMap,_H={rootMargin:"100px"},su=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function wH(e,t,n,s){if(!s)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function EH(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const bc=_.forwardRef((e,t)=>{const{_asChild:n,...s}=e,{type:i,...a}=yH(s,t),l=typeof s.children=="function"?s.children({isActive:a["data-status"]==="active"}):s.children;if(!n){const{disabled:f,...d}=a;return _.createElement("a",d,l)}return _.createElement(n,a,l)});function TH(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let CH=class extends HN{constructor(t){super(t),this.useMatch=n=>Ss({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ss({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Fb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Bb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>$b({...n,from:this.id}),this.useLoaderData=n=>Ub({...n,from:this.id}),this.useNavigate=()=>dp({from:this.fullPath}),this.Link=Mc.forwardRef((n,s)=>h.jsx(bc,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function co(e){return new CH(e)}class RH extends oH{constructor(t){super(t),this.useMatch=n=>Ss({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ss({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Fb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Bb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>$b({...n,from:this.id}),this.useLoaderData=n=>Ub({...n,from:this.id}),this.useNavigate=()=>dp({from:this.fullPath}),this.Link=Mc.forwardRef((n,s)=>h.jsx(bc,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function NH(e){return new RH(e)}function CT(e){return typeof e=="object"?new RT(e,{silent:!0}).createRoute(e):new RT(e,{silent:!0}).createRoute}class RT{constructor(t,n){this.path=t,this.createRoute=s=>{this.silent;const i=co(s);return i.isRoot=!1,i},this.silent=n?.silent}}class NT{constructor(t){this.useMatch=n=>Ss({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ss({from:this.options.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Fb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>Bb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>$b({...n,from:this.options.id}),this.useLoaderData=n=>Ub({...n,from:this.options.id}),this.useNavigate=()=>{const n=Yr();return dp({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function jT(e){return typeof e=="object"?new NT(e):t=>new NT({id:e,...t})}function jH(){const e=Yr(),t=_.useRef({router:e,mounted:!1}),[n,s]=_.useState(!1),{hasPendingMatches:i,isLoading:a}=vr({select:y=>({isLoading:y.isLoading,hasPendingMatches:y.matches.some(b=>b.status==="pending")}),structuralSharing:!0}),l=hy(a),f=a||n||i,d=hy(f),p=a||i,g=hy(p);return e.startTransition=y=>{s(!0),_.startTransition(()=>{y(),s(!1)})},_.useEffect(()=>{const y=e.history.subscribe(e.load),b=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Gs(e.latestLocation.publicHref)!==Gs(b.publicHref)&&e.commitLocation({...b,replace:!0}),()=>{y()}},[e,e.history]),Md(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(b){console.error(b)}})()},[e]),Md(()=>{l&&!a&&e.emit({type:"onLoad",...sa(e.state)})},[l,e,a]),Md(()=>{g&&!p&&e.emit({type:"onBeforeRouteMount",...sa(e.state)})},[p,g,e]),Md(()=>{if(d&&!f){const y=sa(e.state);e.emit({type:"onResolved",...y}),e.__store.setState(b=>({...b,status:"idle",resolvedLocation:b.location})),y.hrefChanged&&PF(e)}},[f,d,e]),null}function AH(e){const t=vr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return h.jsx(zb,{getResetKey:()=>t,onCatch:(n,s)=>{if(yr(n))e.onCatch?.(n,s);else throw n},errorComponent:({error:n})=>{if(yr(n))return e.fallback?.(n);throw n},children:e.children})}function kH(){return h.jsx("p",{children:"Not Found"})}function lc(e){return h.jsx(h.Fragment,{children:e.children})}function ZN(e,t,n){return t.options.notFoundComponent?h.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?h.jsx(e.options.defaultNotFoundComponent,{...n}):h.jsx(kH,{})}function OH(){return Yr().isScrollRestoring,null}const YN=_.memo(function({matchId:t}){const n=Yr(),s=vr({select:w=>{const T=w.matches.findIndex(O=>O.id===t),C=w.matches[T];return so(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._displayPending,resetKey:w.loadedAt,parentRouteId:w.matches[T-1]?.routeId}},structuralSharing:!0}),i=n.routesById[s.routeId],a=i.options.pendingComponent??n.options.defaultPendingComponent,l=a?h.jsx(a,{}):null,f=i.options.errorComponent??n.options.defaultErrorComponent,d=i.options.onCatch??n.options.defaultOnCatch,p=i.isRoot?i.options.notFoundComponent??n.options.notFoundRoute?.options.component:i.options.notFoundComponent,g=s.ssr===!1||s.ssr==="data-only",y=(!i.isRoot||i.options.wrapInSuspense||g)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||g))?_.Suspense:lc,b=f?zb:lc,x=p?AH:lc,S=i.isRoot?i.options.shellComponent??lc:lc;return h.jsxs(S,{children:[h.jsx(fp.Provider,{value:t,children:h.jsx(y,{fallback:l,children:h.jsx(b,{getResetKey:()=>s.resetKey,errorComponent:f||Lb,onCatch:(w,T)=>{if(yr(w))throw w;d?.(w,T)},children:h.jsx(x,{fallback:w=>{if(!p||w.routeId&&w.routeId!==s.routeId||!w.routeId&&!i.isRoot)throw w;return _.createElement(p,w)},children:g||s._displayPending?h.jsx(lH,{fallback:l,children:h.jsx(AT,{matchId:t})}):h.jsx(AT,{matchId:t})})})})}),s.parentRouteId===Lr&&n.options.scrollRestoration?h.jsxs(h.Fragment,{children:[h.jsx(MH,{}),h.jsx(OH,{})]}):null]})});function MH(){const e=Yr(),t=_.useRef(void 0);return h.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...sa(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const AT=_.memo(function({matchId:t}){const n=Yr(),{match:s,key:i,routeId:a}=vr({select:d=>{const p=d.matches.find(S=>S.id===t),g=p.routeId,b=(n.routesById[g].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:g,loaderDeps:p.loaderDeps,params:p._strictParams,search:p._strictSearch});return{key:b?JSON.stringify(b):void 0,routeId:g,match:{id:p.id,status:p.status,error:p.error,invalid:p.invalid,_forcePending:p._forcePending,_displayPending:p._displayPending}}},structuralSharing:!0}),l=n.routesById[a],f=_.useMemo(()=>{const d=l.options.component??n.options.defaultComponent;return d?h.jsx(d,{},i):h.jsx(XN,{})},[i,l.options.component,n.options.defaultComponent]);if(s._displayPending)throw n.getMatch(s.id)?._nonReactive.displayPendingPromise;if(s._forcePending)throw n.getMatch(s.id)?._nonReactive.minPendingPromise;if(s.status==="pending"){const d=l.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const p=n.getMatch(s.id);if(p&&!p._nonReactive.minPendingPromise){const g=Dc();p._nonReactive.minPendingPromise=g,setTimeout(()=>{g.resolve(),p._nonReactive.minPendingPromise=void 0},d)}}throw n.getMatch(s.id)?._nonReactive.loadPromise}if(s.status==="notFound")return so(yr(s.error)),ZN(n,l,s.error);if(s.status==="redirected")throw so(Br(s.error)),n.getMatch(s.id)?._nonReactive.loadPromise;if(s.status==="error")throw s.error;return f}),XN=_.memo(function(){const t=Yr(),n=_.useContext(fp),s=vr({select:p=>p.matches.find(g=>g.id===n)?.routeId}),i=t.routesById[s],a=vr({select:p=>{const y=p.matches.find(b=>b.id===n);return so(y),y.globalNotFound}}),l=vr({select:p=>{const g=p.matches,y=g.findIndex(b=>b.id===n);return g[y+1]?.id}}),f=t.options.defaultPendingComponent?h.jsx(t.options.defaultPendingComponent,{}):null;if(a)return ZN(t,i,void 0);if(!l)return null;const d=h.jsx(YN,{matchId:l});return s===Lr?h.jsx(_.Suspense,{fallback:f,children:d}):d});function IH(){const e=Yr(),n=e.routesById[Lr].options.pendingComponent??e.options.defaultPendingComponent,s=n?h.jsx(n,{}):null,i=typeof document<"u"&&e.ssr?lc:_.Suspense,a=h.jsxs(i,{fallback:s,children:[h.jsx(jH,{}),h.jsx(PH,{})]});return e.options.InnerWrap?h.jsx(e.options.InnerWrap,{children:a}):a}function PH(){const e=Yr(),t=vr({select:i=>i.matches[0]?.id}),n=vr({select:i=>i.loadedAt}),s=t?h.jsx(YN,{matchId:t}):null;return h.jsx(fp.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?s:h.jsx(zb,{getResetKey:()=>n,errorComponent:Lb,onCatch:i=>{i.message||i.toString()},children:s})})}const DH=e=>new zH(e);class zH extends QF{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=CT,globalThis.createLazyFileRoute=jT):typeof window<"u"&&(window.createFileRoute=CT,window.createLazyFileRoute=jT);function LH({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const s=GN(),i=h.jsx(s.Provider,{value:e,children:t});return e.options.Wrap?h.jsx(e.options.Wrap,{children:i}):i}function UH({router:e,...t}){return h.jsx(LH,{router:e,...t,children:h.jsx(IH,{})})}const $H=/\{[^{}]+\}/g,BH=()=>typeof process=="object"&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici;function FH(){return Math.random().toString(36).slice(2,11)}function HH(e){let{baseUrl:t="",Request:n=globalThis.Request,fetch:s=globalThis.fetch,querySerializer:i,bodySerializer:a,pathSerializer:l,headers:f,requestInitExt:d=void 0,...p}={...e};d=BH()?d:void 0,t=MT(t);const g=[];async function y(b,x){const{baseUrl:S,fetch:w=s,Request:T=n,headers:C,params:O={},parseAs:N="json",querySerializer:R,bodySerializer:M=a??VH,pathSerializer:z,body:j,middleware:A=[],...P}=x||{};let Q=t;S&&(Q=MT(S)??t);let B=typeof i=="function"?i:kT(i);R&&(B=typeof R=="function"?R:kT({...typeof i=="object"?i:{},...R}));const U=z||l||qH,Z=j===void 0?void 0:M(j,OT(f,C,O.header)),K=OT(Z===void 0||Z instanceof FormData?{}:{"Content-Type":"application/json"},f,C,O.header),ee=[...g,...A],D={redirect:"follow",...p,...P,body:Z,headers:K};let G,q,V=new T(KH(b,{baseUrl:Q,params:O,querySerializer:B,pathSerializer:U}),D),L;for(const W in P)W in V||(V[W]=P[W]);if(ee.length){G=FH(),q=Object.freeze({baseUrl:Q,fetch:w,parseAs:N,querySerializer:B,bodySerializer:M,pathSerializer:U});for(const W of ee)if(W&&typeof W=="object"&&typeof W.onRequest=="function"){const Y=await W.onRequest({request:V,schemaPath:b,params:O,options:q,id:G});if(Y)if(Y instanceof T)V=Y;else if(Y instanceof Response){L=Y;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!L){try{L=await w(V,d)}catch(W){let Y=W;if(ee.length)for(let ae=ee.length-1;ae>=0;ae--){const se=ee[ae];if(se&&typeof se=="object"&&typeof se.onError=="function"){const fe=await se.onError({request:V,error:Y,schemaPath:b,params:O,options:q,id:G});if(fe){if(fe instanceof Response){Y=void 0,L=fe;break}if(fe instanceof Error){Y=fe;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(Y)throw Y}if(ee.length)for(let W=ee.length-1;W>=0;W--){const Y=ee[W];if(Y&&typeof Y=="object"&&typeof Y.onResponse=="function"){const ae=await Y.onResponse({request:V,response:L,schemaPath:b,params:O,options:q,id:G});if(ae){if(!(ae instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");L=ae}}}}const I=L.headers.get("Content-Length");if(L.status===204||V.method==="HEAD"||I==="0"&&!L.headers.get("Transfer-Encoding")?.includes("chunked"))return L.ok?{data:void 0,response:L}:{error:void 0,response:L};if(L.ok)return{data:await(async()=>{if(N==="stream")return L.body;if(N==="json"&&!I){const Y=await L.text();return Y?JSON.parse(Y):void 0}return await L[N]()})(),response:L};let H=await L.text();try{H=JSON.parse(H)}catch{}return{error:H,response:L}}return{request(b,x,S){return y(x,{...S,method:b.toUpperCase()})},GET(b,x){return y(b,{...x,method:"GET"})},PUT(b,x){return y(b,{...x,method:"PUT"})},POST(b,x){return y(b,{...x,method:"POST"})},DELETE(b,x){return y(b,{...x,method:"DELETE"})},OPTIONS(b,x){return y(b,{...x,method:"OPTIONS"})},HEAD(b,x){return y(b,{...x,method:"HEAD"})},PATCH(b,x){return y(b,{...x,method:"PATCH"})},TRACE(b,x){return y(b,{...x,method:"TRACE"})},use(...b){for(const x of b)if(x){if(typeof x!="object"||!("onRequest"in x||"onResponse"in x||"onError"in x))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");g.push(x)}},eject(...b){for(const x of b){const S=g.indexOf(x);S!==-1&&g.splice(S,1)}}}}function hp(e,t,n){if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${n?.allowReserved===!0?t:encodeURIComponent(t)}`}function QN(e,t,n){if(!t||typeof t!="object")return"";const s=[],i={simple:",",label:".",matrix:";"}[n.style]||"&";if(n.style!=="deepObject"&&n.explode===!1){for(const f in t)s.push(f,n.allowReserved===!0?t[f]:encodeURIComponent(t[f]));const l=s.join(",");switch(n.style){case"form":return`${e}=${l}`;case"label":return`.${l}`;case"matrix":return`;${e}=${l}`;default:return l}}for(const l in t){const f=n.style==="deepObject"?`${e}[${l}]`:l;s.push(hp(f,t[l],n))}const a=s.join(i);return n.style==="label"||n.style==="matrix"?`${i}${a}`:a}function WN(e,t,n){if(!Array.isArray(t))return"";if(n.explode===!1){const a={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[n.style]||",",l=(n.allowReserved===!0?t:t.map(f=>encodeURIComponent(f))).join(a);switch(n.style){case"simple":return l;case"label":return`.${l}`;case"matrix":return`;${e}=${l}`;default:return`${e}=${l}`}}const s={simple:",",label:".",matrix:";"}[n.style]||"&",i=[];for(const a of t)n.style==="simple"||n.style==="label"?i.push(n.allowReserved===!0?a:encodeURIComponent(a)):i.push(hp(e,a,n));return n.style==="label"||n.style==="matrix"?`${s}${i.join(s)}`:i.join(s)}function kT(e){return function(n){const s=[];if(n&&typeof n=="object")for(const i in n){const a=n[i];if(a!=null){if(Array.isArray(a)){if(a.length===0)continue;s.push(WN(i,a,{style:"form",explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof a=="object"){s.push(QN(i,a,{style:"deepObject",explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}s.push(hp(i,a,e))}}return s.join("&")}}function qH(e,t){let n=e;for(const s of e.match($H)??[]){let i=s.substring(1,s.length-1),a=!1,l="simple";if(i.endsWith("*")&&(a=!0,i=i.substring(0,i.length-1)),i.startsWith(".")?(l="label",i=i.substring(1)):i.startsWith(";")&&(l="matrix",i=i.substring(1)),!t||t[i]===void 0||t[i]===null)continue;const f=t[i];if(Array.isArray(f)){n=n.replace(s,WN(i,f,{style:l,explode:a}));continue}if(typeof f=="object"){n=n.replace(s,QN(i,f,{style:l,explode:a}));continue}if(l==="matrix"){n=n.replace(s,`;${hp(i,f)}`);continue}n=n.replace(s,l==="label"?`.${encodeURIComponent(f)}`:encodeURIComponent(f))}return n}function VH(e,t){return e instanceof FormData?e:t&&(t.get instanceof Function?t.get("Content-Type")??t.get("content-type"):t["Content-Type"]??t["content-type"])==="application/x-www-form-urlencoded"?new URLSearchParams(e).toString():JSON.stringify(e)}function KH(e,t){let n=`${t.baseUrl}${e}`;t.params?.path&&(n=t.pathSerializer(n,t.params.path));let s=t.querySerializer(t.params.query??{});return s.startsWith("?")&&(s=s.substring(1)),s&&(n+=`?${s}`),n}function OT(...e){const t=new Headers;for(const n of e){if(!n||typeof n!="object")continue;const s=n instanceof Headers?n.entries():Object.entries(n);for(const[i,a]of s)if(a===null)t.delete(i);else if(Array.isArray(a))for(const l of a)t.append(i,l);else a!==void 0&&t.set(i,a)}return t}function MT(e){return e.endsWith("/")?e.substring(0,e.length-1):e}class GH extends Error{error;constructor(t,n){super(t),this.error=n,this.name="ApiResponseError"}}function ZH(e){if(e&&typeof e=="object"&&"error"in e){const t=e.error;if(typeof t=="string")return t}if(e&&typeof e=="object"&&"message"in e){const t=e.message;if(typeof t=="string")return t}return"Request failed"}async function Yu(e){const{data:t,error:n}=await e;if(n||!t)throw new GH(ZH(n),n);return t}function YH(e){const t=HH({baseUrl:e.baseUrl,...e.fetch&&{fetch:e.fetch}}),n=e.getHeaders,s=e.transportPath??"direct";return t.use({async onRequest({request:i}){if(n){const a=await n();for(const[l,f]of Object.entries(a))i.headers.set(l,f)}return i.headers.has("x-syncular-transport-path")||i.headers.set("x-syncular-transport-path",s),i}}),t}function XH(e){return YH({baseUrl:e.serverUrl,getHeaders:()=>({Authorization:`Bearer ${e.token}`})})}async function QH(e){try{const{error:t,response:n}=await e.GET("/console/stats");if(!t)return;const s=n.status;let i=null;if(typeof t=="string")i=t;else if(t&&typeof t=="object"){const a=t,l=a.error,f=a.message;if(typeof l=="string"&&l.length>0)i=l;else if(typeof f=="string"&&f.length>0)i=f;else try{i=JSON.stringify(a)}catch{i=null}}throw new Error(i&&i.length>0?`Console API /console/stats returned ${s}: ${i}`:`Console API /console/stats returned ${s}`)}catch(t){throw t instanceof Error?t:new Error("Failed to connect to console API")}}function pi(e,t){const[n,s]=_.useState(()=>{if(typeof window>"u")return t;try{const a=window.localStorage.getItem(e);return a===null?t:JSON.parse(a)}catch{return t}});_.useEffect(()=>{try{n==null?window.localStorage.removeItem(e):window.localStorage.setItem(e,JSON.stringify(n))}catch{}},[e,n]);const i=_.useCallback(a=>{s(l=>typeof a=="function"?a(l):a)},[]);return[n,i]}const JN=_.createContext(null);function WH({children:e,defaultConfig:t=null,autoConnect:n=!1}){const[s,i]=pi("sync-console-connection",null),[a,l]=_.useState({isConnected:!1,isConnecting:!1,error:null,client:null}),f=_.useRef(null);_.useEffect(()=>{if(!(s?.serverUrl?.trim()&&s.token?.trim())&&t?.serverUrl?.trim()&&t.token?.trim()){i({serverUrl:t.serverUrl.trim(),token:t.token.trim()});return}},[i,s,t]);const d=_.useCallback(async(x,S)=>{const w=x??s;if(!w)return l(C=>({...C,error:"No connection configured"})),!1;const T={serverUrl:w.serverUrl?.trim()??"",token:w.token?.trim()??""};if(!T.serverUrl)return l(C=>({...C,error:"Server URL is required"})),!1;if(!T.token)return l(C=>({...C,error:"Token is required"})),!1;x&&(S?.persistOverride??!0)&&i(T),l(C=>({...C,isConnecting:!0,error:null}));try{const C=XH(T);return await QH(C),l({isConnected:!0,isConnecting:!1,client:C,error:null}),!0}catch(C){return l({isConnected:!1,isConnecting:!1,client:null,error:C instanceof Error?C.message:"Connection failed"}),!1}},[s,i]),p=_.useCallback(x=>{x?.clearSavedConfig&&i(null),l({isConnected:!1,isConnecting:!1,client:null,error:null})},[i]),g=_.useCallback(()=>{l(x=>({...x,error:null}))},[]),y=_.useCallback(x=>{i(x),l({isConnected:!1,isConnecting:!1,client:null,error:null})},[i]),b=_.useMemo(()=>({config:s,setConfig:y,isConnected:a.isConnected,isConnecting:a.isConnecting,error:a.error,client:a.client,connect:d,disconnect:p,clearError:g}),[s,y,a,d,p,g]);return _.useEffect(()=>{if(!n||a.isConnected||a.isConnecting)return;const x=s??t,S=JH(x);!x||!S||f.current!==S&&(f.current=S,d(x,{persistOverride:!0}))},[n,s,t,a.isConnected,a.isConnecting,d]),h.jsx(JN.Provider,{value:b,children:e})}function JH(e){if(!e)return null;const t=e.serverUrl?.trim()??"",n=e.token?.trim()??"";return!t||!n?null:`${t}\0${n}`}function Dt(){const e=_.useContext(JN);if(!e)throw new Error("useConnection must be used within a ConnectionProvider");return e}function Vt(){const{client:e}=Dt();return e}function ej(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ej(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function Hb(){for(var e,t,n=0,s="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ej(e))&&(s&&(s+=" "),s+=t);return s}var eq=e=>typeof e=="number"&&e!=+e,zh=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,IT=e=>(typeof e=="number"||e instanceof Number)&&!eq(e);function tq(){}var Lh=Symbol("NOT_FOUND");function nq(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function rq(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function sq(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(s=>typeof s=="function"?`function ${s.name||"unnamed"}()`:typeof s).join(", ");throw new TypeError(`${t}[${n}]`)}}var PT=e=>Array.isArray(e)?e:[e];function oq(e){const t=Array.isArray(e[0])?e[0]:e;return sq(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function iq(e,t){const n=[],{length:s}=e;for(let i=0;i<s;i++)n.push(e[i].apply(null,t));return n}function aq(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Lh},put(n,s){t={key:n,value:s}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function cq(e,t){let n=[];function s(f){const d=n.findIndex(p=>t(f,p.key));if(d>-1){const p=n[d];return d>0&&(n.splice(d,1),n.unshift(p)),p.value}return Lh}function i(f,d){s(f)===Lh&&(n.unshift({key:f,value:d}),n.length>e&&n.pop())}function a(){return n}function l(){n=[]}return{get:s,put:i,getEntries:a,clear:l}}var lq=(e,t)=>e===t;function uq(e){return function(n,s){if(n===null||s===null||n.length!==s.length)return!1;const{length:i}=n;for(let a=0;a<i;a++)if(!e(n[a],s[a]))return!1;return!0}}function fq(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:s=lq,maxSize:i=1,resultEqualityCheck:a}=n,l=uq(s);let f=0;const d=i<=1?aq(l):cq(i,l);function p(){let g=d.get(arguments);if(g===Lh){if(g=e.apply(null,arguments),f++,a){const b=d.getEntries().find(x=>a(x.value,g));b&&(g=b.value,f!==0&&f--)}d.put(arguments,g)}return g}return p.clearCache=()=>{d.clear(),p.resetResultsCount()},p.resultsCount=()=>f,p.resetResultsCount=()=>{f=0},p}var dq=class{constructor(e){this.value=e}deref(){return this.value}},hq=typeof WeakRef<"u"?WeakRef:dq,pq=0,DT=1;function Id(){return{s:pq,v:void 0,o:null,p:null}}function tj(e,t={}){let n=Id();const{resultEqualityCheck:s}=t;let i,a=0;function l(){let f=n;const{length:d}=arguments;for(let y=0,b=d;y<b;y++){const x=arguments[y];if(typeof x=="function"||typeof x=="object"&&x!==null){let S=f.o;S===null&&(f.o=S=new WeakMap);const w=S.get(x);w===void 0?(f=Id(),S.set(x,f)):f=w}else{let S=f.p;S===null&&(f.p=S=new Map);const w=S.get(x);w===void 0?(f=Id(),S.set(x,f)):f=w}}const p=f;let g;if(f.s===DT)g=f.v;else if(g=e.apply(null,arguments),a++,s){const y=i?.deref?.()??i;y!=null&&s(y,g)&&(g=y,a!==0&&a--),i=typeof g=="object"&&g!==null||typeof g=="function"?new hq(g):g}return p.s=DT,p.v=g,g}return l.clearCache=()=>{n=Id(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function nj(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,s=(...i)=>{let a=0,l=0,f,d={},p=i.pop();typeof p=="object"&&(d=p,p=i.pop()),nq(p,`createSelector expects an output function after the inputs, but received: [${typeof p}]`);const g={...n,...d},{memoize:y,memoizeOptions:b=[],argsMemoize:x=tj,argsMemoizeOptions:S=[]}=g,w=PT(b),T=PT(S),C=oq(i),O=y(function(){return a++,p.apply(null,arguments)},...w),N=x(function(){l++;const M=iq(C,arguments);return f=O.apply(null,M),f},...T);return Object.assign(N,{resultFunc:p,memoizedResultFunc:O,dependencies:C,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>f,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:y,argsMemoize:x})};return Object.assign(s,{withTypes:()=>s}),s}var mq=nj(tj),gq=Object.assign((e,t=mq)=>{rq(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),s=n.map(a=>e[a]);return t(s,(...a)=>a.reduce((l,f,d)=>(l[n[d]]=f,l),{}))},{withTypes:()=>gq});function Uh(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}var xy={},Sy={},_y={},zT;function yq(){return zT||(zT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,s,{signal:i,edges:a}={}){let l,f=null;const d=a!=null&&a.includes("leading"),p=a==null||a.includes("trailing"),g=()=>{f!==null&&(n.apply(l,f),l=void 0,f=null)},y=()=>{p&&g(),w()};let b=null;const x=()=>{b!=null&&clearTimeout(b),b=setTimeout(()=>{b=null,y()},s)},S=()=>{b!==null&&(clearTimeout(b),b=null)},w=()=>{S(),l=void 0,f=null},T=()=>{g()},C=function(...O){if(i?.aborted)return;l=this,f=O;const N=b==null;x(),d&&N&&g()};return C.schedule=x,C.cancel=w,C.flush=T,i?.addEventListener("abort",w,{once:!0}),C}e.debounce=t})(_y)),_y}var LT;function vq(){return LT||(LT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=yq();function n(s,i=0,a={}){typeof a!="object"&&(a={});const{leading:l=!1,trailing:f=!0,maxWait:d}=a,p=Array(2);l&&(p[0]="leading"),f&&(p[1]="trailing");let g,y=null;const b=t.debounce(function(...w){g=s.apply(this,w),y=null},i,{edges:p}),x=function(...w){return d!=null&&(y===null&&(y=Date.now()),Date.now()-y>=d)?(g=s.apply(this,w),y=Date.now(),b.cancel(),b.schedule(),g):(b.apply(this,w),g)},S=()=>(b.flush(),g);return x.cancel=b.cancel,x.flush=S,x}e.debounce=n})(Sy)),Sy}var UT;function bq(){return UT||(UT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vq();function n(s,i=0,a={}){const{leading:l=!0,trailing:f=!0}=a;return t.debounce(s,i,{leading:l,maxWait:i,trailing:f})}e.throttle=n})(xy)),xy}var wy,$T;function xq(){return $T||($T=1,wy=bq().throttle),wy}var Sq=xq();const _q=I1(Sq);var BT=function(t,n){for(var s=arguments.length,i=new Array(s>2?s-2:0),a=2;a<s;a++)i[a-2]=arguments[a];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=0;console.warn(n.replace(/%s/g,()=>i[l++]))}},bs={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},rj=(e,t,n)=>{var{width:s=bs.width,height:i=bs.height,aspect:a,maxHeight:l}=n,f=zh(s)?e:Number(s),d=zh(i)?t:Number(i);return a&&a>0&&(f?d=f/a:d&&(f=d*a),l&&d!=null&&d>l&&(d=l)),{calculatedWidth:f,calculatedHeight:d}},wq={width:0,height:0,overflow:"visible"},Eq={width:0,overflowX:"visible"},Tq={height:0,overflowY:"visible"},Cq={},Rq=e=>{var{width:t,height:n}=e,s=zh(t),i=zh(n);return s&&i?wq:s?Eq:i?Tq:Cq};function Nq(e){var{width:t,height:n,aspect:s}=e,i=t,a=n;return i===void 0&&a===void 0?(i=bs.width,a=bs.height):i===void 0?i=s&&s>0?void 0:bs.width:a===void 0&&(a=s&&s>0?void 0:bs.height),{width:i,height:a}}function Ev(){return Ev=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Ev.apply(null,arguments)}function FT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,s)}return n}function HT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FT(Object(n),!0).forEach(function(s){jq(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FT(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function jq(e,t,n){return(t=Aq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Aq(e){var t=kq(e,"string");return typeof t=="symbol"?t:t+""}function kq(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var sj=_.createContext(bs.initialDimension);function Oq(e){return Uh(e.width)&&Uh(e.height)}function oj(e){var{children:t,width:n,height:s}=e,i=_.useMemo(()=>({width:n,height:s}),[n,s]);return Oq(i)?_.createElement(sj.Provider,{value:i},t):null}var Mq=()=>_.useContext(sj),Iq=_.forwardRef((e,t)=>{var{aspect:n,initialDimension:s=bs.initialDimension,width:i,height:a,minWidth:l=bs.minWidth,minHeight:f,maxHeight:d,children:p,debounce:g=bs.debounce,id:y,className:b,onResize:x,style:S={}}=e,w=_.useRef(null),T=_.useRef();T.current=x,_.useImperativeHandle(t,()=>w.current);var[C,O]=_.useState({containerWidth:s.width,containerHeight:s.height}),N=_.useCallback((A,P)=>{O(Q=>{var B=Math.round(A),U=Math.round(P);return Q.containerWidth===B&&Q.containerHeight===U?Q:{containerWidth:B,containerHeight:U}})},[]);_.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return tq;var A=U=>{var Z,K=U[0];if(K!=null){var{width:ee,height:D}=K.contentRect;N(ee,D),(Z=T.current)===null||Z===void 0||Z.call(T,ee,D)}};g>0&&(A=_q(A,g,{trailing:!0,leading:!1}));var P=new ResizeObserver(A),{width:Q,height:B}=w.current.getBoundingClientRect();return N(Q,B),P.observe(w.current),()=>{P.disconnect()}},[N,g]);var{containerWidth:R,containerHeight:M}=C;BT(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:z,calculatedHeight:j}=rj(R,M,{width:i,height:a,aspect:n,maxHeight:d});return BT(z!=null&&z>0||j!=null&&j>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
68
|
-
please check the style of container, or the props width(%s) and height(%s),
|
|
69
|
-
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
70
|
-
height and width.`,z,j,i,a,l,f,n),_.createElement("div",{id:y?"".concat(y):void 0,className:Hb("recharts-responsive-container",b),style:HT(HT({},S),{},{width:i,height:a,minWidth:l,minHeight:f,maxHeight:d}),ref:w},_.createElement("div",{style:Rq({width:i,height:a})},_.createElement(oj,{width:z,height:j},p)))}),Pq=_.forwardRef((e,t)=>{var n=Mq();if(Uh(n.width)&&Uh(n.height))return e.children;var{width:s,height:i}=Nq({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:l}=rj(void 0,void 0,{width:s,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return IT(a)&&IT(l)?_.createElement(oj,{width:a,height:l},e.children):_.createElement(Iq,Ev({},e,{width:s,height:i,ref:t}))});const Dq=(e,t)=>{const n=new Array(e.length+t.length);for(let s=0;s<e.length;s++)n[s]=e[s];for(let s=0;s<t.length;s++)n[e.length+s]=t[s];return n},zq=(e,t)=>({classGroupId:e,validator:t}),ij=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),$h="-",qT=[],Lq="arbitrary..",Uq=e=>{const t=Bq(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return $q(l);const f=l.split($h),d=f[0]===""&&f.length>1?1:0;return aj(f,d,t)},getConflictingClassGroupIds:(l,f)=>{if(f){const d=s[l],p=n[l];return d?p?Dq(p,d):d:p||qT}return n[l]||qT}}},aj=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const p=aj(e,t+1,a);if(p)return p}const l=n.validators;if(l===null)return;const f=t===0?e.join($h):e.slice(t).join($h),d=l.length;for(let p=0;p<d;p++){const g=l[p];if(g.validator(f))return g.classGroupId}},$q=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),s=t.slice(0,n);return s?Lq+s:void 0})(),Bq=e=>{const{theme:t,classGroups:n}=e;return Fq(n,t)},Fq=(e,t)=>{const n=ij();for(const s in e){const i=e[s];qb(i,n,s,t)}return n},qb=(e,t,n,s)=>{const i=e.length;for(let a=0;a<i;a++){const l=e[a];Hq(l,t,n,s)}},Hq=(e,t,n,s)=>{if(typeof e=="string"){qq(e,t,n);return}if(typeof e=="function"){Vq(e,t,n,s);return}Kq(e,t,n,s)},qq=(e,t,n)=>{const s=e===""?t:cj(t,e);s.classGroupId=n},Vq=(e,t,n,s)=>{if(Gq(e)){qb(e(s),t,n,s);return}t.validators===null&&(t.validators=[]),t.validators.push(zq(n,e))},Kq=(e,t,n,s)=>{const i=Object.entries(e),a=i.length;for(let l=0;l<a;l++){const[f,d]=i[l];qb(d,cj(t,f),n,s)}},cj=(e,t)=>{let n=e;const s=t.split($h),i=s.length;for(let a=0;a<i;a++){const l=s[a];let f=n.nextPart.get(l);f||(f=ij(),n.nextPart.set(l,f)),n=f}return n},Gq=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Zq=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),s=Object.create(null);const i=(a,l)=>{n[a]=l,t++,t>e&&(t=0,s=n,n=Object.create(null))};return{get(a){let l=n[a];if(l!==void 0)return l;if((l=s[a])!==void 0)return i(a,l),l},set(a,l){a in n?n[a]=l:i(a,l)}}},Tv="!",VT=":",Yq=[],KT=(e,t,n,s,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:s,isExternal:i}),Xq=e=>{const{prefix:t,experimentalParseClassName:n}=e;let s=i=>{const a=[];let l=0,f=0,d=0,p;const g=i.length;for(let w=0;w<g;w++){const T=i[w];if(l===0&&f===0){if(T===VT){a.push(i.slice(d,w)),d=w+1;continue}if(T==="/"){p=w;continue}}T==="["?l++:T==="]"?l--:T==="("?f++:T===")"&&f--}const y=a.length===0?i:i.slice(d);let b=y,x=!1;y.endsWith(Tv)?(b=y.slice(0,-1),x=!0):y.startsWith(Tv)&&(b=y.slice(1),x=!0);const S=p&&p>d?p-d:void 0;return KT(a,x,b,S)};if(t){const i=t+VT,a=s;s=l=>l.startsWith(i)?a(l.slice(i.length)):KT(Yq,!1,l,void 0,!0)}if(n){const i=s;s=a=>n({className:a,parseClassName:i})}return s},Qq=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,s)=>{t.set(n,1e6+s)}),n=>{const s=[];let i=[];for(let a=0;a<n.length;a++){const l=n[a],f=l[0]==="[",d=t.has(l);f||d?(i.length>0&&(i.sort(),s.push(...i),i=[]),s.push(l)):i.push(l)}return i.length>0&&(i.sort(),s.push(...i)),s}},Wq=e=>({cache:Zq(e.cacheSize),parseClassName:Xq(e),sortModifiers:Qq(e),...Uq(e)}),Jq=/\s+/,e9=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:i,sortModifiers:a}=t,l=[],f=e.trim().split(Jq);let d="";for(let p=f.length-1;p>=0;p-=1){const g=f[p],{isExternal:y,modifiers:b,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:w}=n(g);if(y){d=g+(d.length>0?" "+d:d);continue}let T=!!w,C=s(T?S.substring(0,w):S);if(!C){if(!T){d=g+(d.length>0?" "+d:d);continue}if(C=s(S),!C){d=g+(d.length>0?" "+d:d);continue}T=!1}const O=b.length===0?"":b.length===1?b[0]:a(b).join(":"),N=x?O+Tv:O,R=N+C;if(l.indexOf(R)>-1)continue;l.push(R);const M=i(C,T);for(let z=0;z<M.length;++z){const j=M[z];l.push(N+j)}d=g+(d.length>0?" "+d:d)}return d},t9=(...e)=>{let t=0,n,s,i="";for(;t<e.length;)(n=e[t++])&&(s=lj(n))&&(i&&(i+=" "),i+=s);return i},lj=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=lj(e[s]))&&(n&&(n+=" "),n+=t);return n},n9=(e,...t)=>{let n,s,i,a;const l=d=>{const p=t.reduce((g,y)=>y(g),e());return n=Wq(p),s=n.cache.get,i=n.cache.set,a=f,f(d)},f=d=>{const p=s(d);if(p)return p;const g=e9(d,n);return i(d,g),g};return a=l,(...d)=>a(t9(...d))},r9=[],dn=e=>{const t=n=>n[e]||r9;return t.isThemeGetter=!0,t},uj=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fj=/^\((?:(\w[\w-]*):)?(.+)\)$/i,s9=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,o9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,i9=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,a9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,c9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,l9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Uo=e=>s9.test(e),Xe=e=>!!e&&!Number.isNaN(Number(e)),$o=e=>!!e&&Number.isInteger(Number(e)),Ey=e=>e.endsWith("%")&&Xe(e.slice(0,-1)),Hs=e=>o9.test(e),dj=()=>!0,u9=e=>i9.test(e)&&!a9.test(e),Vb=()=>!1,f9=e=>c9.test(e),d9=e=>l9.test(e),h9=e=>!Ne(e)&&!je(e),p9=e=>mi(e,mj,Vb),Ne=e=>uj.test(e),qi=e=>mi(e,gj,u9),GT=e=>mi(e,_9,Xe),m9=e=>mi(e,vj,dj),g9=e=>mi(e,yj,Vb),ZT=e=>mi(e,hj,Vb),y9=e=>mi(e,pj,d9),Pd=e=>mi(e,bj,f9),je=e=>fj.test(e),ou=e=>va(e,gj),v9=e=>va(e,yj),YT=e=>va(e,hj),b9=e=>va(e,mj),x9=e=>va(e,pj),Dd=e=>va(e,bj,!0),S9=e=>va(e,vj,!0),mi=(e,t,n)=>{const s=uj.exec(e);return s?s[1]?t(s[1]):n(s[2]):!1},va=(e,t,n=!1)=>{const s=fj.exec(e);return s?s[1]?t(s[1]):n:!1},hj=e=>e==="position"||e==="percentage",pj=e=>e==="image"||e==="url",mj=e=>e==="length"||e==="size"||e==="bg-size",gj=e=>e==="length",_9=e=>e==="number",yj=e=>e==="family-name",vj=e=>e==="number"||e==="weight",bj=e=>e==="shadow",w9=()=>{const e=dn("color"),t=dn("font"),n=dn("text"),s=dn("font-weight"),i=dn("tracking"),a=dn("leading"),l=dn("breakpoint"),f=dn("container"),d=dn("spacing"),p=dn("radius"),g=dn("shadow"),y=dn("inset-shadow"),b=dn("text-shadow"),x=dn("drop-shadow"),S=dn("blur"),w=dn("perspective"),T=dn("aspect"),C=dn("ease"),O=dn("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...R(),je,Ne],z=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],A=()=>[je,Ne,d],P=()=>[Uo,"full","auto",...A()],Q=()=>[$o,"none","subgrid",je,Ne],B=()=>["auto",{span:["full",$o,je,Ne]},$o,je,Ne],U=()=>[$o,"auto",je,Ne],Z=()=>["auto","min","max","fr",je,Ne],K=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ee=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...A()],G=()=>[Uo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],q=()=>[Uo,"screen","full","dvw","lvw","svw","min","max","fit",...A()],V=()=>[Uo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],L=()=>[e,je,Ne],I=()=>[...R(),YT,ZT,{position:[je,Ne]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],W=()=>["auto","cover","contain",b9,p9,{size:[je,Ne]}],Y=()=>[Ey,ou,qi],ae=()=>["","none","full",p,je,Ne],se=()=>["",Xe,ou,qi],fe=()=>["solid","dashed","dotted","double"],Se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>[Xe,Ey,YT,ZT],Oe=()=>["","none",S,je,Ne],_e=()=>["none",Xe,je,Ne],re=()=>["none",Xe,je,Ne],he=()=>[Xe,je,Ne],ie=()=>[Uo,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Hs],breakpoint:[Hs],color:[dj],container:[Hs],"drop-shadow":[Hs],ease:["in","out","in-out"],font:[h9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Hs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Hs],shadow:[Hs],spacing:["px",Xe],text:[Hs],"text-shadow":[Hs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Uo,Ne,je,T]}],container:["container"],columns:[{columns:[Xe,Ne,je,f]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:M()}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{"inset-s":P(),start:P()}],end:[{"inset-e":P(),end:P()}],"inset-bs":[{"inset-bs":P()}],"inset-be":[{"inset-be":P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[$o,"auto",je,Ne]}],basis:[{basis:[Uo,"full","auto",f,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Xe,Uo,"auto","initial","none",Ne]}],grow:[{grow:["",Xe,je,Ne]}],shrink:[{shrink:["",Xe,je,Ne]}],order:[{order:[$o,"first","last","none",je,Ne]}],"grid-cols":[{"grid-cols":Q()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":Q()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Z()}],"auto-rows":[{"auto-rows":Z()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...K(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...K()]}],"align-items":[{items:[...ee(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ee(),{baseline:["","last"]}]}],"place-content":[{"place-content":K()}],"place-items":[{"place-items":[...ee(),"baseline"]}],"place-self":[{"place-self":["auto",...ee()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mbs:[{mbs:D()}],mbe:[{mbe:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],"inline-size":[{inline:["auto",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...V()]}],"min-block-size":[{"min-block":["auto",...V()]}],"max-block-size":[{"max-block":["none",...V()]}],w:[{w:[f,"screen",...G()]}],"min-w":[{"min-w":[f,"screen","none",...G()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[l]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",n,ou,qi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,S9,m9]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ey,Ne]}],"font-family":[{font:[v9,g9,t]}],"font-features":[{"font-features":[Ne]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,je,Ne]}],"line-clamp":[{"line-clamp":[Xe,"none",je,GT]}],leading:[{leading:[a,...A()]}],"list-image":[{"list-image":["none",je,Ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",je,Ne]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Xe,"from-font","auto",je,qi]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[Xe,"auto",je,Ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",je,Ne]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",je,Ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:W()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},$o,je,Ne],radial:["",je,Ne],conic:[$o,je,Ne]},x9,y9]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:ae()}],"rounded-s":[{"rounded-s":ae()}],"rounded-e":[{"rounded-e":ae()}],"rounded-t":[{"rounded-t":ae()}],"rounded-r":[{"rounded-r":ae()}],"rounded-b":[{"rounded-b":ae()}],"rounded-l":[{"rounded-l":ae()}],"rounded-ss":[{"rounded-ss":ae()}],"rounded-se":[{"rounded-se":ae()}],"rounded-ee":[{"rounded-ee":ae()}],"rounded-es":[{"rounded-es":ae()}],"rounded-tl":[{"rounded-tl":ae()}],"rounded-tr":[{"rounded-tr":ae()}],"rounded-br":[{"rounded-br":ae()}],"rounded-bl":[{"rounded-bl":ae()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-bs":[{"border-bs":se()}],"border-w-be":[{"border-be":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":se()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Xe,je,Ne]}],"outline-w":[{outline:["",Xe,ou,qi]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",g,Dd,Pd]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",y,Dd,Pd]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[Xe,qi]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",b,Dd,Pd]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[Xe,je,Ne]}],"mix-blend":[{"mix-blend":[...Se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Se()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Xe]}],"mask-image-linear-from-pos":[{"mask-linear-from":pe()}],"mask-image-linear-to-pos":[{"mask-linear-to":pe()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":pe()}],"mask-image-t-to-pos":[{"mask-t-to":pe()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":pe()}],"mask-image-r-to-pos":[{"mask-r-to":pe()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":pe()}],"mask-image-b-to-pos":[{"mask-b-to":pe()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":pe()}],"mask-image-l-to-pos":[{"mask-l-to":pe()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":pe()}],"mask-image-x-to-pos":[{"mask-x-to":pe()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":pe()}],"mask-image-y-to-pos":[{"mask-y-to":pe()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[je,Ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":pe()}],"mask-image-radial-to-pos":[{"mask-radial-to":pe()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[Xe]}],"mask-image-conic-from-pos":[{"mask-conic-from":pe()}],"mask-image-conic-to-pos":[{"mask-conic-to":pe()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:W()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",je,Ne]}],filter:[{filter:["","none",je,Ne]}],blur:[{blur:Oe()}],brightness:[{brightness:[Xe,je,Ne]}],contrast:[{contrast:[Xe,je,Ne]}],"drop-shadow":[{"drop-shadow":["","none",x,Dd,Pd]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",Xe,je,Ne]}],"hue-rotate":[{"hue-rotate":[Xe,je,Ne]}],invert:[{invert:["",Xe,je,Ne]}],saturate:[{saturate:[Xe,je,Ne]}],sepia:[{sepia:["",Xe,je,Ne]}],"backdrop-filter":[{"backdrop-filter":["","none",je,Ne]}],"backdrop-blur":[{"backdrop-blur":Oe()}],"backdrop-brightness":[{"backdrop-brightness":[Xe,je,Ne]}],"backdrop-contrast":[{"backdrop-contrast":[Xe,je,Ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Xe,je,Ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Xe,je,Ne]}],"backdrop-invert":[{"backdrop-invert":["",Xe,je,Ne]}],"backdrop-opacity":[{"backdrop-opacity":[Xe,je,Ne]}],"backdrop-saturate":[{"backdrop-saturate":[Xe,je,Ne]}],"backdrop-sepia":[{"backdrop-sepia":["",Xe,je,Ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",je,Ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Xe,"initial",je,Ne]}],ease:[{ease:["linear","initial",C,je,Ne]}],delay:[{delay:[Xe,je,Ne]}],animate:[{animate:["none",O,je,Ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,je,Ne]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:_e()}],"rotate-x":[{"rotate-x":_e()}],"rotate-y":[{"rotate-y":_e()}],"rotate-z":[{"rotate-z":_e()}],scale:[{scale:re()}],"scale-x":[{"scale-x":re()}],"scale-y":[{"scale-y":re()}],"scale-z":[{"scale-z":re()}],"scale-3d":["scale-3d"],skew:[{skew:he()}],"skew-x":[{"skew-x":he()}],"skew-y":[{"skew-y":he()}],transform:[{transform:[je,Ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ie()}],"translate-x":[{"translate-x":ie()}],"translate-y":[{"translate-y":ie()}],"translate-z":[{"translate-z":ie()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",je,Ne]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",je,Ne]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[Xe,ou,qi,GT]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},E9=n9(w9);function ge(...e){return E9(Hb(e))}const T9={light:"",dark:".dark"},xj=_.createContext(null);function C9(){const e=_.useContext(xj);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}const R9=_.forwardRef(({id:e,className:t,children:n,config:s,...i},a)=>{const l=_.useId(),f=`chart-${e||l.replace(/:/g,"")}`;return h.jsx(xj.Provider,{value:{config:s},children:h.jsxs("div",{className:ge("flex justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-neutral-500 [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-panel [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-panel [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",t),"data-chart":f,ref:a,...i,children:[h.jsx(N9,{config:s,id:f}),h.jsx(Pq,{initialDimension:{width:1,height:1},children:n})]})})});R9.displayName="ChartContainer";function N9({config:e,id:t}){const n=Object.entries(e).filter(([,s])=>s.theme||s.color);return n.length<1?null:h.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(T9).map(([s,i])=>{const a=n.map(([l,f])=>{const d=f.theme?.[s]??f.color;return d?` --color-${l}: ${d};`:null}).filter(Boolean).join(`
|
|
71
|
-
`);return`${i} [data-chart='${t}'] {
|
|
72
|
-
${a}
|
|
73
|
-
}`}).join(`
|
|
74
|
-
`)}})}const j9=_.forwardRef(({active:e,className:t,color:n,formatter:s,hideIndicator:i=!1,hideLabel:a=!1,indicator:l="dot",label:f,labelClassName:d,labelFormatter:p,labelKey:g,nameKey:y,payload:b},x)=>{const{config:S}=C9(),w=_.useMemo(()=>{if(a||!b?.length)return null;const C=b[0];if(!C)return null;const O=`${g||C.dataKey||C.name||"value"}`,N=XT(S,C,O),R=!g&&typeof f=="string"?S[f]?.label??f:N?.label;return p?h.jsx("div",{className:ge("font-medium",d),children:p(R??"",b)}):R?h.jsx("div",{className:ge("font-medium",d),children:R}):null},[S,a,f,d,p,g,b]);if(!e||!b?.length)return null;const T=b.length===1&&l!=="dot";return h.jsxs("div",{className:ge("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-surface px-2.5 py-1.5 text-xs shadow-xl",t),ref:x,children:[T?null:w,h.jsx("div",{className:"grid gap-1.5",children:b.map((C,O)=>{const N=`${y||C.name||C.dataKey||"value"}`,R=XT(S,C,N),M=n||C.payload?.fill||C.color;return h.jsx("div",{className:ge("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-neutral-500",l==="dot"?"items-center":null),children:s&&C.value!==void 0&&C.name?s(C.value,C.name,C,O,C.payload??{}):h.jsxs(h.Fragment,{children:[R?.icon?h.jsx(R.icon,{}):i?null:h.jsx("div",{className:ge("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",l==="dot"?"h-2.5 w-2.5":null,l==="line"?"w-1":null,l==="dashed"?"w-0 border-[1.5px] border-dashed bg-transparent":null,T&&l==="dashed"?"my-0.5":null),style:{"--color-bg":M,"--color-border":M}}),h.jsxs("div",{className:ge("flex flex-1 justify-between leading-none",T?"items-end":"items-center"),children:[h.jsxs("div",{className:"grid gap-1.5",children:[T?w:null,h.jsx("span",{className:"text-neutral-500",children:R?.label||C.name})]}),C.value!==void 0?h.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:typeof C.value=="number"?C.value.toLocaleString():C.value}):null]})]})},N)})})]})});j9.displayName="ChartTooltipContent";function XT(e,t,n){const s=t.payload?.[n],i=typeof s=="string"?s:null,a=typeof t.dataKey=="string"?t.dataKey:null,l=typeof t.name=="string"?t.name:null;return e[i??a??l??n]}const A9=["1h","6h","24h","7d"],Sj=_.forwardRef(({className:e,bars:t,activeRange:n="1h",onRangeChange:s,startLabel:i="-1h",midLabel:a="-30m",endLabel:l="now",...f},d)=>h.jsxs("div",{ref:d,className:ge("px-5 pt-4 pb-3 border-b border-border",e),...f,children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Activity"}),h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"w-2 h-2 rounded-sm bg-healthy/70"}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Push"})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"w-2 h-2 rounded-sm bg-flow/70"}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Pull"})]}),h.jsx("div",{className:"flex gap-0.5 ml-2",children:A9.map(p=>h.jsx("button",{type:"button",onClick:()=>s?.(p),className:ge("font-mono text-[9px] border rounded-sm px-1.5 py-0.5 cursor-pointer transition-all",p===n?"text-white border-border-bright bg-white/[0.03]":"text-neutral-500 border-transparent hover:text-neutral-300"),children:p},p))})]})]}),h.jsx("div",{className:"flex items-end gap-[2px] h-16",children:t.map((p,g)=>h.jsxs("div",{className:"flex-1 flex flex-col gap-[1px] h-16 justify-end",children:[h.jsx("div",{className:"bg-flow/60 rounded-t-sm min-h-[2px]",style:{height:`${p.pullPercent}%`}}),h.jsx("div",{className:"bg-healthy/60 rounded-t-sm min-h-[2px]",style:{height:`${p.pushPercent}%`}})]},g))}),h.jsxs("div",{className:"flex justify-between mt-1.5",children:[h.jsx("span",{className:"font-mono text-[8px] text-neutral-600",children:i}),h.jsx("span",{className:"font-mono text-[8px] text-neutral-600",children:a}),h.jsx("span",{className:"font-mono text-[8px] text-neutral-600",children:l})]})]}));Sj.displayName="ActivityBars";const QT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,WT=Hb,gi=(e,t)=>n=>{var s;if(t?.variants==null)return WT(e,n?.class,n?.className);const{variants:i,defaultVariants:a}=t,l=Object.keys(i).map(p=>{const g=n?.[p],y=a?.[p];if(g===null)return null;const b=QT(g)||QT(y);return i[p][b]}),f=n&&Object.entries(n).reduce((p,g)=>{let[y,b]=g;return b===void 0||(p[y]=b),p},{}),d=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((p,g)=>{let{class:y,className:b,...x}=g;return Object.entries(x).every(S=>{let[w,T]=S;return Array.isArray(T)?T.includes({...a,...f}[w]):{...a,...f}[w]===T})?[...p,y,b]:p},[]);return WT(e,l,d,n?.class,n?.className)},k9=gi("bg-surface border border-border rounded-md px-3 py-1.5 text-foreground outline-none w-full transition focus:border-flow placeholder:text-neutral-600",{variants:{variant:{default:"font-sans text-[13px]",mono:"font-mono text-[12px]"}},defaultVariants:{variant:"default"}}),Gn=_.forwardRef(({className:e,variant:t,...n},s)=>h.jsx("input",{ref:s,className:ge(k9({variant:t,className:e})),...n}));Gn.displayName="Input";function pp({controlled:e,default:t,name:n,state:s="value"}){const{current:i}=_.useRef(e!==void 0),[a,l]=_.useState(t),f=i?e:a,d=_.useCallback(p=>{i||l(p)},[]);return[f,d]}const JT={};function zn(e,t){const n=_.useRef(JT);return n.current===JT&&(n.current=e(t)),n}const Ty=P1[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],O9=Ty&&Ty!==_.useLayoutEffect?Ty:e=>e();function Ae(e){const t=zn(M9).current;return t.next=e,O9(t.effect),t.trampoline}function M9(){const e={next:void 0,callback:I9,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function I9(){}function oo(e,t,n,s){const i=zn(_j).current;return D9(i,e,t,n,s)&&wj(i,[e,t,n,s]),i.callback}function P9(e){const t=zn(_j).current;return z9(t,e)&&wj(t,e),t.callback}function _j(){return{callback:null,cleanup:null,refs:[]}}function D9(e,t,n,s,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==s||e.refs[3]!==i}function z9(e,t){return e.refs.length!==t.length||e.refs.some((n,s)=>n!==t[s])}function wj(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const s=Array(t.length).fill(null);for(let i=0;i<t.length;i+=1){const a=t[i];if(a!=null)switch(typeof a){case"function":{const l=a(n);typeof l=="function"&&(s[i]=l);break}case"object":{a.current=n;break}}}e.cleanup=()=>{for(let i=0;i<t.length;i+=1){const a=t[i];if(a!=null)switch(typeof a){case"function":{const l=s[i];typeof l=="function"?l():a(null);break}case"object":{a.current=null;break}}}}}}}const L9=()=>{},Le=typeof document<"u"?_.useLayoutEffect:L9,Ej={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},mp={...Ej,position:"fixed",top:0,left:0},Tj={...Ej,position:"absolute"};function jn(){}const Ru=Object.freeze([]),an=Object.freeze({});function yn(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(s=>n.searchParams.append("args[]",s)),`Base UI error #${e}; visit ${n} for the full message.`}const U9=parseInt(_.version,10);function Kb(e){return U9>=e}function eC(e){if(!_.isValidElement(e))return null;const t=e,n=t.props;return(Kb(19)?n?.ref:t.ref)??null}function Cv(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function $9(e,t){const n={};for(const s in e){const i=e[s];if(t?.hasOwnProperty(s)){const a=t[s](i);a!=null&&Object.assign(n,a);continue}i===!0?n[`data-${s.toLowerCase()}`]="":i&&(n[`data-${s.toLowerCase()}`]=i.toString())}return n}function B9(e,t){return typeof e=="function"?e(t):e}function F9(e,t){return typeof e=="function"?e(t):e}const hu={};function oi(e,t,n,s,i){let a={...Rv(e,hu)};return t&&(a=lu(a,t)),n&&(a=lu(a,n)),s&&(a=lu(a,s)),i&&(a=lu(a,i)),a}function H9(e){if(e.length===0)return hu;if(e.length===1)return Rv(e[0],hu);let t={...Rv(e[0],hu)};for(let n=1;n<e.length;n+=1)t=lu(t,e[n]);return t}function lu(e,t){return Cj(t)?t(e):q9(e,t)}function q9(e,t){if(!t)return e;for(const n in t){const s=t[n];switch(n){case"style":{e[n]=Cv(e.style,s);break}case"className":{e[n]=Rj(e.className,s);break}default:V9(n,s)?e[n]=K9(e[n],s):e[n]=s}}return e}function V9(e,t){const n=e.charCodeAt(0),s=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&s===110&&i>=65&&i<=90&&(typeof t=="function"||typeof t>"u")}function Cj(e){return typeof e=="function"}function Rv(e,t){return Cj(e)?e(t):e??hu}function K9(e,t){return t?e?n=>{if(G9(n)){const i=n;Nv(i);const a=t(i);return i.baseUIHandlerPrevented||e?.(i),a}const s=t(n);return e?.(n),s}:t:e}function Nv(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Rj(e,t){return t?e?t+" "+e:t:e}function G9(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}const Z9={style:{transition:"none"}},Y9="data-base-ui-click-trigger",X9={fallbackAxisSide:"none"},Q9={fallbackAxisSide:"end"},W9={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function zt(e,t,n={}){const s=t.render,i=J9(t,n);if(n.enabled===!1)return null;const a=n.state??an;return t8(e,s,i,a)}function J9(e,t={}){const{className:n,style:s,render:i}=e,{state:a=an,ref:l,props:f,stateAttributesMapping:d,enabled:p=!0}=t,g=p?B9(n,a):void 0,y=p?F9(s,a):void 0,b=p?$9(a,d):an,x=p?Cv(b,Array.isArray(f)?H9(f):f)??an:an;return typeof document<"u"&&(p?Array.isArray(l)?x.ref=P9([x.ref,eC(i),...l]):x.ref=oo(x.ref,eC(i),l):oo(null,null)),p?(g!==void 0&&(x.className=Rj(x.className,g)),y!==void 0&&(x.style=Cv(x.style,y)),x):an}const e8=Symbol.for("react.lazy");function t8(e,t,n,s){if(t){if(typeof t=="function")return t(n,s);const i=oi(n,t.props);i.ref=n.ref;let a=t;return a?.$$typeof===e8&&(a=_.Children.toArray(t)[0]),_.cloneElement(a,i)}if(e&&typeof e=="string")return n8(e,n);throw new Error(yn(8))}function n8(e,t){return e==="button"?_.createElement("button",{type:"button",...t,key:t.key}):e==="img"?_.createElement("img",{alt:"",...t,key:t.key}):_.createElement(e,t)}const r8={...P1};let tC=0;function s8(e,t="mui"){const[n,s]=_.useState(e),i=e||n;return _.useEffect(()=>{n==null&&(tC+=1,s(`${t}-${tC}`))},[n,t]),i}const nC=r8.useId;function Xu(e,t){if(nC!==void 0){const n=nC();return e??(t?`${t}-${n}`:n)}return s8(e,t)}function br(e){return Xu(e,"base-ui")}function gp(){return typeof window<"u"}function yi(e){return Gb(e)?(e.nodeName||"").toLowerCase():"#document"}function un(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _s(e){var t;return(t=(Gb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Gb(e){return gp()?e instanceof Node||e instanceof un(e).Node:!1}function jt(e){return gp()?e instanceof Element||e instanceof un(e).Element:!1}function Zt(e){return gp()?e instanceof HTMLElement||e instanceof un(e).HTMLElement:!1}function jv(e){return!gp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof un(e).ShadowRoot}const o8=new Set(["inline","contents"]);function vi(e){const{overflow:t,overflowX:n,overflowY:s,display:i}=xr(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!o8.has(i)}const i8=new Set(["table","td","th"]);function a8(e){return i8.has(yi(e))}const c8=[":popover-open",":modal"];function yp(e){return c8.some(t=>{try{return e.matches(t)}catch{return!1}})}const l8=["transform","translate","scale","rotate","perspective"],u8=["transform","translate","scale","rotate","perspective","filter"],f8=["paint","layout","strict","content"];function Zb(e){const t=vp(),n=jt(e)?xr(e):e;return l8.some(s=>n[s]?n[s]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||u8.some(s=>(n.willChange||"").includes(s))||f8.some(s=>(n.contain||"").includes(s))}function d8(e){let t=io(e);for(;Zt(t)&&!Xs(t);){if(Zb(t))return t;if(yp(t))return null;t=io(t)}return null}function vp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const h8=new Set(["html","body","#document"]);function Xs(e){return h8.has(yi(e))}function xr(e){return un(e).getComputedStyle(e)}function bp(e){return jt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function io(e){if(yi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||jv(e)&&e.host||_s(e);return jv(t)?t.host:t}function Nj(e){const t=io(e);return Xs(t)?e.ownerDocument?e.ownerDocument.body:e.body:Zt(t)&&vi(t)?t:Nj(t)}function Wo(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Nj(e),a=i===((s=e.ownerDocument)==null?void 0:s.body),l=un(i);if(a){const f=Av(l);return t.concat(l,l.visualViewport||[],vi(i)?i:[],f&&n?Wo(f):[])}return t.concat(i,Wo(i,[],n))}function Av(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const jj=_.createContext(void 0);function Aj(e=!1){const t=_.useContext(jj);if(t===void 0&&!e)throw new Error(yn(16));return t}function p8(e){const{focusableWhenDisabled:t,disabled:n,composite:s=!1,tabIndex:i=0,isNativeButton:a}=e,l=s&&t!==!1,f=s&&t===!1;return{props:_.useMemo(()=>{const p={onKeyDown(g){n&&t&&g.key!=="Tab"&&g.preventDefault()}};return s||(p.tabIndex=i,!a&&n&&(p.tabIndex=t?i:-1)),(a&&(t||l)||!a&&n)&&(p["aria-disabled"]=n),a&&(!t||f)&&(p.disabled=n),p},[s,n,t,l,f,a,i])}}function Jc(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:s=0,native:i=!0}=e,a=_.useRef(null),l=Aj(!0)!==void 0,f=Ae(()=>{const b=a.current;return!!(b?.tagName==="A"&&b?.href)}),{props:d}=p8({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:s,isNativeButton:i}),p=_.useCallback(()=>{const b=a.current;m8(b)&&l&&t&&d.disabled===void 0&&b.disabled&&(b.disabled=!1)},[t,d.disabled,l]);Le(p,[p]);const g=_.useCallback((b={})=>{const{onClick:x,onMouseDown:S,onKeyUp:w,onKeyDown:T,onPointerDown:C,...O}=b;return oi({type:i?"button":void 0,onClick(R){if(t){R.preventDefault();return}x?.(R)},onMouseDown(R){t||S?.(R)},onKeyDown(R){if(t||(Nv(R),T?.(R)),R.baseUIHandlerPrevented)return;const M=R.target===R.currentTarget&&!i&&!f()&&!t,z=R.key==="Enter",j=R.key===" ";M&&((j||z)&&R.preventDefault(),z&&x?.(R))},onKeyUp(R){t||(Nv(R),w?.(R)),!R.baseUIHandlerPrevented&&R.target===R.currentTarget&&!i&&!t&&R.key===" "&&x?.(R)},onPointerDown(R){if(t){R.preventDefault();return}C?.(R)}},i?void 0:{role:"button"},d,O)},[t,d,i,f]),y=Ae(b=>{a.current=b,p()});return{getButtonProps:g,buttonRef:y}}function m8(e){return Zt(e)&&e.tagName==="BUTTON"}const kj=_.createContext(void 0);function g8(){const e=_.useContext(kj);if(e===void 0)throw new Error(yn(63));return e}let rC=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const xp={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},bi={valid(e){return e===null?null:e?{[rC.valid]:""}:{[rC.invalid]:""}}};let sC=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const Oj={...bi,checked(e){return e?{[sC.checked]:""}:{[sC.unchecked]:""}}};function kv(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const y8=_.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:jn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function el(){return _.useContext(y8)}const Mj=_.createContext({invalid:void 0,name:void 0,validityData:{state:xp,errors:[],error:"",value:"",initialValue:null},setValidityData:jn,disabled:void 0,touched:!1,setTouched:jn,dirty:!1,setDirty:jn,filled:!1,setFilled:jn,focused:!1,setFocused:jn,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=an)=>e,getInputValidationProps:(e=an)=>e,inputRef:{current:null},commit:async()=>{}}});function xi(e=!0){const t=_.useContext(Mj);if(t.setValidityData===jn&&!e)throw new Error(yn(28));return t}function Ij(e){const{enabled:t=!0,value:n,id:s,name:i,controlRef:a,commit:l}=e,{formRef:f}=el(),{invalid:d,markedDirtyRef:p,validityData:g,setValidityData:y}=xi(),b=Ae(e.getValue);Le(()=>{if(!t)return;let x=n;x===void 0&&(x=b()),g.initialValue===null&&x!==null&&y(S=>({...S,initialValue:x}))},[t,y,n,g.initialValue,b]),Le(()=>{!t||!s||f.current.fields.set(s,{getValue:b,name:i,controlRef:a,validityData:kv(g,d),validate(x=!0){let S=n;S===void 0&&(S=b()),p.current=!0,x?hi.flushSync(()=>l(S)):l(S)}})},[l,a,t,f,b,s,d,p,i,g,n]),Le(()=>{const x=f.current.fields;return()=>{s&&x.delete(s)}},[f,s])}const Pj=_.createContext({controlId:void 0,registerControlId:jn,labelId:void 0,setLabelId:jn,messageIds:[],setMessageIds:jn,getDescriptionProps:e=>e});function lo(){return _.useContext(Pj)}function Dj(e={}){const{id:t,implicit:n=!1,controlRef:s}=e,{controlId:i,registerControlId:a}=lo(),l=br(t),f=n?i:void 0,d=zn(()=>Symbol("labelable-control")),p=_.useRef(!1),g=_.useRef(t!=null),y=Ae(()=>{!p.current||a===jn||(p.current=!1,a(d.current,void 0))});return Le(()=>{if(a===jn)return;let b;if(n){const x=s?.current;jt(x)&&x.closest("label")!=null?b=t??null:b=f??l}else if(t!=null)g.current=!0,b=t;else if(g.current)b=l;else{y();return}if(b===void 0){y();return}p.current=!0,a(d.current,b)},[t,s,f,a,n,l,d,y]),_.useEffect(()=>y,[y]),i??l}const ii="none",oC="trigger-press",Ov="trigger-hover",zj="outside-press",Cy="item-press",Lj="focus-out",v8="escape-key",b8="cancel-open",x8="imperative-action",S8="window-resize";function Yt(e,t,n,s){let i=!1,a=!1;const l=s??an;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...l}}function Uj(e,t){const n=_.useRef(e),s=Ae(t);Le(()=>{n.current!==e&&s(n.current)},[e,s]),Le(()=>{n.current=e},[e])}const _8=_.forwardRef(function(t,n){const{checked:s,className:i,defaultChecked:a,id:l,inputRef:f,name:d,nativeButton:p=!1,onCheckedChange:g,readOnly:y=!1,required:b=!1,disabled:x=!1,render:S,uncheckedValue:w,value:T,...C}=t,{clearErrors:O}=el(),{state:N,setTouched:R,setDirty:M,validityData:z,setFilled:j,setFocused:A,shouldValidateOnChange:P,validationMode:Q,disabled:B,name:U,validation:Z}=xi(),{labelId:K}=lo(),ee=B||x,D=U??d,G=Ae(g),q=_.useRef(null),V=oo(q,f,Z.inputRef),L=_.useRef(null),I=br(),H=Dj({id:l,implicit:!1,controlRef:L}),W=p?void 0:H,[Y,ae]=pp({controlled:s,default:!!a,name:"Switch",state:"checked"});Ij({id:I,commit:Z.commit,value:Y,controlRef:L,name:D,getValue:()=>Y}),Le(()=>{q.current&&j(q.current.checked)},[q,j]),Uj(Y,()=>{O(D),M(Y!==z.initialValue),j(Y),P()?Z.commit(Y):Z.commit(Y,!0)});const{getButtonProps:se,buttonRef:fe}=Jc({disabled:ee,native:p}),Se={id:p?H:I,role:"switch","aria-checked":Y,"aria-readonly":y||void 0,"aria-required":b||void 0,"aria-labelledby":K,onFocus(){ee||A(!0)},onBlur(){const re=q.current;!re||ee||(R(!0),A(!1),Q==="onBlur"&&Z.commit(re.checked))},onClick(re){y||ee||(re.preventDefault(),q.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:re.shiftKey,ctrlKey:re.ctrlKey,altKey:re.altKey,metaKey:re.metaKey})))}},pe=_.useMemo(()=>oi({checked:Y,disabled:ee,id:W,name:D,required:b,style:D?Tj:mp,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:V,onChange(re){if(re.nativeEvent.defaultPrevented)return;const he=re.target.checked,ie=Yt(ii,re.nativeEvent);G?.(he,ie),!ie.isCanceled&&ae(he)},onFocus(){L.current?.focus()}},Z.getInputValidationProps,T!==void 0?{value:T}:an),[Y,ee,V,W,D,G,b,ae,Z,T]),Oe=_.useMemo(()=>({...N,checked:Y,disabled:ee,readOnly:y,required:b}),[N,Y,ee,y,b]),_e=zt("span",t,{state:Oe,ref:[n,L,fe],props:[Se,Z.getValidationProps,C,se],stateAttributesMapping:Oj});return h.jsxs(kj.Provider,{value:Oe,children:[_e,!Y&&D&&w!==void 0&&h.jsx("input",{type:"hidden",name:D,value:w}),h.jsx("input",{...pe})]})}),w8=_.forwardRef(function(t,n){const{render:s,className:i,...a}=t,{state:l}=xi(),f=g8(),d={...l,...f};return zt("span",t,{state:d,ref:n,stateAttributesMapping:Oj,props:a})}),Sp=_.forwardRef(({className:e,...t},n)=>h.jsx(_8,{ref:n,className:ge("relative w-[34px] h-[18px] bg-border-bright rounded-full cursor-pointer transition data-[checked]:bg-healthy",e),...t,children:h.jsx(w8,{className:"block w-[14px] h-[14px] bg-white rounded-full transition-transform data-[checked]:translate-x-4 absolute top-0.5 left-0.5"})}));Sp.displayName="Switch";const $j=_.forwardRef(({className:e,enabled:t=!0,onEnabledChange:n,thresholds:s,onThresholdsChange:i,...a},l)=>{function f(d,p){const g=Number(p);Number.isFinite(g)&&i?.({...s,[d]:g})}return h.jsxs("div",{ref:l,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...a,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-offline"}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Alerts"})]}),h.jsx(Sp,{checked:t,onCheckedChange:d=>n?.(d)})]}),h.jsxs("div",{className:"p-4 space-y-3",children:[h.jsx(Ry,{label:"P90 latency threshold",value:s.p90Latency,onChange:d=>f("p90Latency",d)}),h.jsx(Ry,{label:"Error rate threshold",value:s.errorRate,onChange:d=>f("errorRate",d)}),h.jsx(Ry,{label:"Client lag threshold",value:s.clientLag,onChange:d=>f("clientLag",d)})]})]})});$j.displayName="AlertsConfig";function Ry({label:e,value:t,onChange:n}){return h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500",children:e}),h.jsx(Gn,{variant:"mono",type:"number",value:t,onChange:s=>n(s.target.value),className:"w-[100px] text-[11px] px-2 py-1 text-right"})]})}const E8=gi("inline-flex items-center gap-1 px-2 py-0.5 rounded-sm font-mono text-[9px] leading-normal uppercase tracking-wider",{variants:{variant:{default:"bg-white/[0.05] text-neutral-300 border border-border-bright",destructive:"bg-offline/10 text-offline border border-offline/20",ghost:"bg-transparent text-neutral-500 border border-border-bright",outline:"bg-transparent text-neutral-400 border border-border-bright",secondary:"bg-panel text-neutral-400 border border-border",healthy:"bg-healthy/10 text-healthy border border-healthy/20",syncing:"bg-syncing/10 text-syncing border border-syncing/20",offline:"bg-offline/10 text-offline border border-offline/20",flow:"bg-flow/10 text-flow border border-flow/20",relay:"bg-relay/10 text-relay border border-relay/20"}},defaultVariants:{variant:"default"}}),mn=_.forwardRef(({className:e,variant:t,style:n,...s},i)=>h.jsx("span",{ref:i,className:ge(E8({variant:t,className:e})),style:{lineHeight:1,...n},...s}));mn.displayName="Badge";const tl=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"table",className:ge("w-full",e),...t}));tl.displayName="Table";const nl=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"rowgroup",className:ge(e),...t}));nl.displayName="TableHeader";const rl=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"rowgroup",className:ge(e),...t}));rl.displayName="TableBody";const ss=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"row",className:ge("font-mono text-[11px] leading-6 px-4 flex items-center gap-4 border-b border-[#141414] hover:bg-white/[0.015] transition-colors cursor-default",e),...t}));ss.displayName="TableRow";const ht=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"columnheader",className:ge("min-w-0 font-mono text-[9px] text-neutral-600 uppercase tracking-wider leading-6 bg-white/[0.01] text-left truncate",e),...t}));ht.displayName="TableHead";const pt=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"cell",className:ge("min-w-0 whitespace-nowrap overflow-hidden text-ellipsis",e),...t}));pt.displayName="TableCell";const T8={relay:"relay",admin:"flow",proxy:"ghost"},C8=_.forwardRef(({className:e,keys:t,onCreateKey:n,onRotateKey:s,onRevokeKey:i,...a},l)=>h.jsx("div",{ref:l,className:ge("w-full",e),...a,children:h.jsxs(tl,{children:[h.jsx(nl,{children:h.jsxs(ss,{children:[h.jsx(ht,{children:"Name"}),h.jsx(ht,{children:"Type"}),h.jsx(ht,{children:"Prefix"}),h.jsx(ht,{children:"Created"})]})}),h.jsx(rl,{children:t.map((f,d)=>h.jsxs(ss,{className:"group relative",children:[h.jsx(pt,{children:h.jsx("span",{className:"text-white truncate",children:f.name})}),h.jsx(pt,{children:h.jsx(mn,{variant:T8[f.type]??"ghost",children:f.type})}),h.jsx(pt,{children:h.jsx("span",{className:"text-neutral-500 truncate",children:f.prefix})}),h.jsx(pt,{children:h.jsx("span",{className:"text-neutral-600 truncate",children:f.created})}),(s||i)&&h.jsxs("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[s&&h.jsx("button",{type:"button",onClick:()=>s(f.name),className:"flex items-center gap-1 px-1.5 py-0.5 rounded text-[9px] text-neutral-600 hover:text-white hover:bg-white/[0.05] cursor-pointer transition-colors",children:"rotate"}),i&&h.jsx("button",{type:"button",onClick:()=>i(f.name),className:"flex items-center gap-1 px-1.5 py-0.5 rounded text-[9px] text-neutral-600 hover:text-offline hover:bg-offline/10 cursor-pointer transition-colors",children:"revoke"})]})]},`${f.name}:${f.prefix}:${d}`))})]})}));C8.displayName="ApiKeysTable";const Bj=_.forwardRef(({className:e,metrics:t=[],uptime:n,isLive:s=!0,...i},a)=>h.jsxs("div",{ref:a,className:ge("fixed bottom-0 left-0 right-0 z-100 h-8 border-t border-border bg-surface/92 backdrop-blur-lg flex items-center justify-between px-5",e),...i,children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"flex items-center gap-[2px]",children:[0,.1,.2,.3,.4].map(l=>h.jsx("div",{className:"w-0.5 h-1.5 bg-healthy rounded-sm animate-[heartbeat_1.2s_ease-in-out_infinite]",style:{animationDelay:`${l}s`}},l))}),s&&h.jsx("span",{className:"font-mono text-[9px] text-healthy uppercase tracking-widest",children:"Live"})]}),h.jsx("div",{className:"flex items-center gap-6",children:t.map(l=>h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:l.label}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-300",children:l.value})]},l.label))}),n!=null&&h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:"UPTIME"}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:n})]})]}));Bj.displayName="BottomBar";const Fj=_.forwardRef(({className:e,commits:t,onViewAll:n,...s},i)=>h.jsxs("div",{ref:i,className:ge("px-5 pt-3 pb-2",e),...s,children:[h.jsxs("div",{className:"flex items-center justify-between mb-2",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Recent Commits"}),n&&h.jsx("button",{type:"button",onClick:n,className:"inline-flex items-center gap-1.5 rounded-md font-mono text-[9px] px-2 py-0.5 border border-border-bright bg-transparent text-neutral-400 hover:text-white hover:bg-white/[0.03] cursor-pointer transition-all",children:"View all →"})]}),h.jsxs("div",{className:"font-mono text-[9px] tracking-wider uppercase text-neutral-600 flex items-center gap-4 px-4 leading-[22px] border-b border-border",children:[h.jsx("span",{className:"w-[60px] truncate",children:"Seq"}),h.jsx("span",{className:"w-[100px] truncate",children:"Actor"}),h.jsx("span",{className:"w-[50px] truncate",children:"Chg"}),h.jsx("span",{className:"flex-1 truncate",children:"Tables"}),h.jsx("span",{className:"w-[70px] text-right truncate",children:"Time"})]}),t.map(a=>h.jsxs("div",{className:"font-mono text-[11px] leading-7 px-4 flex items-center gap-4 border-b border-[#141414] hover:bg-white/[0.015] transition-colors cursor-default",children:[h.jsxs("span",{className:"w-[60px] text-flow font-medium truncate",children:["#",a.seq]}),h.jsx("span",{className:"w-[100px] text-neutral-400 truncate",children:a.actor}),h.jsx("span",{className:"w-[50px] text-white truncate",children:a.changes}),h.jsx("span",{className:"flex-1 truncate",children:h.jsx("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-sm font-mono text-[9px] uppercase tracking-wider bg-transparent text-neutral-500 border border-border-bright",children:a.tables})}),h.jsx("span",{className:"w-[70px] text-right text-neutral-600 truncate",children:a.time})]},a.seq))]}));Fj.displayName="CommitTable";const Hj=gi("inline-flex items-center justify-center gap-1.5 rounded-md font-mono transition-all cursor-pointer disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"border border-border-bright bg-transparent text-neutral-400 hover:text-white hover:bg-white/[0.03]",primary:"border border-flow bg-flow/10 text-flow hover:bg-flow/20",destructive:"border border-offline bg-offline/10 text-offline hover:bg-offline/20",ghost:"border border-transparent bg-transparent text-neutral-400 hover:text-white hover:bg-white/[0.03]",link:"border border-transparent bg-transparent text-neutral-400 underline underline-offset-4 hover:text-white",secondary:"border border-border bg-panel text-neutral-400 hover:text-white hover:bg-white/[0.03]"},size:{sm:"text-[10px] px-2.5 py-1",md:"text-[11px] px-3.5 py-1.5",icon:"h-8 w-8"}},defaultVariants:{variant:"default",size:"md"}}),Me=_.forwardRef(({className:e,variant:t,size:n,...s},i)=>h.jsx("button",{ref:i,className:ge(Hj({variant:t,size:n,className:e})),...s}));Me.displayName="Button";const qj=_.forwardRef(({className:e,isConnected:t=!1,isConnecting:n=!1,isTestingConnection:s=!1,serverUrl:i,onServerUrlChange:a,consoleToken:l,onConsoleTokenChange:f,onSaveAndConnect:d,onDisconnect:p,onTestConnection:g,statusMessage:y,...b},x)=>h.jsxs("div",{ref:x,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...b,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:ge("w-1.5 h-1.5 rounded-full",t?"bg-healthy":"bg-offline"),style:t?{boxShadow:"0 0 4px #22c55e"}:void 0}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Connection"})]}),h.jsx(mn,{variant:t?"healthy":"offline",children:t?"Connected":"Disconnected"})]}),h.jsxs("div",{className:"p-5 space-y-4",children:[h.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:"Configure the server endpoint and authentication token."}),h.jsxs("div",{children:[h.jsx("label",{htmlFor:"console-server-url",className:"font-mono text-[9px] text-neutral-500 uppercase tracking-wider block mb-1.5",children:"Server URL"}),h.jsx(Gn,{id:"console-server-url",variant:"mono",value:i,onChange:S=>a?.(S.target.value)})]}),h.jsxs("div",{children:[h.jsx("label",{htmlFor:"console-token",className:"font-mono text-[9px] text-neutral-500 uppercase tracking-wider block mb-1.5",children:"Console Token"}),h.jsx(Gn,{id:"console-token",variant:"mono",type:"password",value:l,onChange:S=>f?.(S.target.value)})]}),h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx(Me,{variant:"primary",size:"md",onClick:d,disabled:n,children:n?"Connecting...":"Save + Connect"}),h.jsx(Me,{variant:"default",size:"md",onClick:g,disabled:n||s,children:s?"Testing...":"Test Connection"}),h.jsx(Me,{variant:"destructive",size:"md",onClick:p,disabled:!t,children:"Disconnect"})]}),y&&h.jsx("div",{className:ge("font-mono text-[10px]",t?"text-healthy":"text-offline"),children:y})]})]}));qj.displayName="ConnectionForm";const R8=gi("animate-spin text-neutral-500",{variants:{size:{sm:"h-3 w-3",md:"h-5 w-5",lg:"h-8 w-8"}},defaultVariants:{size:"md"}}),Pt=_.forwardRef(({className:e,size:t,...n},s)=>h.jsxs("svg",{ref:s,className:ge(R8({size:t,className:e})),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...n,children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),h.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}));Pt.displayName="Spinner";function N8({className:e,state:t}){switch(t){case"connected":return h.jsx(mn,{variant:"healthy",className:e,children:"Connected"});case"disconnected":return h.jsx(mn,{variant:"destructive",className:e,children:"Disconnected"});case"connecting":return h.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-neutral-400",children:[h.jsx(Pt,{size:"sm"}),"Connecting"]});case"not-configured":return h.jsx(mn,{variant:"ghost",className:e,children:"Not configured"})}}const Yb=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...t}));Yb.displayName="Card";const j8=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-4 py-2.5 border-b border-border flex items-center justify-between",e),...t}));j8.displayName="CardHeader";const A8=_.forwardRef(({className:e,...t},n)=>h.jsx("h3",{ref:n,className:ge("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));A8.displayName="CardTitle";const Xb=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("p-4",e),...t}));Xb.displayName="CardContent";const k8=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-4 py-2.5 border-t border-border",e),...t}));k8.displayName="CardFooter";function Qb({action:e,className:t,icon:n,message:s}){return h.jsxs("div",{className:ge("flex flex-col items-center justify-center gap-3 py-12",t),children:[n?h.jsx("div",{className:"text-neutral-500",children:n}):null,h.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:s}),e?h.jsx("div",{children:e}):null]})}const Vj=_.forwardRef(({className:e,groups:t,searchValue:n,searchPlaceholder:s="Filter by client or actor...",onSearchChange:i,actions:a,...l},f)=>h.jsxs("div",{ref:f,className:ge("px-5 py-3 border-b border-border flex items-center gap-4 flex-wrap",e),...l,children:[t.map((d,p)=>h.jsx(O8,{group:d,showDivider:p>0},p)),i!==void 0&&h.jsx("input",{className:"bg-surface border border-border rounded-md font-mono text-[10px] text-foreground outline-none transition focus:border-flow placeholder:text-neutral-600 max-w-[200px] px-2.5 py-1",placeholder:s,value:n,onChange:d=>i(d.target.value)}),a&&h.jsx("div",{className:"ml-auto flex items-center gap-2",children:a})]}));Vj.displayName="FilterBar";function O8({group:e,showDivider:t}){return h.jsxs(h.Fragment,{children:[t&&h.jsx("div",{className:"w-px h-4 bg-border"}),h.jsxs("div",{className:"flex items-center gap-1",children:[e.label&&h.jsx("span",{className:"font-mono text-[9px] text-neutral-500 mr-1",children:e.label}),e.options.map(n=>h.jsx("button",{type:"button",onClick:()=>e.onActiveChange(n.id),className:ge("font-mono text-[10px] border rounded-sm px-2.5 py-0.5 cursor-pointer transition-all",n.id===e.activeId?"text-white border-border-bright bg-white/[0.03]":"text-neutral-500 border-transparent hover:text-neutral-300"),children:n.label},n.id))]})]})}function M8(e){return e===0?"#22c55e":e<10?"#f59e0b":e<50?"#f97316":"#ef4444"}const I8={online:"healthy",syncing:"syncing",offline:"offline"},P8={realtime:"flow",polling:"ghost"},D8=_.forwardRef(({className:e,client:t,headSeq:n,onEvict:s,...i},a)=>{const l=Math.max(0,n-t.cursor),f=Math.min(100,t.cursor/n*100),d=M8(l);return h.jsxs("div",{ref:a,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),style:{borderLeft:`3px solid ${d}`},...i,children:[h.jsxs("div",{className:"px-3.5 py-2 border-b border-border flex items-center justify-between",children:[h.jsx("div",{className:"flex items-center gap-2 min-w-0",children:h.jsx("span",{className:"font-mono text-[11px] text-white truncate",title:t.id,children:t.id.length>14?`${t.id.substring(0,14)}…`:t.id})}),h.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[h.jsx(mn,{variant:I8[t.status],children:t.status}),h.jsx(mn,{variant:P8[t.mode],children:t.mode})]})]}),h.jsxs("div",{className:"p-3 space-y-3",children:[h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsxs("span",{className:"font-mono text-[9px] text-neutral-600",children:["#",t.cursor.toLocaleString()]}),h.jsxs("span",{className:"font-mono text-[9px] text-neutral-600",children:["#",n.toLocaleString()]})]}),h.jsx("div",{className:"h-1 rounded-full bg-surface",children:h.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${f}%`,background:d}})}),h.jsx("div",{className:"font-mono text-[9px] mt-1",style:{color:d},children:l===0?"Caught up":`${l} behind`})]}),h.jsxs("div",{className:"space-y-1",children:[h.jsx(Ny,{label:"Actor",value:t.actor}),h.jsx(Ny,{label:"Dialect",value:t.dialect}),h.jsx(Ny,{label:"Last seen",value:t.lastSeen}),h.jsxs("div",{className:"flex justify-between items-start",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:"Scopes"}),h.jsxs("div",{className:"flex gap-1 flex-wrap justify-end",children:[t.scopes.slice(0,2).map(p=>h.jsx(mn,{variant:"ghost",children:p},p)),t.scopes.length>2&&h.jsxs("span",{className:"font-mono text-[9px] text-neutral-600",children:["+",t.scopes.length-2]})]})]})]}),s&&h.jsxs("button",{type:"button",onClick:s,className:"w-full inline-flex items-center justify-center gap-1.5 rounded-md font-mono text-[9px] px-2 py-1 border border-offline/25 bg-offline/[0.04] text-offline hover:border-offline hover:bg-offline/[0.08] cursor-pointer transition-all",children:[h.jsxs("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:[h.jsx("path",{d:"M18.36 6.64a9 9 0 11-12.73 0"}),h.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"12"})]}),"Evict"]})]})]})});D8.displayName="FleetCard";function Ny({label:e,value:t}){return h.jsxs("div",{className:"flex justify-between",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:e}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:t})]})}const Kj=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();const z8=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const L8=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());const iC=e=>{const t=L8(e);return t.charAt(0).toUpperCase()+t.slice(1)};var U8={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 $8=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const B8=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:a,iconNode:l,...f},d)=>_.createElement("svg",{ref:d,...U8,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:Kj("lucide",i),...!a&&!$8(f)&&{"aria-hidden":"true"},...f},[...l.map(([p,g])=>_.createElement(p,g)),...Array.isArray(a)?a:[a]]));const Wb=(e,t)=>{const n=_.forwardRef(({className:s,...i},a)=>_.createElement(B8,{ref:a,iconNode:t,className:Kj(`lucide-${z8(iC(e))}`,`lucide-${e}`,s),...i}));return n.displayName=iC(e),n};const F8=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],H8=Wb("arrow-left",F8);const q8=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],V8=Wb("settings",q8);const K8=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]],G8=Wb("user-x",K8);function Z8(e){return e===0?"#22c55e":e<10?"#f59e0b":e<50?"#f97316":"#ef4444"}const Y8={online:"healthy",syncing:"syncing",offline:"offline"},Gj=_.forwardRef(({className:e,clients:t,headSeq:n,onEvict:s,...i},a)=>h.jsx("div",{ref:a,className:ge("w-full",e),...i,children:h.jsxs(tl,{children:[h.jsx(nl,{children:h.jsxs(ss,{children:[h.jsx(ht,{className:"w-[160px]",children:"Client"}),h.jsx(ht,{className:"w-[70px]",children:"Status"}),h.jsx(ht,{className:"w-[60px]",children:"Type"}),h.jsx(ht,{className:"w-[80px]",children:"Cursor"}),h.jsx(ht,{className:"w-[110px]",children:"Lag"}),h.jsx(ht,{className:"w-[60px]",children:"Dialect"}),h.jsx(ht,{className:"flex-1",children:"Mode"})]})}),h.jsx(rl,{children:t.map(l=>{const f=Math.max(0,n-l.cursor),d=n>0?Math.min(100,l.cursor/n*100):100,p=Z8(f);return h.jsxs(ss,{className:"group relative",children:[h.jsx(pt,{className:"w-[160px]",children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:p,boxShadow:`0 0 4px ${p}`}}),h.jsx("span",{className:"font-mono text-[11px] text-white truncate",title:l.id,children:l.id.length>18?`${l.id.substring(0,18)}…`:l.id})]})}),h.jsx(pt,{className:"w-[70px]",children:h.jsx(mn,{variant:Y8[l.status],children:l.status})}),h.jsx(pt,{className:"w-[60px]",children:h.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:l.type})}),h.jsx(pt,{className:"w-[80px]",children:h.jsxs("span",{className:"font-mono text-[11px] text-white font-medium",children:["#",l.cursor.toLocaleString()]})}),h.jsx(pt,{className:"w-[110px]",children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"w-[60px] h-[3px] rounded-full bg-surface overflow-hidden",children:h.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${d}%`,background:p}})}),h.jsx("span",{className:"font-mono text-[10px] font-medium",style:{color:p},children:f===0?"0":`${f}`})]})}),h.jsx(pt,{className:"w-[60px]",children:h.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:l.dialect})}),h.jsx(pt,{className:"flex-1",children:h.jsx(mn,{variant:l.mode==="realtime"?"flow":"ghost",children:l.mode})}),s&&h.jsxs("button",{type:"button",title:"Evict client",onClick:()=>s(l.id),className:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1 px-1.5 py-0.5 rounded text-[9px] text-neutral-600 hover:text-offline hover:bg-offline/10 cursor-pointer transition-colors opacity-0 group-hover:opacity-100",children:[h.jsx(G8,{size:10}),"evict"]})]},l.id)})})]})}));Gj.displayName="FleetTable";const Zj=_.forwardRef(({className:e,handlers:t,tableCount:n,...s},i)=>{const a=n??t.length;return h.jsxs("div",{ref:i,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...s,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-flow"}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Handlers"})]}),h.jsxs("span",{className:"font-mono text-[10px] text-neutral-600",children:[a," tables"]})]}),h.jsxs("div",{className:"font-mono text-[9px] tracking-wider uppercase text-neutral-600 flex items-center gap-4 px-4 leading-6 border-b border-border",children:[h.jsx("span",{className:"flex-1",children:"Table"}),h.jsx("span",{className:"w-[100px]",children:"Depends On"}),h.jsx("span",{className:"w-[70px] text-right",children:"Chunk TTL"})]}),t.map((l,f)=>h.jsxs("div",{className:ge("font-mono text-[11px] leading-7 px-4 flex items-center gap-4 hover:bg-white/[0.015] transition-colors cursor-default",f<t.length-1&&"border-b border-[#141414]"),children:[h.jsx("span",{className:"flex-1 text-white truncate",children:l.table}),h.jsx("span",{className:"w-[100px] truncate",children:l.dependsOn?h.jsx(mn,{variant:"ghost",children:l.dependsOn}):h.jsx("span",{className:"text-neutral-600",children:"—"})}),h.jsx("span",{className:"w-[70px] text-right text-neutral-500 truncate",children:l.chunkTtl})]},`${l.table}:${f}`))]})});Zj.displayName="HandlersTable";const X8={flow:"bg-flow",healthy:"bg-healthy",syncing:"bg-syncing",offline:"bg-offline",relay:"bg-relay",muted:"bg-neutral-500"},Yj=_.forwardRef(({className:e,items:t,...n},s)=>h.jsx("div",{ref:s,className:ge("border-b border-border px-6 py-3 flex items-center justify-between flex-wrap gap-4","bg-[linear-gradient(to_bottom,rgba(17,17,17,0.8),#0c0c0c)]",e),...n,children:t.map((i,a)=>h.jsx(Q8,{item:i,showDivider:a>0},i.label))}));Yj.displayName="KpiStrip";function Q8({item:e,showDivider:t}){const n=X8[e.color??"muted"]??"bg-neutral-500";return h.jsxs(h.Fragment,{children:[t&&h.jsx("div",{className:"w-px h-4 bg-border"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:ge("w-1.5 h-1.5 rounded-full",n)}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase",children:e.label}),h.jsxs("span",{className:"font-mono text-sm text-white font-semibold",children:[e.value,e.unit&&h.jsx("span",{className:"text-xs text-neutral-600",children:e.unit})]}),e.trend&&h.jsx("span",{className:ge("font-mono text-[10px]",e.trend.startsWith("+")?"text-healthy":"text-offline"),children:e.trend})]})]})}const Xj=_.forwardRef(({className:e,buckets:t,successRate:n=99.6,successLabel:s="success",...i},a)=>{const l=n/100*88,f=88-l;return h.jsxs("div",{ref:a,className:ge("px-5 py-3 border-b border-border flex items-center gap-8",e),...i,children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Latency"}),h.jsx("div",{className:"flex items-center gap-6",children:t.map(d=>h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:d.label}),h.jsxs("div",{className:"flex gap-1 items-end h-5",children:[h.jsx("div",{className:"w-3 rounded-t bg-healthy/60",style:{height:`${d.pushBarPercent}%`}}),h.jsx("div",{className:"w-3 rounded-t bg-flow/60",style:{height:`${d.pullBarPercent}%`}})]}),h.jsxs("span",{className:"font-mono text-[10px] text-neutral-400",children:[d.pushMs," / ",d.pullMs,"ms"]})]},d.label))}),h.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[h.jsxs("svg",{viewBox:"0 0 36 36",className:"w-7 h-7",children:[h.jsx("circle",{cx:18,cy:18,r:14,fill:"none",stroke:"#1e1e1e",strokeWidth:4}),h.jsx("circle",{cx:18,cy:18,r:14,fill:"none",stroke:"#22c55e",strokeWidth:4,strokeDasharray:`${l} ${f}`,transform:"rotate(-90 18 18)",strokeLinecap:"round"})]}),h.jsxs("span",{className:"font-mono text-[10px] text-neutral-400",children:[n,"%"," ",h.jsx("span",{className:"text-neutral-600",children:s})]})]})]})});Xj.displayName="LatencyPercentilesBar";const W8={PUSH:"syncing",PULL:"healthy",ACK:"flow"},Qj=_.forwardRef(({className:e,entries:t,isConnected:n=!0,maxVisible:s=20,maxHeight:i,...a},l)=>{const f=t.slice(0,s);return h.jsxs("div",{ref:l,className:ge("flex-shrink-0",e),style:{width:360},...a,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Live Feed"}),h.jsx("span",{className:ge("w-1.5 h-1.5 rounded-full",n?"bg-healthy animate-[dotPulse_1.5s_ease-in-out_infinite]":"bg-neutral-600")})]}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:n?"WebSocket":"Disconnected"})]}),h.jsx("div",{className:"px-3 py-2 space-y-0.5 overflow-y-auto",style:i?{maxHeight:i}:void 0,children:f.length===0?h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx("p",{className:"text-neutral-500 text-sm font-mono",children:n?"Waiting for activity...":"Connect to see live activity"})}):f.map((d,p)=>h.jsxs("div",{className:"flex items-center gap-2 py-1 animate-[streamSlide_0.35s_ease-out]",children:[h.jsx(mn,{variant:W8[d.type]??"ghost",className:"text-[8px] px-1.5 py-0",children:d.type}),h.jsxs("span",{className:"font-mono text-[10px] text-neutral-400 truncate flex-1",children:[d.actor," · ",d.table]}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:d.time})]},`${d.time}-${p}`))})]})});Qj.displayName="LiveActivityFeed";const J8={syncing:"bg-syncing",flow:"bg-flow",healthy:"bg-healthy",offline:"bg-offline"},_p=_.forwardRef(({className:e,title:t,description:n,dotColor:s="syncing",stats:i,actionLabel:a,actionVariant:l="default",actionIcon:f,onAction:d,...p},g)=>h.jsxs("div",{ref:g,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...p,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center gap-2",children:[h.jsx("span",{className:ge("w-1.5 h-1.5 rounded-full",J8[s])}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:t})]}),h.jsxs("div",{className:"p-4",children:[h.jsx("p",{className:"font-mono text-[10px] text-neutral-500 leading-relaxed mb-4",children:n}),h.jsx("div",{className:ge("grid gap-3 mb-4",i.length<=2?"grid-cols-2":"grid-cols-3"),children:i.map(y=>h.jsxs("div",{children:[h.jsx("div",{className:"font-mono text-[9px] text-neutral-600 uppercase tracking-wider mb-1",children:y.label}),h.jsx("div",{className:ge("font-mono font-semibold",y.tone==="syncing"?"text-sm text-syncing":"text-lg text-white"),children:y.value})]},y.label))}),h.jsxs(Me,{variant:l,size:"md",onClick:d,children:[f,a]})]})]}));_p.displayName="MaintenanceCard";function eV({actions:e,children:t,className:n,contentClassName:s,description:i,title:a}){return h.jsxs(Yb,{className:ge("border-border",n),children:[a||e?h.jsxs("div",{className:"flex items-start justify-between px-4 pt-4",children:[h.jsxs("div",{children:[a?h.jsx("h3",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:a}):null,i?h.jsx("p",{className:"mt-1 font-mono text-[10px] text-neutral-500",children:i}):null]}),e?h.jsx("div",{className:"flex items-center gap-2",children:e}):null]}):null,h.jsx(Xb,{className:s,children:t})]})}const Wj=_.forwardRef(({className:e,rows:t,onResetDefaults:n,...s},i)=>h.jsxs("div",{ref:i,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...s,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Preferences"}),n&&h.jsx(Me,{variant:"default",size:"sm",onClick:n,children:"Reset defaults"})]}),h.jsx("div",{className:"p-4 space-y-4",children:t.map((a,l)=>h.jsx(tV,{row:a,showDivider:l>0},a.label))})]}));Wj.displayName="PreferencesPanel";function tV({row:e,showDivider:t}){return h.jsxs(h.Fragment,{children:[t&&h.jsx("div",{className:"border-t border-border"}),h.jsx("div",{className:"flex items-center justify-between",children:e.type==="filter"?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"font-mono text-[11px] text-neutral-400",children:e.label}),h.jsx("div",{className:"flex gap-0.5",children:e.options.map(n=>h.jsx("button",{type:"button",onClick:()=>e.onActiveChange(n.id),className:ge("font-mono text-[10px] border rounded-sm px-2.5 py-0.5 cursor-pointer transition-all",n.id===e.activeId?"text-white border-border-bright bg-white/[0.03]":"text-neutral-500 border-transparent hover:text-neutral-300"),children:n.label},n.id))})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{children:[h.jsx("span",{className:"font-mono text-[11px] text-neutral-400",children:e.label}),e.description&&h.jsx("p",{className:"font-mono text-[9px] text-neutral-600 mt-0.5",children:e.description})]}),h.jsx(Sp,{checked:e.checked,onCheckedChange:n=>e.onCheckedChange(n)})]})})]})}function Jb({actions:e,children:t,className:n,contentClassName:s,description:i,title:a}){return h.jsxs(Yb,{className:n,children:[a||e?h.jsxs("div",{className:"flex items-start justify-between px-4 pt-4",children:[h.jsxs("div",{children:[a?h.jsx("h3",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:a}):null,i?h.jsx("p",{className:"mt-1 font-mono text-[10px] text-neutral-500",children:i}):null]}),e?h.jsx("div",{className:"flex items-center gap-2",children:e}):null]}):null,h.jsx(Xb,{className:s,children:t})]})}const nV={commit:"text-flow",push:"text-syncing",pull:"text-healthy"},rV={applied:"text-healthy",error:"text-offline",cached:"text-syncing"},Jj=_.forwardRef(({className:e,entries:t,filterBar:n,pagination:s,onEntryClick:i,selectedEntryId:a,...l},f)=>h.jsxs("div",{ref:f,className:ge("h-full flex flex-col",e),...l,children:[n,h.jsxs("div",{className:"font-mono text-[9px] tracking-wider uppercase text-neutral-600 flex items-center gap-4 px-4 leading-6 border-b border-border bg-white/[0.01]",children:[h.jsx("span",{className:"w-[50px] truncate",children:"Time"}),h.jsx("span",{className:"w-[65px] truncate",children:"Type"}),h.jsx("span",{className:"w-[55px] truncate",children:"ID"}),h.jsx("span",{className:"w-[65px] truncate",children:"Outcome"}),h.jsx("span",{className:"w-[50px] truncate",children:"Dur"}),h.jsx("span",{className:"w-[100px] truncate",children:"Actor"}),h.jsx("span",{className:"w-[120px] truncate",children:"Client"}),h.jsx("span",{className:"flex-1 truncate",children:"Detail"})]}),h.jsx("div",{className:"flex-1 overflow-y-auto",children:t.map((d,p)=>h.jsx(sV,{entry:d,isSelected:a===d.id,onClick:i},`${d.id}-${p}`))}),s]}));Jj.displayName="StreamLog";function sV({entry:e,isSelected:t,onClick:n}){const s=nV[e.type]??"text-neutral-500",i=rV[e.outcome]??"text-neutral-600",a=ge("font-mono text-[11px] leading-7 px-4 flex items-center gap-4 border-b border-[#141414] hover:bg-white/[0.015] transition-colors",n?"cursor-pointer":"cursor-default",t&&"bg-white/[0.05]"),l=h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"w-[50px] text-neutral-600 truncate",children:e.time}),h.jsx("span",{className:ge("w-[65px] font-medium truncate",s),children:e.type.toUpperCase()}),h.jsx("span",{className:"w-[55px] text-flow truncate",children:e.id}),h.jsx("span",{className:ge("w-[65px] truncate",i),children:e.outcome}),h.jsx("span",{className:"w-[50px] text-neutral-500 truncate",children:e.duration}),h.jsx("span",{className:"w-[100px] text-neutral-400 truncate",children:e.actor}),h.jsx("span",{className:"w-[120px] text-neutral-600 truncate",title:e.client,children:e.client.length>14?`${e.client.substring(0,14)}…`:e.client}),h.jsx("span",{className:"flex-1 text-neutral-500 truncate",children:e.detail})]});return n?h.jsx("button",{type:"button",className:ge(a,"w-full bg-transparent text-left"),onClick:()=>n(e),children:l}):h.jsx("div",{className:a,children:l})}function oV(e){return e==="online"?"#22c55e":e==="syncing"?"#f59e0b":"#ef4444"}const eA=_.forwardRef(({className:e,clients:t,headSeq:n,maxLag:s,minSeq:i,...a},l)=>{const f=t.map(b=>b.cursor),d=i??Math.min(...f,n)-10,p=s??Math.max(...t.map(b=>n-b.cursor),0),g=n-d,y=[d,Math.round(d+g*.33),Math.round(d+g*.66),n];return h.jsxs("div",{ref:l,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...a,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Sync Horizon"}),h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500",children:"Head"}),h.jsxs("span",{className:"font-mono text-xs text-white font-semibold",children:["#",n.toLocaleString()]})]}),h.jsx("div",{className:"w-px h-3 bg-border"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500",children:"Max lag"}),h.jsx("span",{className:"font-mono text-xs text-syncing font-semibold",children:p})]})]})]}),h.jsxs("div",{className:"p-4",children:[h.jsxs("div",{className:"relative h-8 mb-3 rounded bg-surface",children:[h.jsx("div",{className:"absolute inset-0 flex items-center justify-between px-2",children:y.map(b=>h.jsxs("span",{className:"font-mono text-[8px] text-neutral-700",children:["#",b.toLocaleString()]},b))}),h.jsx("div",{className:"absolute top-0 bottom-0 w-px bg-flow/40",style:{right:"2%"}}),t.map(b=>{const x=g>0?(b.cursor-d)/g*96+2:50,S=oV(b.status),w=b.status==="offline"?.4:1;return h.jsx("div",{className:"absolute",style:{left:`${x}%`,top:"50%",transform:"translate(-50%,-50%)",opacity:w},title:`${b.id} → #${b.cursor}`,children:h.jsx("div",{className:"w-2.5 h-2.5 rounded-full",style:{background:S,boxShadow:`0 0 4px ${S}`}})},b.id)})]}),h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"w-2 h-2 rounded-full bg-healthy"}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Caught up"})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"w-2 h-2 rounded-full bg-syncing"}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Behind"})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"w-2 h-2 rounded-full bg-offline opacity-50"}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Offline"})]})]})]})]})});eA.displayName="SyncHorizon";function iV(e){const t=_.useRef(!0);t.current&&(t.current=!1,e())}const aV=_.createContext(void 0);function ex(e){const t=_.useContext(aV);if(t===void 0)throw new Error(yn(72));return t}const cV=[];function tx(e){_.useEffect(e,cV)}const iu=0;class ai{static create(){return new ai}currentId=iu;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=iu,n()},t)}isStarted(){return this.currentId!==iu}clear=()=>{this.currentId!==iu&&(clearTimeout(this.currentId),this.currentId=iu)};disposeEffect=()=>this.clear}function ns(){const e=zn(ai.create).current;return tx(e.disposeEffect),e}function Jo(e){const t=zn(lV,e).current;return t.next=e,Le(t.effect),t}function lV(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Rt(e){return e?.ownerDocument||document}const sl=typeof navigator<"u",jy=dV(),tA=pV(),nA=hV(),nx=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),rA=jy.platform==="MacIntel"&&jy.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(jy.platform),uV=sl&&/apple/i.test(navigator.vendor),Mv=sl&&/android/i.test(tA)||/android/i.test(nA);sl&&tA.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const fV=nA.includes("jsdom/");function dV(){if(!sl)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function hV(){if(!sl)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function pV(){if(!sl)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const Iv="data-base-ui-focusable",sA="active",oA="selected",iA="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Ay="ArrowLeft",ky="ArrowRight",mV="ArrowUp",gV="ArrowDown";function Fo(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Ot(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&jv(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function yV(e,t){if(!jt(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,s]of t.entries())if(Ot(s,n))return!s.hasAttribute("data-trigger-disabled");return!1}function Ur(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Jr(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function vV(e){return e.matches("html,body")}function aA(e){return Zt(e)&&e.matches(iA)}function aC(e){return e?e.getAttribute("role")==="combobox"&&aA(e):!1}function Bh(e){return e?e.hasAttribute(Iv)?e:e.querySelector(`[${Iv}]`)||e:null}function xc(e,t,n=!0){return e.filter(i=>i.parentId===t&&(!n||i.context?.open)).flatMap(i=>[i,...xc(e,i.id,n)])}function cC(e,t){let n=[],s=e.find(i=>i.id===t)?.parentId;for(;s;){const i=e.find(a=>a.id===s);s=i?.parentId,i&&(n=n.concat(i))}return n}function Ki(e){e.preventDefault(),e.stopPropagation()}function bV(e){return"nativeEvent"in e}function xV(e){return e.pointerType===""&&e.isTrusted?!0:Mv&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function SV(e){return fV?!1:!Mv&&e.width===0&&e.height===0||Mv&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function _V(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function wV(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const EV=["top","right","bottom","left"],Lc=Math.min,dr=Math.max,Fh=Math.round,hc=Math.floor,xs=e=>({x:e,y:e}),TV={left:"right",right:"left",bottom:"top",top:"bottom"},CV={start:"end",end:"start"};function Pv(e,t,n){return dr(e,Lc(t,n))}function ao(e,t){return typeof e=="function"?e(t):e}function Zn(e){return e.split("-")[0]}function Si(e){return e.split("-")[1]}function rx(e){return e==="x"?"y":"x"}function sx(e){return e==="y"?"height":"width"}const RV=new Set(["top","bottom"]);function Fr(e){return RV.has(Zn(e))?"y":"x"}function ox(e){return rx(Fr(e))}function NV(e,t,n){n===void 0&&(n=!1);const s=Si(e),i=ox(e),a=sx(i);let l=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=Hh(l)),[l,Hh(l)]}function jV(e){const t=Hh(e);return[Dv(e),t,Dv(t)]}function Dv(e){return e.replace(/start|end/g,t=>CV[t])}const lC=["left","right"],uC=["right","left"],AV=["top","bottom"],kV=["bottom","top"];function OV(e,t,n){switch(e){case"top":case"bottom":return n?t?uC:lC:t?lC:uC;case"left":case"right":return t?AV:kV;default:return[]}}function MV(e,t,n,s){const i=Si(e);let a=OV(Zn(e),n==="start",s);return i&&(a=a.map(l=>l+"-"+i),t&&(a=a.concat(a.map(Dv)))),a}function Hh(e){return e.replace(/left|right|bottom|top/g,t=>TV[t])}function IV(e){return{top:0,right:0,bottom:0,left:0,...e}}function cA(e){return typeof e!="number"?IV(e):{top:e,right:e,bottom:e,left:e}}function qh(e){const{x:t,y:n,width:s,height:i}=e;return{width:s,height:i,top:n,left:t,right:t+s,bottom:n+i,x:t,y:n}}function zd(e,t,n){return Math.floor(e/t)!==n}function ch(e,t){return t<0||t>=e.current.length}function PV(e,t){return fr(e,{disabledIndices:t})}function DV(e,t){return fr(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function fr(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:s,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.current.length-1&&pu(e,a,s));return a}function zV(e,{event:t,orientation:n,loopFocus:s,rtl:i,cols:a,disabledIndices:l,minIndex:f,maxIndex:d,prevIndex:p,stopEvent:g=!1}){let y=p;const b=[],x={};let S=!1;{let C=null,O=-1;e.current.forEach((N,R)=>{if(N==null)return;const M=N.closest('[role="row"]');M&&(S=!0),(M!==C||O===-1)&&(C=M,O+=1,b[O]=[]),b[O].push(R),x[R]=O})}const w=S&&b.length>0&&b.some(C=>C.length!==a);function T(C){if(!w||p===-1)return;const O=x[p];if(O==null)return;const N=b[O].indexOf(p);let R=C==="up"?O-1:O+1;s&&(R<0?R=b.length-1:R>=b.length&&(R=0));const M=new Set;for(;R>=0&&R<b.length&&!M.has(R);){M.add(R);const z=b[R];if(z.length===0){R=C==="up"?R-1:R+1;continue}const j=Math.min(N,z.length-1);for(let A=j;A>=0;A-=1){const P=z[A];if(!pu(e,P,l))return P}R=C==="up"?R-1:R+1,s&&(R<0?R=b.length-1:R>=b.length&&(R=0))}}if(t.key===mV){const C=T("up");if(C!==void 0)g&&Ki(t),y=C;else{if(g&&Ki(t),p===-1)y=d;else if(y=fr(e,{startingIndex:y,amount:a,decrement:!0,disabledIndices:l}),s&&(p-a<f||y<0)){const O=p%a,N=d%a,R=d-(N-O);N===O?y=d:y=N>O?R:R-a}ch(e,y)&&(y=p)}}if(t.key===gV){const C=T("down");C!==void 0?(g&&Ki(t),y=C):(g&&Ki(t),p===-1?y=f:(y=fr(e,{startingIndex:p,amount:a,disabledIndices:l}),s&&p+a>d&&(y=fr(e,{startingIndex:p%a-a,amount:a,disabledIndices:l}))),ch(e,y)&&(y=p))}if(n==="both"){const C=hc(p/a);t.key===(i?Ay:ky)&&(g&&Ki(t),p%a!==a-1?(y=fr(e,{startingIndex:p,disabledIndices:l}),s&&zd(y,a,C)&&(y=fr(e,{startingIndex:p-p%a-1,disabledIndices:l}))):s&&(y=fr(e,{startingIndex:p-p%a-1,disabledIndices:l})),zd(y,a,C)&&(y=p)),t.key===(i?ky:Ay)&&(g&&Ki(t),p%a!==0?(y=fr(e,{startingIndex:p,decrement:!0,disabledIndices:l}),s&&zd(y,a,C)&&(y=fr(e,{startingIndex:p+(a-p%a),decrement:!0,disabledIndices:l}))):s&&(y=fr(e,{startingIndex:p+(a-p%a),decrement:!0,disabledIndices:l})),zd(y,a,C)&&(y=p));const O=hc(d/a)===C;ch(e,y)&&(s&&O?y=t.key===(i?ky:Ay)?d:fr(e,{startingIndex:p-p%a-1,disabledIndices:l}):y=p)}return y}function LV(e,t,n){const s=[];let i=0;return e.forEach(({width:a,height:l},f)=>{let d=!1;for(n&&(i=0);!d;){const p=[];for(let g=0;g<a;g+=1)for(let y=0;y<l;y+=1)p.push(i+g+y*t);i%t+a<=t&&p.every(g=>s[g]==null)?(p.forEach(g=>{s[g]=f}),d=!0):i+=1}}),[...s]}function UV(e,t,n,s,i){if(e===-1)return-1;const a=n.indexOf(e),l=t[e];switch(i){case"tl":return a;case"tr":return l?a+l.width-1:a;case"bl":return l?a+(l.height-1)*s:a;case"br":return n.lastIndexOf(e);default:return-1}}function $V(e,t){return t.flatMap((n,s)=>e.includes(n)?[s]:[])}function pu(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const s=e.current[t];return s?s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true":!1}var BV=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Vh=BV.join(","),lA=typeof Element>"u",Uc=lA?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Kh=!lA&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Gh=function(t,n){var s;n===void 0&&(n=!0);var i=t==null||(s=t.getAttribute)===null||s===void 0?void 0:s.call(t,"inert"),a=i===""||i==="true",l=a||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Gh(t.parentNode));return l},FV=function(t){var n,s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return s===""||s==="true"},uA=function(t,n,s){if(Gh(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Vh));return n&&Uc.call(t,Vh)&&i.unshift(t),i=i.filter(s),i},Zh=function(t,n,s){for(var i=[],a=Array.from(t);a.length;){var l=a.shift();if(!Gh(l,!1))if(l.tagName==="SLOT"){var f=l.assignedElements(),d=f.length?f:l.children,p=Zh(d,!0,s);s.flatten?i.push.apply(i,p):i.push({scopeParent:l,candidates:p})}else{var g=Uc.call(l,Vh);g&&s.filter(l)&&(n||!t.includes(l))&&i.push(l);var y=l.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(l),b=!Gh(y,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(l));if(y&&b){var x=Zh(y===!0?l.children:y.children,!0,s);s.flatten?i.push.apply(i,x):i.push({scopeParent:l,candidates:x})}else a.unshift.apply(a,l.children)}}return i},fA=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},dA=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||FV(t))&&!fA(t)?0:t.tabIndex},HV=function(t,n){var s=dA(t);return s<0&&n&&!fA(t)?0:s},qV=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},hA=function(t){return t.tagName==="INPUT"},VV=function(t){return hA(t)&&t.type==="hidden"},KV=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(s){return s.tagName==="SUMMARY"});return n},GV=function(t,n){for(var s=0;s<t.length;s++)if(t[s].checked&&t[s].form===n)return t[s]},ZV=function(t){if(!t.name)return!0;var n=t.form||Kh(t),s=function(f){return n.querySelectorAll('input[type="radio"][name="'+f+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=s(window.CSS.escape(t.name));else try{i=s(t.name)}catch(l){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",l.message),!1}var a=GV(i,t.form);return!a||a===t},YV=function(t){return hA(t)&&t.type==="radio"},XV=function(t){return YV(t)&&!ZV(t)},QV=function(t){var n,s=t&&Kh(t),i=(n=s)===null||n===void 0?void 0:n.host,a=!1;if(s&&s!==t){var l,f,d;for(a=!!((l=i)!==null&&l!==void 0&&(f=l.ownerDocument)!==null&&f!==void 0&&f.contains(i)||t!=null&&(d=t.ownerDocument)!==null&&d!==void 0&&d.contains(t));!a&&i;){var p,g,y;s=Kh(i),i=(p=s)===null||p===void 0?void 0:p.host,a=!!((g=i)!==null&&g!==void 0&&(y=g.ownerDocument)!==null&&y!==void 0&&y.contains(i))}}return a},fC=function(t){var n=t.getBoundingClientRect(),s=n.width,i=n.height;return s===0&&i===0},WV=function(t,n){var s=n.displayCheck,i=n.getShadowRoot;if(s==="full-native"&&"checkVisibility"in t){var a=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!a}if(getComputedStyle(t).visibility==="hidden")return!0;var l=Uc.call(t,"details>summary:first-of-type"),f=l?t.parentElement:t;if(Uc.call(f,"details:not([open]) *"))return!0;if(!s||s==="full"||s==="full-native"||s==="legacy-full"){if(typeof i=="function"){for(var d=t;t;){var p=t.parentElement,g=Kh(t);if(p&&!p.shadowRoot&&i(p)===!0)return fC(t);t.assignedSlot?t=t.assignedSlot:!p&&g!==t.ownerDocument?t=g.host:t=p}t=d}if(QV(t))return!t.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return fC(t);return!1},JV=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var s=0;s<n.children.length;s++){var i=n.children.item(s);if(i.tagName==="LEGEND")return Uc.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},zv=function(t,n){return!(n.disabled||VV(n)||WV(n,t)||KV(n)||JV(n))},Lv=function(t,n){return!(XV(n)||dA(n)<0||!zv(t,n))},eK=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},pA=function(t){var n=[],s=[];return t.forEach(function(i,a){var l=!!i.scopeParent,f=l?i.scopeParent:i,d=HV(f,l),p=l?pA(i.candidates):f;d===0?l?n.push.apply(n,p):n.push(f):s.push({documentOrder:a,tabIndex:d,item:i,isScope:l,content:p})}),s.sort(qV).reduce(function(i,a){return a.isScope?i.push.apply(i,a.content):i.push(a.content),i},[]).concat(n)},wp=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Zh([t],n.includeContainer,{filter:Lv.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:eK}):s=uA(t,n.includeContainer,Lv.bind(null,n)),pA(s)},tK=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Zh([t],n.includeContainer,{filter:zv.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):s=uA(t,n.includeContainer,zv.bind(null,n)),s},mA=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Uc.call(t,Vh)===!1?!1:Lv(n,t)};const Qu=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function gA(e,t){const n=wp(e,Qu()),s=n.length;if(s===0)return;const i=Fo(Rt(e)),a=n.indexOf(i),l=a===-1?t===1?0:s-1:a+t;return n[l]}function yA(e){return gA(Rt(e).body,1)||e}function vA(e){return gA(Rt(e).body,-1)||e}function mu(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!Ot(n,s)}function nK(e){wp(e,Qu()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function dC(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const s=n.dataset.tabindex;delete n.dataset.tabindex,s?n.setAttribute("tabindex",s):n.removeAttribute("tabindex")})}function rK(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(s=>s(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}const sK=_.createContext(null),oK=_.createContext(null),Ep=()=>_.useContext(sK)?.id||null,Tp=e=>{const t=_.useContext(oK);return e??t};function Nu(e){return`data-base-ui-${e}`}const Ld=null;class iK{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,s=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,s>0)for(let i=0;i<n.length;i+=1)n[i]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Ud=new iK;class ys{static create(){return new ys}static request(t){return Ud.request(t)}static cancel(t){return Ud.cancel(t)}currentId=Ld;request(t){this.cancel(),this.currentId=Ud.request(()=>{this.currentId=Ld,t()})}cancel=()=>{this.currentId!==Ld&&(Ud.cancel(this.currentId),this.currentId=Ld)};disposeEffect=()=>this.cancel}function ix(){const e=zn(ys.create).current;return tx(e.disposeEffect),e}const Yh=_.forwardRef(function(t,n){const[s,i]=_.useState();Le(()=>{uV&&i("button")},[]);const a={tabIndex:0,role:s};return h.jsx("span",{...t,ref:n,style:mp,"aria-hidden":s?void 0:!0,...a,"data-base-ui-focus-guard":""})});let hC=0;function Oy(e,t={}){const{preventScroll:n=!1,cancelPrevious:s=!0,sync:i=!1}=t;s&&cancelAnimationFrame(hC);const a=()=>e?.focus({preventScroll:n});i?a():hC=requestAnimationFrame(a)}const Sc={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function pC(e){return e==="inert"?Sc.inert:e==="aria-hidden"?Sc["aria-hidden"]:Sc.none}let $d=new WeakSet,Bd={},My=0;const bA=e=>e&&(e.host||bA(e.parentNode)),aK=(e,t)=>t.map(n=>{if(e.contains(n))return n;const s=bA(n);return e.contains(s)?s:null}).filter(n=>n!=null);function cK(e,t,n,s){const i="data-base-ui-inert",a=s?"inert":n?"aria-hidden":null,l=aK(t,e),f=new Set,d=new Set(l),p=[];Bd[i]||(Bd[i]=new WeakMap);const g=Bd[i];l.forEach(y),b(t),f.clear();function y(x){!x||f.has(x)||(f.add(x),x.parentNode&&y(x.parentNode))}function b(x){!x||d.has(x)||[].forEach.call(x.children,S=>{if(yi(S)!=="script")if(f.has(S))b(S);else{const w=a?S.getAttribute(a):null,T=w!==null&&w!=="false",C=pC(a),O=(C.get(S)||0)+1,N=(g.get(S)||0)+1;C.set(S,O),g.set(S,N),p.push(S),O===1&&T&&$d.add(S),N===1&&S.setAttribute(i,""),!T&&a&&S.setAttribute(a,a==="inert"?"":"true")}})}return My+=1,()=>{p.forEach(x=>{const S=pC(a),T=(S.get(x)||0)-1,C=(g.get(x)||0)-1;S.set(x,T),g.set(x,C),T||(!$d.has(x)&&a&&x.removeAttribute(a),$d.delete(x)),C||x.removeAttribute(i)}),My-=1,My||(Sc.inert=new WeakMap,Sc["aria-hidden"]=new WeakMap,Sc.none=new WeakMap,$d=new WeakSet,Bd={})}}function lK(e,t=!1,n=!1){const s=Rt(e[0]).body;return cK(e.concat(Array.from(s.querySelectorAll("[aria-live]"))),s,t,n)}const xA=_.createContext(null),SA=()=>_.useContext(xA),uK=Nu("portal");function _A(e={}){const{ref:t,container:n,componentProps:s=an,elementProps:i}=e,a=Xu(),f=SA()?.portalNode,[d,p]=_.useState(null),[g,y]=_.useState(null),b=Ae(T=>{T!==null&&y(T)}),x=_.useRef(null);Le(()=>{if(n===null){x.current&&(x.current=null,y(null),p(null));return}if(a==null)return;const T=(n&&(Gb(n)?n:n.current))??f??document.body;if(T==null){x.current&&(x.current=null,y(null),p(null));return}x.current!==T&&(x.current=T,y(null),p(T))},[n,f,a]);const S=zt("div",s,{ref:[t,b],props:[{id:a,[uK]:""},i]});return{portalNode:g,portalSubtree:d&&S?hi.createPortal(S,d):null}}const wA=_.forwardRef(function(t,n){const{children:s,container:i,className:a,render:l,renderGuards:f,...d}=t,{portalNode:p,portalSubtree:g}=_A({container:i,ref:n,componentProps:t,elementProps:d}),y=_.useRef(null),b=_.useRef(null),x=_.useRef(null),S=_.useRef(null),[w,T]=_.useState(null),C=w?.modal,O=w?.open,N=typeof f=="boolean"?f:!!w&&!w.modal&&w.open&&!!p;_.useEffect(()=>{if(!p||C)return;function M(z){p&&z.relatedTarget&&mu(z)&&(z.type==="focusin"?dC:nK)(p)}return p.addEventListener("focusin",M,!0),p.addEventListener("focusout",M,!0),()=>{p.removeEventListener("focusin",M,!0),p.removeEventListener("focusout",M,!0)}},[p,C]),_.useEffect(()=>{!p||O||dC(p)},[O,p]);const R=_.useMemo(()=>({beforeOutsideRef:y,afterOutsideRef:b,beforeInsideRef:x,afterInsideRef:S,portalNode:p,setFocusManagerState:T}),[p]);return h.jsxs(_.Fragment,{children:[g,h.jsxs(xA.Provider,{value:R,children:[N&&p&&h.jsx(Yh,{"data-type":"outside",ref:y,onFocus:M=>{if(mu(M,p))x.current?.focus();else{const z=w?w.domReference:null;vA(z)?.focus()}}}),N&&p&&h.jsx("span",{"aria-owns":p.id,style:W9}),p&&hi.createPortal(s,p),N&&p&&h.jsx(Yh,{"data-type":"outside",ref:b,onFocus:M=>{if(mu(M,p))S.current?.focus();else{const z=w?w.domReference:null;yA(z)?.focus(),w?.closeOnFocusOut&&w?.onOpenChange(!1,Yt(Lj,M.nativeEvent))}}})]})]})});function qs(e){return e==null?e:"current"in e?e.current:e}function fK(e,t){const n=un(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const mC=20;let Vo=[];function ax(){Vo=Vo.filter(e=>e.deref()?.isConnected)}function dK(e){ax(),e&&yi(e)!=="body"&&(Vo.push(new WeakRef(e)),Vo.length>mC&&(Vo=Vo.slice(-mC)))}function Iy(){return ax(),Vo[Vo.length-1]?.deref()}function hK(e){if(!e)return null;const t=Qu();return mA(e,t)?e:wp(e,t)[0]||e}function pK(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():xr(e).display!=="none"}function gC(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Qu(),i=tK(e,n).filter(l=>{const f=l.getAttribute("data-tabindex")||"";return mA(l,n)||l.hasAttribute("data-tabindex")&&!f.startsWith("-")}),a=e.getAttribute("tabindex");t.current.includes("floating")||i.length===0?a!=="0"&&e.setAttribute("tabindex","0"):(a!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function EA(e){const{context:t,children:n,disabled:s=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:l=!1,modal:f=!0,closeOnFocusOut:d=!0,openInteractionType:p="",nextFocusableElement:g,previousFocusableElement:y,beforeContentFocusGuardRef:b,externalTree:x}=e,S="rootStore"in t?t.rootStore:t,w=S.useState("open"),T=S.useState("domReferenceElement"),C=S.useState("floatingElement"),{events:O,dataRef:N}=S.context,R=Ae(()=>N.current.floatingContext?.nodeId),M=i===!1,z=aC(T)&&M,j=_.useRef(["content"]),A=Jo(i),P=Jo(a),Q=Jo(p),B=Tp(x),U=SA(),Z=_.useRef(null),K=_.useRef(null),ee=_.useRef(!1),D=_.useRef(!1),G=_.useRef(!1),q=_.useRef(-1),V=_.useRef(""),L=_.useRef(""),I=_.useRef(null),H=_.useRef(null),W=oo(I,b,U?.beforeInsideRef),Y=oo(H,U?.afterInsideRef),ae=ns(),se=ns(),fe=ix(),Se=U!=null,pe=Bh(C),Oe=Ae((he=pe)=>he?wp(he,Qu()):[]),_e=Ae(he=>{const ie=Oe(he);return j.current.map(()=>ie).filter(Boolean).flat()});_.useEffect(()=>{if(s||!f)return;function he(we){we.key==="Tab"&&Ot(pe,Fo(Rt(pe)))&&Oe().length===0&&!z&&Ki(we)}const ie=Rt(pe);return ie.addEventListener("keydown",he),()=>{ie.removeEventListener("keydown",he)}},[s,T,pe,f,j,z,Oe,_e]),_.useEffect(()=>{if(s||!w)return;const he=Rt(pe);function ie(){G.current=!1}function we(xe){const ve=Ur(xe),Ie=Ot(C,ve)||Ot(T,ve)||Ot(U?.portalNode,ve);G.current=!Ie,L.current=xe.pointerType||"keyboard",ve?.closest(`[${Y9}]`)&&(D.current=!0)}function ye(){L.current="keyboard"}return he.addEventListener("pointerdown",we,!0),he.addEventListener("pointerup",ie,!0),he.addEventListener("pointercancel",ie,!0),he.addEventListener("keydown",ye,!0),()=>{he.removeEventListener("pointerdown",we,!0),he.removeEventListener("pointerup",ie,!0),he.removeEventListener("pointercancel",ie,!0),he.removeEventListener("keydown",ye,!0)}},[s,C,T,pe,w,U]),_.useEffect(()=>{if(s||!d)return;const he=Rt(pe);function ie(){D.current=!0,se.start(0,()=>{D.current=!1})}function we(Ue){const Ee=Ur(Ue),Qe=Oe().indexOf(Ee);Qe!==-1&&(q.current=Qe)}function ye(Ue){const Ee=Ue.relatedTarget,Ve=Ue.currentTarget,Qe=Ur(Ue);queueMicrotask(()=>{const Be=R(),We=S.context.triggerElements,He=Ee?.hasAttribute(Nu("focus-guard"))&&[I.current,H.current,U?.beforeInsideRef.current,U?.afterInsideRef.current,U?.beforeOutsideRef.current,U?.afterOutsideRef.current,qs(y),qs(g)].includes(Ee),me=!(Ot(T,Ee)||Ot(C,Ee)||Ot(Ee,C)||Ot(U?.portalNode,Ee)||Ee!=null&&We.hasElement(Ee)||We.hasMatchingElement(Te=>Ot(Te,Ee))||He||B&&(xc(B.nodesRef.current,Be).find(Te=>Ot(Te.context?.elements.floating,Ee)||Ot(Te.context?.elements.domReference,Ee))||cC(B.nodesRef.current,Be).find(Te=>[Te.context?.elements.floating,Bh(Te.context?.elements.floating)].includes(Ee)||Te.context?.elements.domReference===Ee)));if(Ve===T&&pe&&gC(pe,j),l&&Ve!==T&&!pK(Qe)&&Fo(he)===he.body){if(Zt(pe)&&(pe.focus(),l==="popup")){fe.request(()=>{pe.focus()});return}const Te=q.current,qe=Oe(),mt=qe[Te]||qe[qe.length-1]||pe;Zt(mt)&&mt.focus()}if(N.current.insideReactTree){N.current.insideReactTree=!1;return}(z||!f)&&Ee&&me&&!D.current&&(z||Ee!==Iy())&&(ee.current=!0,S.setOpen(!1,Yt(Lj,Ue)))})}function xe(){G.current||(N.current.insideReactTree=!0,ae.start(0,()=>{N.current.insideReactTree=!1}))}const ve=Zt(T)?T:null,Ie=[];if(!(!C&&!ve))return ve&&(ve.addEventListener("focusout",ye),ve.addEventListener("pointerdown",ie),Ie.push(()=>{ve.removeEventListener("focusout",ye),ve.removeEventListener("pointerdown",ie)})),C&&(C.addEventListener("focusin",we),C.addEventListener("focusout",ye),U&&(C.addEventListener("focusout",xe,!0),Ie.push(()=>{C.removeEventListener("focusout",xe,!0)})),Ie.push(()=>{C.removeEventListener("focusin",we),C.removeEventListener("focusout",ye)})),()=>{Ie.forEach(Ue=>{Ue()})}},[s,T,C,pe,f,B,U,S,d,l,Oe,z,R,j,N,ae,se,fe,g,y]),_.useEffect(()=>{if(s||!C||!w)return;const he=Array.from(U?.portalNode?.querySelectorAll(`[${Nu("portal")}]`)||[]),we=(B?cC(B.nodesRef.current,R()):[]).find(xe=>aC(xe.context?.elements.domReference||null))?.context?.elements.domReference,ye=[C,we,...he,Z.current,K.current,I.current,H.current,U?.beforeOutsideRef.current,U?.afterOutsideRef.current,qs(y),qs(g),z?T:null].filter(xe=>xe!=null);return lK(ye,f||z)},[w,s,T,C,f,j,U,z,B,R,g,y]),Le(()=>{if(!w||s||!Zt(pe))return;const he=Rt(pe),ie=Fo(he);queueMicrotask(()=>{const we=_e(pe),ye=A.current,xe=typeof ye=="function"?ye(Q.current||""):ye;if(xe===void 0||xe===!1)return;let ve;xe===!0||xe===null?ve=we[0]||pe:ve=qs(xe),ve=ve||we[0]||pe,!Ot(pe,ie)&&Oy(ve,{preventScroll:ve===pe})})},[s,w,pe,M,_e,A,Q]),Le(()=>{if(s||!pe)return;const he=Rt(pe),ie=Fo(he);dK(ie);function we(ve){if(ve.open||(V.current=fK(ve.nativeEvent,L.current)),ve.reason===Ov&&ve.nativeEvent.type==="mouseleave"&&(ee.current=!0),ve.reason===zj)if(ve.nested)ee.current=!1;else if(xV(ve.nativeEvent)||SV(ve.nativeEvent))ee.current=!1;else{let Ie=!1;document.createElement("div").focus({get preventScroll(){return Ie=!0,!1}}),Ie?ee.current=!1:ee.current=!0}}O.on("openchange",we);const ye=he.createElement("span");ye.setAttribute("tabindex","-1"),ye.setAttribute("aria-hidden","true"),Object.assign(ye.style,mp),Se&&T&&T.insertAdjacentElement("afterend",ye);function xe(){const ve=P.current;let Ie=typeof ve=="function"?ve(V.current):ve;if(Ie===void 0||Ie===!1)return null;if(Ie===null&&(Ie=!0),typeof Ie=="boolean"){const Ee=T||Iy();return Ee&&Ee.isConnected?Ee:ye}const Ue=T||Iy()||ye;return qs(Ie)||Ue}return()=>{O.off("openchange",we);const ve=Fo(he),Ie=Ot(C,ve)||B&&xc(B.nodesRef.current,R(),!1).some(Ee=>Ot(Ee.context?.elements.floating,ve)),Ue=xe();queueMicrotask(()=>{const Ee=hK(Ue),Ve=typeof P.current!="boolean";P.current&&!ee.current&&Zt(Ee)&&(!(!Ve&&Ee!==ve&&ve!==he.body)||Ie)&&Ee.focus({preventScroll:!0}),ye.remove(),ee.current=!1})}},[s,C,pe,P,N,O,B,Se,T,R]),Le(()=>{if(!nx||w||!C)return;const he=Fo(Rt(C));!Zt(he)||!aA(he)||Ot(C,he)&&he.blur()},[w,C]),Le(()=>{if(!(s||!U))return U.setFocusManagerState({modal:f,closeOnFocusOut:d,open:w,onOpenChange:S.setOpen,domReference:T}),()=>{U.setFocusManagerState(null)}},[s,U,f,w,S,d,T]),Le(()=>{if(!(s||!pe))return gC(pe,j),()=>{queueMicrotask(ax)}},[s,pe,j]);const re=!s&&(f?!z:!0)&&(Se||f);return h.jsxs(_.Fragment,{children:[re&&h.jsx(Yh,{"data-type":"inside",ref:W,onFocus:he=>{if(f){const ie=_e();Oy(ie[ie.length-1])}else U?.portalNode&&(ee.current=!1,mu(he,U.portalNode)?yA(T)?.focus():qs(y??U.beforeOutsideRef)?.focus())}}),n,re&&h.jsx(Yh,{"data-type":"inside",ref:Y,onFocus:he=>{f?Oy(_e()[0]):U?.portalNode&&(d&&(ee.current=!0),mu(he,U.portalNode)?vA(T)?.focus():qs(g??U.afterOutsideRef)?.focus())}})]})}function yC(e,t,n){let{reference:s,floating:i}=e;const a=Fr(t),l=ox(t),f=sx(l),d=Zn(t),p=a==="y",g=s.x+s.width/2-i.width/2,y=s.y+s.height/2-i.height/2,b=s[f]/2-i[f]/2;let x;switch(d){case"top":x={x:g,y:s.y-i.height};break;case"bottom":x={x:g,y:s.y+s.height};break;case"right":x={x:s.x+s.width,y};break;case"left":x={x:s.x-i.width,y};break;default:x={x:s.x,y:s.y}}switch(Si(t)){case"start":x[l]-=b*(n&&p?-1:1);break;case"end":x[l]+=b*(n&&p?-1:1);break}return x}async function mK(e,t){var n;t===void 0&&(t={});const{x:s,y:i,platform:a,rects:l,elements:f,strategy:d}=e,{boundary:p="clippingAncestors",rootBoundary:g="viewport",elementContext:y="floating",altBoundary:b=!1,padding:x=0}=ao(t,e),S=cA(x),T=f[b?y==="floating"?"reference":"floating":y],C=qh(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(T)))==null||n?T:T.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(f.floating)),boundary:p,rootBoundary:g,strategy:d})),O=y==="floating"?{x:s,y:i,width:l.floating.width,height:l.floating.height}:l.reference,N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f.floating)),R=await(a.isElement==null?void 0:a.isElement(N))?await(a.getScale==null?void 0:a.getScale(N))||{x:1,y:1}:{x:1,y:1},M=qh(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:O,offsetParent:N,strategy:d}):O);return{top:(C.top-M.top+S.top)/R.y,bottom:(M.bottom-C.bottom+S.bottom)/R.y,left:(C.left-M.left+S.left)/R.x,right:(M.right-C.right+S.right)/R.x}}const gK=async(e,t,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:a=[],platform:l}=n,f=a.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let p=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:g,y}=yC(p,s,d),b=s,x={},S=0;for(let T=0;T<f.length;T++){var w;const{name:C,fn:O}=f[T],{x:N,y:R,data:M,reset:z}=await O({x:g,y,initialPlacement:s,placement:b,strategy:i,middlewareData:x,rects:p,platform:{...l,detectOverflow:(w=l.detectOverflow)!=null?w:mK},elements:{reference:e,floating:t}});g=N??g,y=R??y,x={...x,[C]:{...x[C],...M}},z&&S<=50&&(S++,typeof z=="object"&&(z.placement&&(b=z.placement),z.rects&&(p=z.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):z.rects),{x:g,y}=yC(p,b,d)),T=-1)}return{x:g,y,placement:b,strategy:i,middlewareData:x}},yK=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:i,middlewareData:a,rects:l,initialPlacement:f,platform:d,elements:p}=t,{mainAxis:g=!0,crossAxis:y=!0,fallbackPlacements:b,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:w=!0,...T}=ao(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const C=Zn(i),O=Fr(f),N=Zn(f)===f,R=await(d.isRTL==null?void 0:d.isRTL(p.floating)),M=b||(N||!w?[Hh(f)]:jV(f)),z=S!=="none";!b&&z&&M.push(...MV(f,w,S,R));const j=[f,...M],A=await d.detectOverflow(t,T),P=[];let Q=((s=a.flip)==null?void 0:s.overflows)||[];if(g&&P.push(A[C]),y){const K=NV(i,l,R);P.push(A[K[0]],A[K[1]])}if(Q=[...Q,{placement:i,overflows:P}],!P.every(K=>K<=0)){var B,U;const K=(((B=a.flip)==null?void 0:B.index)||0)+1,ee=j[K];if(ee&&(!(y==="alignment"?O!==Fr(ee):!1)||Q.every(q=>Fr(q.placement)===O?q.overflows[0]>0:!0)))return{data:{index:K,overflows:Q},reset:{placement:ee}};let D=(U=Q.filter(G=>G.overflows[0]<=0).sort((G,q)=>G.overflows[1]-q.overflows[1])[0])==null?void 0:U.placement;if(!D)switch(x){case"bestFit":{var Z;const G=(Z=Q.filter(q=>{if(z){const V=Fr(q.placement);return V===O||V==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(V=>V>0).reduce((V,L)=>V+L,0)]).sort((q,V)=>q[1]-V[1])[0])==null?void 0:Z[0];G&&(D=G);break}case"initialPlacement":D=f;break}if(i!==D)return{reset:{placement:D}}}return{}}}};function vC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bC(e){return EV.some(t=>e[t]>=0)}const vK=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:s}=t,{strategy:i="referenceHidden",...a}=ao(e,t);switch(i){case"referenceHidden":{const l=await s.detectOverflow(t,{...a,elementContext:"reference"}),f=vC(l,n.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:bC(f)}}}case"escaped":{const l=await s.detectOverflow(t,{...a,altBoundary:!0}),f=vC(l,n.floating);return{data:{escapedOffsets:f,escaped:bC(f)}}}default:return{}}}}},TA=new Set(["left","top"]);async function bK(e,t){const{placement:n,platform:s,elements:i}=e,a=await(s.isRTL==null?void 0:s.isRTL(i.floating)),l=Zn(n),f=Si(n),d=Fr(n)==="y",p=TA.has(l)?-1:1,g=a&&d?-1:1,y=ao(t,e);let{mainAxis:b,crossAxis:x,alignmentAxis:S}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return f&&typeof S=="number"&&(x=f==="end"?S*-1:S),d?{x:x*g,y:b*p}:{x:b*p,y:x*g}}const xK=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:i,y:a,placement:l,middlewareData:f}=t,d=await bK(t,e);return l===((n=f.offset)==null?void 0:n.placement)&&(s=f.arrow)!=null&&s.alignmentOffset?{}:{x:i+d.x,y:a+d.y,data:{...d,placement:l}}}}},SK=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:i,platform:a}=t,{mainAxis:l=!0,crossAxis:f=!1,limiter:d={fn:C=>{let{x:O,y:N}=C;return{x:O,y:N}}},...p}=ao(e,t),g={x:n,y:s},y=await a.detectOverflow(t,p),b=Fr(Zn(i)),x=rx(b);let S=g[x],w=g[b];if(l){const C=x==="y"?"top":"left",O=x==="y"?"bottom":"right",N=S+y[C],R=S-y[O];S=Pv(N,S,R)}if(f){const C=b==="y"?"top":"left",O=b==="y"?"bottom":"right",N=w+y[C],R=w-y[O];w=Pv(N,w,R)}const T=d.fn({...t,[x]:S,[b]:w});return{...T,data:{x:T.x-n,y:T.y-s,enabled:{[x]:l,[b]:f}}}}}},_K=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:i,rects:a,middlewareData:l}=t,{offset:f=0,mainAxis:d=!0,crossAxis:p=!0}=ao(e,t),g={x:n,y:s},y=Fr(i),b=rx(y);let x=g[b],S=g[y];const w=ao(f,t),T=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(d){const N=b==="y"?"height":"width",R=a.reference[b]-a.floating[N]+T.mainAxis,M=a.reference[b]+a.reference[N]-T.mainAxis;x<R?x=R:x>M&&(x=M)}if(p){var C,O;const N=b==="y"?"width":"height",R=TA.has(Zn(i)),M=a.reference[y]-a.floating[N]+(R&&((C=l.offset)==null?void 0:C[y])||0)+(R?0:T.crossAxis),z=a.reference[y]+a.reference[N]+(R?0:((O=l.offset)==null?void 0:O[y])||0)-(R?T.crossAxis:0);S<M?S=M:S>z&&(S=z)}return{[b]:x,[y]:S}}}},wK=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:i,rects:a,platform:l,elements:f}=t,{apply:d=()=>{},...p}=ao(e,t),g=await l.detectOverflow(t,p),y=Zn(i),b=Si(i),x=Fr(i)==="y",{width:S,height:w}=a.floating;let T,C;y==="top"||y==="bottom"?(T=y,C=b===(await(l.isRTL==null?void 0:l.isRTL(f.floating))?"start":"end")?"left":"right"):(C=y,T=b==="end"?"top":"bottom");const O=w-g.top-g.bottom,N=S-g.left-g.right,R=Lc(w-g[T],O),M=Lc(S-g[C],N),z=!t.middlewareData.shift;let j=R,A=M;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=N),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(j=O),z&&!b){const Q=dr(g.left,0),B=dr(g.right,0),U=dr(g.top,0),Z=dr(g.bottom,0);x?A=S-2*(Q!==0||B!==0?Q+B:dr(g.left,g.right)):j=w-2*(U!==0||Z!==0?U+Z:dr(g.top,g.bottom))}await d({...t,availableWidth:A,availableHeight:j});const P=await l.getDimensions(f.floating);return S!==P.width||w!==P.height?{reset:{rects:!0}}:{}}}};function CA(e){const t=xr(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const i=Zt(e),a=i?e.offsetWidth:n,l=i?e.offsetHeight:s,f=Fh(n)!==a||Fh(s)!==l;return f&&(n=a,s=l),{width:n,height:s,$:f}}function cx(e){return jt(e)?e:e.contextElement}function _c(e){const t=cx(e);if(!Zt(t))return xs(1);const n=t.getBoundingClientRect(),{width:s,height:i,$:a}=CA(t);let l=(a?Fh(n.width):n.width)/s,f=(a?Fh(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!f||!Number.isFinite(f))&&(f=1),{x:l,y:f}}const EK=xs(0);function RA(e){const t=un(e);return!vp()||!t.visualViewport?EK:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function TK(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==un(e)?!1:t}function da(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=cx(e);let l=xs(1);t&&(s?jt(s)&&(l=_c(s)):l=_c(e));const f=TK(a,n,s)?RA(a):xs(0);let d=(i.left+f.x)/l.x,p=(i.top+f.y)/l.y,g=i.width/l.x,y=i.height/l.y;if(a){const b=un(a),x=s&&jt(s)?un(s):s;let S=b,w=Av(S);for(;w&&s&&x!==S;){const T=_c(w),C=w.getBoundingClientRect(),O=xr(w),N=C.left+(w.clientLeft+parseFloat(O.paddingLeft))*T.x,R=C.top+(w.clientTop+parseFloat(O.paddingTop))*T.y;d*=T.x,p*=T.y,g*=T.x,y*=T.y,d+=N,p+=R,S=un(w),w=Av(S)}}return qh({width:g,height:y,x:d,y:p})}function Cp(e,t){const n=bp(e).scrollLeft;return t?t.left+n:da(_s(e)).left+n}function NA(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-Cp(e,n),i=n.top+t.scrollTop;return{x:s,y:i}}function CK(e){let{elements:t,rect:n,offsetParent:s,strategy:i}=e;const a=i==="fixed",l=_s(s),f=t?yp(t.floating):!1;if(s===l||f&&a)return n;let d={scrollLeft:0,scrollTop:0},p=xs(1);const g=xs(0),y=Zt(s);if((y||!y&&!a)&&((yi(s)!=="body"||vi(l))&&(d=bp(s)),Zt(s))){const x=da(s);p=_c(s),g.x=x.x+s.clientLeft,g.y=x.y+s.clientTop}const b=l&&!y&&!a?NA(l,d):xs(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-d.scrollLeft*p.x+g.x+b.x,y:n.y*p.y-d.scrollTop*p.y+g.y+b.y}}function RK(e){return Array.from(e.getClientRects())}function NK(e){const t=_s(e),n=bp(e),s=e.ownerDocument.body,i=dr(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),a=dr(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let l=-n.scrollLeft+Cp(e);const f=-n.scrollTop;return xr(s).direction==="rtl"&&(l+=dr(t.clientWidth,s.clientWidth)-i),{width:i,height:a,x:l,y:f}}const xC=25;function jK(e,t){const n=un(e),s=_s(e),i=n.visualViewport;let a=s.clientWidth,l=s.clientHeight,f=0,d=0;if(i){a=i.width,l=i.height;const g=vp();(!g||g&&t==="fixed")&&(f=i.offsetLeft,d=i.offsetTop)}const p=Cp(s);if(p<=0){const g=s.ownerDocument,y=g.body,b=getComputedStyle(y),x=g.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,S=Math.abs(s.clientWidth-y.clientWidth-x);S<=xC&&(a-=S)}else p<=xC&&(a+=p);return{width:a,height:l,x:f,y:d}}const AK=new Set(["absolute","fixed"]);function kK(e,t){const n=da(e,!0,t==="fixed"),s=n.top+e.clientTop,i=n.left+e.clientLeft,a=Zt(e)?_c(e):xs(1),l=e.clientWidth*a.x,f=e.clientHeight*a.y,d=i*a.x,p=s*a.y;return{width:l,height:f,x:d,y:p}}function SC(e,t,n){let s;if(t==="viewport")s=jK(e,n);else if(t==="document")s=NK(_s(e));else if(jt(t))s=kK(t,n);else{const i=RA(e);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return qh(s)}function jA(e,t){const n=io(e);return n===t||!jt(n)||Xs(n)?!1:xr(n).position==="fixed"||jA(n,t)}function OK(e,t){const n=t.get(e);if(n)return n;let s=Wo(e,[],!1).filter(f=>jt(f)&&yi(f)!=="body"),i=null;const a=xr(e).position==="fixed";let l=a?io(e):e;for(;jt(l)&&!Xs(l);){const f=xr(l),d=Zb(l);!d&&f.position==="fixed"&&(i=null),(a?!d&&!i:!d&&f.position==="static"&&!!i&&AK.has(i.position)||vi(l)&&!d&&jA(e,l))?s=s.filter(g=>g!==l):i=f,l=io(l)}return t.set(e,s),s}function MK(e){let{element:t,boundary:n,rootBoundary:s,strategy:i}=e;const l=[...n==="clippingAncestors"?yp(t)?[]:OK(t,this._c):[].concat(n),s],f=l[0],d=l.reduce((p,g)=>{const y=SC(t,g,i);return p.top=dr(y.top,p.top),p.right=Lc(y.right,p.right),p.bottom=Lc(y.bottom,p.bottom),p.left=dr(y.left,p.left),p},SC(t,f,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function IK(e){const{width:t,height:n}=CA(e);return{width:t,height:n}}function PK(e,t,n){const s=Zt(t),i=_s(t),a=n==="fixed",l=da(e,!0,a,t);let f={scrollLeft:0,scrollTop:0};const d=xs(0);function p(){d.x=Cp(i)}if(s||!s&&!a)if((yi(t)!=="body"||vi(i))&&(f=bp(t)),s){const x=da(t,!0,a,t);d.x=x.x+t.clientLeft,d.y=x.y+t.clientTop}else i&&p();a&&!s&&i&&p();const g=i&&!s&&!a?NA(i,f):xs(0),y=l.left+f.scrollLeft-d.x-g.x,b=l.top+f.scrollTop-d.y-g.y;return{x:y,y:b,width:l.width,height:l.height}}function Py(e){return xr(e).position==="static"}function _C(e,t){if(!Zt(e)||xr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return _s(e)===n&&(n=n.ownerDocument.body),n}function AA(e,t){const n=un(e);if(yp(e))return n;if(!Zt(e)){let i=io(e);for(;i&&!Xs(i);){if(jt(i)&&!Py(i))return i;i=io(i)}return n}let s=_C(e,t);for(;s&&a8(s)&&Py(s);)s=_C(s,t);return s&&Xs(s)&&Py(s)&&!Zb(s)?n:s||d8(e)||n}const DK=async function(e){const t=this.getOffsetParent||AA,n=this.getDimensions,s=await n(e.floating);return{reference:PK(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function zK(e){return xr(e).direction==="rtl"}const LK={convertOffsetParentRelativeRectToViewportRelativeRect:CK,getDocumentElement:_s,getClippingRect:MK,getOffsetParent:AA,getElementRects:DK,getClientRects:RK,getDimensions:IK,getScale:_c,isElement:jt,isRTL:zK};function kA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function UK(e,t){let n=null,s;const i=_s(e);function a(){var f;clearTimeout(s),(f=n)==null||f.disconnect(),n=null}function l(f,d){f===void 0&&(f=!1),d===void 0&&(d=1),a();const p=e.getBoundingClientRect(),{left:g,top:y,width:b,height:x}=p;if(f||t(),!b||!x)return;const S=hc(y),w=hc(i.clientWidth-(g+b)),T=hc(i.clientHeight-(y+x)),C=hc(g),N={rootMargin:-S+"px "+-w+"px "+-T+"px "+-C+"px",threshold:dr(0,Lc(1,d))||1};let R=!0;function M(z){const j=z[0].intersectionRatio;if(j!==d){if(!R)return l();j?l(!1,j):s=setTimeout(()=>{l(!1,1e-7)},1e3)}j===1&&!kA(p,e.getBoundingClientRect())&&l(),R=!1}try{n=new IntersectionObserver(M,{...N,root:i.ownerDocument})}catch{n=new IntersectionObserver(M,N)}n.observe(e)}return l(!0),a}function wC(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:d=!1}=s,p=cx(e),g=i||a?[...p?Wo(p):[],...Wo(t)]:[];g.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),a&&C.addEventListener("resize",n)});const y=p&&f?UK(p,n):null;let b=-1,x=null;l&&(x=new ResizeObserver(C=>{let[O]=C;O&&O.target===p&&x&&(x.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var N;(N=x)==null||N.observe(t)})),n()}),p&&!d&&x.observe(p),x.observe(t));let S,w=d?da(e):null;d&&T();function T(){const C=da(e);w&&!kA(w,C)&&n(),w=C,S=requestAnimationFrame(T)}return n(),()=>{var C;g.forEach(O=>{i&&O.removeEventListener("scroll",n),a&&O.removeEventListener("resize",n)}),y?.(),(C=x)==null||C.disconnect(),x=null,d&&cancelAnimationFrame(S)}}const $K=xK,BK=SK,FK=yK,HK=wK,qK=vK,VK=_K,KK=(e,t,n)=>{const s=new Map,i={platform:LK,...n},a={...i.platform,_c:s};return gK(e,t,{...i,platform:a})};var GK=typeof document<"u",ZK=function(){},lh=GK?_.useLayoutEffect:ZK;function Xh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,s,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!Xh(e[s],t[s]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,i[s]))return!1;for(s=n;s--!==0;){const a=i[s];if(!(a==="_owner"&&e.$$typeof)&&!Xh(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function OA(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function EC(e,t){const n=OA(e);return Math.round(t*n)/n}function Dy(e){const t=_.useRef(e);return lh(()=>{t.current=e}),t}function YK(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:i,elements:{reference:a,floating:l}={},transform:f=!0,whileElementsMounted:d,open:p}=e,[g,y]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,x]=_.useState(s);Xh(b,s)||x(s);const[S,w]=_.useState(null),[T,C]=_.useState(null),O=_.useCallback(q=>{q!==z.current&&(z.current=q,w(q))},[]),N=_.useCallback(q=>{q!==j.current&&(j.current=q,C(q))},[]),R=a||S,M=l||T,z=_.useRef(null),j=_.useRef(null),A=_.useRef(g),P=d!=null,Q=Dy(d),B=Dy(i),U=Dy(p),Z=_.useCallback(()=>{if(!z.current||!j.current)return;const q={placement:t,strategy:n,middleware:b};B.current&&(q.platform=B.current),KK(z.current,j.current,q).then(V=>{const L={...V,isPositioned:U.current!==!1};K.current&&!Xh(A.current,L)&&(A.current=L,hi.flushSync(()=>{y(L)}))})},[b,t,n,B,U]);lh(()=>{p===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,y(q=>({...q,isPositioned:!1})))},[p]);const K=_.useRef(!1);lh(()=>(K.current=!0,()=>{K.current=!1}),[]),lh(()=>{if(R&&(z.current=R),M&&(j.current=M),R&&M){if(Q.current)return Q.current(R,M,Z);Z()}},[R,M,Z,Q,P]);const ee=_.useMemo(()=>({reference:z,floating:j,setReference:O,setFloating:N}),[O,N]),D=_.useMemo(()=>({reference:R,floating:M}),[R,M]),G=_.useMemo(()=>{const q={position:n,left:0,top:0};if(!D.floating)return q;const V=EC(D.floating,g.x),L=EC(D.floating,g.y);return f?{...q,transform:"translate("+V+"px, "+L+"px)",...OA(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:L}},[n,f,D.floating,g.x,g.y]);return _.useMemo(()=>({...g,update:Z,refs:ee,elements:D,floatingStyles:G}),[g,Z,ee,D,G])}const XK=(e,t)=>({...$K(e),options:[e,t]}),QK=(e,t)=>({...BK(e),options:[e,t]}),WK=(e,t)=>({...VK(e),options:[e,t]}),JK=(e,t)=>({...FK(e),options:[e,t]}),e7=(e,t)=>({...HK(e),options:[e,t]}),t7=(e,t)=>({...qK(e),options:[e,t]}),n7={intentional:"onClick",sloppy:"onPointerDown"};function r7(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function s7(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),i=n.useState("floatingElement"),a=n.useState("referenceElement"),l=n.useState("domReferenceElement"),{onOpenChange:f,dataRef:d}=n.context,{enabled:p=!0,escapeKey:g=!0,outsidePress:y=!0,outsidePressEvent:b="sloppy",referencePress:x=!1,referencePressEvent:S="sloppy",ancestorScroll:w=!1,bubbles:T,externalTree:C}=t,O=Tp(C),N=Ae(typeof y=="function"?y:()=>!1),R=typeof y=="function"?N:y,M=_.useRef(!1),{escapeKey:z,outsidePress:j}=r7(T),A=_.useRef(null),P=ns(),Q=ns(),B=Ae(()=>{Q.clear(),d.current.insideReactTree=!1}),U=_.useRef(!1),Z=_.useRef(""),K=Ae(re=>{Z.current=re.pointerType}),ee=Ae(()=>{const re=Z.current,he=re==="pen"||!re?"mouse":re,ie=typeof b=="function"?b():b;return typeof ie=="string"?ie:ie[he]}),D=Ae(re=>{if(!s||!p||!g||re.key!=="Escape"||U.current)return;const he=d.current.floatingContext?.nodeId,ie=O?xc(O.nodesRef.current,he):[];if(!z&&ie.length>0){let xe=!0;if(ie.forEach(ve=>{ve.context?.open&&!ve.context.dataRef.current.__escapeKeyBubbles&&(xe=!1)}),!xe)return}const we=bV(re)?re.nativeEvent:re,ye=Yt(v8,we);n.setOpen(!1,ye),!z&&!ye.isPropagationAllowed&&re.stopPropagation()}),G=Ae(re=>{const he=ee();return he==="intentional"&&re.type!=="click"||he==="sloppy"&&re.type==="click"}),q=Ae(()=>{d.current.insideReactTree=!0,Q.start(0,B)}),V=Ae((re,he=!1)=>{if(G(re)){B();return}if(d.current.insideReactTree){B();return}if(ee()==="intentional"&&he||typeof R=="function"&&!R(re))return;const ie=Ur(re),we=`[${Nu("inert")}]`,ye=Rt(n.select("floatingElement")).querySelectorAll(we),xe=n.context.triggerElements;if(ie&&(xe.hasElement(ie)||xe.hasMatchingElement(Ve=>Ot(Ve,ie))))return;let ve=jt(ie)?ie:null;for(;ve&&!Xs(ve);){const Ve=io(ve);if(Xs(Ve)||!jt(Ve))break;ve=Ve}if(ye.length&&jt(ie)&&!vV(ie)&&!Ot(ie,n.select("floatingElement"))&&Array.from(ye).every(Ve=>!Ot(ve,Ve)))return;if(Zt(ie)&&!("touches"in re)){const Ve=Xs(ie),Qe=xr(ie),Be=/auto|scroll/,We=Ve||Be.test(Qe.overflowX),He=Ve||Be.test(Qe.overflowY),me=We&&ie.clientWidth>0&&ie.scrollWidth>ie.clientWidth,Te=He&&ie.clientHeight>0&&ie.scrollHeight>ie.clientHeight,qe=Qe.direction==="rtl",mt=Te&&(qe?re.offsetX<=ie.offsetWidth-ie.clientWidth:re.offsetX>ie.clientWidth),lt=me&&re.offsetY>ie.clientHeight;if(mt||lt)return}const Ie=d.current.floatingContext?.nodeId,Ue=O&&xc(O.nodesRef.current,Ie).some(Ve=>Jr(re,Ve.context?.elements.floating));if(Jr(re,n.select("floatingElement"))||Jr(re,n.select("domReferenceElement"))||Ue)return;const Ee=O?xc(O.nodesRef.current,Ie):[];if(Ee.length>0){let Ve=!0;if(Ee.forEach(Qe=>{Qe.context?.open&&!Qe.context.dataRef.current.__outsidePressBubbles&&(Ve=!1)}),!Ve)return}n.setOpen(!1,Yt(zj,re)),B()}),L=Ae(re=>{ee()!=="sloppy"||re.pointerType==="touch"||!n.select("open")||!p||Jr(re,n.select("floatingElement"))||Jr(re,n.select("domReferenceElement"))||V(re)}),I=Ae(re=>{if(ee()!=="sloppy"||!n.select("open")||!p||Jr(re,n.select("floatingElement"))||Jr(re,n.select("domReferenceElement")))return;const he=re.touches[0];he&&(A.current={startTime:Date.now(),startX:he.clientX,startY:he.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},P.start(1e3,()=>{A.current&&(A.current.dismissOnTouchEnd=!1,A.current.dismissOnMouseDown=!1)}))}),H=Ae(re=>{const he=Ur(re);function ie(){I(re),he?.removeEventListener(re.type,ie)}he?.addEventListener(re.type,ie)}),W=Ae(re=>{const he=M.current;if(M.current=!1,P.clear(),re.type==="mousedown"&&A.current&&!A.current.dismissOnMouseDown)return;const ie=Ur(re);function we(){re.type==="pointerdown"?L(re):V(re,he),ie?.removeEventListener(re.type,we)}ie?.addEventListener(re.type,we)}),Y=Ae(re=>{if(ee()!=="sloppy"||!A.current||Jr(re,n.select("floatingElement"))||Jr(re,n.select("domReferenceElement")))return;const he=re.touches[0];if(!he)return;const ie=Math.abs(he.clientX-A.current.startX),we=Math.abs(he.clientY-A.current.startY),ye=Math.sqrt(ie*ie+we*we);ye>5&&(A.current.dismissOnTouchEnd=!0),ye>10&&(V(re),P.clear(),A.current=null)}),ae=Ae(re=>{const he=Ur(re);function ie(){Y(re),he?.removeEventListener(re.type,ie)}he?.addEventListener(re.type,ie)}),se=Ae(re=>{ee()!=="sloppy"||!A.current||Jr(re,n.select("floatingElement"))||Jr(re,n.select("domReferenceElement"))||(A.current.dismissOnTouchEnd&&V(re),P.clear(),A.current=null)}),fe=Ae(re=>{const he=Ur(re);function ie(){se(re),he?.removeEventListener(re.type,ie)}he?.addEventListener(re.type,ie)});_.useEffect(()=>{if(!s||!p)return;d.current.__escapeKeyBubbles=z,d.current.__outsidePressBubbles=j;const re=new ai;function he(ve){n.setOpen(!1,Yt(ii,ve))}function ie(){re.clear(),U.current=!0}function we(){re.start(vp()?5:0,()=>{U.current=!1})}const ye=Rt(i);ye.addEventListener("pointerdown",K,!0),g&&(ye.addEventListener("keydown",D),ye.addEventListener("compositionstart",ie),ye.addEventListener("compositionend",we)),R&&(ye.addEventListener("click",W,!0),ye.addEventListener("pointerdown",W,!0),ye.addEventListener("touchstart",H,!0),ye.addEventListener("touchmove",ae,!0),ye.addEventListener("touchend",fe,!0),ye.addEventListener("mousedown",W,!0));let xe=[];return w&&(jt(l)&&(xe=Wo(l)),jt(i)&&(xe=xe.concat(Wo(i))),!jt(a)&&a&&a.contextElement&&(xe=xe.concat(Wo(a.contextElement)))),xe=xe.filter(ve=>ve!==ye.defaultView?.visualViewport),xe.forEach(ve=>{ve.addEventListener("scroll",he,{passive:!0})}),()=>{ye.removeEventListener("pointerdown",K,!0),g&&(ye.removeEventListener("keydown",D),ye.removeEventListener("compositionstart",ie),ye.removeEventListener("compositionend",we)),R&&(ye.removeEventListener("click",W,!0),ye.removeEventListener("pointerdown",W,!0),ye.removeEventListener("touchstart",H,!0),ye.removeEventListener("touchmove",ae,!0),ye.removeEventListener("touchend",fe,!0),ye.removeEventListener("mousedown",W,!0)),xe.forEach(ve=>{ve.removeEventListener("scroll",he)}),re.clear(),M.current=!1}},[d,i,a,l,g,R,s,f,w,p,z,j,D,V,W,L,H,ae,fe,K,n]),_.useEffect(B,[R,B]);const Se=_.useMemo(()=>({onKeyDown:D,...x&&{[n7[S]]:re=>{n.setOpen(!1,Yt(oC,re.nativeEvent))},...S!=="intentional"&&{onClick(re){n.setOpen(!1,Yt(oC,re.nativeEvent))}}}}),[D,n,x,S]),pe=Ae(re=>{const he=Ur(re.nativeEvent);!Ot(n.select("floatingElement"),he)||re.button!==0||(M.current=!0)}),Oe=Ae(re=>{!s||!p||re.button!==0||(M.current=!0)}),_e=_.useMemo(()=>({onKeyDown:D,onPointerDown:pe,onMouseDown:pe,onMouseUp:pe,onClickCapture:q,onMouseDownCapture(re){q(),Oe(re)},onPointerDownCapture(re){q(),Oe(re)},onMouseUpCapture:q,onTouchEndCapture:q,onTouchMoveCapture:q}),[D,pe,q,Oe]);return _.useMemo(()=>p?{reference:Se,floating:_e,trigger:Se}:{},[p,Se,_e])}nj({memoize:fq,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Pe=(e,t,n,s,i,a,...l)=>{if(l.length>0)throw new Error(yn(1));let f;if(e)f=e;else throw new Error("Missing arguments");return f};var o7=VN();const i7=Kb(19),a7=i7?l7:u7;function at(e,t,n,s,i){return a7(e,t,n,s,i)}function c7(e,t,n,s,i){const a=_.useCallback(()=>t(e.getSnapshot(),n,s,i),[e,t,n,s,i]);return o7.useSyncExternalStore(e.subscribe,a,a)}function l7(e,t,n,s,i){return c7(e,t,n,s,i)}function u7(e,t,n,s,i){return KN.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,a=>t(a,n,s,i))}class f7{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const s of this.listeners){if(n!==this.updateTick)return;s(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,s,i){return at(this,t,n,s,i)}}class MA extends f7{constructor(t,n={},s){super(t),this.context=n,this.selectors=s}useSyncedValue(t,n){_.useDebugValue(t),Le(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const s=this;Le(()=>(s.state[t]!==n&&s.set(t,n),()=>{s.set(t,void 0)}),[s,t,n])}useSyncedValues(t){const n=this,s=Object.values(t);Le(()=>{n.update(t)},[n,...s])}useControlledProp(t,n){_.useDebugValue(t);const s=n!==void 0;Le(()=>{s&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,s])}select(t,n,s,i){const a=this.selectors[t];return a(this.state,n,s,i)}useState(t,n,s,i){return _.useDebugValue(t),at(this,this.selectors[t],n,s,i)}useContextCallback(t,n){_.useDebugValue(t);const s=Ae(n??jn);this.context[t]=s}useStateSetter(t){const n=_.useRef(void 0);return n.current===void 0&&(n.current=s=>{this.set(t,s)}),n.current}observe(t,n){let s;typeof t=="function"?s=t:s=this.selectors[t];let i=s(this.state);return n(i,i,this),this.subscribe(a=>{const l=s(a);if(!Object.is(i,l)){const f=i;i=l,n(l,f,this)}})}}const d7={open:Pe(e=>e.open),domReferenceElement:Pe(e=>e.domReferenceElement),referenceElement:Pe(e=>e.positionReference??e.referenceElement),floatingElement:Pe(e=>e.floatingElement),floatingId:Pe(e=>e.floatingId)};class lx extends MA{constructor(t){const{nested:n,noEmit:s,onOpenChange:i,triggerElements:a,...l}=t;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:i,dataRef:{current:{}},events:rK(),nested:n,noEmit:s,triggerElements:a},d7)}setOpen=(t,n)=>{if((!t||!this.state.open||wV(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const s={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",s)}this.context.onOpenChange?.(t,n)}}function Rp(e,t=!1,n=!1){const[s,i]=_.useState(e&&t?"idle":void 0),[a,l]=_.useState(e);return e&&!a&&(l(!0),i("starting")),!e&&a&&s!=="ending"&&!n&&i("ending"),!e&&!a&&s==="ending"&&i(void 0),Le(()=>{if(!e&&a&&s!=="ending"&&n){const f=ys.request(()=>{i("ending")});return()=>{ys.cancel(f)}}},[e,a,s,n]),Le(()=>{if(!e||t)return;const f=ys.request(()=>{i(void 0)});return()=>{ys.cancel(f)}},[t,e]),Le(()=>{if(!e||!t)return;e&&a&&s!=="idle"&&i("starting");const f=ys.request(()=>{i("idle")});return()=>{ys.cancel(f)}},[t,e,a,i,s]),_.useMemo(()=>({mounted:a,setMounted:l,transitionStatus:s}),[a,s])}let ju=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const h7={[ju.startingStyle]:""},p7={[ju.endingStyle]:""},ba={transitionStatus(e){return e==="starting"?h7:e==="ending"?p7:null}};function m7(e,t=!1,n=!0){const s=ix();return Ae((i,a=null)=>{s.cancel();function l(){hi.flushSync(i)}const f=qs(e);if(f==null)return;const d=f;if(typeof d.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)i();else{let y=function(){const x=ju.startingStyle;if(!d.hasAttribute(x)){s.request(b);return}const S=new MutationObserver(()=>{d.hasAttribute(x)||(S.disconnect(),b())});S.observe(d,{attributes:!0,attributeFilter:[x]}),a?.addEventListener("abort",()=>S.disconnect(),{once:!0})},b=function(){Promise.all(d.getAnimations().map(x=>x.finished)).then(()=>{a?.aborted||l()}).catch(()=>{const x=d.getAnimations();if(n){if(a?.aborted)return;l()}else x.length>0&&x.some(S=>S.pending||S.playState!=="finished")&&b()})};var p=y,g=b;if(t){y();return}s.request(b)}})}function xa(e){const{enabled:t=!0,open:n,ref:s,onComplete:i}=e,a=Ae(i),l=m7(s,n,!1);_.useEffect(()=>{if(!t)return;const f=new AbortController;return l(a,f.signal),()=>{f.abort()}},[t,n,a,l])}function g7(e){const t=e.useState("open");Le(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[s,i]=n.value;e.update({activeTriggerId:s,activeTriggerElement:i})}}},[t,e])}function y7(e,t,n){const{mounted:s,setMounted:i,transitionStatus:a}=Rp(e);t.useSyncedValues({mounted:s,transitionStatus:a});const l=Ae(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),f=t.useState("preventUnmountingOnClose");return xa({enabled:!f,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:a}}class ux{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const s=this.idMap.get(t);s!==n&&(s!==void 0&&this.elementsSet.delete(s),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function v7(){return new lx({open:!1,floatingElement:null,referenceElement:null,triggerElements:new ux,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function b7(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:v7(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:an,inactiveTriggerProps:an,popupProps:an}}const Fd=Pe(e=>e.triggerIdProp??e.activeTriggerId),x7={open:Pe(e=>e.openProp??e.open),mounted:Pe(e=>e.mounted),transitionStatus:Pe(e=>e.transitionStatus),floatingRootContext:Pe(e=>e.floatingRootContext),preventUnmountingOnClose:Pe(e=>e.preventUnmountingOnClose),payload:Pe(e=>e.payload),activeTriggerId:Fd,activeTriggerElement:Pe(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:Pe((e,t)=>t!==void 0&&Fd(e)===t),isOpenedByTrigger:Pe((e,t)=>t!==void 0&&Fd(e)===t&&e.open),isMountedByTrigger:Pe((e,t)=>t!==void 0&&Fd(e)===t&&e.mounted),triggerProps:Pe((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:Pe(e=>e.popupProps),popupElement:Pe(e=>e.popupElement),positionerElement:Pe(e=>e.positionerElement)};function S7(e){const{open:t=!1,onOpenChange:n,elements:s={}}=e,i=Xu(),a=Ep()!=null,l=zn(()=>new lx({open:t,onOpenChange:n,referenceElement:s.reference??null,floatingElement:s.floating??null,triggerElements:new ux,floatingId:i,nested:a,noEmit:!1})).current;return Le(()=>{const f={open:t,floatingId:i};s.reference!==void 0&&(f.referenceElement=s.reference,f.domReferenceElement=jt(s.reference)?s.reference:null),s.floating!==void 0&&(f.floatingElement=s.floating),l.update(f)},[t,i,s.reference,s.floating,l]),l.context.onOpenChange=n,l.context.nested=a,l.context.noEmit=!1,l}function _7(e={}){const{nodeId:t,externalTree:n}=e,s=S7(e),i=e.rootContext||s,a={reference:i.useState("referenceElement"),floating:i.useState("floatingElement"),domReference:i.useState("domReferenceElement")},[l,f]=_.useState(null),d=_.useRef(null),p=Tp(n);Le(()=>{a.domReference&&(d.current=a.domReference)},[a.domReference]);const g=YK({...e,elements:{...a,...l&&{reference:l}}}),y=_.useCallback(j=>{const A=jt(j)?{getBoundingClientRect:()=>j.getBoundingClientRect(),getClientRects:()=>j.getClientRects(),contextElement:j}:j;f(A),g.refs.setReference(A)},[g.refs]),[b,x]=_.useState(null),[S,w]=_.useState(null);i.useSyncedValue("referenceElement",b),i.useSyncedValue("domReferenceElement",jt(b)?b:null),i.useSyncedValue("floatingElement",S);const T=_.useCallback(j=>{(jt(j)||j===null)&&(d.current=j,x(j)),(jt(g.refs.reference.current)||g.refs.reference.current===null||j!==null&&!jt(j))&&g.refs.setReference(j)},[g.refs,x]),C=_.useCallback(j=>{w(j),g.refs.setFloating(j)},[g.refs]),O=_.useMemo(()=>({...g.refs,setReference:T,setFloating:C,setPositionReference:y,domReference:d}),[g.refs,T,C,y]),N=_.useMemo(()=>({...g.elements,domReference:a.domReference}),[g.elements,a.domReference]),R=i.useState("open"),M=i.useState("floatingId"),z=_.useMemo(()=>({...g,dataRef:i.context.dataRef,open:R,onOpenChange:i.setOpen,events:i.context.events,floatingId:M,refs:O,elements:N,nodeId:t,rootStore:i}),[g,O,N,t,i,R,M]);return Le(()=>{i.context.dataRef.current.floatingContext=z;const j=p?.nodesRef.current.find(A=>A.id===t);j&&(j.context=z)}),_.useMemo(()=>({...g,context:z,refs:O,elements:N,rootStore:i}),[g,O,N,z,i])}function w7(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:s=!1,onOpenChange:i}=e,a=Xu(),l=Ep()!=null,f=t.useState("open"),d=t.useState("activeTriggerElement"),p=t.useState(s?"popupElement":"positionerElement"),g=t.context.triggerElements,y=zn(()=>new lx({open:f,referenceElement:d,floatingElement:p,triggerElements:g,onOpenChange:i,floatingId:a,nested:l,noEmit:n})).current;return Le(()=>{const b={open:f,floatingId:a,referenceElement:d,floatingElement:p};jt(d)&&(b.domReferenceElement=d),y.state.positionReference===y.state.referenceElement&&(b.positionReference=d),y.update(b)},[f,a,d,p,y]),y.context.onOpenChange=i,y.context.nested=l,y.context.noEmit=n,y}const TC=Nu("safe-polygon"),E7=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${iA}`;function T7(e){return e?!!e.closest(E7):!1}class fx{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.unbindMouseMove=()=>{},this.restTimeoutPending=!1,this.openChangeTimeout=new ai,this.restTimeout=new ai,this.handleCloseOptions=void 0}static create(){return new fx}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}function C7(e){const t=zn(fx.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),tx(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}const R7=new Set(["click","mousedown"]);function N7(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),i=n.useState("floatingElement"),a=n.useState("domReferenceElement"),{dataRef:l}=n.context,{enabled:f=!0,closeDelay:d=0}=t,p=C7(n),g=Tp(),y=Ep(),b=Ae(()=>p.interactedInside?!0:l.current.openEvent?R7.has(l.current.openEvent.type):!1),x=Ae(()=>{const N=l.current.openEvent?.type;return N?.includes("mouse")&&N!=="mousedown"}),S=Ae(N=>yV(N,n.context.triggerElements)),w=_.useCallback((N,R=!0)=>{const M=j7(d,p.pointerType);M&&!p.handler?p.openChangeTimeout.start(M,()=>n.setOpen(!1,Yt(Ov,N))):R&&(p.openChangeTimeout.clear(),n.setOpen(!1,Yt(Ov,N)))},[d,n,p]),T=Ae(()=>{p.unbindMouseMove(),p.handler=void 0}),C=Ae(()=>{if(p.performedPointerEventsMutation){const N=Rt(i).body;N.style.pointerEvents="",N.removeAttribute(TC),p.performedPointerEventsMutation=!1}}),O=Ae(N=>{const R=Ur(N);if(!T7(R)){p.interactedInside=!1;return}p.interactedInside=!0});Le(()=>{s||(p.pointerType=void 0,p.restTimeoutPending=!1,p.interactedInside=!1,T(),C())},[s,p,T,C]),_.useEffect(()=>()=>{T()},[T]),_.useEffect(()=>C,[C]),Le(()=>{if(f&&s&&p.handleCloseOptions?.blockPointerEvents&&x()&&jt(a)&&i){p.performedPointerEventsMutation=!0;const N=Rt(i).body;N.setAttribute(TC,"");const R=a,M=i,z=g?.nodesRef.current.find(j=>j.id===y)?.context?.elements.floating;return z&&(z.style.pointerEvents=""),N.style.pointerEvents="none",R.style.pointerEvents="auto",M.style.pointerEvents="auto",()=>{N.style.pointerEvents="",R.style.pointerEvents="",M.style.pointerEvents=""}}},[f,s,a,i,p,x,g,y]),_.useEffect(()=>{if(!f)return;function N(j){b()||!l.current.floatingContext||!n.select("open")||S(j.relatedTarget)||(C(),T(),b()||w(j))}function R(j){p.openChangeTimeout.clear(),C(),p.handler?.(j),T()}function M(j){b()||w(j,!1)}const z=i;return z&&(z.addEventListener("mouseleave",N),z.addEventListener("mouseenter",R),z.addEventListener("mouseleave",M),z.addEventListener("pointerdown",O,!0)),()=>{z&&(z.removeEventListener("mouseleave",N),z.removeEventListener("mouseenter",R),z.removeEventListener("mouseleave",M),z.removeEventListener("pointerdown",O,!0))}},[f,i,n,l,b,S,w,C,T,O,p])}function j7(e,t){return t&&!_V(t)?0:typeof e=="function"?e():e}function A7(e=[]){const t=e.map(p=>p?.reference),n=e.map(p=>p?.floating),s=e.map(p=>p?.item),i=e.map(p=>p?.trigger),a=_.useCallback(p=>Hd(p,e,"reference"),t),l=_.useCallback(p=>Hd(p,e,"floating"),n),f=_.useCallback(p=>Hd(p,e,"item"),s),d=_.useCallback(p=>Hd(p,e,"trigger"),i);return _.useMemo(()=>({getReferenceProps:a,getFloatingProps:l,getItemProps:f,getTriggerProps:d}),[a,l,f,d])}function Hd(e,t,n){const s=new Map,i=n==="item",a={};n==="floating"&&(a.tabIndex=-1,a[Iv]="");for(const l in e)i&&e&&(l===sA||l===oA)||(a[l]=e[l]);for(let l=0;l<t.length;l+=1){let f;const d=t[l]?.[n];typeof d=="function"?f=e?d(e):null:f=d,f&&CC(a,f,i,s)}return CC(a,e,i,s),a}function CC(e,t,n,s){for(const i in t){const a=t[i];n&&(i===sA||i===oA)||(i.startsWith("on")?(s.has(i)||s.set(i,[]),typeof a=="function"&&(s.get(i)?.push(a),e[i]=(...l)=>s.get(i)?.map(f=>f(...l)).find(f=>f!==void 0))):e[i]=a)}}const k7=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function O7(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),i=n.useState("floatingId"),a=n.useState("domReferenceElement"),l=n.useState("floatingElement"),{role:f="dialog"}=t,d=Xu(),p=a?.id||d,g=_.useMemo(()=>Bh(l)?.id||i,[l,i]),y=k7.get(f)??f,x=Ep()!=null,S=_.useMemo(()=>y==="tooltip"||f==="label"?an:{"aria-haspopup":y==="alertdialog"?"dialog":y,"aria-expanded":"false",...y==="listbox"&&{role:"combobox"},...y==="menu"&&x&&{role:"menuitem"},...f==="select"&&{"aria-autocomplete":"none"},...f==="combobox"&&{"aria-autocomplete":"list"}},[y,x,f]),w=_.useMemo(()=>y==="tooltip"||f==="label"?{[`aria-${f==="label"?"labelledby":"describedby"}`]:s?g:void 0}:{...S,"aria-expanded":s?"true":"false","aria-controls":s?g:void 0,...y==="menu"&&{id:p}},[y,g,s,p,f,S]),T=_.useMemo(()=>{const O={id:g,...y&&{role:y}};return y==="tooltip"||f==="label"?O:{...O,...y==="menu"&&{"aria-labelledby":p}}},[y,g,p,f]),C=_.useCallback(({active:O,selected:N})=>{const R={role:"option",...O&&{id:`${g}-fui-option`}};switch(f){case"select":case"combobox":return{...R,"aria-selected":N}}return{}},[g,f]);return _.useMemo(()=>({reference:w,floating:T,item:C,trigger:S}),[w,T,S,C])}let Qi=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=ju.startingStyle]="startingStyle",e[e.endingStyle=ju.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),RC=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const M7={[RC.popupOpen]:"",[RC.pressed]:""},I7={[Qi.open]:""},P7={[Qi.closed]:""},D7={[Qi.anchorHidden]:""},z7={open(e){return e?M7:null}},ol={open(e){return e?I7:P7},anchorHidden(e){return e?D7:null}},IA=_.createContext(void 0);function L7(){const e=_.useContext(IA);if(e===void 0)throw new Error(yn(70));return e}const U7=_.forwardRef(function(t,n){const{children:s,container:i,className:a,render:l,...f}=t,{portalNode:d,portalSubtree:p}=_A({container:i,ref:n,componentProps:t,elementProps:f});return!p&&!d?null:h.jsxs(_.Fragment,{children:[p,d&&hi.createPortal(s,d)]})}),$7=_.forwardRef(function(t,n){const{keepMounted:s=!1,...i}=t;return ex().useState("mounted")||s?h.jsx(IA.Provider,{value:s,children:h.jsx(U7,{ref:n,...i})}):null}),PA=_.createContext(void 0);function B7(){const e=_.useContext(PA);if(e===void 0)throw new Error(yn(71));return e}const F7=_.createContext(void 0);function DA(){return _.useContext(F7)?.direction??"ltr"}const H7=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:i,rects:a,platform:l,elements:f,middlewareData:d}=t,{element:p,padding:g=0,offsetParent:y="real"}=ao(e,t)||{};if(p==null)return{};const b=cA(g),x={x:n,y:s},S=ox(i),w=sx(S),T=await l.getDimensions(p),C=S==="y",O=C?"top":"left",N=C?"bottom":"right",R=C?"clientHeight":"clientWidth",M=a.reference[w]+a.reference[S]-x[S]-a.floating[w],z=x[S]-a.reference[S],j=y==="real"?await l.getOffsetParent?.(p):f.floating;let A=f.floating[R]||a.floating[w];(!A||!await l.isElement?.(j))&&(A=f.floating[R]||a.floating[w]);const P=M/2-z/2,Q=A/2-T[w]/2-1,B=Math.min(b[O],Q),U=Math.min(b[N],Q),Z=B,K=A-T[w]-U,ee=A/2-T[w]/2+P,D=Pv(Z,ee,K),G=!d.arrow&&Si(i)!=null&&ee!==D&&a.reference[w]/2-(ee<Z?B:U)-T[w]/2<0,q=G?ee<Z?ee-Z:ee-K:0;return{[S]:x[S]+q,data:{[S]:D,centerOffset:ee-D-q,...G&&{alignmentOffset:q}},reset:G}}}),q7=(e,t)=>({...H7(e),options:[e,t]}),V7={name:"hide",async fn(e){const{width:t,height:n,x:s,y:i}=e.rects.reference,a=t===0&&n===0&&s===0&&i===0;return{data:{referenceHidden:(await t7().fn(e)).data?.referenceHidden||a}}}},uh={sideX:"left",sideY:"top"},K7={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:s},elements:{floating:i},platform:a,strategy:l,placement:f}=e,d=un(i),p=d.getComputedStyle(i);if(!(p.transitionDuration!=="0s"&&p.transitionDuration!==""))return{x:t,y:n,data:uh};const y=await a.getOffsetParent?.(i);let b={width:0,height:0};if(l==="fixed"&&d?.visualViewport)b={width:d.visualViewport.width,height:d.visualViewport.height};else if(y===d){const O=Rt(i);b={width:O.documentElement.clientWidth,height:O.documentElement.clientHeight}}else await a.isElement?.(y)&&(b=await a.getDimensions(y));const x=Zn(f);let S=t,w=n;x==="left"&&(S=b.width-(t+s.width)),x==="top"&&(w=b.height-(n+s.height));const T=x==="left"?"right":uh.sideX,C=x==="top"?"bottom":uh.sideY;return{x:S,y:w,data:{sideX:T,sideY:C}}}};function zA(e,t,n){const s=e==="inline-start"||e==="inline-end";return{top:"top",right:s?n?"inline-start":"inline-end":"right",bottom:"bottom",left:s?n?"inline-end":"inline-start":"left"}[t]}function NC(e,t,n){const{rects:s,placement:i}=e;return{side:zA(t,Zn(i),n),align:Si(i)||"center",anchor:{width:s.reference.width,height:s.reference.height},positioner:{width:s.floating.width,height:s.floating.height}}}function LA(e){const{anchor:t,positionMethod:n="absolute",side:s="bottom",sideOffset:i=0,align:a="center",alignOffset:l=0,collisionBoundary:f,collisionPadding:d=5,sticky:p=!1,arrowPadding:g=5,disableAnchorTracking:y=!1,keepMounted:b=!1,floatingRootContext:x,mounted:S,collisionAvoidance:w,shiftCrossAxis:T=!1,nodeId:C,adaptiveOrigin:O,lazyFlip:N=!1,externalTree:R}=e,[M,z]=_.useState(null);!S&&M!==null&&z(null);const j=w.side||"flip",A=w.align||"flip",P=w.fallbackAxisSide||"end",Q=typeof t=="function"?t:void 0,B=Ae(Q),U=Q?B:t,Z=Jo(t),ee=DA()==="rtl",D=M||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":ee?"left":"right","inline-start":ee?"right":"left"}[s],G=a==="center"?D:`${D}-${a}`;let q=d;const V=1,L=s==="bottom"?V:0,I=s==="top"?V:0,H=s==="right"?V:0,W=s==="left"?V:0;typeof q=="number"?q={top:q+L,right:q+W,bottom:q+I,left:q+H}:q&&(q={top:(q.top||0)+L,right:(q.right||0)+W,bottom:(q.bottom||0)+I,left:(q.left||0)+H});const Y={boundary:f==="clipping-ancestors"?"clippingAncestors":f,padding:q},ae=_.useRef(null),se=Jo(i),fe=Jo(l),Oe=[XK(ot=>{const Wt=NC(ot,s,ee),vn=typeof se.current=="function"?se.current(Wt):se.current,kt=typeof fe.current=="function"?fe.current(Wt):fe.current;return{mainAxis:vn,crossAxis:kt,alignmentAxis:kt}},[typeof i!="function"?i:0,typeof l!="function"?l:0,ee,s])],_e=A==="none"&&j!=="shift",re=!_e&&(p||T||j==="shift"),he=j==="none"?null:JK({...Y,padding:{top:q.top+V,right:q.right+V,bottom:q.bottom+V,left:q.left+V},mainAxis:!T&&j==="flip",crossAxis:A==="flip"?"alignment":!1,fallbackAxisSideDirection:P}),ie=_e?null:QK(ot=>{const Wt=Rt(ot.elements.floating).documentElement;return{...Y,rootBoundary:T?{x:0,y:0,width:Wt.clientWidth,height:Wt.clientHeight}:void 0,mainAxis:A!=="none",crossAxis:re,limiter:p||T?void 0:WK(vn=>{if(!ae.current)return{};const{width:kt,height:Cn}=ae.current.getBoundingClientRect(),er=Fr(Zn(vn.placement)),An=er==="y"?kt:Cn,as=er==="y"?q.left+q.right:q.top+q.bottom;return{offset:An/2+as/2}})}},[Y,p,T,q,A]);j==="shift"||A==="shift"||a==="center"?Oe.push(ie,he):Oe.push(he,ie),Oe.push(e7({...Y,apply({elements:{floating:ot},rects:{reference:Wt},availableWidth:vn,availableHeight:kt}){const Cn=ot.style;Cn.setProperty("--available-width",`${vn}px`),Cn.setProperty("--available-height",`${kt}px`),Cn.setProperty("--anchor-width",`${Wt.width}px`),Cn.setProperty("--anchor-height",`${Wt.height}px`)}}),q7(()=>({element:ae.current||document.createElement("div"),padding:g,offsetParent:"floating"}),[g]),{name:"transformOrigin",fn(ot){const{elements:Wt,middlewareData:vn,placement:kt,rects:Cn,y:er}=ot,An=Zn(kt),as=Fr(An),cs=ae.current,_a=vn.arrow?.x||0,wi=vn.arrow?.y||0,Ei=cs?.clientWidth||0,ws=cs?.clientHeight||0,tr=_a+Ei/2,ls=wi+ws/2,fo=Math.abs(vn.shift?.y||0),ho=Cn.reference.height/2,nr=typeof i=="function"?i(NC(ot,s,ee)):i,al=fo>nr,af={top:`${tr}px calc(100% + ${nr}px)`,bottom:`${tr}px ${-nr}px`,left:`calc(100% + ${nr}px) ${ls}px`,right:`${-nr}px ${ls}px`}[An],cf=`${tr}px ${Cn.reference.y+ho-er}px`;return Wt.floating.style.setProperty("--transform-origin",re&&as==="y"&&al?cf:af),{}}},V7,O),Le(()=>{!S&&x&&x.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[S,x]);const we=_.useMemo(()=>({elementResize:!y&&typeof ResizeObserver<"u",layoutShift:!y&&typeof IntersectionObserver<"u"}),[y]),{refs:ye,elements:xe,x:ve,y:Ie,middlewareData:Ue,update:Ee,placement:Ve,context:Qe,isPositioned:Be,floatingStyles:We}=_7({rootContext:x,placement:G,middleware:Oe,strategy:n,whileElementsMounted:b?void 0:(...ot)=>wC(...ot,we),nodeId:C,externalTree:R}),{sideX:He,sideY:me}=Ue.adaptiveOrigin||uh,Te=Be?n:"fixed",qe=_.useMemo(()=>{const ot=O?{position:Te,[He]:ve,[me]:Ie}:{position:Te,...We};return Be||(ot.opacity=0),ot},[O,Te,He,ve,me,Ie,We,Be]),mt=_.useRef(null);Le(()=>{if(!S)return;const ot=Z.current,Wt=typeof ot=="function"?ot():ot,kt=(jC(Wt)?Wt.current:Wt)||null||null;kt!==mt.current&&(ye.setPositionReference(kt),mt.current=kt)},[S,ye,U,Z]),_.useEffect(()=>{if(!S)return;const ot=Z.current;typeof ot!="function"&&jC(ot)&&ot.current!==mt.current&&(ye.setPositionReference(ot.current),mt.current=ot.current)},[S,ye,U,Z]),_.useEffect(()=>{if(b&&S&&xe.domReference&&xe.floating)return wC(xe.domReference,xe.floating,Ee,we)},[b,S,xe,Ee,we]);const lt=Zn(Ve),wr=zA(s,lt,ee),Er=Si(Ve)||"center",Qt=!!Ue.hide?.referenceHidden;Le(()=>{N&&S&&Be&&z(lt)},[N,S,Be,lt]);const ut=_.useMemo(()=>({position:"absolute",top:Ue.arrow?.y,left:Ue.arrow?.x}),[Ue.arrow]),xt=Ue.arrow?.centerOffset!==0;return _.useMemo(()=>({positionerStyles:qe,arrowStyles:ut,arrowRef:ae,arrowUncentered:xt,side:wr,align:Er,physicalSide:lt,anchorHidden:Qt,refs:ye,context:Qe,isPositioned:Be,update:Ee}),[qe,ut,ae,xt,wr,Er,lt,Qt,ye,Qe,Be,Ee])}function jC(e){return e!=null&&"current"in e}function Np(e){return e==="starting"?Z9:an}const G7=_.forwardRef(function(t,n){const{render:s,className:i,anchor:a,positionMethod:l="absolute",side:f="top",align:d="center",sideOffset:p=0,alignOffset:g=0,collisionBoundary:y="clipping-ancestors",collisionPadding:b=5,arrowPadding:x=5,sticky:S=!1,disableAnchorTracking:w=!1,collisionAvoidance:T=Q9,...C}=t,O=ex(),N=L7(),R=O.useState("open"),M=O.useState("mounted"),z=O.useState("trackCursorAxis"),j=O.useState("disableHoverablePopup"),A=O.useState("floatingRootContext"),P=O.useState("instantType"),Q=O.useState("transitionStatus"),B=O.useState("hasViewport"),U=LA({anchor:a,positionMethod:l,floatingRootContext:A,mounted:M,side:f,sideOffset:p,align:d,alignOffset:g,collisionBoundary:y,collisionPadding:b,sticky:S,arrowPadding:x,disableAnchorTracking:w,keepMounted:N,collisionAvoidance:T,adaptiveOrigin:B?K7:void 0}),Z=_.useMemo(()=>{const G={};return(!R||z==="both"||j)&&(G.pointerEvents="none"),{role:"presentation",hidden:!M,style:{...U.positionerStyles,...G}}},[R,z,j,M,U.positionerStyles]),K=_.useMemo(()=>({open:R,side:U.side,align:U.align,anchorHidden:U.anchorHidden,instant:z!=="none"?"tracking-cursor":P}),[R,U.side,U.align,U.anchorHidden,z,P]),ee=_.useMemo(()=>({...K,arrowRef:U.arrowRef,arrowStyles:U.arrowStyles,arrowUncentered:U.arrowUncentered}),[K,U.arrowRef,U.arrowStyles,U.arrowUncentered]),D=zt("div",t,{state:K,props:[Z,Np(Q),C],ref:[n,O.useStateSetter("positionerElement")],stateAttributesMapping:ol});return h.jsx(PA.Provider,{value:ee,children:D})}),Z7={...ol,...ba},Y7=_.forwardRef(function(t,n){const{className:s,render:i,...a}=t,l=ex(),{side:f,align:d}=B7(),p=l.useState("open"),g=l.useState("instantType"),y=l.useState("transitionStatus"),b=l.useState("popupProps"),x=l.useState("floatingRootContext");xa({open:p,ref:l.context.popupRef,onComplete(){p&&l.context.onOpenChangeComplete?.(!0)}});const S=l.useState("disabled"),w=l.useState("closeDelay");return N7(x,{enabled:!S,closeDelay:w}),zt("div",t,{state:{open:p,side:f,align:d,instant:g,transitionStatus:y},ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],props:[b,Np(y),a],stateAttributesMapping:Z7})});function dx(e){return Kb(19)?e:e?"true":void 0}const X7=_.forwardRef(({className:e,sideOffset:t=4,children:n,...s},i)=>h.jsx($7,{children:h.jsx(G7,{sideOffset:t,children:h.jsx(Y7,{ref:i,className:ge("bg-[#1e1e1e] border border-neutral-700 rounded-md px-2.5 py-1.5 text-xs text-neutral-300 font-mono shadow-lg",e),...s,children:n})})}));X7.displayName="TooltipContent";function AC(e){return e==="online"?"#22c55e":e==="syncing"?"#f59e0b":"#ef4444"}const UA=_.forwardRef(({className:e,clients:t,positions:n,relayClientIds:s=[],serverPosition:i={x:420,y:190},relayPosition:a={x:780,y:190},viewBox:l={width:1200,height:380},totalNodes:f,onlineCount:d,offlineCount:p,...g},y)=>{const b=i.x,x=i.y,S=a.x,w=a.y,T={},C=2*Math.PI/Math.max(t.length,1);t.forEach((j,A)=>{const P=s.includes(j.id),Q=P?S:b,B=P?w:x,U=P?240:260,Z=P?130:150,K=C*A-Math.PI/2;T[j.id]={x:Q+U*Math.cos(K),y:B+Z*Math.sin(K)}});const O={};if(n)for(const j of n)O[j.clientId]={x:j.x,y:j.y};function N(j){return O[j]??T[j]??{x:600,y:190}}const R=f??t.length+2,M=d??t.filter(j=>j.status!=="offline").length,z=p??t.filter(j=>j.status==="offline").length;return h.jsxs("div",{ref:y,className:ge("relative overflow-hidden","bg-[radial-gradient(ellipse_at_35%_50%,rgba(59,130,246,0.06)_0%,transparent_50%),radial-gradient(ellipse_at_68%_50%,rgba(139,92,246,0.04)_0%,transparent_40%),#0c0c0c]","bg-[image:radial-gradient(circle_at_1px_1px,#1a1a1a_1px,transparent_0)] bg-[size:24px_24px]",e),style:{height:420},...g,children:[h.jsx("div",{className:"absolute left-0 right-0 h-px bg-[linear-gradient(90deg,transparent,rgba(59,130,246,0.3),transparent)] animate-[scanSweep_6s_ease-in-out_infinite] pointer-events-none"}),h.jsx("div",{className:"absolute top-4 left-5 z-10",children:h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Sync Topology"})}),h.jsxs("div",{className:"absolute top-4 right-5 z-10 flex items-center gap-3",children:[h.jsxs("span",{className:"font-mono text-[10px] text-neutral-600",children:[R," nodes"]}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-600",children:"·"}),h.jsxs("span",{className:"font-mono text-[10px] text-healthy",children:[M," online"]}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-600",children:"·"}),h.jsxs("span",{className:"font-mono text-[10px] text-offline",children:[z," offline"]})]}),h.jsxs("svg",{viewBox:`0 0 ${l.width} ${l.height}`,className:"w-full h-full",preserveAspectRatio:"xMidYMid meet",children:[h.jsx("ellipse",{cx:b,cy:x,rx:280,ry:160,fill:"none",stroke:"#1a1a1a",strokeWidth:.5,strokeDasharray:"6 10"}),h.jsx("ellipse",{cx:S,cy:w,rx:260,ry:140,fill:"none",stroke:"#1a1a1a",strokeWidth:.5,strokeDasharray:"6 10"}),h.jsx("line",{x1:b,y1:x,x2:S,y2:w,stroke:"#8b5cf6",strokeWidth:2,opacity:.3}),h.jsx("line",{x1:b,y1:x,x2:S,y2:w,stroke:"#8b5cf6",strokeWidth:1,strokeDasharray:"4 2",opacity:.6,children:h.jsx("animate",{attributeName:"stroke-dashoffset",from:"20",to:"0",dur:"1s",repeatCount:"indefinite"})}),h.jsxs("circle",{r:3,fill:"#8b5cf6",opacity:.8,children:[h.jsx("animateMotion",{dur:"2.5s",repeatCount:"indefinite",path:`M${b},${x} L${S},${w}`}),h.jsx("animate",{attributeName:"opacity",values:"0;0.8;0.8;0",dur:"2.5s",repeatCount:"indefinite"})]}),h.jsxs("circle",{r:3,fill:"#8b5cf6",opacity:.8,children:[h.jsx("animateMotion",{dur:"2.5s",begin:"1.25s",repeatCount:"indefinite",path:`M${S},${w} L${b},${x}`}),h.jsx("animate",{attributeName:"opacity",values:"0;0.8;0.8;0",dur:"2.5s",begin:"1.25s",repeatCount:"indefinite"})]}),h.jsx("text",{x:(b+S)/2,y:x-20,textAnchor:"middle",fill:"#8b5cf6",fontFamily:"JetBrains Mono, monospace",fontSize:8,opacity:.4,letterSpacing:2,children:"BACKBONE"}),t.map(j=>{const A=N(j.id),P=s.includes(j.id),Q=P?S:b,B=P?w:x,U=AC(j.status),Z=j.status==="syncing"?2.5:1.5;if(j.status==="offline")return h.jsx("line",{x1:Q,y1:B,x2:A.x,y2:A.y,stroke:U,strokeWidth:1,strokeDasharray:"3 6",opacity:.2},`line-${j.id}`);const K=j.status==="syncing"?"1.2s":"2.8s",ee=`${Number.parseFloat(K)/2}s`;return h.jsxs("g",{children:[h.jsx("line",{x1:Q,y1:B,x2:A.x,y2:A.y,stroke:U,strokeWidth:Z,strokeDasharray:"4 2",children:h.jsx("animate",{attributeName:"stroke-dashoffset",from:"20",to:"0",dur:"1s",repeatCount:"indefinite"})}),h.jsxs("circle",{r:2.5,fill:U,opacity:.7,children:[h.jsx("animateMotion",{dur:K,repeatCount:"indefinite",path:`M${Q},${B} L${A.x},${A.y}`}),h.jsx("animate",{attributeName:"opacity",values:"0;0.7;0.7;0",dur:K,repeatCount:"indefinite"})]}),h.jsxs("circle",{r:2,fill:U,opacity:.5,children:[h.jsx("animateMotion",{dur:K,begin:ee,repeatCount:"indefinite",path:`M${A.x},${A.y} L${Q},${B}`}),h.jsx("animate",{attributeName:"opacity",values:"0;0.5;0.5;0",dur:K,begin:ee,repeatCount:"indefinite"})]})]},`line-${j.id}`)}),h.jsxs("circle",{cx:b,cy:x,r:50,fill:"none",stroke:"#3b82f6",strokeWidth:.5,opacity:.15,children:[h.jsx("animate",{attributeName:"r",from:"32",to:"60",dur:"3s",repeatCount:"indefinite"}),h.jsx("animate",{attributeName:"opacity",from:"0.25",to:"0",dur:"3s",repeatCount:"indefinite"})]}),h.jsxs("circle",{cx:b,cy:x,r:50,fill:"none",stroke:"#3b82f6",strokeWidth:.5,opacity:.15,children:[h.jsx("animate",{attributeName:"r",from:"32",to:"60",dur:"3s",begin:"1.5s",repeatCount:"indefinite"}),h.jsx("animate",{attributeName:"opacity",from:"0.25",to:"0",dur:"3s",begin:"1.5s",repeatCount:"indefinite"})]}),h.jsx("circle",{cx:b,cy:x,r:32,fill:"#0c0c0c",stroke:"#3b82f6",strokeWidth:2,style:{filter:"drop-shadow(0 0 12px rgba(59,130,246,0.4))"}}),h.jsx("circle",{cx:b,cy:x,r:16,fill:"rgba(59,130,246,0.12)",stroke:"#3b82f6",strokeWidth:.8}),h.jsx("circle",{cx:b,cy:x,r:6,fill:"#3b82f6"}),h.jsx("text",{x:b,y:x+48,textAnchor:"middle",fill:"#444",fontFamily:"JetBrains Mono, monospace",fontSize:9,letterSpacing:2.5,children:"SERVER"}),h.jsxs("circle",{cx:S,cy:w,r:40,fill:"none",stroke:"#8b5cf6",strokeWidth:.5,opacity:.15,children:[h.jsx("animate",{attributeName:"r",from:"26",to:"48",dur:"3.5s",repeatCount:"indefinite"}),h.jsx("animate",{attributeName:"opacity",from:"0.2",to:"0",dur:"3.5s",repeatCount:"indefinite"})]}),h.jsx("circle",{cx:S,cy:w,r:26,fill:"#0c0c0c",stroke:"#8b5cf6",strokeWidth:2,style:{filter:"drop-shadow(0 0 10px rgba(139,92,246,0.35))"}}),h.jsx("circle",{cx:S,cy:w,r:13,fill:"rgba(139,92,246,0.12)",stroke:"#8b5cf6",strokeWidth:.8}),h.jsx("circle",{cx:S,cy:w,r:5,fill:"#8b5cf6"}),h.jsx("text",{x:S,y:w+42,textAnchor:"middle",fill:"#444",fontFamily:"JetBrains Mono, monospace",fontSize:9,letterSpacing:2.5,children:"RELAY"}),t.map(j=>{const A=N(j.id),P=AC(j.status),Q=j.status==="offline"?.25:1,B=j.actor.replace("user-","").replace("svc-",""),U=s.includes(j.id);return h.jsxs("g",{opacity:Q,children:[h.jsx("circle",{cx:A.x,cy:A.y,r:20,fill:"#0c0c0c",stroke:P,strokeWidth:1.5}),h.jsx("circle",{cx:A.x,cy:A.y,r:5,fill:P}),h.jsx("text",{x:A.x,y:A.y+32,textAnchor:"middle",fill:"#555",fontFamily:"JetBrains Mono, monospace",fontSize:9,children:B}),h.jsxs("text",{x:A.x,y:A.y+42,textAnchor:"middle",fill:"#333",fontFamily:"JetBrains Mono, monospace",fontSize:7,children:[j.type,U?" · relay":""]})]},`node-${j.id}`)})]})]})});UA.displayName="TopologyHero";let kC=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.indeterminate="data-indeterminate",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});function $A(e){return _.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[kC.checked]:""}:{[kC.unchecked]:""}},...bi}),[e.indeterminate])}const Q7=_.createContext({disabled:!1});function W7(){return _.useContext(Q7)}const J7=_.createContext(void 0);function eG(e=!0){const t=_.useContext(J7);if(t===void 0&&!e)throw new Error(yn(3));return t}const BA=_.createContext(void 0);function tG(){const e=_.useContext(BA);if(e===void 0)throw new Error(yn(14));return e}const nG="data-parent",rG=_.forwardRef(function(t,n){const{checked:s,className:i,defaultChecked:a=!1,disabled:l=!1,id:f,indeterminate:d=!1,inputRef:p,name:g,onCheckedChange:y,parent:b=!1,readOnly:x=!1,render:S,required:w=!1,uncheckedValue:T,value:C,nativeButton:O=!1,...N}=t,{clearErrors:R}=el(),{disabled:M,name:z,setDirty:j,setFilled:A,setFocused:P,setTouched:Q,state:B,validationMode:U,validityData:Z,shouldValidateOnChange:K,validation:ee}=xi(),D=W7(),{labelId:G,controlId:q,registerControlId:V,getDescriptionProps:L}=lo(),I=eG(),H=I?.parent,W=H&&I.allValues,Y=M||D.disabled||I?.disabled||l,ae=z??g,se=C??ae,fe=br(),Se=br();let pe=q;W?pe=b?Se:`${H.id}-${se}`:f&&(pe=f);let Oe={};W&&(b?Oe=I.parent.getParentProps():se&&(Oe=I.parent.getChildProps(se)));const _e=Ae(y),{checked:re=s,indeterminate:he=d,onCheckedChange:ie,...we}=Oe,ye=I?.value,xe=I?.setValue,ve=I?.defaultValue,Ie=_.useRef(null),Ue=zn(()=>Symbol("checkbox-control")),Ee=_.useRef(!1),{getButtonProps:Ve,buttonRef:Qe}=Jc({disabled:Y,native:O}),Be=I?.validation??ee,[We,He]=pp({controlled:se&&ye&&!b?ye.includes(se):re,default:se&&ve&&!b?ve.includes(se):a,name:"Checkbox",state:"checked"});Le(()=>{V!==jn&&(Ee.current=!0,V(Ue.current,pe))},[pe,I,V,b,Ue]),_.useEffect(()=>{const ut=Ue.current;return()=>{!Ee.current||V===jn||(Ee.current=!1,V(ut,void 0))}},[V,Ue]),Ij({enabled:!I,id:fe,commit:Be.commit,value:We,controlRef:Ie,name:ae,getValue:()=>We});const me=_.useRef(null),Te=oo(p,me,Be.inputRef);Le(()=>{me.current&&(me.current.indeterminate=he,We&&A(!0))},[We,he,A]),Uj(We,()=>{I&&!b||(R(ae),A(We),j(We!==Z.initialValue),K()?Be.commit(We):Be.commit(We,!0))});const qe=oi({checked:We,disabled:Y,name:b?void 0:ae,id:O?void 0:pe??void 0,required:w,ref:Te,style:ae?Tj:mp,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(ut){if(ut.nativeEvent.defaultPrevented)return;const xt=ut.target.checked,ot=Yt(ii,ut.nativeEvent);if(ie?.(xt,ot),_e(xt,ot),!ot.isCanceled&&(He(xt),se&&ye&&xe&&!b)){const Wt=xt?[...ye,se]:ye.filter(vn=>vn!==se);xe(Wt,ot)}},onFocus(){Ie.current?.focus()}},C!==void 0?{value:(I?We&&C:C)||""}:an,L,I?Be.getValidationProps:Be.getInputValidationProps),mt=W?!!re:We,lt=W&&he||d;_.useEffect(()=>{if(!H||!se)return;const ut=H.disabledStatesRef.current;return ut.set(se,Y),()=>{ut.delete(se)}},[H,Y,se]);const wr=_.useMemo(()=>({...B,checked:mt,disabled:Y,readOnly:x,required:w,indeterminate:lt}),[B,mt,Y,x,w,lt]),Er=$A(wr),Qt=zt("span",t,{state:wr,ref:[Qe,Ie,n,I?.registerControlRef],props:[{id:O?pe??void 0:fe,role:"checkbox","aria-checked":he?"mixed":We,"aria-readonly":x||void 0,"aria-required":w||void 0,"aria-labelledby":G,[nG]:b?"":void 0,onFocus(){P(!0)},onBlur(){const ut=me.current;ut&&(Q(!0),P(!1),U==="onBlur"&&Be.commit(I?ye:ut.checked))},onClick(ut){x||Y||(ut.preventDefault(),me.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:ut.shiftKey,ctrlKey:ut.ctrlKey,altKey:ut.altKey,metaKey:ut.metaKey})))}},L,Be.getValidationProps,N,we,Ve],stateAttributesMapping:Er});return h.jsxs(BA.Provider,{value:wr,children:[Qt,!We&&!I&&ae&&!b&&T!==void 0&&h.jsx("input",{type:"hidden",name:ae,value:T}),h.jsx("input",{...qe})]})}),sG=_.forwardRef(function(t,n){const{render:s,className:i,keepMounted:a=!1,...l}=t,f=tG(),d=f.checked||f.indeterminate,{mounted:p,transitionStatus:g,setMounted:y}=Rp(d),b=_.useRef(null),x={...f,transitionStatus:g};xa({open:d,ref:b,onComplete(){d||y(!1)}});const S=$A(f),w=_.useMemo(()=>({...S,...ba,...bi}),[S]),T=a||p,C=zt("span",t,{ref:[n,b],state:x,stateAttributesMapping:w,props:l});return T?C:null}),Uv=_.forwardRef(({className:e,label:t,...n},s)=>{const i=h.jsx(rG,{ref:s,className:ge("w-[15px] h-[15px] border-[1.5px] border-neutral-700 rounded-full flex items-center justify-center cursor-pointer transition-all duration-200","data-[checked]:bg-healthy data-[checked]:border-healthy data-[checked]:shadow-[0_0_6px_rgba(34,197,94,0.3)]",e),...n,children:h.jsx(sG,{className:"flex items-center justify-center text-white",children:h.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M1.5 4L3.25 5.75L6.5 2.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})});return t?h.jsxs("span",{className:"inline-flex items-center gap-2 cursor-pointer font-mono text-[11px] text-neutral-400",children:[i,h.jsx("span",{children:t})]}):i});Uv.displayName="Checkbox";const oG=_.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function iG(e=!1){const t=_.useContext(oG);if(!t&&!e)throw new Error(yn(86));return t}const aG=function(t){const n=br(),[s,i]=_.useState(t.initialControlId===void 0?n:t.initialControlId),[a,l]=_.useState(void 0),[f,d]=_.useState([]),p=zn(()=>new Map),{messageIds:g}=lo(),y=Ae((S,w)=>{const T=p.current;if(w===void 0){T.delete(S);return}T.set(S,w),i(C=>{if(T.size===0)return;let O;for(const N of T.values()){if(C!==void 0&&N===C)return C;O===void 0&&(O=N)}return O})}),b=_.useCallback(S=>oi({"aria-describedby":g.concat(f).join(" ")||void 0},S),[g,f]),x=_.useMemo(()=>({controlId:s,registerControlId:y,labelId:a,setLabelId:l,messageIds:f,setMessageIds:d,getDescriptionProps:b}),[s,y,a,l,f,d,b]);return h.jsx(Pj.Provider,{value:x,children:t.children})},fh=Object.keys(xp);function cG(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(const n of fh)n!=="valid"&&(n==="valueMissing"&&(t=e[n]),e[n]&&(t=!1));return t}function lG(e){const{formRef:t,clearErrors:n}=el(),{setValidityData:s,validate:i,validityData:a,validationDebounceTime:l,invalid:f,markedDirtyRef:d,state:p,name:g,shouldValidateOnChange:y}=e,{controlId:b,getDescriptionProps:x}=lo(),S=ns(),w=_.useRef(null),T=Ae(async(N,R=!1)=>{const M=w.current;if(!M)return;if(R){if(p.valid!==!1)return;const Z=M.validity;if(!Z.valueMissing){const ee={value:N,state:{...xp,valid:!0},error:"",errors:[],initialValue:a.initialValue};if(M.setCustomValidity(""),b){const D=t.current.fields.get(b);D&&t.current.fields.set(b,{...D,...kv(ee,!1)})}s(ee);return}const K=fh.reduce((ee,D)=>(ee[D]=Z[D],ee),{});if(!K.valid&&!cG(K))return}function z(Z){const K=fh.reduce((D,G)=>(D[G]=Z.validity[G],D),{});let ee=!1;for(const D of fh)if(D!=="valid"){if(D==="valueMissing"&&K[D])ee=!0;else if(K[D])return K}return ee&&!d.current&&(K.valid=!0,K.valueMissing=!1),K}S.clear();let j=null,A=[];const P=z(M);let Q;const B=y();if(M.validationMessage&&!B)Q=M.validationMessage,A=[M.validationMessage];else{const Z=Array.from(t.current.fields.values()).reduce((ee,D)=>(D.name&&(ee[D.name]=D.getValue()),ee),{}),K=i(N,Z);typeof K=="object"&&K!==null&&"then"in K?j=await K:j=K,j!==null?(P.valid=!1,P.customError=!0,Array.isArray(j)?(A=j,M.setCustomValidity(j.join(`
|
|
75
|
-
`))):j&&(A=[j],M.setCustomValidity(j))):B&&(M.setCustomValidity(""),P.customError=!1,M.validationMessage?(Q=M.validationMessage,A=[M.validationMessage]):M.validity.valid&&!P.valid&&(P.valid=!0))}const U={value:N,state:P,error:Q??(Array.isArray(j)?j[0]:j??""),errors:A,initialValue:a.initialValue};if(b){const Z=t.current.fields.get(b);Z&&t.current.fields.set(b,{...Z,...kv(U,f)})}s(U)}),C=_.useCallback((N={})=>oi(x,p.valid===!1?{"aria-invalid":!0}:an,N),[x,p.valid]),O=_.useCallback((N={})=>oi({onChange(R){if(R.nativeEvent.defaultPrevented)return;if(n(g),!y()){T(R.currentTarget.value,!0);return}if(f)return;const M=R.currentTarget;if(M.value===""){T(M.value);return}S.clear(),l?S.start(l,()=>{T(M.value)}):T(M.value)}},C(N)),[C,n,g,S,T,f,l,y]);return _.useMemo(()=>({getValidationProps:C,getInputValidationProps:O,inputRef:w,commit:T}),[C,O,T])}const uG=_.forwardRef(function(t,n){const{errors:s,validationMode:i,submitAttemptedRef:a}=el(),{render:l,className:f,validate:d,validationDebounceTime:p=0,validationMode:g=i,name:y,disabled:b=!1,invalid:x,dirty:S,touched:w,actionsRef:T,...C}=t,{disabled:O}=iG(),N=Ae(d||(()=>null)),R=O||b,[M,z]=_.useState(!1),[j,A]=_.useState(!1),[P,Q]=_.useState(!1),[B,U]=_.useState(!1),Z=S??j,K=w??M,ee=_.useRef(!1),D=Ae(Se=>{S===void 0&&(Se&&(ee.current=!0),A(Se))}),G=Ae(Se=>{w===void 0&&z(Se)}),q=Ae(()=>g==="onChange"||g==="onSubmit"&&a.current),V=!!(x||y&&{}.hasOwnProperty.call(s,y)&&s[y]!==void 0),[L,I]=_.useState({state:xp,error:"",errors:[],value:null,initialValue:null}),H=!V&&L.state.valid,W=_.useMemo(()=>({disabled:R,touched:K,dirty:Z,valid:H,filled:P,focused:B}),[R,K,Z,H,P,B]),Y=lG({setValidityData:I,validate:N,validityData:L,validationDebounceTime:p,invalid:V,markedDirtyRef:ee,state:W,name:y,shouldValidateOnChange:q}),ae=_.useCallback(()=>{ee.current=!0,Y.commit(L.value)},[Y,L]);_.useImperativeHandle(T,()=>({validate:ae}),[ae]);const se=_.useMemo(()=>({invalid:V,name:y,validityData:L,setValidityData:I,disabled:R,touched:K,setTouched:G,dirty:Z,setDirty:D,filled:P,setFilled:Q,focused:B,setFocused:U,validate:N,validationMode:g,validationDebounceTime:p,shouldValidateOnChange:q,state:W,markedDirtyRef:ee,validation:Y}),[V,y,L,R,K,G,Z,D,P,Q,B,U,N,g,p,q,W,Y]),fe=zt("div",t,{ref:n,state:W,props:C,stateAttributesMapping:bi});return h.jsx(Mj.Provider,{value:se,children:fe})}),fG=_.forwardRef(function(t,n){return h.jsx(aG,{children:h.jsx(uG,{...t,ref:n})})}),dG=_.forwardRef(function(t,n){const{render:s,className:i,id:a,nativeLabel:l=!0,...f}=t,d=xi(!1),{controlId:p,setLabelId:g,labelId:y}=lo(),b=br(a),x=_.useRef(null),S=Ae(T=>{if(Ur(T.nativeEvent)?.closest("button,input,select,textarea")||(!T.defaultPrevented&&T.detail>1&&T.preventDefault(),l||!p))return;const O=Rt(T.currentTarget).getElementById(p);Zt(O)&&O.focus({focusVisible:!0})});return Le(()=>(b&&g(b),()=>{g(void 0)}),[b,g]),zt("label",t,{ref:[n,x],state:d.state,props:[{id:y},l?{htmlFor:p??void 0,onMouseDown:S}:{onClick:S,onPointerDown(T){T.preventDefault()}},f],stateAttributesMapping:bi})}),hG={...bi,...ba},pG=_.forwardRef(function(t,n){const{render:s,id:i,className:a,match:l,...f}=t,d=br(i),{validityData:p,state:g,name:y}=xi(!1),{setMessageIds:b}=lo(),{errors:x}=el(),S=y?x[y]:null;let w=!1;S||l===!0?w=!0:l?w=!!p.state[l]:w=p.state.valid===!1;const{mounted:T,transitionStatus:C,setMounted:O}=Rp(w);Le(()=>{if(!(!w||!d))return b(U=>U.concat(d)),()=>{b(U=>U.filter(Z=>Z!==d))}},[w,d,b]);const N=_.useRef(null),[R,M]=_.useState(null),[z,j]=_.useState(null),A=S||(p.errors.length>1?h.jsx("ul",{children:p.errors.map(U=>h.jsx("li",{children:U},U))}):p.error);let P=p.error;S!=null?P=Array.isArray(S)?JSON.stringify(S):S:p.errors.length>1&&(P=JSON.stringify(p.errors)),w&&P!==z&&(j(P),M(A)),xa({open:w,ref:N,onComplete(){w||O(!1)}});const Q={...g,transitionStatus:C},B=zt("div",t,{ref:[n,N],state:Q,props:[{id:d,children:w?A:R},f],stateAttributesMapping:hG,enabled:T});return T?B:null}),mG=_.forwardRef(function(t,n){const{render:s,id:i,className:a,...l}=t,f=br(i),d=xi(!1),{setMessageIds:p}=lo();return Le(()=>{if(f)return p(y=>y.concat(f)),()=>{p(y=>y.filter(b=>b!==f))}},[f,p]),zt("p",t,{ref:n,state:d.state,props:[{id:f},l],stateAttributesMapping:bi})}),ms=fG,es=_.forwardRef(({className:e,...t},n)=>h.jsx(dG,{ref:n,className:ge("font-mono text-[9px] text-neutral-500 uppercase tracking-wider block mb-1.5",e),...t}));es.displayName="FieldLabel";const pc=_.forwardRef(({className:e,...t},n)=>h.jsx(mG,{ref:n,className:ge("font-mono text-[9px] text-neutral-600 mt-0.5",e),...t}));pc.displayName="FieldDescription";const gG=_.forwardRef(({className:e,...t},n)=>h.jsx(pG,{ref:n,className:ge("font-mono text-[10px] text-offline mt-1",e),...t}));gG.displayName="FieldError";const yG=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge(e),...t}));yG.displayName="FieldContent";const vG=_.createContext(null),bG=_.createContext(null);function Wu(){const e=_.useContext(vG);if(e===null)throw new Error(yn(60));return e}function FA(){const e=_.useContext(bG);if(e===null)throw new Error(yn(61));return e}function $c(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function xG(e,t,n){return!e||e.length===0?!1:e.some(s=>s===void 0?!1:$c(t,s,n))}function zy(e,t,n){return!e||e.length===0?-1:e.findIndex(s=>s===void 0?!1:$c(s,t,n))}function SG(e,t,n){return e.filter(s=>!$c(t,s,n))}function OC(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function _G(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function wG(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(_G(e)){for(const t of e)for(const n of t.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(const t of e)if(t&&t.value==null&&t.label!=null)return!0;return!1}function EG(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?OC(e.value):OC(e)}const it={id:Pe(e=>e.id),modal:Pe(e=>e.modal),multiple:Pe(e=>e.multiple),items:Pe(e=>e.items),itemToStringLabel:Pe(e=>e.itemToStringLabel),itemToStringValue:Pe(e=>e.itemToStringValue),isItemEqualToValue:Pe(e=>e.isItemEqualToValue),value:Pe(e=>e.value),hasSelectedValue:Pe(e=>{const{value:t,multiple:n,itemToStringValue:s}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:EG(t,s)!==""}),hasNullItemLabel:Pe((e,t)=>t?wG(e.items):!1),open:Pe(e=>e.open),mounted:Pe(e=>e.mounted),forceMount:Pe(e=>e.forceMount),transitionStatus:Pe(e=>e.transitionStatus),openMethod:Pe(e=>e.openMethod),activeIndex:Pe(e=>e.activeIndex),selectedIndex:Pe(e=>e.selectedIndex),isActive:Pe((e,t)=>e.activeIndex===t),isSelected:Pe((e,t,n)=>{const s=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(a=>$c(n,a,s)):e.selectedIndex===t&&e.selectedIndex!==null?!0:$c(n,i,s)}),isSelectedByFocus:Pe((e,t)=>e.selectedIndex===t),popupProps:Pe(e=>e.popupProps),triggerProps:Pe(e=>e.triggerProps),triggerElement:Pe(e=>e.triggerElement),positionerElement:Pe(e=>e.positionerElement),listElement:Pe(e=>e.listElement),scrollUpArrowVisible:Pe(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Pe(e=>e.scrollDownArrowVisible),hasScrollArrows:Pe(e=>e.hasScrollArrows)};function TG(e){const t=_.useRef(""),n=_.useCallback(i=>{i.defaultPrevented||(t.current=i.pointerType,e(i,i.pointerType))},[e]);return{onClick:_.useCallback(i=>{if(i.detail===0){e(i,"keyboard");return}"pointerType"in i?e(i,i.pointerType):e(i,t.current),t.current=""},[e]),onPointerDown:n}}function CG(e){const[t,n]=_.useState(null),s=Ae((f,d)=>{e||n(d||(rA?"touch":""))}),i=_.useCallback(()=>{n(null)},[]),{onClick:a,onPointerDown:l}=TG(s);return _.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:a,onPointerDown:l}}),[t,i,a,l])}function RG(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),s=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||s.content!=="none"))return t;const a=parseFloat(n.width)||0,l=parseFloat(n.height)||0,f=parseFloat(s.width)||0,d=parseFloat(s.height)||0,p=Math.max(t.width,a,f),g=Math.max(t.height,l,d),y=p-t.width,b=g-t.height;return{left:t.left-y/2,right:t.right+y/2,top:t.top-b/2,bottom:t.bottom+b/2}}const qd=2,NG=400,MC=200,jG={...z7,...bi,value:()=>null},AG=_.forwardRef(function(t,n){const{render:s,className:i,id:a,disabled:l=!1,nativeButton:f=!0,...d}=t,{setTouched:p,setFocused:g,validationMode:y,state:b,disabled:x}=xi(),{labelId:S}=lo(),{store:w,setOpen:T,selectionRef:C,validation:O,readOnly:N,required:R,alignItemWithTriggerActiveRef:M,disabled:z,keyboardActiveRef:j}=Wu(),A=x||z||l,P=at(w,it.open),Q=at(w,it.value),B=at(w,it.triggerProps),U=at(w,it.positionerElement),Z=at(w,it.listElement),K=at(w,it.id),ee=at(w,it.hasSelectedValue),D=!ee&&P,G=at(w,it.hasNullItemLabel,D),q=a??K;Dj({id:q});const V=Jo(U),L=_.useRef(null),{getButtonProps:I,buttonRef:H}=Jc({disabled:A,native:f}),W=Ae(re=>{w.set("triggerElement",re)}),Y=oo(n,L,H,W),ae=ns(),se=ns(),fe=ns(),Se=ns();_.useEffect(()=>{if(P)return!(ee||G)?fe.start(NG,()=>{C.current.allowUnselectedMouseUp=!0,C.current.allowSelectedMouseUp=!0}):Se.start(MC,()=>{C.current.allowUnselectedMouseUp=!0,fe.start(MC,()=>{C.current.allowSelectedMouseUp=!0})}),()=>{fe.clear(),Se.clear()};C.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},se.clear()},[P,ee,G,C,se,fe,Se]);const pe=_.useMemo(()=>Z?.id??Bh(U)?.id,[Z,U]),Oe=oi(B,{id:q,role:"combobox","aria-expanded":P?"true":"false","aria-haspopup":"listbox","aria-controls":P?pe:void 0,"aria-labelledby":S,"aria-readonly":N||void 0,"aria-required":R||void 0,tabIndex:A?-1:0,ref:Y,onFocus(re){g(!0),P&&M.current&&T(!1,Yt(ii,re.nativeEvent)),ae.start(0,()=>{w.set("forceMount",!0)})},onBlur(re){Ot(U,re.relatedTarget)||(p(!0),g(!1),y==="onBlur"&&O.commit(Q))},onPointerMove(){j.current=!1},onKeyDown(){j.current=!0},onMouseDown(re){if(P)return;const he=Rt(re.currentTarget);function ie(we){if(!L.current)return;const ye=we.target;if(Ot(L.current,ye)||Ot(V.current,ye)||ye===L.current)return;const xe=RG(L.current);we.clientX>=xe.left-qd&&we.clientX<=xe.right+qd&&we.clientY>=xe.top-qd&&we.clientY<=xe.bottom+qd||T(!1,Yt(b8,we))}se.start(0,()=>{he.addEventListener("mouseup",ie,{once:!0})})}},O.getValidationProps,d,I);Oe.role="combobox";const _e={...b,open:P,disabled:A,value:Q,readOnly:N,placeholder:!ee};return zt("button",t,{ref:[n,L],state:_e,stateAttributesMapping:jG,props:Oe})}),kG=_.createContext(void 0),OG=_.forwardRef(function(t,n){const{store:s}=Wu(),i=at(s,it.mounted),a=at(s,it.forceMount);return i||a?h.jsx(kG.Provider,{value:!0,children:h.jsx(wA,{ref:n,...t})}):null});let IC={},PC={},DC="";function MG(e){if(typeof document>"u")return!1;const t=Rt(e);return un(t).innerWidth-t.documentElement.clientWidth>0}function IG(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Rt(e),s=n.documentElement,i=n.body,a=vi(s)?s:i,l=a.style.overflowY,f=s.style.scrollbarGutter;s.style.scrollbarGutter="stable",a.style.overflowY="scroll";const d=a.offsetWidth;a.style.overflowY="hidden";const p=a.offsetWidth;return a.style.overflowY=l,s.style.scrollbarGutter=f,d===p}function PG(e){const t=Rt(e),n=t.documentElement,s=t.body,i=vi(n)?n:s,a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(i.style,a)}}function DG(e){const t=Rt(e),n=t.documentElement,s=t.body,i=un(n);let a=0,l=0,f=!1;const d=ys.create();if(nx&&(i.visualViewport?.scale??1)!==1)return()=>{};function p(){const b=i.getComputedStyle(n),x=i.getComputedStyle(s),T=(b.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=n.scrollTop,l=n.scrollLeft,IC={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},DC=n.style.scrollBehavior,PC={position:s.style.position,height:s.style.height,width:s.style.width,boxSizing:s.style.boxSizing,overflowY:s.style.overflowY,overflowX:s.style.overflowX,scrollBehavior:s.style.scrollBehavior};const C=n.scrollHeight>n.clientHeight,O=n.scrollWidth>n.clientWidth,N=b.overflowY==="scroll"||x.overflowY==="scroll",R=b.overflowX==="scroll"||x.overflowX==="scroll",M=Math.max(0,i.innerWidth-s.clientWidth),z=Math.max(0,i.innerHeight-s.clientHeight),j=parseFloat(x.marginTop)+parseFloat(x.marginBottom),A=parseFloat(x.marginLeft)+parseFloat(x.marginRight),P=vi(n)?n:s;if(f=IG(e),f){n.style.scrollbarGutter=T,P.style.overflowY="hidden",P.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:T,overflowY:"hidden",overflowX:"hidden"}),(C||N)&&(n.style.overflowY="scroll"),(O||R)&&(n.style.overflowX="scroll"),Object.assign(s.style,{position:"relative",height:j||z?`calc(100dvh - ${j+z}px)`:"100dvh",width:A||M?`calc(100vw - ${A+M}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),s.scrollTop=a,s.scrollLeft=l,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function g(){Object.assign(n.style,IC),Object.assign(s.style,PC),f||(n.scrollTop=a,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=DC)}function y(){g(),d.request(p)}return p(),i.addEventListener("resize",y),()=>{d.cancel(),g(),typeof i.removeEventListener=="function"&&i.removeEventListener("resize",y)}}class zG{lockCount=0;restore=null;timeoutLock=ai.create();timeoutUnlock=ai.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const s=Rt(t).documentElement,i=un(s).getComputedStyle(s).overflowY;if(i==="hidden"||i==="clip"){this.restore=jn;return}const a=rA||!MG(t);this.restore=a?PG(t):DG(t)}}const LG=new zG;function HA(e=!0,t=null){Le(()=>{if(e)return LG.acquire(t)},[e,t])}const qA=_.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function UG(){return _.useContext(qA)}function VA(e){const{children:t,elementsRef:n,labelsRef:s,onMapChange:i}=e,a=Ae(i),l=_.useRef(0),f=zn(BG).current,d=zn($G).current,[p,g]=_.useState(0),y=_.useRef(p),b=Ae((C,O)=>{d.set(C,O??null),y.current+=1,g(y.current)}),x=Ae(C=>{d.delete(C),y.current+=1,g(y.current)}),S=_.useMemo(()=>{const C=new Map;return Array.from(d.keys()).filter(N=>N.isConnected).sort(FG).forEach((N,R)=>{const M=d.get(N)??{};C.set(N,{...M,index:R})}),C},[d,p]);Le(()=>{if(typeof MutationObserver!="function"||S.size===0)return;const C=new MutationObserver(O=>{const N=new Set,R=M=>N.has(M)?N.delete(M):N.add(M);O.forEach(M=>{M.removedNodes.forEach(R),M.addedNodes.forEach(R)}),N.size===0&&(y.current+=1,g(y.current))});return S.forEach((O,N)=>{N.parentElement&&C.observe(N.parentElement,{childList:!0})}),()=>{C.disconnect()}},[S]),Le(()=>{y.current===p&&(n.current.length!==S.size&&(n.current.length=S.size),s&&s.current.length!==S.size&&(s.current.length=S.size),l.current=S.size),a(S)},[a,S,n,s,p]),Le(()=>()=>{n.current=[]},[n]),Le(()=>()=>{s&&(s.current=[])},[s]);const w=Ae(C=>(f.add(C),()=>{f.delete(C)}));Le(()=>{f.forEach(C=>C(S))},[f,S]);const T=_.useMemo(()=>({register:b,unregister:x,subscribeMapChange:w,elementsRef:n,labelsRef:s,nextIndexRef:l}),[b,x,w,n,s,l]);return h.jsx(qA.Provider,{value:T,children:t})}function $G(){return new Map}function BG(){return new Set}function FG(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const KA=_.createContext(void 0);function HG(){const e=_.useContext(KA);if(!e)throw new Error(yn(59));return e}const GA=_.forwardRef(function(t,n){const{cutout:s,...i}=t;let a;if(s){const l=s?.getBoundingClientRect();a=`polygon(
|
|
76
|
-
0% 0%,
|
|
77
|
-
100% 0%,
|
|
78
|
-
100% 100%,
|
|
79
|
-
0% 100%,
|
|
80
|
-
0% 0%,
|
|
81
|
-
${l.left}px ${l.top}px,
|
|
82
|
-
${l.left}px ${l.bottom}px,
|
|
83
|
-
${l.right}px ${l.bottom}px,
|
|
84
|
-
${l.right}px ${l.top}px,
|
|
85
|
-
${l.left}px ${l.top}px
|
|
86
|
-
)`}return h.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:a}})});function Qh(e,t){e&&Object.assign(e.style,t)}const qG={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},VG={position:"fixed"},KG=_.forwardRef(function(t,n){const{anchor:s,positionMethod:i="absolute",className:a,render:l,side:f="bottom",align:d="center",sideOffset:p=0,alignOffset:g=0,collisionBoundary:y="clipping-ancestors",collisionPadding:b,arrowPadding:x=5,sticky:S=!1,disableAnchorTracking:w,alignItemWithTrigger:T=!0,collisionAvoidance:C=X9,...O}=t,{store:N,listRef:R,labelsRef:M,alignItemWithTriggerActiveRef:z,selectedItemTextRef:j,valuesRef:A,initialValueRef:P,popupRef:Q,setValue:B}=Wu(),U=FA(),Z=at(N,it.open),K=at(N,it.mounted),ee=at(N,it.modal),D=at(N,it.value),G=at(N,it.openMethod),q=at(N,it.positionerElement),V=at(N,it.triggerElement),L=at(N,it.isItemEqualToValue),I=at(N,it.transitionStatus),H=_.useRef(null),W=_.useRef(null),[Y,ae]=_.useState(T),se=K&&Y&&G!=="touch";!K&&Y!==T&&ae(T),Le(()=>{K||(it.scrollUpArrowVisible(N.state)&&N.set("scrollUpArrowVisible",!1),it.scrollDownArrowVisible(N.state)&&N.set("scrollDownArrowVisible",!1))},[N,K]),_.useImperativeHandle(z,()=>se),HA((se||ee)&&Z&&G!=="touch",V);const fe=LA({anchor:s,floatingRootContext:U,positionMethod:i,mounted:K,side:f,sideOffset:p,align:d,alignOffset:g,arrowPadding:x,collisionBoundary:y,collisionPadding:b,sticky:S,disableAnchorTracking:w??se,collisionAvoidance:C,keepMounted:!0}),Se=se?"none":fe.side,pe=se?VG:fe.positionerStyles,Oe=_.useMemo(()=>{const xe={};return Z||(xe.pointerEvents="none"),{role:"presentation",hidden:!K,style:{...pe,...xe}}},[Z,K,pe]),_e={open:Z,side:Se,align:fe.align,anchorHidden:fe.anchorHidden},re=Ae(xe=>{N.set("positionerElement",xe)}),he=zt("div",t,{ref:[n,re],state:_e,stateAttributesMapping:ol,props:[Oe,Np(I),O]}),ie=_.useRef(0),we=Ae(xe=>{if(xe.size===0&&ie.current===0||A.current.length===0)return;const ve=ie.current;if(ie.current=xe.size,xe.size===ve)return;const Ie=Yt(ii);if(ve!==0&&!N.state.multiple&&D!==null&&zy(A.current,D,L)===-1){const Ee=P.current,Qe=Ee!=null&&zy(A.current,Ee,L)!==-1?Ee:null;B(Qe,Ie),Qe===null&&(N.set("selectedIndex",null),j.current=null)}if(ve!==0&&N.state.multiple&&Array.isArray(D)){const Ue=Ve=>zy(A.current,Ve,L)!==-1,Ee=D.filter(Ve=>Ue(Ve));(Ee.length!==D.length||Ee.some(Ve=>!xG(D,Ve,L)))&&(B(Ee,Ie),Ee.length===0&&(N.set("selectedIndex",null),j.current=null))}if(Z&&se){N.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Ue={height:""};Qh(q,Ue),Qh(Q.current,Ue)}}),ye=_.useMemo(()=>({...fe,side:Se,alignItemWithTriggerActive:se,setControlledAlignItemWithTrigger:ae,scrollUpArrowRef:H,scrollDownArrowRef:W}),[fe,Se,se,ae]);return h.jsx(VA,{elementsRef:R,labelsRef:M,onMapChange:we,children:h.jsxs(KA.Provider,{value:ye,children:[K&&ee&&h.jsx(GA,{inert:dx(!Z),cutout:V}),he]})})});function ZA(e){const t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}const Vd="base-ui-disable-scrollbar",zC={className:Vd,getElement(e){return h.jsx("style",{nonce:e,href:Vd,precedence:"base-ui:low",children:`.${Vd}{scrollbar-width:none}.${Vd}::-webkit-scrollbar{display:none}`})}},GG=_.createContext(void 0);function YA(e){return _.useContext(GG)}const wc="ArrowUp",Wi="ArrowDown",Au="ArrowLeft",Ec="ArrowRight",Ju="Home",ef="End",XA=new Set([Au,Ec]),ZG=new Set([Au,Ec,Ju,ef]),QA=new Set([wc,Wi]),YG=new Set([wc,Wi,Ju,ef]),WA=new Set([...XA,...QA]),XG=new Set([...WA,Ju,ef]),JA=new Set([wc,Wi,Au,Ec,Ju,ef]),QG="Shift",WG="Control",JG="Alt",eZ="Meta",tZ=new Set([QG,WG,JG,eZ]);function nZ(e){return Zt(e)&&e.tagName==="INPUT"}function LC(e){return!!(nZ(e)&&e.selectionStart!=null||Zt(e)&&e.tagName==="TEXTAREA")}function UC(e,t,n,s){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop;const l=e.clientWidth<e.scrollWidth,f=e.clientHeight<e.scrollHeight;if(l&&s!=="vertical"){const d=$C(e,t,"left"),p=Kd(e),g=Kd(t);n==="ltr"&&(d+t.offsetWidth+g.scrollMarginRight>e.scrollLeft+e.clientWidth-p.scrollPaddingRight?i=d+t.offsetWidth+g.scrollMarginRight-e.clientWidth+p.scrollPaddingRight:d-g.scrollMarginLeft<e.scrollLeft+p.scrollPaddingLeft&&(i=d-g.scrollMarginLeft-p.scrollPaddingLeft)),n==="rtl"&&(d-g.scrollMarginRight<e.scrollLeft+p.scrollPaddingLeft?i=d-g.scrollMarginLeft-p.scrollPaddingLeft:d+t.offsetWidth+g.scrollMarginRight>e.scrollLeft+e.clientWidth-p.scrollPaddingRight&&(i=d+t.offsetWidth+g.scrollMarginRight-e.clientWidth+p.scrollPaddingRight))}if(f&&s!=="horizontal"){const d=$C(e,t,"top"),p=Kd(e),g=Kd(t);d-g.scrollMarginTop<e.scrollTop+p.scrollPaddingTop?a=d-g.scrollMarginTop-p.scrollPaddingTop:d+t.offsetHeight+g.scrollMarginBottom>e.scrollTop+e.clientHeight-p.scrollPaddingBottom&&(a=d+t.offsetHeight+g.scrollMarginBottom-e.clientHeight+p.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:"auto"})}function $C(e,t,n){const s=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[s],t.offsetParent!==e);)t=t.offsetParent;return i}function Kd(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function Ly(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const rZ=_.createContext(void 0),sZ={disableStyleElements:!1};function oZ(){return _.useContext(rZ)??sZ}const Vi=1,iZ={...ol,...ba},aZ=_.forwardRef(function(t,n){const{render:s,className:i,finalFocus:a,...l}=t,{store:f,popupRef:d,onOpenChangeComplete:p,setOpen:g,valueRef:y,selectedItemTextRef:b,keyboardActiveRef:x,multiple:S,handleScrollArrowVisibility:w,scrollHandlerRef:T,highlightItemOnHover:C}=Wu(),{side:O,align:N,alignItemWithTriggerActive:R,setControlledAlignItemWithTrigger:M,scrollDownArrowRef:z,scrollUpArrowRef:j}=HG(),A=YA()!=null,P=FA(),{nonce:Q,disableStyleElements:B}=oZ(),U=ns(),Z=at(f,it.id),K=at(f,it.open),ee=at(f,it.mounted),D=at(f,it.popupProps),G=at(f,it.transitionStatus),q=at(f,it.triggerElement),V=at(f,it.positionerElement),L=at(f,it.listElement),I=_.useRef(0),H=_.useRef(!1),W=_.useRef(0),Y=_.useRef(!1),ae=_.useRef({}),se=ix(),fe=Ae(_e=>{if(!V||!d.current||!Y.current)return;if(H.current||!R){w();return}const re=V.style.top==="0px",he=V.style.bottom==="0px",ie=V.getBoundingClientRect().height,we=Rt(V),ye=getComputedStyle(V),xe=parseFloat(ye.marginTop),ve=parseFloat(ye.marginBottom),Ie=BC(getComputedStyle(d.current)),Ue=Math.min(we.documentElement.clientHeight-xe-ve,Ie),Ee=_e.scrollTop,Ve=FC(_e);let Qe=0,Be=null,We=!1,He=!1;const me=qe=>{V.style.height=`${qe}px`},Te=(qe,mt)=>{const lt=Ly(qe,0,Ue-ie);lt>0&&me(ie+lt),_e.scrollTop=mt,Ue-(ie+lt)<=Vi&&(H.current=!0),w()};if(re){const qe=Ve-Ee,mt=ie+qe,lt=Math.min(mt,Ue);if(Qe=lt,qe<=Vi){Te(qe,Ve);return}Ue-lt>Vi?He=!0:We=!0}else if(he){const qe=Ee,mt=ie+qe,lt=Math.min(mt,Ue),wr=mt-Ue;if(Qe=lt,qe<=Vi){Te(qe,0);return}Ue-lt>Vi?Be=0:(We=!0,Ee<Ve&&(Be=Ee-(qe-wr)))}if(Qe=Math.ceil(Qe),Qe!==0&&me(Qe),He||Be!=null){const qe=FC(_e),mt=He?qe:Ly(Be,0,qe);Math.abs(_e.scrollTop-mt)>Vi&&(_e.scrollTop=mt)}(We||Qe>=Ue-Vi)&&(H.current=!0),w()});_.useImperativeHandle(T,()=>fe,[fe]),xa({open:K,ref:d,onComplete(){K&&p?.(!0)}});const Se={open:K,transitionStatus:G,side:O,align:N};Le(()=>{!V||!d.current||Object.keys(ae.current).length||(ae.current={top:V.style.top||"0",left:V.style.left||"0",right:V.style.right,height:V.style.height,bottom:V.style.bottom,minHeight:V.style.minHeight,maxHeight:V.style.maxHeight,marginTop:V.style.marginTop,marginBottom:V.style.marginBottom})},[d,V]),Le(()=>{K||R||(Y.current=!1,H.current=!1,I.current=0,W.current=0,Qh(V,ae.current))},[K,R,V,d]),Le(()=>{const _e=d.current;if(!(!K||!q||!V||!_e||f.state.transitionStatus==="ending")){if(!R){Y.current=!0,se.request(w),_e.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{const re=cZ(_e);_e.style.removeProperty("--transform-origin");try{const he=getComputedStyle(V),ie=getComputedStyle(_e),we=Rt(q),ye=un(V),xe=q.getBoundingClientRect(),ve=V.getBoundingClientRect(),Ie=xe.left,Ue=xe.height,Ee=L||_e,Ve=Ee.scrollHeight,Qe=parseFloat(ie.borderBottomWidth),Be=parseFloat(he.marginTop)||10,We=parseFloat(he.marginBottom)||10,He=parseFloat(he.minHeight)||100,me=BC(ie),Te=5,qe=5,mt=20,lt=we.documentElement.clientHeight-Be-We,wr=we.documentElement.clientWidth,Er=lt-xe.bottom+Ue,Qt=b.current,ut=y.current;let xt,ot=0,Wt=0;if(Qt&&ut){const tr=ut.getBoundingClientRect();xt=Qt.getBoundingClientRect();const ls=tr.left-Ie,fo=xt.left-ve.left,ho=tr.top-xe.top+tr.height/2,nr=xt.top-ve.top+xt.height/2;ot=ls-fo,Wt=nr-ho}const vn=Er+Wt+We+Qe;let kt=Math.min(lt,vn);const Cn=lt-Be-We,er=vn-kt,An=Math.max(Te,Ie+ot),as=wr-qe,cs=Math.max(0,An+ve.width-as);V.style.left=`${An-cs}px`,V.style.height=`${kt}px`,V.style.maxHeight="auto",V.style.marginTop=`${Be}px`,V.style.marginBottom=`${We}px`,_e.style.height="100%";const _a=Ee.scrollHeight-Ee.clientHeight,wi=er>=_a;wi&&(kt=Math.min(lt,ve.height)-(er-_a));const Ei=xe.top<mt||xe.bottom>lt-mt||kt<Math.min(Ve,He),ws=(ye.visualViewport?.scale??1)!==1&&nx;if(Ei||ws){Y.current=!0,Qh(V,ae.current),hi.flushSync(()=>M(!1));return}if(wi){const tr=Math.max(0,lt-vn);V.style.top=ve.height>=Cn?"0":`${tr}px`,V.style.height=`${kt}px`,Ee.scrollTop=Ee.scrollHeight-Ee.clientHeight,I.current=Math.max(He,kt)}else V.style.bottom="0",I.current=Math.max(He,kt),Ee.scrollTop=er;if(xt){const tr=ve.top,ls=ve.height,fo=xt.top+xt.height/2,ho=ls>0?(fo-tr)/ls*100:50,nr=Ly(ho,0,100);_e.style.setProperty("--transform-origin",`50% ${nr}%`)}(I.current===lt||kt>=me)&&(H.current=!0),w(),setTimeout(()=>{Y.current=!0})}finally{re()}})}},[f,K,V,q,y,b,d,w,R,M,se,z,j,L]),_.useEffect(()=>{if(!R||!V||!K)return;const _e=un(V);function re(he){g(!1,Yt(S8,he))}return _e.addEventListener("resize",re),()=>{_e.removeEventListener("resize",re)}},[g,R,V,K]);const pe={...L?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":S||void 0,id:`${Z}-list`},onKeyDown(_e){x.current=!0,A&&JA.has(_e.key)&&_e.stopPropagation()},onMouseMove(){x.current=!1},onPointerLeave(_e){if(!C||ZA(_e)||_e.pointerType==="touch")return;const re=_e.currentTarget;U.start(0,()=>{f.set("activeIndex",null),re.focus({preventScroll:!0})})},onScroll(_e){L||fe(_e.currentTarget)},...R&&{style:L?{height:"100%"}:qG}},Oe=zt("div",t,{ref:[n,d],state:Se,stateAttributesMapping:iZ,props:[D,pe,Np(G),{className:!L&&R?zC.className:void 0},l]});return h.jsxs(_.Fragment,{children:[!B&&zC.getElement(Q),h.jsx(EA,{context:P,modal:!1,disabled:!ee,returnFocus:a,restoreFocus:!0,children:Oe})]})});function BC(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function FC(e){return Math.max(0,e.scrollHeight-e.clientHeight)}const HC=[["transform","none"],["scale","1"],["translate","0 0"]];function cZ(e){const{style:t}=e,n={};for(const[s,i]of HC)n[s]=t.getPropertyValue(s),t.setProperty(s,i,"important");return()=>{for(const[s]of HC){const i=n[s];i?t.setProperty(s,i):t.removeProperty(s)}}}let ek=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function hx(e={}){const{label:t,metadata:n,textRef:s,indexGuessBehavior:i,index:a}=e,{register:l,unregister:f,subscribeMapChange:d,elementsRef:p,labelsRef:g,nextIndexRef:y}=UG(),b=_.useRef(-1),[x,S]=_.useState(a??(i===ek.GuessFromOrder?()=>{if(b.current===-1){const C=y.current;y.current+=1,b.current=C}return b.current}:-1)),w=_.useRef(null),T=_.useCallback(C=>{if(w.current=C,x!==-1&&C!==null&&(p.current[x]=C,g)){const O=t!==void 0;g.current[x]=O?t:s?.current?.textContent??C.textContent}},[x,p,g,t,s]);return Le(()=>{if(a!=null)return;const C=w.current;if(C)return l(C,n),()=>{f(C)}},[a,l,f,n]),Le(()=>{if(a==null)return d(C=>{const O=w.current?C.get(w.current)?.index:null;O!=null&&S(O)})},[a,d,S]),_.useMemo(()=>({ref:T,index:x}),[x,T])}const lZ=_.createContext(void 0),uZ=_.memo(_.forwardRef(function(t,n){const{render:s,className:i,value:a=null,label:l,disabled:f=!1,nativeButton:d=!1,...p}=t,g=_.useRef(null),y=hx({label:l,textRef:g,indexGuessBehavior:ek.GuessFromOrder}),{store:b,getItemProps:x,setOpen:S,setValue:w,selectionRef:T,typingRef:C,valuesRef:O,keyboardActiveRef:N,multiple:R,highlightItemOnHover:M}=Wu(),z=ns(),j=at(b,it.isActive,y.index),A=at(b,it.isSelected,y.index,a),P=at(b,it.isSelectedByFocus,y.index),Q=at(b,it.isItemEqualToValue),B=y.index,U=B!==-1,Z=_.useRef(null),K=Jo(B);Le(()=>{if(!U)return;const se=O.current;return se[B]=a,()=>{delete se[B]}},[U,B,a,O]),Le(()=>{if(!U)return;const se=b.state.value;let fe=se;R&&Array.isArray(se)&&se.length>0&&(fe=se[se.length-1]),fe!==void 0&&$c(a,fe,Q)&&b.set("selectedIndex",B)},[U,B,R,Q,b,a]);const ee={disabled:f,selected:A,highlighted:j},D=x({active:j,selected:A});D.onFocus=void 0,D.id=void 0;const G=_.useRef(null),q=_.useRef("mouse"),V=_.useRef(!1),{getButtonProps:L,buttonRef:I}=Jc({disabled:f,focusableWhenDisabled:!0,native:d});function H(se){const fe=b.state.value;if(R){const Se=Array.isArray(fe)?fe:[],pe=A?SG(Se,a,Q):[...Se,a];w(pe,Yt(Cy,se))}else w(a,Yt(Cy,se)),S(!1,Yt(Cy,se))}const W={role:"option","aria-selected":A,tabIndex:j?0:-1,onFocus(){b.set("activeIndex",B)},onMouseEnter(){!N.current&&b.state.selectedIndex===null&&M&&b.set("activeIndex",B)},onMouseMove(){M&&b.set("activeIndex",B)},onMouseLeave(se){!M||N.current||ZA(se)||z.start(0,()=>{b.state.activeIndex===B&&b.set("activeIndex",null)})},onTouchStart(){T.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(se){G.current=se.key,b.set("activeIndex",B)},onClick(se){V.current=!1,!(se.type==="keydown"&&G.current===null)&&(f||G.current===" "&&C.current||q.current!=="touch"&&!j||(G.current=null,H(se.nativeEvent)))},onPointerEnter(se){q.current=se.pointerType},onPointerDown(se){q.current=se.pointerType,V.current=!0},onMouseUp(se){if(f)return;if(V.current){V.current=!1;return}const fe=!T.current.allowSelectedMouseUp&&A,Se=!T.current.allowUnselectedMouseUp&&!A;fe||Se||q.current!=="touch"&&!j||H(se.nativeEvent)}},Y=zt("div",t,{ref:[I,n,y.ref,Z],state:ee,props:[D,W,p,L]}),ae=_.useMemo(()=>({selected:A,indexRef:K,textRef:g,selectedByFocus:P,hasRegistered:U}),[A,K,g,P,U]);return h.jsx(lZ.Provider,{value:ae,children:Y})})),fZ=_.forwardRef(({className:e,children:t,...n},s)=>h.jsx(AG,{ref:s,className:ge("inline-flex items-center justify-between bg-surface border border-border rounded-md px-3 py-1.5 font-mono text-[12px] text-foreground cursor-pointer hover:border-border-bright transition",e),...n,children:t}));fZ.displayName="SelectTrigger";const dZ=_.forwardRef(({className:e,portalProps:t,positionerProps:n,...s},i)=>h.jsx(OG,{...t,children:h.jsx(KG,{...n,children:h.jsx(aZ,{ref:i,className:ge("bg-panel border border-border rounded-md py-1 shadow-lg z-50",e),...s})})}));dZ.displayName="SelectContent";const hZ=_.forwardRef(({className:e,...t},n)=>h.jsx(uZ,{ref:n,className:ge("font-mono text-[11px] px-3 py-1.5 text-neutral-400 cursor-pointer hover:bg-white/[0.03] hover:text-white data-[highlighted]:bg-white/[0.03] data-[highlighted]:text-white outline-none",e),...t}));hZ.displayName="SelectItem";const pZ=_.forwardRef(({className:e,...t},n)=>h.jsx("textarea",{ref:n,className:ge("bg-surface border border-border rounded-md px-3 py-2 font-mono text-[12px] text-foreground outline-none w-full transition focus:border-flow placeholder:text-neutral-600 resize-none min-h-[80px]",e),...t}));pZ.displayName="Textarea";const tk=_.createContext(void 0);function mZ(e=!0){const t=_.useContext(tk);if(t===void 0&&!e)throw new Error(yn(7));return t}function nk(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:s}=Aj(),{ref:i,index:a}=hx(e),l=n===a,f=_.useRef(null),d=oo(i,f);return{compositeProps:_.useMemo(()=>({tabIndex:l?0:-1,onFocus(){s(a)},onMouseMove(){const g=f.current;if(!t||!g)return;const y=g.hasAttribute("disabled")||g.ariaDisabled==="true";!l&&!y&&g.focus()}}),[l,s,a,t]),compositeRef:d,index:a}}function gZ(e){const{render:t,className:n,state:s=an,props:i=Ru,refs:a=Ru,metadata:l,stateAttributesMapping:f,tag:d="div",...p}=e,{compositeProps:g,compositeRef:y}=nk({metadata:l});return zt(d,e,{state:s,ref:[...a,y],props:[g,...i,p],stateAttributesMapping:f})}const yZ=_.forwardRef(function(t,n){const{className:s,defaultPressed:i=!1,disabled:a=!1,form:l,onPressedChange:f,pressed:d,render:p,type:g,value:y,nativeButton:b=!0,...x}=t,S=br(y||void 0),w=mZ(),T=w?.value??[],C=w?void 0:i,O=(a||w?.disabled)??!1,[N,R]=pp({controlled:w?S!==void 0&&T.indexOf(S)>-1:d,default:C,name:"Toggle",state:"pressed"}),M=Ae((U,Z)=>{S&&w?.setGroupValue?.(S,U,Z),f?.(U,Z)}),{getButtonProps:z,buttonRef:j}=Jc({disabled:O,native:b}),A={disabled:O,pressed:N},P=[j,n],Q=[{"aria-pressed":N,onClick(U){const Z=!N,K=Yt(ii,U.nativeEvent);M(Z,K),!K.isCanceled&&R(Z)}},x,z],B=zt("button",t,{enabled:!w,state:A,ref:P,props:Q});return w?h.jsx(gZ,{tag:"button",render:p,className:s,state:A,refs:P,props:Q}):B}),Dr=_.forwardRef(({className:e,...t},n)=>h.jsx(yZ,{ref:n,className:ge("font-mono text-[10px] text-neutral-500 border border-transparent rounded-sm px-2.5 py-1 cursor-pointer transition-all hover:text-neutral-300 data-[pressed]:text-white data-[pressed]:border-border-bright data-[pressed]:bg-white/[0.03]",e),...t}));Dr.displayName="Toggle";function vZ(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const rk="data-composite-item-active",bZ=[];function xZ(e){const{itemSizes:t,cols:n=1,loopFocus:s=!0,dense:i=!1,orientation:a="both",direction:l,highlightedIndex:f,onHighlightedIndexChange:d,rootRef:p,enableHomeAndEndKeys:g=!1,stopEventPropagation:y=!1,disabledIndices:b,modifierKeys:x=bZ}=e,[S,w]=_.useState(0),T=n>1,C=_.useRef(null),O=oo(C,p),N=_.useRef([]),R=_.useRef(!1),M=f??S,z=Ae((P,Q=!1)=>{if((d??w)(P),Q){const B=N.current[P];UC(C.current,B,l,a)}}),j=Ae(P=>{if(P.size===0||R.current)return;R.current=!0;const Q=Array.from(P.keys()),B=Q.find(Z=>Z?.hasAttribute(rk))??null,U=B?Q.indexOf(B):-1;U!==-1&&z(U),UC(C.current,B,l,a)}),A=_.useMemo(()=>({"aria-orientation":a==="both"?void 0:a,ref:O,onFocus(P){!C.current||!LC(P.target)||P.target.setSelectionRange(0,P.target.value.length??0)},onKeyDown(P){const Q=g?XG:WA;if(!Q.has(P.key)||SZ(P,x)||!C.current)return;const U=l==="rtl",Z=U?Au:Ec,K={horizontal:Z,vertical:Wi,both:Z}[a],ee=U?Ec:Au,D={horizontal:ee,vertical:wc,both:ee}[a];if(LC(P.target)&&!vZ(P.target)){const W=P.target.selectionStart,Y=P.target.selectionEnd,ae=P.target.value??"";if(W==null||P.shiftKey||W!==Y||P.key!==D&&W<ae.length||P.key!==K&&W>0)return}let G=M;const q=PV(N,b),V=DV(N,b);if(T){const W=t||Array.from({length:N.current.length},()=>({width:1,height:1})),Y=LV(W,n,i),ae=Y.findIndex(fe=>fe!=null&&!pu(N,fe,b)),se=Y.reduce((fe,Se,pe)=>Se!=null&&!pu(N,Se,b)?pe:fe,-1);G=Y[zV({current:Y.map(fe=>fe?N.current[fe]:null)},{event:P,orientation:a,loopFocus:s,cols:n,disabledIndices:$V([...b||N.current.map((fe,Se)=>pu(N,Se)?Se:void 0),void 0],Y),minIndex:ae,maxIndex:se,prevIndex:UV(M>V?q:M,W,Y,n,P.key===Wi?"bl":P.key===Ec?"tr":"tl"),rtl:U})]}const L={horizontal:[Z],vertical:[Wi],both:[Z,Wi]}[a],I={horizontal:[ee],vertical:[wc],both:[ee,wc]}[a],H=T?Q:{horizontal:g?ZG:XA,vertical:g?YG:QA,both:Q}[a];g&&(P.key===Ju?G=q:P.key===ef&&(G=V)),G===M&&(L.includes(P.key)||I.includes(P.key))&&(s&&G===V&&L.includes(P.key)?G=q:s&&G===q&&I.includes(P.key)?G=V:G=fr(N,{startingIndex:G,decrement:I.includes(P.key),disabledIndices:b})),G!==M&&!ch(N,G)&&(y&&P.stopPropagation(),H.has(P.key)&&P.preventDefault(),z(G,!0),queueMicrotask(()=>{N.current[G]?.focus()}))}}),[n,i,l,b,N,g,M,T,t,s,O,x,z,a,y]);return _.useMemo(()=>({props:A,highlightedIndex:M,onHighlightedIndexChange:z,elementsRef:N,disabledIndices:b,onMapChange:j,relayKeyboardEvent:A.onKeyDown}),[A,M,z,N,b,j])}function SZ(e,t){for(const n of tZ.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function sk(e){const{render:t,className:n,refs:s=Ru,props:i=Ru,state:a=an,stateAttributesMapping:l,highlightedIndex:f,onHighlightedIndexChange:d,orientation:p,dense:g,itemSizes:y,loopFocus:b,cols:x,enableHomeAndEndKeys:S,onMapChange:w,stopEventPropagation:T=!0,rootRef:C,disabledIndices:O,modifierKeys:N,highlightItemOnHover:R=!1,tag:M="div",...z}=e,j=DA(),{props:A,highlightedIndex:P,onHighlightedIndexChange:Q,elementsRef:B,onMapChange:U,relayKeyboardEvent:Z}=xZ({itemSizes:y,cols:x,loopFocus:b,dense:g,orientation:p,highlightedIndex:f,onHighlightedIndexChange:d,rootRef:C,stopEventPropagation:T,enableHomeAndEndKeys:S,direction:j,disabledIndices:O,modifierKeys:N}),K=zt(M,e,{state:a,ref:s,props:[A,...i,z],stateAttributesMapping:l}),ee=_.useMemo(()=>({highlightedIndex:P,onHighlightedIndexChange:Q,highlightItemOnHover:R,relayKeyboardEvent:Z}),[P,Q,R,Z]);return h.jsx(jj.Provider,{value:ee,children:h.jsx(VA,{elementsRef:B,onMapChange:D=>{w?.(D),U(D)},children:K})})}let _Z=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e.multiple="data-multiple",e})({});const qC={multiple(e){return e?{[_Z.multiple]:""}:null}},wZ=_.forwardRef(function(t,n){const{defaultValue:s,disabled:i=!1,loopFocus:a=!0,onValueChange:l,orientation:f="horizontal",multiple:d=!1,value:p,className:g,render:y,...b}=t,x=YA(),S=_.useMemo(()=>{if(p===void 0)return s??[]},[p,s]),w=_.useMemo(()=>p!==void 0||s!==void 0,[p,s]),T=(x?.disabled??!1)||i,[C,O]=pp({controlled:p,default:S,name:"ToggleGroup",state:"value"}),N=Ae((A,P,Q)=>{let B;if(d?(B=C.slice(),P?B.push(A):B.splice(C.indexOf(A),1)):B=P?[A]:[],Array.isArray(B)){if(l?.(B,Q),Q.isCanceled)return;O(B)}}),R={disabled:T,multiple:d,orientation:f},M=_.useMemo(()=>({disabled:T,orientation:f,setGroupValue:N,value:C,isValueInitialized:w}),[T,f,N,C,w]),z={role:"group"},j=zt("div",t,{enabled:!!x,state:R,ref:n,props:[z,b],stateAttributesMapping:qC});return h.jsx(tk.Provider,{value:M,children:x?j:h.jsx(sk,{render:y,className:g,state:R,refs:[n],props:[z,b],stateAttributesMapping:qC,loopFocus:a,enableHomeAndEndKeys:!0})})}),dh=_.forwardRef(({className:e,...t},n)=>h.jsx(wZ,{ref:n,className:ge("flex items-center gap-0.5",e),...t}));dh.displayName="ToggleGroup";const EZ=ge(Hj({variant:"secondary",size:"sm"}),"h-7 whitespace-nowrap uppercase tracking-[0.08em] leading-none no-underline");function ok({active:e,onClick:t,children:n,className:s}){return h.jsxs("button",{type:"button",onClick:t,className:ge("font-mono text-[10px] tracking-[1.5px] uppercase bg-transparent border-none px-3.5 py-1 cursor-pointer relative transition-colors",e?"text-white":"text-neutral-500 hover:text-neutral-300",s),children:[n,e&&h.jsx("span",{className:"absolute -bottom-2.5 left-1/2 -translate-x-1/2 w-4 h-0.5 bg-flow rounded-sm shadow-[0_0_8px_rgba(59,130,246,0.5)]"})]})}function TZ({items:e,activeId:t,onItemChange:n,renderItem:s,className:i}){return h.jsx("div",{className:ge("flex items-center gap-0.5",i),children:e.map(a=>{const l=a.id===t,f=()=>n?.(a.id);return s?h.jsx("span",{children:s(a,{active:l,onClick:f})},a.id):h.jsx(ok,{active:l,onClick:f,children:a.label},a.id)})})}const CZ=gi("rounded-full inline-block flex-shrink-0",{variants:{color:{healthy:"bg-healthy",syncing:"bg-syncing",offline:"bg-offline",flow:"bg-flow",relay:"bg-relay",encrypt:"bg-encrypt",muted:"bg-neutral-500"},size:{sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-2.5 h-2.5"},glow:{true:"",false:""}},defaultVariants:{color:"healthy",size:"sm",glow:!1}}),RZ={healthy:"0 0 6px #22c55e",syncing:"0 0 6px #f59e0b",offline:"0 0 6px #ef4444",flow:"0 0 6px #3b82f6",relay:"0 0 6px #8b5cf6",encrypt:"0 0 6px #f472b6",muted:"none"};function NZ({color:e,size:t,glow:n,pulse:s,className:i}){return h.jsx("span",{className:ge(CZ({color:e,size:t,glow:n}),s&&"dot-pulse",i),style:n?{boxShadow:RZ[e??"healthy"]}:void 0})}const jZ="0.0.6-82",AZ={version:jZ},kZ=AZ.version;function OZ({label:e,className:t}){return h.jsxs("div",{className:ge("flex items-center gap-3",t),children:[h.jsx(NZ,{color:"healthy",size:"md",glow:!0}),h.jsx("span",{className:"font-display font-bold text-white text-sm tracking-tight",children:"syncular"}),e&&h.jsx("span",{className:"font-mono text-[9px] text-neutral-600 uppercase tracking-widest",children:e}),h.jsxs("span",{className:"font-mono text-[9px] text-neutral-600 tracking-wider",children:["v",kZ]})]})}function MZ({brand:e,center:t,right:n,className:s}){return h.jsxs(h.Fragment,{children:[h.jsx("div",{"aria-hidden":"true",className:"h-[42px] shrink-0"}),h.jsxs("nav",{className:ge("fixed top-0 left-0 right-0 z-100 h-[42px] border-b border-border bg-surface/88 backdrop-blur-lg flex items-center justify-between px-5",s),children:[h.jsx("div",{className:"flex items-center gap-3",children:e}),h.jsx("div",{className:"flex items-center gap-0.5",children:t}),h.jsx("div",{className:"flex items-center gap-2",children:n})]})]})}const IZ=gi("border rounded-lg p-3 font-mono text-[11px]",{variants:{variant:{default:"border-border bg-panel",destructive:"border-offline/20 bg-offline/5 text-offline"}},defaultVariants:{variant:"default"}}),In=_.forwardRef(({className:e,variant:t,...n},s)=>h.jsx("div",{ref:s,role:"alert",className:ge(IZ({variant:t,className:e})),...n}));In.displayName="Alert";const tf=_.forwardRef(({className:e,...t},n)=>h.jsx("h5",{ref:n,className:ge("font-medium text-white mb-1",e),...t}));tf.displayName="AlertTitle";const Pn=_.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:ge("text-neutral-400",e),...t}));Pn.displayName="AlertDescription";const ik=_.createContext(void 0);function il(e){const t=_.useContext(ik);if(e===!1&&t===void 0)throw new Error(yn(27));return t}const PZ={...ol,...ba},px=_.forwardRef(function(t,n){const{render:s,className:i,forceRender:a=!1,...l}=t,{store:f}=il(),d=f.useState("open"),p=f.useState("nested"),g=f.useState("mounted"),y=f.useState("transitionStatus");return zt("div",t,{state:{open:d,transitionStatus:y},ref:[f.context.backdropRef,n],stateAttributesMapping:PZ,props:[{role:"presentation",hidden:!g,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:a||!p})}),ak=_.forwardRef(function(t,n){const{render:s,className:i,id:a,...l}=t,{store:f}=il(),d=br(a);return f.useSyncedValueWithCleanup("descriptionElementId",d),zt("p",t,{ref:n,props:[{id:d},l]})});let DZ=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),zZ=(function(e){return e[e.open=Qi.open]="open",e[e.closed=Qi.closed]="closed",e[e.startingStyle=Qi.startingStyle]="startingStyle",e[e.endingStyle=Qi.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const ck=_.createContext(void 0);function LZ(){const e=_.useContext(ck);if(e===void 0)throw new Error(yn(26));return e}const UZ={...ol,...ba,nestedDialogOpen(e){return e?{[zZ.nestedDialogOpen]:""}:null}},lk=_.forwardRef(function(t,n){const{className:s,finalFocus:i,initialFocus:a,render:l,...f}=t,{store:d}=il(),p=d.useState("descriptionElementId"),g=d.useState("disablePointerDismissal"),y=d.useState("floatingRootContext"),b=d.useState("popupProps"),x=d.useState("modal"),S=d.useState("mounted"),w=d.useState("nested"),T=d.useState("nestedOpenDialogCount"),C=d.useState("open"),O=d.useState("openMethod"),N=d.useState("titleElementId"),R=d.useState("transitionStatus"),M=d.useState("role");LZ(),xa({open:C,ref:d.context.popupRef,onComplete(){C&&d.context.onOpenChangeComplete?.(!0)}});function z(B){return B==="touch"?d.context.popupRef.current:!0}const j=a===void 0?z:a,A=T>0,Q=zt("div",t,{state:{open:C,nested:w,transitionStatus:R,nestedDialogOpen:A},props:[b,{"aria-labelledby":N??void 0,"aria-describedby":p??void 0,role:M,tabIndex:-1,hidden:!S,onKeyDown(B){JA.has(B.key)&&B.stopPropagation()},style:{[DZ.nestedDialogs]:T}},f],ref:[n,d.context.popupRef,d.useStateSetter("popupElement")],stateAttributesMapping:UZ});return h.jsx(EA,{context:y,openInteractionType:O,disabled:!S,closeOnFocusOut:!g,initialFocus:j,returnFocus:i,modal:x!==!1,restoreFocus:"popup",children:Q})}),uk=_.forwardRef(function(t,n){const{keepMounted:s=!1,...i}=t,{store:a}=il(),l=a.useState("mounted"),f=a.useState("modal"),d=a.useState("open");return l||s?h.jsx(ck.Provider,{value:s,children:h.jsxs(wA,{ref:n,...i,children:[l&&f===!0&&h.jsx(GA,{ref:a.context.internalBackdropRef,inert:dx(!d)}),t.children]})}):null});function $Z(e){const{store:t,parentContext:n,actionsRef:s}=e,i=t.useState("open"),a=t.useState("disablePointerDismissal"),l=t.useState("modal"),f=t.useState("popupElement"),{openMethod:d,triggerProps:p,reset:g}=CG(i);g7(t);const{forceUnmount:y}=y7(i,t,()=>{g()}),b=Ae(Q=>{const B=Yt(Q);return B.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},B}),x=_.useCallback(()=>{t.setOpen(!1,b(x8))},[t,b]);_.useImperativeHandle(s,()=>({unmount:y,close:x}),[y,x]);const S=w7({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[w,T]=_.useState(0),C=w===0,O=O7(S),N=s7(S,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:l==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(Q){if(!t.context.outsidePressEnabledRef.current||"button"in Q&&Q.button!==0||"touches"in Q&&Q.touches.length!==1)return!1;const B=Ur(Q);if(C&&!a){const U=B;return l&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===U||t.context.backdropRef.current===U||Ot(U,f)&&!U?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:C});HA(i&&l===!0,f);const{getReferenceProps:R,getFloatingProps:M,getTriggerProps:z}=A7([O,N]);t.useContextCallback("onNestedDialogOpen",Q=>{T(Q+1)}),t.useContextCallback("onNestedDialogClose",()=>{T(0)}),_.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(w),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,w]);const j=_.useMemo(()=>R(p),[R,p]),A=_.useMemo(()=>z(p),[z,p]),P=_.useMemo(()=>M(),[M]);t.useSyncedValues({openMethod:d,activeTriggerProps:j,inactiveTriggerProps:A,popupProps:P,floatingRootContext:S,nestedOpenDialogCount:w})}const BZ={...x7,modal:Pe(e=>e.modal),nested:Pe(e=>e.nested),nestedOpenDialogCount:Pe(e=>e.nestedOpenDialogCount),disablePointerDismissal:Pe(e=>e.disablePointerDismissal),openMethod:Pe(e=>e.openMethod),descriptionElementId:Pe(e=>e.descriptionElementId),titleElementId:Pe(e=>e.titleElementId),viewportElement:Pe(e=>e.viewportElement),role:Pe(e=>e.role)};class FZ extends MA{constructor(t){super(HZ(t),{popupRef:_.createRef(),backdropRef:_.createRef(),internalBackdropRef:_.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new ux,onOpenChange:void 0,onOpenChangeComplete:void 0},BZ)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;const s={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",s);const i={open:t},a=n.trigger?.id??null;(a||t)&&(i.activeTriggerId=a,i.activeTriggerElement=n.trigger??null),this.update(i)}}function HZ(e={}){return{...b7(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function qZ(e){const{children:t,open:n,defaultOpen:s=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:l=!1,modal:f=!0,actionsRef:d,handle:p,triggerId:g,defaultTriggerId:y=null}=e,b=il(!0),x=!!b,S=zn(()=>p?.store??new FZ({open:s,openProp:n,activeTriggerId:y,triggerIdProp:g,modal:f,disablePointerDismissal:l,nested:x})).current;iV(()=>{n===void 0&&S.state.open===!1&&s===!0&&S.update({open:!0,activeTriggerId:y})}),S.useControlledProp("openProp",n),S.useControlledProp("triggerIdProp",g),S.useSyncedValues({disablePointerDismissal:l,nested:x,modal:f}),S.useContextCallback("onOpenChange",i),S.useContextCallback("onOpenChangeComplete",a);const w=S.useState("payload");$Z({store:S,actionsRef:d,parentContext:b?.store.context});const T=_.useMemo(()=>({store:S}),[S]);return h.jsx(ik.Provider,{value:T,children:typeof t=="function"?t({payload:w}):t})}const fk=_.forwardRef(function(t,n){const{render:s,className:i,id:a,...l}=t,{store:f}=il(),d=br(a);return f.useSyncedValueWithCleanup("titleElementId",d),zt("h2",t,{ref:n,props:[{id:d},l]})}),$r=qZ,VZ=_.forwardRef(({className:e,...t},n)=>h.jsx(px,{ref:n,className:ge("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm",e),...t}));VZ.displayName="DialogOverlay";const hr=_.forwardRef(({className:e,children:t,...n},s)=>h.jsxs(uk,{children:[h.jsx(px,{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm"}),h.jsx(lk,{ref:s,className:ge("fixed z-50 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-panel border border-border rounded-lg shadow-lg max-w-lg w-full p-0",e),...n,children:t})]}));hr.displayName="DialogContent";const pr=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-5 py-3 border-b border-border",e),...t}));pr.displayName="DialogHeader";const Nn=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-5 py-3 border-t border-border flex justify-end gap-2",e),...t}));Nn.displayName="DialogFooter";const mr=_.forwardRef(({className:e,...t},n)=>h.jsx(fk,{ref:n,className:ge("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));mr.displayName="DialogTitle";const KZ=_.forwardRef(({className:e,...t},n)=>h.jsx(ak,{ref:n,className:ge("font-mono text-[10px] text-neutral-500",e),...t}));KZ.displayName="DialogDescription";const mx=_.forwardRef(({className:e,page:t,totalPages:n,totalItems:s,onPageChange:i,...a},l)=>h.jsxs("div",{ref:l,className:ge("px-5 py-2.5 border-t border-border flex items-center justify-between",e),...a,children:[h.jsxs("span",{className:"font-mono text-[10px] text-neutral-600",children:[s," items · Page ",t," of ",n]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(Me,{size:"sm",variant:"default",disabled:t<=1,onClick:()=>i(t-1),children:"Prev"}),h.jsx(Me,{size:"sm",variant:"default",disabled:t>=n,onClick:()=>i(t+1),children:"Next"})]})]}));mx.displayName="Pagination";const GZ=_.forwardRef(({className:e,orientation:t="horizontal",...n},s)=>h.jsx("hr",{ref:s,"aria-orientation":t==="vertical"?"vertical":void 0,className:ge("border-none m-0",t==="horizontal"?"h-px w-full bg-border":"w-px h-4 bg-border",e),...n}));GZ.displayName="Separator";const ZZ=gi("fixed z-50 bg-panel shadow-lg overflow-auto",{variants:{side:{top:"top-0 left-0 w-full h-[400px] border-b border-border",right:"right-0 top-0 h-full w-[400px] border-l border-border",bottom:"bottom-0 left-0 w-full h-[400px] border-t border-border",left:"left-0 top-0 h-full w-[400px] border-r border-border"}},defaultVariants:{side:"right"}}),YZ=_.forwardRef(({className:e,side:t,children:n,...s},i)=>h.jsxs(uk,{children:[h.jsx(px,{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm"}),h.jsx(lk,{ref:i,className:ge(ZZ({side:t,className:e})),...s,children:n})]}));YZ.displayName="SheetContent";const XZ=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-5 py-3 border-b border-border",e),...t}));XZ.displayName="SheetHeader";const QZ=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-5 py-3 border-t border-border flex justify-end gap-2",e),...t}));QZ.displayName="SheetFooter";const WZ=_.forwardRef(({className:e,...t},n)=>h.jsx(fk,{ref:n,className:ge("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));WZ.displayName="SheetTitle";const JZ=_.forwardRef(({className:e,...t},n)=>h.jsx(ak,{ref:n,className:ge("text-sm text-neutral-400",e),...t}));JZ.displayName="SheetDescription";const eY=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("rounded-md bg-neutral-800 animate-pulse",e),...t}));eY.displayName="Skeleton";const tY=_.createContext(void 0);function gx(){const e=_.useContext(tY);if(e===void 0)throw new Error(yn(64));return e}let nY=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const dk={tabActivationDirection:e=>({[nY.activationDirection]:e})},hk=_.createContext(void 0);function rY(){const e=_.useContext(hk);if(e===void 0)throw new Error(yn(65));return e}const sY=_.forwardRef(function(t,n){const{className:s,disabled:i=!1,render:a,value:l,id:f,nativeButton:d=!0,...p}=t,{value:g,getTabPanelIdByValue:y,orientation:b}=gx(),{activateOnFocus:x,highlightedTabIndex:S,onTabActivation:w,setHighlightedTabIndex:T,tabsListElement:C}=rY(),O=br(f),N=_.useMemo(()=>({disabled:i,id:O,value:l}),[i,O,l]),{compositeProps:R,compositeRef:M,index:z}=nk({metadata:N}),j=l===g,A=_.useRef(!1);Le(()=>{if(A.current){A.current=!1;return}if(!(j&&z>-1&&S!==z))return;const V=C;if(V!=null){const L=Fo(Rt(V));if(L&&Ot(V,L))return}i||T(z)},[j,z,S,T,i,C]);const{getButtonProps:P,buttonRef:Q}=Jc({disabled:i,native:d,focusableWhenDisabled:!0}),B=y(l),U=_.useRef(!1),Z=_.useRef(!1);function K(V){j||i||w(l,Yt(ii,V.nativeEvent,void 0,{activationDirection:"none"}))}function ee(V){j||(z>-1&&!i&&T(z),!i&&x&&(!U.current||U.current&&Z.current)&&w(l,Yt(ii,V.nativeEvent,void 0,{activationDirection:"none"})))}function D(V){if(j||i)return;U.current=!0;function L(){U.current=!1,Z.current=!1}(!V.button||V.button===0)&&(Z.current=!0,Rt(V.currentTarget).addEventListener("pointerup",L,{once:!0}))}return zt("button",t,{state:{disabled:i,active:j,orientation:b},ref:[n,Q,M],props:[R,{role:"tab","aria-controls":B,"aria-selected":j,id:O,onClick:K,onFocus:ee,onPointerDown:D,[rk]:j?"":void 0,onKeyDownCapture(){A.current=!0}},p,P]})});let oY=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e})({});const iY={...dk,...ba},aY=_.forwardRef(function(t,n){const{className:s,value:i,render:a,keepMounted:l=!1,...f}=t,{value:d,getTabIdByPanelValue:p,orientation:g,tabActivationDirection:y,registerMountedTabPanel:b,unregisterMountedTabPanel:x}=gx(),S=br(),w=_.useMemo(()=>({id:S,value:i}),[S,i]),{ref:T,index:C}=hx({metadata:w}),O=i===d,{mounted:N,transitionStatus:R,setMounted:M}=Rp(O),z=!N,j=p(i),A={hidden:z,orientation:g,tabActivationDirection:y,transitionStatus:R},P=_.useRef(null),Q=zt("div",t,{state:A,ref:[n,T,P],props:[{"aria-labelledby":j,hidden:z,id:S,role:"tabpanel",tabIndex:O?0:-1,inert:dx(!O),[oY.index]:C},f],stateAttributesMapping:iY});return xa({open:O,ref:P,onComplete(){O||M(!1)}}),Le(()=>{if(!(z&&!l)&&S!=null)return b(i,S),()=>{x(i,S)}},[z,l,i,S,b,x]),l||N?Q:null}),cY=_.forwardRef(function(t,n){const{activateOnFocus:s=!1,className:i,loopFocus:a=!0,render:l,...f}=t,{getTabElementBySelectedValue:d,onValueChange:p,orientation:g,value:y,setTabMap:b,tabActivationDirection:x}=gx(),[S,w]=_.useState(0),[T,C]=_.useState(null),O=lY(y,g,T,d),N=Ae((j,A)=>{if(j!==y){const P=O(j);A.activationDirection=P,p(j,A)}}),R={orientation:g,tabActivationDirection:x},M={"aria-orientation":g==="vertical"?"vertical":void 0,role:"tablist"},z=_.useMemo(()=>({activateOnFocus:s,highlightedTabIndex:S,onTabActivation:N,setHighlightedTabIndex:w,tabsListElement:T,value:y}),[s,S,N,w,T,y]);return h.jsx(hk.Provider,{value:z,children:h.jsx(sk,{render:l,className:i,state:R,refs:[n,C],props:[M,f],stateAttributesMapping:dk,highlightedIndex:S,enableHomeAndEndKeys:!0,loopFocus:a,orientation:g,onHighlightedIndexChange:w,onMapChange:b,disabledIndices:Ru})})});function VC(e,t){const{left:n,top:s}=e.getBoundingClientRect(),{left:i,top:a}=t.getBoundingClientRect(),l=n-i,f=s-a;return{left:l,top:f}}function lY(e,t,n,s){const[i,a]=_.useState(null);return Le(()=>{if(e==null||n==null){a(null);return}const l=s(e);if(l==null){a(null);return}const{left:f,top:d}=VC(l,n);a(t==="horizontal"?f:d)},[t,s,n,e]),_.useCallback(l=>{if(l===e)return"none";if(l==null)return a(null),"none";if(l!=null&&n!=null){const f=s(l);if(f!=null){const{left:d,top:p}=VC(f,n);if(i==null)return a(t==="horizontal"?d:p),"none";if(t==="horizontal"){if(d<i)return a(d),"left";if(d>i)return a(d),"right"}else{if(p<i)return a(p),"up";if(p>i)return a(p),"down"}}}return"none"},[s,t,i,n,e])}const uY=_.forwardRef(({className:e,...t},n)=>h.jsx(cY,{ref:n,className:ge("flex items-center gap-0.5",e),...t}));uY.displayName="TabsList";const fY=gi("inline-flex items-center justify-center cursor-pointer transition-all outline-none",{variants:{variant:{default:"font-mono text-[10px] text-neutral-500 border border-transparent rounded-sm px-2.5 py-1 hover:text-neutral-300 data-[selected]:text-white data-[selected]:border-border-bright data-[selected]:bg-white/[0.03]",pills:"font-mono text-[10px] text-neutral-500 border border-transparent rounded-full px-3 py-1 hover:text-neutral-300 data-[selected]:text-white data-[selected]:border-border-bright data-[selected]:bg-white/[0.03]"}},defaultVariants:{variant:"default"}}),dY=_.forwardRef(({className:e,variant:t,...n},s)=>h.jsx(sY,{ref:s,className:ge(fY({variant:t,className:e})),...n}));dY.displayName="TabsTrigger";const hY=_.forwardRef(({className:e,...t},n)=>h.jsx(aY,{ref:n,className:ge("outline-none",e),...t}));hY.displayName="TabsContent";const pY=_.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:ge("font-mono text-[11px] text-neutral-300",e),...t}));pY.displayName="Text";const mY=_.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:ge("font-mono text-[10px] text-neutral-500",e),...t}));mY.displayName="TextMuted";const gY=_.forwardRef(({className:e,...t},n)=>h.jsx("code",{ref:n,className:ge("font-mono text-[11px] text-white",e),...t}));gY.displayName="TextCode";const yY=_.forwardRef(({className:e,...t},n)=>h.jsx("span",{ref:n,className:ge("font-mono text-[9px] uppercase tracking-wider text-neutral-500",e),...t}));yY.displayName="TextLabel";const vY=_.forwardRef(({className:e,...t},n)=>h.jsx("pre",{ref:n,className:ge("font-mono text-[11px] text-neutral-300 p-3 rounded border border-border bg-panel-alt overflow-x-auto",e),...t}));vY.displayName="CodeBlock";const bY="console:instance-id";function Lt(){const[e,t]=pi(bY,""),n=e.trim();return _.useMemo(()=>({instanceId:n.length>0?n:void 0,rawInstanceId:e,setInstanceId:t,clearInstanceId:()=>t("")}),[n,e,t])}const Jn={stats:e=>["console","stats",e],timeseries:e=>["console","stats","timeseries",e],latency:e=>["console","stats","latency",e],commits:e=>["console","commits",e],commitDetail:(e,t,n)=>["console","commit-detail",e,t,n],timeline:e=>["console","timeline",e],clients:e=>["console","clients",e],eventDetail:(e,t,n)=>["console","event-detail",e,t,n],eventPayload:(e,t,n)=>["console","event-payload",e,t,n],handlers:e=>["console","handlers",e],prunePreview:e=>["console","prune","preview",e],operations:e=>["console","operations",e],apiKeys:e=>["console","api-keys",e],storage:e=>["console","storage",e]};function _i(e,t){return e===0?!1:e??t}function nf(e,t){return t?{...e,instanceId:t}:e}function Sa(e){return encodeURIComponent(String(e))}function Ln(e,t,n){const s=e.endsWith("/")?e.slice(0,-1):e,i=n?.toString();return`${s}${t}${i?`?${i}`:""}`}function rf(e={}){const t=Vt(),{instanceId:n}=Lt(),s=e.instanceId??n,i=nf(e.partitionId?{partitionId:e.partitionId}:{},s);return Wn({queryKey:Jn.stats({partitionId:e.partitionId,instanceId:s}),queryFn:()=>{if(!t)throw new Error("Not connected");return Yu(t.GET("/console/stats",{params:{query:i}}))},enabled:!!t,refetchInterval:_i(e.refetchIntervalMs,5e3)})}function xY(e={},t={}){const n=Vt(),{config:s}=Dt(),{instanceId:i}=Lt(),a=e.instanceId??i;return Wn({queryKey:Jn.timeseries({...e,instanceId:a}),queryFn:async()=>{if(!n||!s)throw new Error("Not connected");const l=new URLSearchParams;e.interval&&l.set("interval",e.interval),e.range&&l.set("range",e.range),e.partitionId&&l.set("partitionId",e.partitionId),a&&l.set("instanceId",a);const f=await fetch(`${s.serverUrl}/console/stats/timeseries?${l}`,{headers:{Authorization:`Bearer ${s.token}`}});if(!f.ok)throw new Error("Failed to fetch timeseries stats");return f.json()},enabled:(t.enabled??!0)&&!!n&&!!s,refetchInterval:_i(t.refetchIntervalMs,3e4)})}function SY(e={},t={}){const n=Vt(),{config:s}=Dt(),{instanceId:i}=Lt(),a=e.instanceId??i;return Wn({queryKey:Jn.latency({...e,instanceId:a}),queryFn:async()=>{if(!n||!s)throw new Error("Not connected");const l=new URLSearchParams;e.range&&l.set("range",e.range),e.partitionId&&l.set("partitionId",e.partitionId),a&&l.set("instanceId",a);const f=await fetch(`${s.serverUrl}/console/stats/latency?${l}`,{headers:{Authorization:`Bearer ${s.token}`}});if(!f.ok)throw new Error("Failed to fetch latency stats");return f.json()},enabled:(t.enabled??!0)&&!!n&&!!s,refetchInterval:_i(t.refetchIntervalMs,3e4)})}function _Y(e={},t={}){const n=Vt(),{instanceId:s}=Lt(),i=e.instanceId??s,a=nf({limit:e.limit,offset:e.offset,partitionId:e.partitionId},i);return Wn({queryKey:Jn.commits({...e,instanceId:i}),queryFn:()=>{if(!n)throw new Error("Not connected");return Yu(n.GET("/console/commits",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:_i(t.refetchIntervalMs,1e4)})}function wY(e,t={}){const n=Vt(),{config:s}=Dt(),{instanceId:i}=Lt(),a=t.instanceId??i;return Wn({queryKey:Jn.commitDetail(e,t.partitionId,a),queryFn:async()=>{if(!n||!s)throw new Error("Not connected");if(e===void 0)throw new Error("Commit sequence is required");const l=new URLSearchParams;t.partitionId&&l.set("partitionId",t.partitionId),a&&l.set("instanceId",a);const f=l.toString(),d=await fetch(`${s.serverUrl}/console/commits/${Sa(e)}${f?`?${f}`:""}`,{headers:{Authorization:`Bearer ${s.token}`}});if(!d.ok)throw new Error("Failed to fetch commit detail");return d.json()},enabled:(t.enabled??!0)&&e!==void 0&&!!n})}function EY(e={},t={}){const n=Vt(),{instanceId:s}=Lt(),i=e.instanceId??s,a=nf({limit:e.limit,offset:e.offset,partitionId:e.partitionId,view:e.view,eventType:e.eventType,actorId:e.actorId,clientId:e.clientId,requestId:e.requestId,traceId:e.traceId,table:e.table,outcome:e.outcome,search:e.search,from:e.from,to:e.to},i);return Wn({queryKey:Jn.timeline({...e,instanceId:i}),queryFn:()=>{if(!n)throw new Error("Not connected");return Yu(n.GET("/console/timeline",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:_i(t.refetchIntervalMs,1e4)})}function pk(e={},t={}){const n=Vt(),{instanceId:s}=Lt(),i=e.instanceId??s,a=nf({limit:e.limit,offset:e.offset,partitionId:e.partitionId},i);return Wn({queryKey:Jn.clients({...e,instanceId:i}),queryFn:()=>{if(!n)throw new Error("Not connected");return Yu(n.GET("/console/clients",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:_i(t.refetchIntervalMs,1e4)})}function TY(e,t={}){const n=Vt(),{config:s}=Dt(),{instanceId:i}=Lt(),a=t.instanceId??i;return Wn({queryKey:Jn.eventDetail(e,t.partitionId,a),queryFn:async()=>{if(!n||!s)throw new Error("Not connected");if(e===void 0)throw new Error("Event id is required");const l=new URLSearchParams;t.partitionId&&l.set("partitionId",t.partitionId),a&&l.set("instanceId",a);const f=l.toString(),d=await fetch(`${s.serverUrl}/console/events/${Sa(e)}${f?`?${f}`:""}`,{headers:{Authorization:`Bearer ${s.token}`}});if(!d.ok)throw new Error("Failed to fetch event detail");return d.json()},enabled:(t.enabled??!0)&&e!==void 0&&!!n})}function CY(e,t={}){const n=Vt(),{config:s}=Dt(),{instanceId:i}=Lt(),a=t.instanceId??i;return Wn({queryKey:Jn.eventPayload(e,t.partitionId,a),queryFn:async()=>{if(!n||!s)throw new Error("Not connected");if(e===void 0)throw new Error("Event id is required");const l=new URLSearchParams;t.partitionId&&l.set("partitionId",t.partitionId),a&&l.set("instanceId",a);const f=l.toString(),d=await fetch(`${s.serverUrl}/console/events/${Sa(e)}/payload${f?`?${f}`:""}`,{headers:{Authorization:`Bearer ${s.token}`}});if(!d.ok)throw new Error("Failed to fetch event payload");return d.json()},enabled:(t.enabled??!0)&&e!==void 0&&!!n})}function RY(e={}){const t=Vt(),{config:n}=Dt(),{instanceId:s}=Lt(),i=e.instanceId??s;return Wn({queryKey:Jn.handlers(i),queryFn:async()=>{if(!t||!n)throw new Error("Not connected");const a=new URLSearchParams;i&&a.set("instanceId",i);const l=await fetch(Ln(n.serverUrl,"/console/handlers",a),{headers:{Authorization:`Bearer ${n.token}`}});if(!l.ok)throw new Error("Failed to fetch handlers");return l.json()},enabled:!!t&&!!n})}function NY(e={}){const t=Vt(),{config:n}=Dt(),{instanceId:s}=Lt(),i=e.instanceId??s;return Wn({queryKey:Jn.prunePreview(i),queryFn:async()=>{if(!t||!n)throw new Error("Not connected");const a=new URLSearchParams;i&&a.set("instanceId",i);const l=await fetch(Ln(n.serverUrl,"/console/prune/preview",a),{method:"POST",headers:{Authorization:`Bearer ${n.token}`}});if(!l.ok)throw new Error("Failed to fetch prune preview");return l.json()},enabled:!!t&&!!n&&(e.enabled??!0)})}function jY(e={},t={}){const n=Vt(),{instanceId:s}=Lt(),i=e.instanceId??s,a=nf({limit:e.limit,offset:e.offset,operationType:e.operationType,partitionId:e.partitionId},i);return Wn({queryKey:Jn.operations({...e,instanceId:i}),queryFn:()=>{if(!n)throw new Error("Not connected");return Yu(n.GET("/console/operations",{params:{query:a}}))},enabled:(t.enabled??!0)&&!!n,refetchInterval:_i(t.refetchIntervalMs,1e4)})}function AY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async({clientId:i,partitionId:a,instanceId:l})=>{if(!e||!t)throw new Error("Not connected");const f=l??n,d=new URLSearchParams;a&&d.set("partitionId",a),f&&d.set("instanceId",f);const p=await fetch(Ln(t.serverUrl,`/console/clients/${Sa(i)}`,d),{method:"DELETE",headers:{Authorization:`Bearer ${t.token}`}});if(!p.ok)throw new Error("Failed to evict client");return p.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","clients"]}),s.invalidateQueries({queryKey:["console","stats"]}),s.invalidateQueries({queryKey:["console","operations"]})}})}function kY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async()=>{if(!e||!t)throw new Error("Not connected");const i=new URLSearchParams;n&&i.set("instanceId",n);const a=await fetch(Ln(t.serverUrl,"/console/prune",i),{method:"POST",headers:{Authorization:`Bearer ${t.token}`}});if(!a.ok)throw new Error("Failed to prune");return a.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","stats"]}),s.invalidateQueries({queryKey:["console","commits"]}),s.invalidateQueries({queryKey:["console","timeline"]}),s.invalidateQueries({queryKey:["console","prune","preview"]}),s.invalidateQueries({queryKey:["console","operations"]})}})}function OY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async()=>{if(!e||!t)throw new Error("Not connected");const i=new URLSearchParams;n&&i.set("instanceId",n);const a=await fetch(Ln(t.serverUrl,"/console/compact",i),{method:"POST",headers:{Authorization:`Bearer ${t.token}`}});if(!a.ok)throw new Error("Failed to compact");return a.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","stats"]}),s.invalidateQueries({queryKey:["console","operations"]})}})}function MY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=i.instanceId??n,l=new URLSearchParams;a&&l.set("instanceId",a);const f=await fetch(Ln(t.serverUrl,"/console/notify-data-change",l),{method:"POST",headers:{Authorization:`Bearer ${t.token}`,"Content-Type":"application/json"},body:JSON.stringify({tables:i.tables,partitionId:i.partitionId})});if(!f.ok)throw new Error("Failed to notify data change");return f.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","stats"]}),s.invalidateQueries({queryKey:["console","commits"]}),s.invalidateQueries({queryKey:["console","timeline"]}),s.invalidateQueries({queryKey:["console","operations"]})}})}function IY(e={}){const t=Vt(),{config:n}=Dt(),{instanceId:s}=Lt(),i=e.instanceId??s;return Wn({queryKey:Jn.apiKeys({...e,instanceId:i}),queryFn:async()=>{if(!t||!n)throw new Error("Not connected");const a=new URLSearchParams;e.limit!==void 0&&a.set("limit",String(e.limit)),e.offset!==void 0&&a.set("offset",String(e.offset)),e.type&&a.set("type",e.type),e.status&&a.set("status",e.status),e.expiresWithinDays!==void 0&&a.set("expiresWithinDays",String(e.expiresWithinDays)),i&&a.set("instanceId",i);const l=await fetch(Ln(n.serverUrl,"/console/api-keys",a),{headers:{Authorization:`Bearer ${n.token}`}});if(!l.ok)throw new Error("Failed to fetch API keys");return l.json()},enabled:!!t&&!!n})}function PY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Ln(t.serverUrl,"/console/api-keys",a),{method:"POST",headers:{Authorization:`Bearer ${t.token}`,"Content-Type":"application/json"},body:JSON.stringify(i)});if(!l.ok)throw new Error("Failed to create API key");return l.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","api-keys"]})}})}function DY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Ln(t.serverUrl,`/console/api-keys/${Sa(i)}`,a),{method:"DELETE",headers:{Authorization:`Bearer ${t.token}`}});if(!l.ok)throw new Error("Failed to revoke API key");return l.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","api-keys"]})}})}function zY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Ln(t.serverUrl,"/console/api-keys/bulk-revoke",a),{method:"POST",headers:{Authorization:`Bearer ${t.token}`,"Content-Type":"application/json"},body:JSON.stringify(i)});if(!l.ok)throw new Error("Failed to bulk revoke API keys");return l.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","api-keys"]})}})}function LY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Ln(t.serverUrl,`/console/api-keys/${Sa(i)}/rotate`,a),{method:"POST",headers:{Authorization:`Bearer ${t.token}`}});if(!l.ok)throw new Error("Failed to rotate API key");return l.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","api-keys"]})}})}function UY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async i=>{if(!e||!t)throw new Error("Not connected");const a=new URLSearchParams;n&&a.set("instanceId",n);const l=await fetch(Ln(t.serverUrl,`/console/api-keys/${Sa(i)}/rotate/stage`,a),{method:"POST",headers:{Authorization:`Bearer ${t.token}`}});if(!l.ok)throw new Error("Failed to stage-rotate API key");return l.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","api-keys"]})}})}function $Y(e={}){const{config:t}=Dt();return Wn({queryKey:Jn.storage({prefix:e.prefix,cursor:e.cursor,limit:e.limit}),queryFn:async()=>{if(!t)throw new Error("Not connected");const n=new URLSearchParams;e.prefix&&n.set("prefix",e.prefix),e.cursor&&n.set("cursor",e.cursor),e.limit&&n.set("limit",String(e.limit));const s=await fetch(Ln(t.serverUrl,"/console/storage",n),{method:"GET",headers:{Authorization:`Bearer ${t.token}`}});if(!s.ok)throw new Error("Failed to list blobs");return s.json()},enabled:!!t,refetchInterval:_i(e.refetchIntervalMs,3e4)})}function BY(){const{config:e}=Dt(),t=_r();return is({mutationFn:async n=>{if(!e)throw new Error("Not connected");const s=encodeURIComponent(n),i=await fetch(Ln(e.serverUrl,`/console/storage/${s}`,new URLSearchParams),{method:"DELETE",headers:{Authorization:`Bearer ${e.token}`}});if(!i.ok)throw new Error("Failed to delete blob");return i.json()},onSuccess:()=>{t.invalidateQueries({queryKey:["console","storage"]})}})}function FY(){const{config:e}=Dt();return async t=>{if(!e)throw new Error("Not connected");const n=encodeURIComponent(t),s=await fetch(Ln(e.serverUrl,`/console/storage/${n}/download`,new URLSearchParams),{method:"GET",headers:{Authorization:`Bearer ${e.token}`}});if(!s.ok)throw new Error("Failed to download blob");const i=await s.blob(),a=URL.createObjectURL(i),l=document.createElement("a");l.href=a,l.download=t.split("/").pop()||t,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(a)}}const HY="console:partition-id";function sf(){const[e,t]=pi(HY,""),n=e.trim();return _.useMemo(()=>({partitionId:n.length>0?n:void 0,rawPartitionId:e,setPartitionId:t,clearPartitionId:()=>t("")}),[n,e,t])}const KC={refreshInterval:5,timeFormat:"relative",showSparklines:!0,pageSize:20};function of(){const[e,t]=pi("console:preferences",KC);return{preferences:e,setPreferences:t,updatePreference:(i,a)=>{t(l=>({...l,[i]:a}))},resetPreferences:()=>{t(KC)}}}const qY=[{value:5,label:"5 seconds"},{value:10,label:"10 seconds"},{value:30,label:"30 seconds"},{value:60,label:"1 minute"},{value:0,label:"Manual only"}],VY=[{value:10,label:"10"},{value:20,label:"20"},{value:50,label:"50"},{value:100,label:"100"}],yx="syncular-console-root";function KY(e){e.classList.add(yx)}const GY=[{suffix:"",label:"Command"},{suffix:"/stream",label:"Stream"},{suffix:"/fleet",label:"Fleet"},{suffix:"/ops",label:"Ops"},{suffix:"/storage",label:"Storage"},{suffix:"/config",label:"Config"}];function ZY(e){const t=e?.trim()??"";return!t||t==="/"?"":(t.startsWith("/")?t:`/${t}`).replace(/\/+$/g,"")}function Uy(e,t){return e?t?`${e}${t}`:e:t||"/"}function YY({basePath:e,appHref:t,modeBadge:n}){const{connect:s,config:i,isConnected:a,isConnecting:l}=Dt(),{preferences:f}=of(),{instanceId:d,rawInstanceId:p,setInstanceId:g,clearInstanceId:y}=Lt(),{partitionId:b,rawPartitionId:x,setPartitionId:S,clearPartitionId:w}=sf(),T=vr({select:P=>P.location.pathname}),{data:C}=rf({refetchIntervalMs:f.refreshInterval*1e3,partitionId:b,instanceId:d}),O=ZY(e),N=_.useMemo(()=>GY.map(P=>({...P,id:Uy(O,P.suffix)})),[O]),R=Uy(O,""),M=Uy(O,"/config"),z=l?"connecting":a?"connected":i?"disconnected":"not-configured",j=N.find(P=>P.suffix===""?T===R||T===`${R}/`:T.startsWith(P.id))?.id??R,A=C?[{label:"HEAD",value:`#${C.maxCommitSeq}`},{label:"COMMITS",value:`${C.commitCount}`},{label:"CHANGES",value:`${C.changeCount}`},{label:"CLIENTS",value:`${C.activeClientCount}/${C.clientCount}`}]:[];return h.jsxs("div",{className:`${yx} h-screen bg-background text-foreground flex flex-col`,children:[h.jsx(MZ,{brand:h.jsx(bc,{to:R,children:h.jsx(OZ,{label:"console"})}),center:h.jsx(TZ,{items:N,activeId:j,renderItem:(P,{active:Q})=>h.jsx(bc,{to:P.id,children:h.jsx(ok,{active:Q,children:P.label})},P.id)}),right:h.jsxs("div",{className:"flex items-center gap-2",children:[n?h.jsx(mn,{variant:"flow",className:"hidden md:inline-flex px-2 py-1 text-[10px]",children:n}):null,h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-500 uppercase tracking-wide",children:"Instance"}),h.jsx(Gn,{variant:"mono",value:p,onChange:P=>g(P.target.value),onBlur:P=>g(P.target.value.trim()),placeholder:"all",className:"h-7 w-[110px] px-2 py-1"}),d?h.jsx(Me,{variant:"ghost",size:"sm",className:"h-7 px-2 text-[10px]",onClick:y,children:"All"}):null]}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-500 uppercase tracking-wide",children:"Partition"}),h.jsx(Gn,{variant:"mono",value:x,onChange:P=>S(P.target.value),onBlur:P=>S(P.target.value.trim()),placeholder:"all",className:"h-7 w-[110px] px-2 py-1"}),b?h.jsx(Me,{variant:"ghost",size:"sm",className:"h-7 px-2 text-[10px]",onClick:w,children:"All"}):null]}),h.jsx(N8,{state:z}),h.jsx(bc,{to:M,children:h.jsx(Me,{variant:T===M?"secondary":"ghost",size:"icon",children:h.jsx(V8,{className:"h-3 w-3"})})}),t?h.jsxs("a",{href:t,className:EZ,children:[h.jsx(H8,{className:"h-3 w-3"}),"Go to app"]}):null]})}),h.jsx("main",{className:"flex-1 overflow-auto pb-[32px]",children:h.jsx("div",{className:"min-h-full",children:a||T===M?h.jsx("div",{style:{animation:"pageIn 0.3s ease-out"},children:h.jsx(XN,{})},T):h.jsx(XY,{configPath:M,hasSavedConfig:!!i,isConnecting:l,onConnect:()=>{s()}})})}),a&&h.jsx(Bj,{isLive:a,metrics:A,uptime:"--"})]})}function XY({configPath:e,hasSavedConfig:t,isConnecting:n,onConnect:s}){return h.jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[h.jsx("p",{className:"mb-4 text-foreground-muted",children:"Not connected to a @syncular server"}),h.jsxs("div",{className:"flex items-center gap-2",children:[t&&h.jsx(Me,{variant:"default",onClick:s,disabled:n,children:n?"Connecting...":"Connect"}),h.jsx(bc,{to:e,children:h.jsx(Me,{variant:"link",children:"Configure connection"})})]})]})}const uo=NH({component:YY});function QY(){return typeof window>"u"?!1:new URLSearchParams(window.location.search).get("swServer")==="1"}function WY(e={}){const{maxEvents:t=100,enabled:n=!0,staleAfterMs:s=65e3,replayLimit:i=100,partitionId:a,instanceId:l}=e,{config:f,isConnected:d}=Dt(),{instanceId:p}=Lt(),g=l??p,[y,b]=_.useState([]),[x,S]=_.useState(!1),[w,T]=_.useState("disconnected"),[C,O]=_.useState(null),N=_.useRef(null),R=_.useRef(null),M=_.useRef(null),z=_.useRef(0),j=_.useRef(0),A=_.useRef(null),P=_.useRef(null),Q=_.useCallback(()=>{b([]),A.current=null,P.current=null},[]);return _.useEffect(()=>{if(!n||!d||!f?.serverUrl||!f?.token)return;let B=!1;const U=Number.isFinite(i)?Math.max(1,Math.min(500,Math.floor(i))):100;if(QY()||typeof WebSocket>"u"){T("connecting"),S(!1);let V=null,L=!1;const I=async()=>{if(!(B||L)){L=!0;try{const H=new URL(f.serverUrl,window.location.origin),W=H.pathname.endsWith("/")?H.pathname.slice(0,-1):H.pathname;H.pathname=`${W}/console/events`,H.search="",H.searchParams.set("limit",String(U)),H.searchParams.set("offset","0"),a&&H.searchParams.set("partitionId",a);const Y=await fetch(H.toString(),{headers:{Authorization:`Bearer ${f.token}`}});if(!Y.ok)throw new Error(`Live event polling failed (${Y.status})`);const ae=await Y.json(),fe=(Array.isArray(ae.items)?ae.items:[]).filter(Oe=>g?Oe.instanceId===g:!0).sort((Oe,_e)=>Oe.eventId-_e.eventId),Se=P.current??-1,pe=fe.filter(Oe=>Oe.eventId>Se);if(pe.length>0){const Oe=pe.map(re=>({type:re.eventType,timestamp:re.createdAt,data:re})).reverse();b(re=>[...Oe,...re].slice(0,t));const _e=pe[pe.length-1];P.current=_e.eventId,A.current=_e.createdAt}else if(fe.length>0){const Oe=fe[fe.length-1];P.current=Math.max(P.current??-1,Oe.eventId),A.current=Oe.createdAt}O(null),S(!0),T("connected")}catch(H){B||(S(!1),T("disconnected"),O(H instanceof Error?H:new Error("Live event polling failed")))}finally{L=!1}}};return I(),V=setInterval(()=>{I()},2e3),()=>{B=!0,V&&clearInterval(V),S(!1),T("disconnected")}}const K=()=>{R.current&&(clearTimeout(R.current),R.current=null)},ee=()=>{M.current&&(clearInterval(M.current),M.current=null)},D=()=>{if(B||R.current)return;z.current+=1;const V=Math.min(3e4,1e3*2**Math.max(0,z.current-1)),L=Math.floor(V*.2*Math.random()),I=V+L;R.current=setTimeout(()=>{R.current=null,B||q()},I)},G=()=>{j.current=Date.now(),S(!0),T("connected")},q=()=>{if(B)return;T("connecting"),K();const V=(()=>{const I=new URL(f.serverUrl,window.location.origin);I.protocol=I.protocol==="https:"?"wss:":"ws:";const H=I.pathname.endsWith("/")?I.pathname.slice(0,-1):I.pathname;return I.pathname=`${H}/console/events/live`,I.search="",I.searchParams.set("token",f.token),A.current&&I.searchParams.set("since",A.current),I.searchParams.set("replayLimit",String(U)),a&&I.searchParams.set("partitionId",a),g&&I.searchParams.set("instanceId",g),I.toString()})(),L=new WebSocket(V);N.current=L,L.onopen=()=>{if(B){L.close();return}z.current=0,G(),O(null),ee(),M.current=setInterval(()=>{const I=N.current;if(!I||I.readyState!==WebSocket.OPEN)return;const H=j.current;!H||Date.now()-H<=s||(S(!1),T("stale"),I.close())},1e3)},L.onclose=()=>{B||(S(!1),T("disconnected"),ee(),D())},L.onerror=()=>{B||O(new Error("WebSocket connection failed"))},L.onmessage=I=>{try{const H=JSON.parse(I.data),W=H.type;if(G(),W==="connected"||W==="heartbeat")return;const Y={type:W,timestamp:H.timestamp||new Date().toISOString(),data:H};if(a&&Y.data.partitionId!==a||g&&Y.data.instanceId!==g)return;const ae=Date.parse(A.current??""),se=Date.parse(Y.timestamp);Number.isFinite(se)&&(!Number.isFinite(ae)||se>ae)&&(A.current=Y.timestamp),b(fe=>[Y,...fe].slice(0,t))}catch{}}};return q(),()=>{B=!0,K(),ee(),N.current&&(N.current.close(),N.current=null),S(!1),T("disconnected")}},[n,d,f?.serverUrl,f?.token,t,a,g,i,s]),{events:y,isConnected:x,connectionState:w,error:C,clearEvents:Q}}function JY(){const e=Vt(),{config:t}=Dt(),{instanceId:n}=Lt(),s=_r();return is({mutationFn:async()=>{if(!e||!t)throw new Error("Not connected");const i=new URLSearchParams;n&&i.set("instanceId",n);const a=i.toString(),l=await fetch(`${t.serverUrl}/console/events${a?`?${a}`:""}`,{method:"DELETE",headers:{Authorization:`Bearer ${t.token}`}});if(!l.ok)throw new Error("Failed to clear events");return l.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["console","events"]})}})}const eX=_.createContext(null);function mk(){const[e,t]=pi("console:time-range","24h");return{range:e,setRange:t}}const tX=[{hint:"ios",type:"mobile"},{hint:"android",type:"mobile"},{hint:"mobile",type:"mobile"},{hint:"tablet",type:"tablet"},{hint:"desktop",type:"desktop"},{hint:"mac",type:"desktop"},{hint:"windows",type:"desktop"},{hint:"linux",type:"desktop"},{hint:"browser",type:"browser"},{hint:"web",type:"browser"},{hint:"server",type:"server"},{hint:"api",type:"server"},{hint:"iot",type:"iot"},{hint:"sensor",type:"iot"}];function nX(e){const t=e.toLowerCase();for(const n of tX)if(t.includes(n.hint))return n.type;return"client"}function rX(e){const t=e.toLowerCase();return t.includes("pglite")?"PGlite":t.includes("sqlite")||t.includes("wa-sqlite")?"SQLite":t.includes("postgres")||t.includes("pg")?"PostgreSQL":"unknown"}function sX(e,t){return typeof e.lagCommitCount=="number"?Math.max(0,e.lagCommitCount):t?Math.max(0,t.maxCommitSeq-e.cursor):0}function oX(e,t){return e.activityState==="stale"?"offline":t>0?"syncing":"online"}function iX(e,t){return e.length<=16?e:`${e.slice(0,12)}-${t+1}`}function aX(e,t,n={}){const s=n.maxNodes??10;return e.slice(0,s).map((i,a)=>{const l=sX(i,t),f=oX(i,l);return{id:iX(i.clientId,a),type:nX(i.clientId),status:f,cursor:Math.max(0,i.cursor),actor:i.actorId,mode:i.connectionMode,dialect:rX(i.clientId),scopes:Object.keys(i.effectiveScopes||{}),lastSeen:i.updatedAt}})}const cX={enabled:!1,thresholds:{p90Latency:500,errorRate:5,clientLag:100}};function GC(e,t="relative"){if(t==="absolute")return new Date(e).toLocaleString();const n=new Date(e),i=new Date().getTime()-n.getTime(),a=Math.floor(i/1e3);return a<60?`${a}s ago`:a<3600?`${Math.floor(a/60)}m ago`:a<86400?`${Math.floor(a/3600)}h ago`:`${Math.floor(a/86400)}d ago`}function lX(e){const t=e.length>1&&e.endsWith("/")?e.slice(0,-1):e;return t==="/console"||t.startsWith("/console/")?"/console/stream":"/stream"}function uX(){const e=dp(),t=_.useMemo(()=>typeof window>"u"?"/stream":lX(window.location.pathname),[]),n=mk(),{range:s}=n,{preferences:i}=of(),{partitionId:a}=sf(),l=i.refreshInterval*1e3,[f]=pi("console:alert-config",cX),[d,p]=_.useState("1h"),{data:g}=rf({refetchIntervalMs:l,partitionId:a}),{data:y}=xY({range:s,partitionId:a},{refetchIntervalMs:l}),{data:b}=SY({range:s,partitionId:a},{refetchIntervalMs:l}),{data:x}=_Y({limit:5,partitionId:a},{refetchIntervalMs:l}),{data:S}=pk({limit:12,offset:0,partitionId:a},{refetchIntervalMs:l}),{events:w,isConnected:T}=WY({maxEvents:8,partitionId:a}),C=_.useMemo(()=>{const U=y?.buckets??[];let Z=0,K=0;for(const D of U)Z+=D.pushCount+D.pullCount,K+=D.errorCount;const ee=Z>0?K/Z*100:0;return{totalEvents:Z,errorRate:ee}},[y?.buckets]),O=_.useMemo(()=>S?.items?aX(S.items,g,{maxNodes:12}):[],[S?.items,g]),N=O.filter(U=>U.status!=="offline").length,R=O.filter(U=>U.status==="offline").length,M=_.useMemo(()=>g?[{label:"Ops (Range)",value:C.totalEvents,color:"flow"},{label:"P50 Latency",value:b?.push?.p50??0,unit:"ms",color:"healthy"},{label:"Error Rate",value:`${C.errorRate.toFixed(1)}%`,color:C.errorRate>0?"offline":"muted"},{label:"Active Clients",value:g.activeClientCount,color:"syncing"},{label:"Pending",value:g.maxActiveClientCursor!==null&&g.maxCommitSeq>0?g.maxCommitSeq-(g.minActiveClientCursor??0):0,color:"relay"}]:[],[g,b,C.errorRate,C.totalEvents]),z=_.useMemo(()=>w.map(U=>({type:U.type.toUpperCase(),actor:U.data?.actorId??"",table:(U.data?.tables??[])[0]??"",time:GC(U.timestamp,i.timeFormat)})),[w,i.timeFormat]),j=_.useMemo(()=>{const U=y?.buckets;if(!U?.length)return[];const Z=Math.max(...U.map(K=>Math.max(K.pushCount,K.pullCount)),1);return U.map(K=>({pushPercent:Z>0?K.pushCount/Z*100:0,pullPercent:Z>0?K.pullCount/Z*100:0}))},[y?.buckets]),A=_.useMemo(()=>{if(!b)return[];const U=Math.max(b.push.p50,b.push.p90,b.push.p99,b.pull.p50,b.pull.p90,b.pull.p99,1);return[{label:"P50",pushMs:b.push.p50,pullMs:b.pull.p50,pushBarPercent:b.push.p50/U*100,pullBarPercent:b.pull.p50/U*100},{label:"P90",pushMs:b.push.p90,pullMs:b.pull.p90,pushBarPercent:b.push.p90/U*100,pullBarPercent:b.pull.p90/U*100},{label:"P99",pushMs:b.push.p99,pullMs:b.pull.p99,pushBarPercent:b.push.p99/U*100,pullBarPercent:b.pull.p99/U*100}]},[b]),P=_.useMemo(()=>x?.items?x.items.map(U=>({seq:U.commitSeq,actor:U.actorId,changes:U.changeCount,tables:(U.affectedTables??[]).join(", "),time:GC(U.createdAt,i.timeFormat)})):[],[x?.items,i.timeFormat]),Q=_.useMemo(()=>Math.max(0,100-C.errorRate),[C.errorRate]),B=_.useMemo(()=>{if(!f.enabled||!g)return[];const U=[];return b?.push?.p90&&b.push.p90>f.thresholds.p90Latency&&U.push(`P90 push latency (${b.push.p90}ms) exceeds threshold (${f.thresholds.p90Latency}ms)`),g.minActiveClientCursor!==null&&g.maxCommitSeq-g.minActiveClientCursor>f.thresholds.clientLag&&U.push(`Client lag (${g.maxCommitSeq-g.minActiveClientCursor}) exceeds threshold (${f.thresholds.clientLag})`),C.errorRate>f.thresholds.errorRate&&U.push(`Error rate (${C.errorRate.toFixed(1)}%) exceeds threshold (${f.thresholds.errorRate}%)`),U},[f,g,b,C.errorRate]);return g?h.jsx(eX.Provider,{value:n,children:h.jsxs("div",{className:"flex flex-col",children:[B.length>0&&h.jsx("div",{className:"px-6 pb-4",children:h.jsxs(In,{variant:"destructive",children:[h.jsx(tf,{children:"Threshold Exceeded"}),h.jsx(Pn,{children:B.map((U,Z)=>h.jsx("span",{className:"block",children:U},Z))})]})}),h.jsx(UA,{clients:O,totalNodes:O.length+2,onlineCount:N,offlineCount:R,relayClientIds:[]}),h.jsx(Yj,{items:M}),h.jsxs("div",{className:"flex",children:[h.jsxs("div",{className:"flex-1 min-w-0 flex flex-col",children:[h.jsx("div",{className:"border-b border-border border-r border-border",children:h.jsx(Sj,{bars:j,activeRange:d,onRangeChange:p})}),h.jsx("div",{className:"border-b border-border border-r border-border",children:h.jsx(Xj,{buckets:A,successRate:Q})}),h.jsx("div",{className:"border-r border-border",children:h.jsx(Fj,{commits:P,onViewAll:()=>e({href:t})})})]}),h.jsx(Qj,{entries:z,isConnected:T,maxVisible:20,maxHeight:"calc(100vh - 200px)"})]})]})}):h.jsx("div",{className:"flex items-center justify-center py-24",children:h.jsx(Pt,{size:"lg"})})}function fX(){return h.jsx(uX,{})}function dX({children:e}){return h.jsxs("div",{className:"space-y-4 px-5 py-5",children:[h.jsx(hX,{}),h.jsx(vX,{}),h.jsx(bX,{}),e]})}function hX(){const{clearError:e,config:t,connect:n,disconnect:s,error:i,isConnected:a,isConnecting:l}=Dt(),[f,d]=_.useState(t?.serverUrl??"/api"),[p,g]=_.useState(t?.token??""),[y,b]=_.useState(null),[x,S]=_.useState(!1),[w,T]=_.useState(null),[C,O]=pi("console:disconnect-clear-saved-config",!1);_.useEffect(()=>{const j=new URLSearchParams(window.location.search),A=j.get("token"),P=j.get("server");A&&(g(A),window.history.replaceState({},"",window.location.pathname)),P&&d(P)},[]),_.useEffect(()=>{t?.serverUrl&&d(t.serverUrl),t?.token&&g(t.token)},[t?.serverUrl,t?.token]),_.useEffect(()=>{T(null)},[]);const N=async()=>{e(),b(null);const j=await n({serverUrl:f.trim(),token:p.trim()},{persistOverride:!0});T(j?"Connected successfully and configuration saved.":"Failed to connect with the provided settings.")},R=()=>{s({clearSavedConfig:C}),C&&(d("/api"),g("")),T(C?"Disconnected and saved credentials cleared.":"Disconnected."),b(null)},M=async()=>{S(!0),b(null),T(null);const j=performance.now();try{const A=f.trim(),P=p.trim();if(!A||!P)throw new Error("Missing server URL or token");if(!(await fetch(`${A}/console/stats`,{headers:{Authorization:`Bearer ${P}`}})).ok)throw new Error("Failed to connect");b(Math.round(performance.now()-j))}catch{b(-1)}finally{S(!1)}},z=i??w??(y!==null?y<0?"Connection failed":`Connection successful (${y}ms latency)`:void 0);return h.jsx(qj,{isConnected:a,isConnecting:l,isTestingConnection:x,serverUrl:f,onServerUrlChange:d,consoleToken:p,onConsoleTokenChange:g,onSaveAndConnect:N,onDisconnect:R,onTestConnection:M,statusMessage:z,children:h.jsx("div",{className:"px-5 pb-5 -mt-2",children:h.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-3 py-2",children:[h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] text-neutral-400",children:"Clear saved credentials on disconnect"}),h.jsx("p",{className:"font-mono text-[9px] text-neutral-500",children:"Removes stored server URL and token from this browser."})]}),h.jsx(Sp,{checked:C,onCheckedChange:O})]})})})}const pX=1440*60*1e3;function ZC(e){const t=e.trim();if(!t)return null;const n=Number.parseInt(t,10);return!Number.isInteger(n)||n<=0?null:n}function $y(e){if(!e)return"Never";const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():"Invalid date"}function mX(e){return e.length===0?"all scopes":e.length<=2?e.join(", "):`${e.slice(0,2).join(", ")} +${e.length-2}`}function gX(e,t){if(e.revokedAt)return"revoked";if(!e.expiresAt)return"active";const n=Date.parse(e.expiresAt);if(!Number.isFinite(n))return"active";const s=Date.now();return n<=s?"expired":n<=s+t*pX?"expiring":"active"}function yX(e){return e==="revoked"?"destructive":e==="expired"?"offline":e==="expiring"?"syncing":"healthy"}function vX(){const[e,t]=_.useState("all"),[n,s]=_.useState("all"),[i,a]=_.useState("14"),[l,f]=_.useState(!1),[d,p]=_.useState(!1),[g,y]=_.useState(""),[b,x]=_.useState("relay"),[S,w]=_.useState(""),[T,C]=_.useState(""),[O,N]=_.useState(""),[R,M]=_.useState(null),[z,j]=_.useState([]),[A,P]=_.useState(null),[Q,B]=_.useState(null),[U,Z]=_.useState(null),[K,ee]=_.useState(null),[D,G]=_.useState(null),[q,V]=_.useState(null),[L,I]=_.useState(null),H=_.useMemo(()=>ZC(i),[i]),W=H??14,Y=_.useMemo(()=>ZC(O),[O]),ae=O.trim().length>0,se=!ae||Y!==null,fe=_.useMemo(()=>({type:e==="all"?void 0:e,status:n==="all"?void 0:n,expiresWithinDays:n==="expiring"?W:void 0}),[e,n,W]),{data:Se,isLoading:pe,error:Oe}=IY(fe),_e=PY(),re=zY(),he=DY(),ie=LY(),we=UY();_.useEffect(()=>{const me=new Set((Se?.items??[]).map(Te=>Te.keyId));j(Te=>Te.filter(qe=>me.has(qe)))},[Se?.items]);const ye=async()=>{try{const me=T.split(",").map(qe=>qe.trim()).filter(qe=>qe.length>0),Te=await _e.mutateAsync({name:g,keyType:b,actorId:S||void 0,scopeKeys:me.length>0?me:void 0,expiresInDays:ae?Y??void 0:void 0});M(Te.secretKey),y(""),w(""),C(""),N("")}catch{}},xe=me=>{navigator.clipboard.writeText(me),B(me),setTimeout(()=>B(null),2e3)},ve=async()=>{if(U)try{await he.mutateAsync(U)}finally{Z(null)}},Ie=async()=>{if(z.length!==0)try{const me=await re.mutateAsync({keyIds:z});P(me),j([])}catch{}},Ue=async()=>{if(K)try{const me=await we.mutateAsync(K.keyId);G({oldKeyId:K.keyId,oldKeyName:K.name,secretKey:me.secretKey})}catch{}},Ee=async()=>{if(D)try{await he.mutateAsync(D.oldKeyId)}finally{G(null),ee(null)}},Ve=async()=>{if(q)try{const me=await ie.mutateAsync(q);I(me.secretKey)}finally{V(null)}};if(pe)return h.jsx("div",{className:"flex h-[200px] items-center justify-center",children:h.jsx(Pt,{size:"lg"})});if(Oe)return h.jsx("div",{className:"flex h-[200px] items-center justify-center",children:h.jsxs("p",{className:"text-danger",children:["Failed to load API keys: ",Oe.message]})});const Qe=(Se?.items??[]).filter(me=>me.revokedAt===null).map(me=>me.keyId),Be=Qe.length>0&&Qe.every(me=>z.includes(me)),We=z.length>0,He=(Se?.items??[]).filter(me=>z.includes(me.keyId)).map(me=>me.name);return h.jsxs(h.Fragment,{children:[h.jsxs(Jb,{title:"API Keys",description:"Issue, rotate, revoke, and audit key lifecycle state.",actions:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(Me,{size:"sm",variant:"destructive",onClick:()=>p(!0),disabled:z.length===0,children:["Revoke Selected (",z.length,")"]}),h.jsx(Me,{size:"sm",onClick:()=>f(!0),children:"Create Key"})]}),children:[h.jsxs("div",{className:"mb-4 grid gap-3 lg:grid-cols-3",children:[h.jsxs(ms,{children:[h.jsx(es,{children:"Type filter"}),h.jsxs(dh,{value:[e],multiple:!1,onValueChange:me=>{const Te=me.find(qe=>typeof qe=="string");(Te==="all"||Te==="relay"||Te==="proxy"||Te==="admin")&&t(Te)},children:[h.jsx(Dr,{value:"all",children:"all"}),h.jsx(Dr,{value:"relay",children:"relay"}),h.jsx(Dr,{value:"proxy",children:"proxy"}),h.jsx(Dr,{value:"admin",children:"admin"})]})]}),h.jsxs(ms,{children:[h.jsx(es,{children:"Status filter"}),h.jsxs(dh,{value:[n],multiple:!1,onValueChange:me=>{const Te=me.find(qe=>typeof qe=="string");(Te==="all"||Te==="active"||Te==="revoked"||Te==="expiring")&&s(Te)},children:[h.jsx(Dr,{value:"all",children:"all"}),h.jsx(Dr,{value:"active",children:"active"}),h.jsx(Dr,{value:"revoked",children:"revoked"}),h.jsx(Dr,{value:"expiring",children:"expiring"})]})]}),h.jsxs(ms,{children:[h.jsx(es,{htmlFor:"api-key-expiring-window",children:"Expiring window (days)"}),h.jsx(pc,{children:"Used when status filter is set to expiring."}),h.jsx(Gn,{id:"api-key-expiring-window",placeholder:"14",value:i,inputMode:"numeric",onChange:me=>a(me.target.value)}),H===null&&i.trim().length>0?h.jsx("p",{className:"font-mono text-[10px] text-offline",children:"Enter a positive whole number."}):null]})]}),Se?.items.length===0?h.jsx(Qb,{message:"No API keys match the current filters."}):h.jsxs(tl,{children:[h.jsx(nl,{children:h.jsxs(ss,{children:[h.jsx(ht,{className:"w-[28px]",children:h.jsx(Uv,{checked:Be,indeterminate:!Be&&We&&Qe.length>0,onCheckedChange:me=>{j(me?Qe:[])},"aria-label":"Select all active keys"})}),h.jsx(ht,{className:"w-[100px]",children:"NAME"}),h.jsx(ht,{className:"w-[55px]",children:"TYPE"}),h.jsx(ht,{className:"w-[90px]",children:"KEY PREFIX"}),h.jsx(ht,{className:"w-[80px]",children:"ACTOR"}),h.jsx(ht,{className:"w-[100px]",children:"SCOPES"}),h.jsx(ht,{className:"w-[120px]",children:"CREATED"}),h.jsx(ht,{className:"w-[120px]",children:"LAST USED"}),h.jsx(ht,{className:"w-[120px]",children:"EXPIRES"}),h.jsx(ht,{className:"flex-1",children:"STATUS"})]})}),h.jsx(rl,{children:(Se?.items??[]).map(me=>{const Te=gX(me,W);return h.jsxs(ss,{className:"group relative",children:[h.jsx(pt,{className:"w-[28px]",children:h.jsx(Uv,{checked:z.includes(me.keyId),onCheckedChange:qe=>{j(mt=>qe?[...new Set([...mt,me.keyId])]:mt.filter(lt=>lt!==me.keyId))},"aria-label":`Select ${me.name}`,disabled:me.revokedAt!==null})}),h.jsx(pt,{className:"w-[100px] font-medium",children:me.name}),h.jsx(pt,{className:"w-[55px]",children:h.jsx(mn,{variant:me.keyType==="admin"?"flow":me.keyType==="proxy"?"ghost":"relay",children:me.keyType})}),h.jsx(pt,{className:"w-[90px]",children:h.jsxs("code",{className:"font-mono text-[11px]",children:[me.keyPrefix,"..."]})}),h.jsx(pt,{className:"w-[80px] text-neutral-500",children:me.actorId??"-"}),h.jsx(pt,{className:"w-[100px] text-neutral-500",children:h.jsx("code",{className:"font-mono text-[10px]",children:mX(me.scopeKeys)})}),h.jsx(pt,{className:"w-[120px] text-neutral-500",children:$y(me.createdAt)}),h.jsx(pt,{className:"w-[120px] text-neutral-500",children:$y(me.lastUsedAt)}),h.jsx(pt,{className:"w-[120px] text-neutral-500",children:$y(me.expiresAt)}),h.jsx(pt,{className:"flex-1",children:h.jsx(mn,{variant:yX(Te),children:Te})}),me.revokedAt===null&&h.jsxs("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[h.jsx("button",{type:"button",onClick:()=>ee(me),className:"px-1.5 py-0.5 rounded text-[9px] font-mono text-neutral-600 hover:text-white hover:bg-white/[0.05] cursor-pointer transition-colors",children:"stage"}),h.jsx("button",{type:"button",onClick:()=>V(me.keyId),className:"px-1.5 py-0.5 rounded text-[9px] font-mono text-neutral-600 hover:text-white hover:bg-white/[0.05] cursor-pointer transition-colors",children:"rotate"}),h.jsx("button",{type:"button",onClick:()=>Z(me.keyId),className:"px-1.5 py-0.5 rounded text-[9px] font-mono text-neutral-600 hover:text-offline hover:bg-offline/10 cursor-pointer transition-colors",children:"revoke"})]})]},me.keyId)})})]})]}),h.jsx($r,{open:l,onOpenChange:f,children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Create API Key"})}),R?h.jsx(YC,{copiedKeyId:Q,onClose:()=>{M(null),f(!1)},onCopy:xe,secretKey:R,warning:"Copy this key now. You will not be able to view it again."}):h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[h.jsxs(ms,{children:[h.jsx(es,{htmlFor:"api-key-name",children:"Name"}),h.jsx(Gn,{id:"api-key-name",placeholder:"Backend Relay Key",value:g,onChange:me=>y(me.target.value)})]}),h.jsxs(ms,{children:[h.jsx(es,{children:"Key type"}),h.jsxs(dh,{value:[b],multiple:!1,onValueChange:me=>{const Te=me.find(qe=>typeof qe=="string");(Te==="relay"||Te==="proxy"||Te==="admin")&&x(Te)},children:[h.jsx(Dr,{value:"relay",children:"relay"}),h.jsx(Dr,{value:"proxy",children:"proxy"}),h.jsx(Dr,{value:"admin",children:"admin"})]})]}),h.jsxs(ms,{children:[h.jsx(es,{htmlFor:"api-key-actor-id",children:"Actor ID (optional)"}),h.jsx(pc,{children:"Pin this key to a fixed actor ID"}),h.jsx(Gn,{id:"api-key-actor-id",placeholder:"actor-123",value:S,onChange:me=>w(me.target.value)})]}),h.jsxs(ms,{children:[h.jsx(es,{htmlFor:"api-key-scope-keys",children:"Scope keys (optional)"}),h.jsx(pc,{children:"Comma-separated list of allowed scope keys"}),h.jsx(Gn,{id:"api-key-scope-keys",placeholder:"scope-a, scope-b",value:T,onChange:me=>C(me.target.value)})]}),h.jsxs(ms,{children:[h.jsx(es,{htmlFor:"api-key-expires-days",children:"Expires in days (optional)"}),h.jsx(pc,{children:"Leave empty to keep the key non-expiring."}),h.jsx(Gn,{id:"api-key-expires-days",placeholder:"30",value:O,inputMode:"numeric",onChange:me=>N(me.target.value)}),se?null:h.jsx("p",{className:"font-mono text-[10px] text-offline",children:"Enter a positive whole number."})]}),h.jsxs(Nn,{children:[h.jsx(Me,{variant:"default",onClick:()=>f(!1),children:"Cancel"}),h.jsx(Me,{variant:"primary",onClick:ye,disabled:_e.isPending||!g||!se,children:_e.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Creating..."]}):"Create"})]})]})]})}),h.jsx($r,{open:d,onOpenChange:me=>{p(me),me||P(null)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Bulk Revoke API Keys"})}),A?h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",children:[h.jsx(In,{variant:"destructive",children:h.jsxs(Pn,{children:["Requested ",A.requestedCount," keys. Revoked"," ",A.revokedCount,", already revoked"," ",A.alreadyRevokedCount,", not found"," ",A.notFoundCount,"."]})}),h.jsx(Nn,{children:h.jsx(Me,{variant:"primary",onClick:()=>{p(!1),P(null)},children:"Done"})})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",children:[h.jsx(In,{variant:"destructive",children:h.jsx(Pn,{children:"This revokes selected keys immediately and cannot be undone."})}),h.jsxs("p",{className:"font-mono text-[10px] text-neutral-500",children:["Selected keys: ",He.slice(0,5).join(", "),He.length>5?` +${He.length-5} more`:""]})]}),h.jsxs(Nn,{children:[h.jsx(Me,{variant:"default",onClick:()=>p(!1),children:"Cancel"}),h.jsx(Me,{variant:"destructive",onClick:Ie,disabled:re.isPending||z.length===0,children:re.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Revoking..."]}):"Revoke Selected"})]})]})]})}),h.jsx($r,{open:K!==null||D!==null,onOpenChange:()=>{ee(null),G(null)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Stage Rotate API Key"})}),D?h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[h.jsx(In,{variant:"default",children:h.jsxs(Pn,{children:["Replacement key created for ",D.oldKeyName,". The old key is still active until you revoke it."]})}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("code",{className:"flex-1 rounded-md border border-border bg-surface p-3 font-mono text-[11px] text-white break-all",children:D.secretKey}),h.jsx(Me,{variant:"default",size:"sm",onClick:()=>xe(D.secretKey),children:Q===D.secretKey?"Copied":"Copy"})]}),h.jsxs(Nn,{children:[h.jsx(Me,{variant:"default",onClick:()=>{G(null),ee(null)},children:"Keep Old Key Active"}),h.jsx(Me,{variant:"destructive",onClick:Ee,disabled:he.isPending,children:he.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Revoking Old Key..."]}):"Finalize and Revoke Old Key"})]})]}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"px-5 py-4",children:h.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:"Staged rotation creates a replacement key now and keeps the current key active until you explicitly revoke it."})}),h.jsxs(Nn,{children:[h.jsx(Me,{variant:"default",onClick:()=>ee(null),children:"Cancel"}),h.jsx(Me,{variant:"primary",onClick:Ue,disabled:we.isPending||!K,children:we.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Staging..."]}):"Create Replacement Key"})]})]})]})}),h.jsx($r,{open:U!==null,onOpenChange:()=>Z(null),children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Revoke API Key"})}),h.jsx("div",{className:"px-5 py-4",children:h.jsx(In,{variant:"destructive",children:h.jsx(Pn,{children:"Revoking a key immediately invalidates it for all requests."})})}),h.jsxs(Nn,{children:[h.jsx(Me,{variant:"default",onClick:()=>Z(null),children:"Cancel"}),h.jsx(Me,{variant:"destructive",onClick:ve,disabled:he.isPending,children:he.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Revoking..."]}):"Revoke"})]})]})}),h.jsx($r,{open:q!==null||L!==null,onOpenChange:()=>{V(null),I(null)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Rotate API Key"})}),L?h.jsx(YC,{copiedKeyId:Q,onClose:()=>I(null),onCopy:xe,secretKey:L,warning:"The previous key has been invalidated. Store this replacement securely."}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"px-5 py-4",children:h.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:"Rotating a key invalidates the previous secret immediately."})}),h.jsxs(Nn,{children:[h.jsx(Me,{variant:"default",onClick:()=>V(null),children:"Cancel"}),h.jsx(Me,{variant:"primary",onClick:Ve,disabled:ie.isPending,children:ie.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Rotating..."]}):"Rotate"})]})]})]})})]})}function bX(){const{preferences:e,updatePreference:t,resetPreferences:n}=of(),s=[{type:"filter",label:"Auto-refresh interval",options:qY.map(i=>({id:`${i.value}`,label:i.label})),activeId:`${e.refreshInterval}`,onActiveChange:i=>t("refreshInterval",Number.parseInt(i,10))},{type:"filter",label:"Items per page",options:VY.map(i=>({id:`${i.value}`,label:i.label})),activeId:`${e.pageSize}`,onActiveChange:i=>t("pageSize",Number.parseInt(i,10))},{type:"filter",label:"Time format",options:[{id:"relative",label:"Relative"},{id:"absolute",label:"Absolute"}],activeId:e.timeFormat,onActiveChange:i=>t("timeFormat",i)},{type:"toggle",label:"Show sparklines",description:"Display mini trend charts in dashboard metric cards",checked:e.showSparklines,onCheckedChange:i=>t("showSparklines",i)}];return h.jsx(Wj,{rows:s,onResetDefaults:n})}function YC({copiedKeyId:e,onClose:t,onCopy:n,secretKey:s,warning:i}){return h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[h.jsx(In,{variant:"destructive",children:h.jsx(Pn,{children:i})}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("code",{className:"flex-1 rounded-md border border-border bg-surface p-3 font-mono text-[11px] text-white break-all",children:s}),h.jsx(Me,{variant:"default",size:"sm",onClick:()=>n(s),children:e===s?"Copied":"Copy"})]}),h.jsx(Nn,{children:h.jsx(Me,{variant:"primary",onClick:t,children:"Done"})})]})}function xX(e){const t=e.toLowerCase();return t.includes("mobile")||t.includes("ios")||t.includes("android")?"mobile":t.includes("tablet")?"tablet":t.includes("desktop")||t.includes("laptop")?"desktop":t.includes("edge")?"edge":t.includes("iot")?"iot":"desktop"}function SX(e){const t=e.toLowerCase();return t.includes("pglite")?"PGlite":t.includes("wa-sqlite")||t.includes("sqlite")?"SQLite":t.includes("postgres")||t.includes("pg")?"PostgreSQL":"unknown"}function _X(e,t){if(t==="absolute")return new Date(e).toLocaleString();try{const n=new Date(e),i=new Date().getTime()-n.getTime(),a=Math.floor(i/1e3),l=Math.floor(a/60),f=Math.floor(l/60),d=Math.floor(f/24);return a<60?"just now":l<60?`${l}m ago`:f<24?`${f}h ago`:`${d}d ago`}catch{return e}}function wX(e,t,n){return{id:e.clientId,type:xX(e.clientId),status:e.activityState==="stale"?"offline":e.activityState==="idle"?"syncing":"online",cursor:e.cursor,actor:e.actorId,mode:e.connectionMode==="realtime"?"realtime":"polling",dialect:SX(e.clientId),scopes:Object.keys(e.effectiveScopes??{}),lastSeen:_X(e.updatedAt,n)}}function EX({emptyState:e}={}){const[t,n]=_.useState(1),[s,i]=_.useState(null),{preferences:a}=of(),{partitionId:l}=sf(),f=a.pageSize,d=a.refreshInterval*1e3,{data:p,isLoading:g}=rf({refetchIntervalMs:d,partitionId:l}),{data:y,isLoading:b,error:x}=pk({limit:f,offset:(t-1)*f,partitionId:l},{refetchIntervalMs:d}),S=AY(),w=Math.ceil((y?.total??0)/f),T=p?.maxCommitSeq??0;_.useEffect(()=>{n(1)},[]);const C=async()=>{if(s)try{await S.mutateAsync({clientId:s,partitionId:l})}finally{i(null)}};if(b||g)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Pt,{size:"lg"})});if(x)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsxs("p",{className:"text-danger",children:["Failed to load clients: ",x.message]})});const O=(y?.items??[]).map(N=>wX(N,T,a.timeFormat));return h.jsxs("div",{className:"flex flex-col gap-5 px-5 py-5",children:[O.length>0&&h.jsx(eA,{clients:O,headSeq:T}),O.length===0?e??h.jsx(eV,{children:h.jsx(Qb,{message:"No clients yet"})}):h.jsx(Gj,{clients:O,headSeq:T,onEvict:N=>{const R=y?.items.find(M=>M.clientId===N);i(R?.clientId??N)}}),w>1&&h.jsx(mx,{page:t,totalPages:w,totalItems:y?.total??0,onPageChange:n}),h.jsx($r,{open:s!==null,onOpenChange:()=>i(null),children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Evict Client"})}),h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[h.jsxs("p",{className:"font-mono text-[11px] text-neutral-300",children:["Are you sure you want to evict client"," ",h.jsxs("span",{className:"font-mono text-white",children:[s?.slice(0,12),"..."]}),"?"]}),h.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:"This will force the client to re-bootstrap on their next sync."})]}),h.jsxs(Nn,{children:[h.jsx(Me,{variant:"default",onClick:()=>i(null),children:"Cancel"}),h.jsx(Me,{variant:"destructive",onClick:C,disabled:S.isPending,children:S.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Evicting..."]}):"Evict"})]})]})})]})}const TX={latencyThresholdMs:1e3,errorRateThreshold:5,clientLagThreshold:50,enabled:!1};function CX(e){return e<1e3?`${e}ms`:e<6e4?`${Math.round(e/1e3)}s`:e<36e5?`${Math.round(e/6e4)}m`:`${Math.round(e/36e5)}h`}function RX(e){const t=e.split(",").map(n=>n.trim()).filter(n=>n.length>0);return Array.from(new Set(t))}function NX(e){switch(e){case"notify_data_change":return"Notify";case"evict_client":return"Evict";case"compact":return"Compact";default:return"Prune"}}function XC(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function jX(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function AX(e){const t=XC(e.requestPayload),n=XC(e.resultPayload);if(e.operationType==="notify_data_change"){const a=jX(t?.tables),l=n?.commitSeq;return`${a.length} table${a.length===1?"":"s"} -> commit #${typeof l=="number"?l:"?"}`}if(e.operationType==="evict_client"){const a=n?.evicted===!0?"evicted":"not found";return`client ${e.targetClientId??"?"} ${a}`}if(e.operationType==="compact")return`${typeof n?.deletedChanges=="number"?n.deletedChanges:0} changes removed`;const s=typeof n?.deletedCommits=="number"?n.deletedCommits:0,i=typeof t?.watermarkCommitSeq=="number"?` at #${t.watermarkCommitSeq}`:"";return`${s} commits removed${i}`}function kX(e){const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function OX(){const{partitionId:e}=sf();return h.jsxs("div",{className:"flex flex-col gap-4 px-5 py-5",children:[h.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[h.jsx(MX,{}),h.jsx(LX,{})]}),h.jsxs("div",{className:"grid gap-4 xl:grid-cols-3",children:[h.jsx(IX,{partitionId:e}),h.jsx(PX,{partitionId:e}),h.jsx(DX,{partitionId:e})]}),h.jsx(zX,{partitionId:e})]})}function MX(){const{data:e,isLoading:t,error:n}=RY();if(t)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Pt,{size:"lg"})});if(n)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsxs("p",{className:"text-danger",children:["Failed to load handlers: ",n.message]})});const s=(e?.items??[]).map(i=>({table:i.table,dependsOn:i.dependsOn?.join(", ")??null,chunkTtl:i.snapshotChunkTtlMs?CX(i.snapshotChunkTtlMs):"default"}));return h.jsx(Zj,{handlers:s,tableCount:e?.items.length??0})}function IX({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState(null),{data:a,isLoading:l}=rf({partitionId:e}),{data:f,isLoading:d,refetch:p}=NY({enabled:!1}),g=kY(),y=async()=>{n(!0),i(null),await p()},b=async()=>{const S=await g.mutateAsync();i(S.deletedCommits)};if(l)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Pt,{size:"lg"})});const x=[{label:"Total commits",value:a?.commitCount??0},{label:"Commit range",value:`${a?.minCommitSeq??0} - ${a?.maxCommitSeq??0}`},{label:"Min active cursor",value:a?.minActiveClientCursor??"N/A",tone:"syncing"}];return h.jsxs(h.Fragment,{children:[h.jsx(_p,{title:"Prune",description:"Delete commits that all clients have already synced. Pruning removes commits older than the oldest active client cursor.",dotColor:"syncing",stats:x,actionLabel:"Preview Prune",actionVariant:"destructive",onAction:y}),h.jsx($r,{open:t,onOpenChange:n,children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Prune Old Commits"})}),h.jsx("div",{className:"px-5 py-4 flex flex-col gap-4",children:s!==null?h.jsxs(In,{variant:"default",children:[h.jsx(tf,{children:"Pruning Complete"}),h.jsxs(Pn,{children:["Successfully deleted ",h.jsx("strong",{children:s})," commits."]})]}):d?h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsx(Pt,{size:"sm"})}):f?h.jsxs(h.Fragment,{children:[h.jsx(In,{variant:f.commitsToDelete>0?"destructive":"default",children:h.jsx(Pn,{children:f.commitsToDelete>0?h.jsxs(h.Fragment,{children:["This will delete"," ",h.jsx("strong",{children:f.commitsToDelete})," commits up to sequence"," ",h.jsxs("code",{className:"font-mono",children:["#",f.watermarkCommitSeq]}),"."]}):"No commits are eligible for pruning."})}),h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsxs("div",{className:"flex justify-between font-mono text-[11px]",children:[h.jsx("span",{className:"text-neutral-500",children:"Watermark commit seq:"}),h.jsxs("span",{className:"text-white",children:["#",f.watermarkCommitSeq]})]}),h.jsxs("div",{className:"flex justify-between font-mono text-[11px] items-center",children:[h.jsx("span",{className:"text-neutral-500",children:"Commits to delete:"}),h.jsx(mn,{variant:f.commitsToDelete>0?"offline":"ghost",children:f.commitsToDelete})]})]})]}):null}),h.jsxs(Nn,{children:[h.jsx(Me,{variant:"default",onClick:()=>n(!1),children:s!==null?"Close":"Cancel"}),s===null&&h.jsx(Me,{variant:"destructive",onClick:b,disabled:g.isPending||d||(f?.commitsToDelete??0)===0,children:g.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Pruning..."]}):"Prune Now"})]})]})})]})}function PX({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState(null),{data:a,isLoading:l}=rf({partitionId:e}),f=OY(),d=()=>{n(!0),i(null)},p=async()=>{const y=await f.mutateAsync();i(y.deletedChanges)};if(l)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Pt,{size:"lg"})});const g=[{label:"Total changes",value:a?.changeCount??0},{label:"Total commits",value:a?.commitCount??0}];return h.jsxs(h.Fragment,{children:[h.jsx(_p,{title:"Compact",description:"Merge old changes to reduce storage space. Compaction merges multiple changes to the same row into a single change.",dotColor:"flow",stats:g,actionLabel:"Run Compaction",actionVariant:"primary",onAction:d}),h.jsx($r,{open:t,onOpenChange:n,children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Compact Changes"})}),h.jsx("div",{className:"px-5 py-4 flex flex-col gap-4",children:s!==null?h.jsxs(In,{variant:"default",children:[h.jsx(tf,{children:"Compaction Complete"}),h.jsxs(Pn,{children:["Successfully removed ",h.jsx("strong",{children:s})," redundant changes."]})]}):h.jsx(In,{variant:"default",children:h.jsx(Pn,{children:"Compaction will merge multiple changes to the same row, keeping only the most recent version. This is safe and can be run at any time."})})}),h.jsxs(Nn,{children:[h.jsx(Me,{variant:"default",onClick:()=>n(!1),children:s!==null?"Close":"Cancel"}),s===null&&h.jsx(Me,{variant:"primary",onClick:p,disabled:f.isPending,children:f.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Compacting..."]}):"Compact Now"})]})]})})]})}function DX({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState("tasks"),[a,l]=_.useState(e??""),[f,d]=_.useState(null),[p,g]=_.useState(null),y=MY(),b=RX(s),x=[{label:"Next tables",value:b.length,tone:"syncing"},{label:"Last commit seq",value:f?`#${f.commitSeq}`:"—",tone:"syncing"},{label:"Last chunks cleared",value:f?.deletedChunks??"—"}],S=()=>{n(!0),g(null)},w=async()=>{if(b.length===0){g("Provide at least one table name.");return}g(null);const T=await y.mutateAsync({tables:b,partitionId:a.trim()||void 0});d(T)};return h.jsxs(h.Fragment,{children:[h.jsx(_p,{title:"Notify Data Change",description:"Create a synthetic commit after external imports or direct DB writes so clients re-bootstrap for affected tables.",dotColor:"healthy",stats:x,actionLabel:"Notify Clients",actionVariant:"primary",onAction:S}),h.jsx($r,{open:t,onOpenChange:n,children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Notify External Data Change"})}),h.jsxs("div",{className:"flex flex-col gap-4 px-5 py-4",children:[f?h.jsxs(In,{variant:"default",children:[h.jsx(tf,{children:"Notification Sent"}),h.jsxs(Pn,{children:["Created synthetic commit"," ",h.jsxs("strong",{children:["#",f.commitSeq]})," for"," ",h.jsx("strong",{children:f.tables.length})," table",f.tables.length===1?"":"s"," and cleared"," ",h.jsx("strong",{children:f.deletedChunks})," cached chunk",f.deletedChunks===1?"":"s","."]})]}):h.jsx(In,{variant:"default",children:h.jsx(Pn,{children:"Use this when data changed outside Syncular push flow. It invalidates cached snapshot chunks and forces clients to pull fresh data."})}),p?h.jsx(In,{variant:"destructive",children:h.jsx(Pn,{children:p})}):null,h.jsxs(ms,{children:[h.jsx(es,{children:"Tables (comma-separated)"}),h.jsx(Gn,{value:s,onChange:T=>i(T.target.value),placeholder:"tasks, notes",disabled:y.isPending}),h.jsx(pc,{children:"Enter one or more table names affected by the external change."})]}),h.jsxs(ms,{children:[h.jsx(es,{children:"Partition ID (optional)"}),h.jsx(Gn,{value:a,onChange:T=>l(T.target.value),placeholder:"default",disabled:y.isPending})]})]}),h.jsxs(Nn,{children:[h.jsx(Me,{variant:"default",onClick:()=>n(!1),children:f?"Close":"Cancel"}),f?null:h.jsx(Me,{variant:"primary",onClick:w,disabled:y.isPending,children:y.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"}),"Notifying..."]}):"Notify Data Change"})]})]})})]})}function zX({partitionId:e}){const[t,n]=_.useState("all"),{data:s,isLoading:i,error:a}=jY({limit:20,offset:0,operationType:t==="all"?void 0:t,partitionId:e},{refetchIntervalMs:5e3});return h.jsx(Jb,{title:"Operation Audit",description:"Recent prune/compact/notify/evict actions with actor and result context.",actions:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Me,{variant:t==="all"?"default":"ghost",size:"sm",onClick:()=>n("all"),children:"All"}),h.jsx(Me,{variant:t==="prune"?"default":"ghost",size:"sm",onClick:()=>n("prune"),children:"Prune"}),h.jsx(Me,{variant:t==="compact"?"default":"ghost",size:"sm",onClick:()=>n("compact"),children:"Compact"}),h.jsx(Me,{variant:t==="notify_data_change"?"default":"ghost",size:"sm",onClick:()=>n("notify_data_change"),children:"Notify"}),h.jsx(Me,{variant:t==="evict_client"?"default":"ghost",size:"sm",onClick:()=>n("evict_client"),children:"Evict"})]}),contentClassName:"pt-2",children:i?h.jsx("div",{className:"flex items-center justify-center py-10",children:h.jsx(Pt,{size:"lg"})}):a?h.jsx(In,{variant:"destructive",children:h.jsxs(Pn,{children:["Failed to load operation audit events: ",a.message]})}):(s?.items.length??0)===0?h.jsx("div",{className:"px-2 py-8 text-sm text-neutral-500",children:"No operation events found for this filter."}):h.jsx("div",{className:"overflow-x-auto",children:h.jsxs(tl,{children:[h.jsx(nl,{children:h.jsxs(ss,{children:[h.jsx(ht,{children:"Time"}),h.jsx(ht,{children:"Type"}),h.jsx(ht,{children:"User"}),h.jsx(ht,{children:"Target"}),h.jsx(ht,{children:"Result"})]})}),h.jsx(rl,{children:(s?.items??[]).map((l,f)=>h.jsxs(ss,{children:[h.jsx(pt,{className:"whitespace-nowrap text-xs text-neutral-400",children:kX(l.createdAt)}),h.jsx(pt,{children:h.jsx(mn,{variant:"ghost",children:NX(l.operationType)})}),h.jsx(pt,{className:"font-mono text-xs",children:l.consoleUserId??"system"}),h.jsx(pt,{className:"font-mono text-xs",children:l.targetClientId??l.partitionId??(l.operationType==="notify_data_change"?"partition default":"global")}),h.jsx(pt,{className:"font-mono text-xs text-neutral-300",children:AX(l)})]},`${l.operationId}:${l.createdAt}:${f}`))})]})})})}function LX(){const[e,t]=pi("console:alert-config",TX),n={p90Latency:e.latencyThresholdMs,errorRate:e.errorRateThreshold,clientLag:e.clientLagThreshold},s=a=>{t(l=>({...l,latencyThresholdMs:a.p90Latency,errorRateThreshold:a.errorRate,clientLagThreshold:a.clientLag}))},i=a=>{t(l=>({...l,enabled:a}))};return h.jsx($j,{enabled:e.enabled,onEnabledChange:i,thresholds:n,onThresholdsChange:s})}function UX(e){if(e===0)return"0 B";const t=["B","KB","MB","GB","TB"],n=Math.floor(Math.log(e)/Math.log(1024));return`${(e/1024**n).toFixed(n===0?0:1)} ${t[n]}`}function $X(e){const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function BX(){const[e,t]=_.useState(""),[n,s]=_.useState(void 0),[i,a]=_.useState(void 0),[l,f]=_.useState([]),[d,p]=_.useState(null),{data:g,isLoading:y,error:b}=$Y({prefix:n,cursor:i,limit:100}),x=BY(),S=FY();function w(){const M=e.trim();s(M.length>0?M:void 0),a(void 0),f([])}function T(){t(""),s(void 0),a(void 0),f([])}function C(){g?.cursor&&(f(M=>[...M,i??""]),a(g.cursor))}function O(){f(M=>{const z=[...M],j=z.pop();return a(j&&j.length>0?j:void 0),z})}function N(){d&&x.mutate(d,{onSuccess:()=>p(null)})}if(y)return h.jsx("div",{className:"flex flex-col gap-4 px-5 py-5",children:h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Pt,{size:"lg"})})});if(b)return h.jsx("div",{className:"flex flex-col gap-4 px-5 py-5",children:h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsxs("p",{className:"text-danger font-mono text-[11px]",children:["Failed to load storage items: ",b.message]})})});const R=g?.items??[];return h.jsxs("div",{className:"flex flex-col gap-4 px-5 py-5",children:[h.jsx(Jb,{title:"Storage",actions:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Gn,{placeholder:"Prefix filter...",value:e,onChange:M=>t(M.target.value),onKeyDown:M=>{M.key==="Enter"&&w()},className:"h-7 w-48 text-xs"}),h.jsx(Me,{variant:"default",size:"sm",onClick:w,children:"Filter"}),n&&h.jsx(Me,{variant:"ghost",size:"sm",onClick:T,children:"Clear"})]}),children:R.length===0?h.jsx(Qb,{message:n?`No storage items matching prefix "${n}".`:"No storage items found."}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"overflow-x-auto",children:h.jsxs(tl,{children:[h.jsx(nl,{children:h.jsxs(ss,{children:[h.jsx(ht,{children:"Key"}),h.jsx(ht,{children:"Size"}),h.jsx(ht,{children:"Type"}),h.jsx(ht,{children:"Uploaded"}),h.jsx(ht,{children:"Actions"})]})}),h.jsx(rl,{children:R.map(M=>h.jsxs(ss,{children:[h.jsx(pt,{className:"font-mono text-xs max-w-[320px]",title:M.key,children:M.key}),h.jsx(pt,{className:"font-mono text-xs text-neutral-400 whitespace-nowrap",children:UX(M.size)}),h.jsx(pt,{children:M.httpMetadata?.contentType?h.jsx(mn,{variant:"ghost",children:M.httpMetadata.contentType}):h.jsx("span",{className:"text-neutral-500 text-xs",children:"--"})}),h.jsx(pt,{className:"whitespace-nowrap text-xs text-neutral-400",children:$X(M.uploaded)}),h.jsx(pt,{children:h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(Me,{variant:"ghost",size:"sm",onClick:()=>{S(M.key)},children:"Download"}),h.jsx(Me,{variant:"ghost",size:"sm",onClick:()=>p(M.key),children:"Delete"})]})})]},M.key))})]})}),h.jsxs("div",{className:"flex items-center justify-between px-2 py-2",children:[h.jsx(Me,{variant:"ghost",size:"sm",disabled:l.length===0,onClick:O,children:"Previous"}),h.jsx(Me,{variant:"ghost",size:"sm",disabled:!g?.truncated,onClick:C,children:"Next"})]})]})}),h.jsx($r,{open:d!==null,onOpenChange:()=>p(null),children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Delete Storage Item"})}),h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[h.jsxs("p",{className:"font-mono text-[11px] text-neutral-300",children:["Are you sure you want to delete"," ",h.jsx("span",{className:"font-mono text-white",children:d}),"?"]}),h.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:"This action cannot be undone."})]}),h.jsxs(Nn,{children:[h.jsx(Me,{variant:"default",onClick:()=>p(null),children:"Cancel"}),h.jsx(Me,{variant:"destructive",onClick:N,disabled:x.isPending,children:x.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Pt,{size:"sm"})," Deleting..."]}):"Delete"})]})]})})]})}const FX={};function au(e,t){if(t==="absolute")return new Date(e).toLocaleString();const n=new Date(e),i=new Date().getTime()-n.getTime(),a=Math.floor(i/1e3);return a<60?`${a}s`:a<3600?`${Math.floor(a/60)}m`:a<86400?`${Math.floor(a/3600)}h`:`${Math.floor(a/86400)}d`}function HX(e){const t=e.split(/\s+/).map(i=>i.trim()).filter(i=>i.length>0),n={},s=[];for(const i of t){const[a="",...l]=i.split(":"),f=l.join(":").trim(),d=a.toLowerCase();if(!f){s.push(i);continue}if(d==="actor"){n.actorId=f;continue}if(d==="client"){n.clientId=f;continue}if(d==="table"){n.table=f;continue}if(d==="request"){n.requestId=f;continue}if(d==="trace"){n.traceId=f;continue}s.push(i)}return s.length>0&&(n.search=s.join(" ")),n}function qX(e){return e==="1h"?3600*1e3:e==="6h"?360*60*1e3:e==="24h"?1440*60*1e3:e==="7d"?10080*60*1e3:720*60*60*1e3}function Gd(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function VX(e,t){return e?`#${e.federatedCommitId??(t?`${t}:${e.commitSeq}`:String(e.commitSeq))}`:"#?"}function KX(e,t){return e?`E${e.federatedEventId??(t?`${t}:${e.eventId}`:e.eventId)}`:"E?"}function GX(e,t,n){return!e||!t?null:e.replaceAll("{traceId}",encodeURIComponent(t)).replaceAll("{spanId}",encodeURIComponent(n??""))}function vx({initialSelectedEntryId:e}={}){const{preferences:t}=of(),{partitionId:n}=sf(),{range:s,setRange:i}=mk(),a=t.pageSize,l=t.refreshInterval*1e3,f=FX?.VITE_CONSOLE_TRACE_URL_TEMPLATE,[d,p]=_.useState(()=>e?.startsWith("#")?"commits":e?.startsWith("E")?"events":"all"),[g,y]=_.useState("all"),[b,x]=_.useState("all"),[S,w]=_.useState(""),[T,C]=_.useState(1),[O,N]=_.useState(!1),[R,M]=_.useState(e??null),z=_.useRef(!1),j=_.useMemo(()=>HX(S),[S]),A=_.useMemo(()=>new Date(Date.now()-qX(s)).toISOString(),[s]),{data:P,isLoading:Q,refetch:B}=EY({limit:a,offset:(T-1)*a,...n?{partitionId:n}:{},view:d,...d!=="commits"&&g!=="all"?{eventType:g}:{},...d!=="commits"&&b!=="all"?{outcome:b}:{},...j.actorId?{actorId:j.actorId}:{},...j.clientId?{clientId:j.clientId}:{},...j.requestId?{requestId:j.requestId}:{},...j.traceId?{traceId:j.traceId}:{},...j.table?{table:j.table}:{},...j.search?{search:j.search}:{},from:A},{refetchIntervalMs:l}),U=JY(),Z=R?.startsWith("#")?R.slice(1):void 0,K=R?.startsWith("E")?R.slice(1):void 0,ee=Z&&Z!=="?"?Z:void 0,D=K&&K!=="?"?K:void 0,{data:G,isLoading:q,error:V}=wY(ee,{enabled:ee!==void 0,partitionId:n}),{data:L,isLoading:I,error:H}=TY(D,{enabled:D!==void 0,partitionId:n}),{data:W,isLoading:Y,error:ae}=CY(D,{enabled:D!==void 0&&!!L?.payloadRef,partitionId:n}),se=_.useMemo(()=>GX(f,L?.traceId??null,L?.spanId??null),[L?.spanId,L?.traceId,f]);_.useEffect(()=>{C(1)},[]),_.useEffect(()=>{C(1)},[]),_.useEffect(()=>{e&&M(e)},[e]),_.useEffect(()=>{if(!z.current){z.current=!0;return}M(null)},[]),_.useEffect(()=>{C(1),M(null)},[]);const Se=_.useMemo(()=>(P?.items??[]).map(we=>{const ye=we.instanceId??we.commit?.instanceId??we.event?.instanceId,xe=ye?`[${ye}] `:"";if(we.type==="commit"&&we.commit){const Ie=we.commit;return{type:"commit",id:VX(Ie,ye),outcome:"--",duration:"--",actor:Ie.actorId,client:Ie.clientId,detail:`${xe}${Ie.changeCount} chg | ${(Ie.affectedTables??[]).join(", ")}`,time:au(we.timestamp,t.timeFormat)}}const ve=we.event;return ve?{type:ve.eventType,id:KX(ve,ye),outcome:ve.outcome,duration:`${ve.durationMs}ms`,actor:ve.actorId,client:ve.clientId,detail:`${xe}${(ve.tables??[]).join(", ")||"--"}`,time:au(we.timestamp,t.timeFormat)}:{type:"pull",id:"E?",outcome:"unknown",duration:"--",actor:"",client:"",detail:"--",time:au(we.timestamp,t.timeFormat)}}),[t.timeFormat,P?.items]),pe=P?.total??0,Oe=Math.max(1,Math.ceil(pe/a)),_e=Q,re=[{label:"",options:[{id:"all",label:"All"},{id:"commits",label:"Commits"},{id:"events",label:"Events"}],activeId:d,onActiveChange:ie=>{p(ie),ie==="commits"&&(y("all"),x("all")),C(1)}},{label:"Time",options:[{id:"1h",label:"1h"},{id:"6h",label:"6h"},{id:"24h",label:"24h"},{id:"7d",label:"7d"},{id:"30d",label:"30d"}],activeId:s,onActiveChange:ie=>{i(ie),C(1)}},{label:"Type",options:[{id:"all",label:"All"},{id:"push",label:"Push"},{id:"pull",label:"Pull"}],activeId:g,onActiveChange:ie=>{y(ie),C(1)}},{label:"Outcome",options:[{id:"all",label:"All"},{id:"applied",label:"Applied"},{id:"error",label:"Error"},{id:"rejected",label:"Rejected"}],activeId:b,onActiveChange:ie=>{x(ie),C(1)}}];function he(){U.mutate(void 0,{onSuccess:()=>{N(!1),B()}})}return h.jsxs("div",{className:"flex flex-col h-full",children:[_e&&Se.length===0?h.jsx("div",{className:"flex items-center justify-center py-24",children:h.jsx(Pt,{size:"lg"})}):h.jsx(Jj,{entries:Se,selectedEntryId:R,onEntryClick:ie=>M(ie.id),filterBar:h.jsx(Vj,{groups:re,searchValue:S,searchPlaceholder:"Use actor:, client:, table:, request:, trace: or free text...",onSearchChange:w,actions:h.jsxs(h.Fragment,{children:[h.jsx(Me,{size:"sm",variant:"ghost",onClick:()=>{B()},children:"Refresh"}),h.jsx(Me,{size:"sm",variant:"ghost",children:"Export"}),h.jsx(Me,{size:"sm",variant:"destructive",onClick:()=>N(!0),children:"Clear"})]})}),pagination:h.jsx(mx,{page:T,totalPages:Oe,totalItems:pe,onPageChange:C})}),h.jsx($r,{open:R!==null,onOpenChange:ie=>{ie||M(null)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:ee!==void 0?`Commit #${ee}`:D!==void 0?`Event E${D}`:"Entry details"})}),h.jsx("div",{className:"px-5 py-4 space-y-3 max-h-[70vh] overflow-y-auto",children:q||I?h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsx(Pt,{size:"sm"})}):V||H?h.jsx("p",{className:"font-mono text-[11px] text-offline",children:"Failed to load details."}):G?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"grid grid-cols-2 gap-3 font-mono text-[11px]",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Actor"}),h.jsx("div",{className:"text-neutral-100",children:G.actorId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Client"}),h.jsx("div",{className:"text-neutral-100",children:G.clientId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Instance"}),h.jsx("div",{className:"text-neutral-100",children:G.instanceId??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Created"}),h.jsx("div",{className:"text-neutral-100",children:au(G.createdAt,t.timeFormat)})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Changes"}),h.jsx("div",{className:"text-neutral-100",children:G.changeCount})]})]}),h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Affected Tables"}),h.jsx("p",{className:"font-mono text-[11px] text-neutral-200",children:G.affectedTables.join(", ")||"--"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500",children:"Changes"}),G.changes.length===0?h.jsx("p",{className:"font-mono text-[11px] text-neutral-500",children:"No changes recorded."}):G.changes.map(ie=>h.jsxs("div",{className:"rounded-md border border-border p-3 space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between font-mono text-[11px]",children:[h.jsxs("span",{className:"text-neutral-300",children:[ie.table," | ",ie.op]}),h.jsxs("span",{className:"text-neutral-500",children:["#",ie.changeId]})]}),h.jsxs("div",{className:"font-mono text-[11px] text-neutral-400",children:["rowId: ",ie.rowId,ie.rowVersion!==null?` | version: ${ie.rowVersion}`:""]}),h.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:Gd(ie.rowJson)})]},ie.changeId))]})]}):L?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"grid grid-cols-2 gap-3 font-mono text-[11px]",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Type"}),h.jsx("div",{className:"text-neutral-100",children:L.eventType})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Path"}),h.jsx("div",{className:"text-neutral-100",children:L.syncPath})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Instance"}),h.jsx("div",{className:"text-neutral-100",children:L.instanceId??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Outcome"}),h.jsx("div",{className:"text-neutral-100",children:L.outcome})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Response Status"}),h.jsx("div",{className:"text-neutral-100",children:L.responseStatus})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Actor"}),h.jsx("div",{className:"text-neutral-100",children:L.actorId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Client"}),h.jsx("div",{className:"text-neutral-100",children:L.clientId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Status"}),h.jsx("div",{className:"text-neutral-100",children:L.statusCode})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Transport"}),h.jsx("div",{className:"text-neutral-100",children:L.transportPath})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Duration"}),h.jsxs("div",{className:"text-neutral-100",children:[L.durationMs,"ms"]})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Request ID"}),h.jsx("div",{className:"text-neutral-100",children:L.requestId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Trace ID"}),h.jsx("div",{className:"text-neutral-100",children:L.traceId??"--"}),se&&h.jsx("a",{href:se,target:"_blank",rel:"noreferrer",className:"font-mono text-[10px] text-flow underline underline-offset-4",children:"Open external trace"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Span ID"}),h.jsx("div",{className:"text-neutral-100",children:L.spanId??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Commit Seq"}),h.jsx("div",{className:"text-neutral-100",children:L.commitSeq??"--"}),L.commitSeq!==null&&h.jsx(Me,{variant:"ghost",size:"sm",onClick:()=>M(`#${L.instanceId?`${L.instanceId}:`:""}${L.commitSeq}`),children:"Open linked commit"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Subscription Count"}),h.jsx("div",{className:"text-neutral-100",children:L.subscriptionCount??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Error Code"}),h.jsx("div",{className:"text-neutral-100",children:L.errorCode??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Payload Ref"}),h.jsx("div",{className:"text-neutral-100",children:L.payloadRef??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Created"}),h.jsx("div",{className:"text-neutral-100",children:au(L.createdAt,t.timeFormat)})]})]}),h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Tables"}),h.jsx("p",{className:"font-mono text-[11px] text-neutral-200",children:L.tables.join(", ")||"--"})]}),L.scopesSummary&&h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Scopes Summary"}),h.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:Gd(L.scopesSummary)})]}),L.payloadRef&&h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Payload Snapshot"}),Y?h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Pt,{size:"sm"}),h.jsx("span",{className:"font-mono text-[11px] text-neutral-400",children:"Loading payload snapshot..."})]}):ae?h.jsx("p",{className:"font-mono text-[11px] text-offline",children:"Failed to load payload snapshot."}):W?h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500",children:"Request"}),h.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:Gd(W.requestPayload)}),h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500",children:"Response"}),h.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:Gd(W.responsePayload)})]}):h.jsx("p",{className:"font-mono text-[11px] text-neutral-500",children:"No payload snapshot available."})]}),L.errorMessage&&h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Error"}),h.jsx("p",{className:"font-mono text-[11px] text-offline",children:L.errorMessage})]})]}):h.jsx("p",{className:"font-mono text-[11px] text-neutral-500",children:"No details available for this row."})}),h.jsx(Nn,{children:h.jsx(Me,{variant:"default",size:"sm",onClick:()=>M(null),children:"Close"})})]})}),h.jsx($r,{open:O,onOpenChange:ie=>{ie||N(!1)},children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsx(mr,{children:"Clear all events"})}),h.jsx("div",{className:"p-4",children:h.jsx("span",{className:"font-mono text-[11px] text-neutral-400",children:"This will permanently delete all request events. Commits are not affected. Are you sure?"})}),h.jsxs(Nn,{children:[h.jsx(Me,{variant:"default",size:"sm",onClick:()=>N(!1),children:"Cancel"}),h.jsx(Me,{variant:"destructive",size:"sm",onClick:he,disabled:U.isPending,children:U.isPending?"Clearing...":"Clear all"})]})]})})]})}const ZX=co({getParentRoute:()=>uo,path:"/config",component:dX}),YX=co({getParentRoute:()=>uo,path:"/fleet",component:EX}),XX=co({getParentRoute:()=>uo,path:"/",component:fX});function QX(){const{seq:e}=gk.useParams();return h.jsx(vx,{initialSelectedEntryId:`#${e}`})}const gk=co({getParentRoute:()=>uo,path:"/investigate/commit/$seq",component:QX});function WX(){const{id:e}=yk.useParams();return h.jsx(vx,{initialSelectedEntryId:`E${e}`})}const yk=co({getParentRoute:()=>uo,path:"/investigate/event/$id",component:WX}),JX=co({getParentRoute:()=>uo,path:"/ops",component:OX}),eQ=co({getParentRoute:()=>uo,path:"/storage",component:BX}),tQ=co({getParentRoute:()=>uo,path:"/stream",component:vx}),nQ=uo.addChildren([XX,tQ,gk,yk,YX,JX,eQ,ZX]),rQ="syncular-console-basepath",sQ="syncular-console-server-url",oQ="syncular-console-token";function iQ(e){if(!e)return;const t=e.trim();return t.length>0?t:void 0}function $v(e){const t=globalThis.document;if(!t)return;const n=t.querySelector(`meta[name="${e}"]`)?.getAttribute("content");return iQ(n)}function vk(e){return!e||e==="/"?"/":(e.startsWith("/")?e:`/${e}`).replace(/\/+$/g,"")||"/"}function aQ(){return vk($v(rQ))}function cQ(){const e=$v(sQ),t=$v(oQ);return!e||!t?null:{serverUrl:e,token:t}}function lQ(){return new k6({defaultOptions:{queries:{staleTime:5e3,retry:1}}})}function uQ(e){return vk(e??aQ())}function fQ(e){const[t]=_.useState(()=>lQ()),n=_.useMemo(()=>DH({routeTree:nQ,basepath:uQ(e.basePath)}),[e.basePath]),s=e.defaultConfig===void 0?cQ():e.defaultConfig,i=e.autoConnect??e.defaultConfig===void 0;return h.jsx(O6,{client:t,children:h.jsx(WH,{defaultConfig:s,autoConnect:i,children:h.jsx(UH,{router:n})})})}function dQ(e){return h.jsx("div",{className:yx,children:h.jsx(fQ,{...e})})}function hQ(e){const t=document.querySelector(e);if(!t)throw new Error(`Unable to mount console: ${e} not found`);return t}function pQ(e,t={}){const n=hQ(e);KY(n);const s=a6.createRoot(n),i=h.jsx(dQ,{basePath:t.basePath,defaultConfig:t.defaultConfig,autoConnect:t.autoConnect});return t.strictMode===!1?(s.render(i),s):(s.render(h.jsx(_.StrictMode,{children:i})),s)}var mQ={};const gQ="syncular-sentry-dsn",yQ="syncular-sentry-environment",vQ="syncular-sentry-release";function gu(e){if(!e)return;const t=e.trim();return t.length>0?t:void 0}function By(e){if(typeof document>"u")return;const t=document.querySelector(`meta[name="${e}"]`)?.getAttribute("content");return gu(t)}function Fy(e){if(!(typeof process>"u"))return gu(mQ[e])}function Hy(e){for(const t of e)if(t)return t}function bQ(){const e=Hy([gu(globalThis.__SYNCULAR_SENTRY_DSN__),By(gQ),Fy("SYNCULAR_SENTRY_DSN")]);if(!e)return null;const t=Hy([gu(globalThis.__SYNCULAR_SENTRY_ENVIRONMENT__),By(yQ),Fy("SYNCULAR_SENTRY_ENVIRONMENT")]),n=Hy([gu(globalThis.__SYNCULAR_SENTRY_RELEASE__),By(vQ),Fy("SYNCULAR_SENTRY_RELEASE")]);return{dsn:e,environment:t,release:n,enableLogs:!0,tracesSampleRate:.2,tracePropagationTargets:[/^https?:\/\/.*\/api\/.*/]}}const QC=bQ();QC&&WB(QC);pQ("#root");
|