tmex-cli 0.6.8 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,386 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SettingsPage-D-ttUVSw.js","assets/card-BfO0Uw5Q.js","assets/refresh-cw-C1HbpgDO.js","assets/DevicesPage-JZ_FB4Hs.js","assets/DevicePage-BXgCF7q_.js"])))=>i.map(i=>d[i]);
2
+ var $D=Object.defineProperty;var Q1=e=>{throw TypeError(e)};var YD=(e,t,n)=>t in e?$D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var tt=(e,t,n)=>YD(e,typeof t!="symbol"?t+"":t,n),Jg=(e,t,n)=>t.has(e)||Q1("Cannot "+n);var ne=(e,t,n)=>(Jg(e,t,"read from private field"),n?n.call(e):t.get(e)),ut=(e,t,n)=>t.has(e)?Q1("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ge=(e,t,n,r)=>(Jg(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),It=(e,t,n)=>(Jg(e,t,"access private method"),n);var Uf=(e,t,n,r)=>({set _(a){Ge(e,t,a,n)},get _(){return ne(e,t,r)}});function WD(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const s=Object.getOwnPropertyDescriptor(r,a);s&&Object.defineProperty(e,a,s.get?s:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const s of a)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const s={};return a.integrity&&(s.integrity=a.integrity),a.referrerPolicy&&(s.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?s.credentials="include":a.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(a){if(a.ep)return;a.ep=!0;const s=n(a);fetch(a.href,s)}})();const KD="modulepreload",GD=function(e){return"/"+e},Z1={},Nv=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let l=function(d){return Promise.all(d.map(m=>Promise.resolve(m).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),f=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));a=l(n.map(d=>{if(d=GD(d),d in Z1)return;Z1[d]=!0;const m=d.endsWith(".css"),p=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const y=document.createElement("link");if(y.rel=m?"stylesheet":KD,m||(y.as="script"),y.crossOrigin="",y.href=d,f&&y.setAttribute("nonce",f),document.head.appendChild(y),m)return new Promise((g,x)=>{y.addEventListener("load",g),y.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${d}`)))})}))}function s(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return a.then(l=>{for(const c of l||[])c.status==="rejected"&&s(c.reason);return t().catch(s)})};function sp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ey={exports:{}},hc={};/**
3
+ * @license React
4
+ * react-jsx-runtime.production.js
5
+ *
6
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */var J1;function XD(){if(J1)return hc;J1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,s){var l=null;if(s!==void 0&&(l=""+s),a.key!==void 0&&(l=""+a.key),"key"in a){s={};for(var c in a)c!=="key"&&(s[c]=a[c])}else s=a;return a=s.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:s}}return hc.Fragment=t,hc.jsx=n,hc.jsxs=n,hc}var eE;function QD(){return eE||(eE=1,ey.exports=XD()),ey.exports}var E=QD(),hu=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(){}},ZD={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},yo,Av,NR,JD=(NR=class{constructor(){ut(this,yo,ZD);ut(this,Av,!1)}setTimeoutProvider(e){Ge(this,yo,e)}setTimeout(e,t){return ne(this,yo).setTimeout(e,t)}clearTimeout(e){ne(this,yo).clearTimeout(e)}setInterval(e,t){return ne(this,yo).setInterval(e,t)}clearInterval(e){ne(this,yo).clearInterval(e)}},yo=new WeakMap,Av=new WeakMap,NR),ms=new JD;function eI(e){setTimeout(e,0)}var Ns=typeof window>"u"||"Deno"in globalThis;function xr(){}function tI(e,t){return typeof e=="function"?e(t):e}function ub(e){return typeof e=="number"&&e>=0&&e!==1/0}function UR(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Oo(e,t){return typeof e=="function"?e(t):e}function fi(e,t){return typeof e=="function"?e(t):e}function tE(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:s,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==Dv(l,t.options))return!1}else if(!Xc(t.queryKey,l))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||a&&a!==t.state.fetchStatus||s&&!s(t))}function nE(e,t){const{exact:n,status:r,predicate:a,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Ds(t.options.mutationKey)!==Ds(s))return!1}else if(!Xc(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function Dv(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ds)(e)}function Ds(e){return JSON.stringify(e,(t,n)=>cb(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function Xc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Xc(e[n],t[n])):!1}var nI=Object.prototype.hasOwnProperty;function VR(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=rE(e)&&rE(t);if(!r&&!(cb(e)&&cb(t)))return t;const s=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),c=l.length,f=r?new Array(c):{};let d=0;for(let m=0;m<c;m++){const p=r?m:l[m],y=e[p],g=t[p];if(y===g){f[p]=y,(r?m<s:nI.call(e,p))&&d++;continue}if(y===null||g===null||typeof y!="object"||typeof g!="object"){f[p]=g;continue}const x=VR(y,g,n+1);f[p]=x,x===y&&d++}return s===c&&d===s?e:f}function Dh(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 rE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function cb(e){if(!iE(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!iE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function iE(e){return Object.prototype.toString.call(e)==="[object Object]"}function rI(e){return new Promise(t=>{ms.setTimeout(t,e)})}function db(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?VR(e,t):t}function iI(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function aI(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Iv=Symbol();function qR(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Iv?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Pv(e,t){return typeof e=="function"?e(...t):!!e}function oI(e,t,n){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=t()),r||(r=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),e}var vs,bo,ql,DR,sI=(DR=class extends hu{constructor(){super();ut(this,vs);ut(this,bo);ut(this,ql);Ge(this,ql,t=>{if(!Ns&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ne(this,bo)||this.setEventListener(ne(this,ql))}onUnsubscribe(){var t;this.hasListeners()||((t=ne(this,bo))==null||t.call(this),Ge(this,bo,void 0))}setEventListener(t){var n;Ge(this,ql,t),(n=ne(this,bo))==null||n.call(this),Ge(this,bo,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){ne(this,vs)!==t&&(Ge(this,vs,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof ne(this,vs)=="boolean"?ne(this,vs):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},vs=new WeakMap,bo=new WeakMap,ql=new WeakMap,DR),Lv=new sI;function fb(){let e,t;const n=new Promise((a,s)=>{e=a,t=s});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}var lI=eI;function uI(){let e=[],t=0,n=c=>{c()},r=c=>{c()},a=lI;const s=c=>{t?e.push(c):a(()=>{n(c)})},l=()=>{const c=e;e=[],c.length&&a(()=>{r(()=>{c.forEach(f=>{n(f)})})})};return{batch:c=>{let f;t++;try{f=c()}finally{t--,t||l()}return f},batchCalls:c=>(...f)=>{s(()=>{c(...f)})},schedule:s,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{a=c}}}var Zn=uI(),$l,vo,Yl,IR,cI=(IR=class extends hu{constructor(){super();ut(this,$l,!0);ut(this,vo);ut(this,Yl);Ge(this,Yl,t=>{if(!Ns&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){ne(this,vo)||this.setEventListener(ne(this,Yl))}onUnsubscribe(){var t;this.hasListeners()||((t=ne(this,vo))==null||t.call(this),Ge(this,vo,void 0))}setEventListener(t){var n;Ge(this,Yl,t),(n=ne(this,vo))==null||n.call(this),Ge(this,vo,t(this.setOnline.bind(this)))}setOnline(t){ne(this,$l)!==t&&(Ge(this,$l,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return ne(this,$l)}},$l=new WeakMap,vo=new WeakMap,Yl=new WeakMap,IR),Ih=new cI;function dI(e){return Math.min(1e3*2**e,3e4)}function $R(e){return(e??"online")==="online"?Ih.isOnline():!0}var hb=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function YR(e){let t=!1,n=0,r;const a=fb(),s=()=>a.status!=="pending",l=C=>{var T;if(!s()){const S=new hb(C);y(S),(T=e.onCancel)==null||T.call(e,S)}},c=()=>{t=!0},f=()=>{t=!1},d=()=>Lv.isFocused()&&(e.networkMode==="always"||Ih.isOnline())&&e.canRun(),m=()=>$R(e.networkMode)&&e.canRun(),p=C=>{s()||(r==null||r(),a.resolve(C))},y=C=>{s()||(r==null||r(),a.reject(C))},g=()=>new Promise(C=>{var T;r=S=>{(s()||d())&&C(S)},(T=e.onPause)==null||T.call(e)}).then(()=>{var C;r=void 0,s()||(C=e.onContinue)==null||C.call(e)}),x=()=>{if(s())return;let C;const T=n===0?e.initialPromise:void 0;try{C=T??e.fn()}catch(S){C=Promise.reject(S)}Promise.resolve(C).then(p).catch(S=>{var O;if(s())return;const R=e.retry??(Ns?0:3),k=e.retryDelay??dI,M=typeof k=="function"?k(n,S):k,D=R===!0||typeof R=="number"&&n<R||typeof R=="function"&&R(n,S);if(t||!D){y(S);return}n++,(O=e.onFail)==null||O.call(e,n,S),rI(M).then(()=>d()?void 0:g()).then(()=>{t?y(S):x()})})};return{promise:a,status:()=>a.status,cancel:l,continue:()=>(r==null||r(),a),cancelRetry:c,continueRetry:f,canStart:m,start:()=>(m()?x():g().then(x),a)}}var xs,PR,WR=(PR=class{constructor(){ut(this,xs)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ub(this.gcTime)&&Ge(this,xs,ms.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ns?1/0:300*1e3))}clearGcTimeout(){ne(this,xs)&&(ms.clearTimeout(ne(this,xs)),Ge(this,xs,void 0))}},xs=new WeakMap,PR),ws,Wl,ci,Ss,nr,ld,Es,Mi,Sa,LR,fI=(LR=class extends WR{constructor(t){super();ut(this,Mi);ut(this,ws);ut(this,Wl);ut(this,ci);ut(this,Ss);ut(this,nr);ut(this,ld);ut(this,Es);Ge(this,Es,!1),Ge(this,ld,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ge(this,Ss,t.client),Ge(this,ci,ne(this,Ss).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ge(this,ws,oE(this.options)),this.state=t.state??ne(this,ws),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=ne(this,nr))==null?void 0:t.promise}setOptions(t){if(this.options={...ne(this,ld),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=oE(this.options);n.data!==void 0&&(this.setState(aE(n.data,n.dataUpdatedAt)),Ge(this,ws,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ne(this,ci).remove(this)}setData(t,n){const r=db(this.state.data,t,this.options);return It(this,Mi,Sa).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){It(this,Mi,Sa).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=ne(this,nr))==null?void 0:r.promise;return(a=ne(this,nr))==null||a.cancel(t),n?n.then(xr).catch(xr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ne(this,ws))}isActive(){return this.observers.some(t=>fi(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Iv||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Oo(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!UR(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=ne(this,nr))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=ne(this,nr))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),ne(this,ci).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(ne(this,nr)&&(ne(this,Es)?ne(this,nr).cancel({revert:!0}):ne(this,nr).cancelRetry()),this.scheduleGc()),ne(this,ci).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||It(this,Mi,Sa).call(this,{type:"invalidate"})}async fetch(t,n){var f,d,m,p,y,g,x,C,T,S,R,k;if(this.state.fetchStatus!=="idle"&&((f=ne(this,nr))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ne(this,nr))return ne(this,nr).continueRetry(),ne(this,nr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const M=this.observers.find(D=>D.options.queryFn);M&&this.setOptions(M.options)}const r=new AbortController,a=M=>{Object.defineProperty(M,"signal",{enumerable:!0,get:()=>(Ge(this,Es,!0),r.signal)})},s=()=>{const M=qR(this.options,n),O=(()=>{const N={client:ne(this,Ss),queryKey:this.queryKey,meta:this.meta};return a(N),N})();return Ge(this,Es,!1),this.options.persister?this.options.persister(M,O,this):M(O)},c=(()=>{const M={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:ne(this,Ss),state:this.state,fetchFn:s};return a(M),M})();(d=this.options.behavior)==null||d.onFetch(c,this),Ge(this,Wl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=c.fetchOptions)==null?void 0:m.meta))&&It(this,Mi,Sa).call(this,{type:"fetch",meta:(p=c.fetchOptions)==null?void 0:p.meta}),Ge(this,nr,YR({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:M=>{M instanceof hb&&M.revert&&this.setState({...ne(this,Wl),fetchStatus:"idle"}),r.abort()},onFail:(M,D)=>{It(this,Mi,Sa).call(this,{type:"failed",failureCount:M,error:D})},onPause:()=>{It(this,Mi,Sa).call(this,{type:"pause"})},onContinue:()=>{It(this,Mi,Sa).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const M=await ne(this,nr).start();if(M===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(M),(g=(y=ne(this,ci).config).onSuccess)==null||g.call(y,M,this),(C=(x=ne(this,ci).config).onSettled)==null||C.call(x,M,this.state.error,this),M}catch(M){if(M instanceof hb){if(M.silent)return ne(this,nr).promise;if(M.revert){if(this.state.data===void 0)throw M;return this.state.data}}throw It(this,Mi,Sa).call(this,{type:"error",error:M}),(S=(T=ne(this,ci).config).onError)==null||S.call(T,M,this),(k=(R=ne(this,ci).config).onSettled)==null||k.call(R,this.state.data,M,this),M}finally{this.scheduleGc()}}},ws=new WeakMap,Wl=new WeakMap,ci=new WeakMap,Ss=new WeakMap,nr=new WeakMap,ld=new WeakMap,Es=new WeakMap,Mi=new WeakSet,Sa=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...KR(r.data,this.options),fetchMeta:t.meta??null};case"success":const a={...r,...aE(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ge(this,Wl,t.manual?a:void 0),a;case"error":const s=t.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Zn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),ne(this,ci).notify({query:this,type:"updated",action:t})})},LR);function KR(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:$R(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function aE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function oE(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Ir,Jt,ud,vr,Ts,Kl,ka,xo,cd,Gl,Xl,Cs,Rs,wo,Ql,un,Ac,pb,mb,gb,yb,bb,vb,xb,GR,_R,hI=(_R=class extends hu{constructor(t,n){super();ut(this,un);ut(this,Ir);ut(this,Jt);ut(this,ud);ut(this,vr);ut(this,Ts);ut(this,Kl);ut(this,ka);ut(this,xo);ut(this,cd);ut(this,Gl);ut(this,Xl);ut(this,Cs);ut(this,Rs);ut(this,wo);ut(this,Ql,new Set);this.options=n,Ge(this,Ir,t),Ge(this,xo,null),Ge(this,ka,fb()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ne(this,Jt).addObserver(this),sE(ne(this,Jt),this.options)?It(this,un,Ac).call(this):this.updateResult(),It(this,un,yb).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return wb(ne(this,Jt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return wb(ne(this,Jt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,It(this,un,bb).call(this),It(this,un,vb).call(this),ne(this,Jt).removeObserver(this)}setOptions(t){const n=this.options,r=ne(this,Jt);if(this.options=ne(this,Ir).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof fi(this.options.enabled,ne(this,Jt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");It(this,un,xb).call(this),ne(this,Jt).setOptions(this.options),n._defaulted&&!Dh(this.options,n)&&ne(this,Ir).getQueryCache().notify({type:"observerOptionsUpdated",query:ne(this,Jt),observer:this});const a=this.hasListeners();a&&lE(ne(this,Jt),r,this.options,n)&&It(this,un,Ac).call(this),this.updateResult(),a&&(ne(this,Jt)!==r||fi(this.options.enabled,ne(this,Jt))!==fi(n.enabled,ne(this,Jt))||Oo(this.options.staleTime,ne(this,Jt))!==Oo(n.staleTime,ne(this,Jt)))&&It(this,un,pb).call(this);const s=It(this,un,mb).call(this);a&&(ne(this,Jt)!==r||fi(this.options.enabled,ne(this,Jt))!==fi(n.enabled,ne(this,Jt))||s!==ne(this,wo))&&It(this,un,gb).call(this,s)}getOptimisticResult(t){const n=ne(this,Ir).getQueryCache().build(ne(this,Ir),t),r=this.createResult(n,t);return mI(this,r)&&(Ge(this,vr,r),Ge(this,Kl,this.options),Ge(this,Ts,ne(this,Jt).state)),r}getCurrentResult(){return ne(this,vr)}trackResult(t,n){return new Proxy(t,{get:(r,a)=>(this.trackProp(a),n==null||n(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&ne(this,ka).status==="pending"&&ne(this,ka).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,a))})}trackProp(t){ne(this,Ql).add(t)}getCurrentQuery(){return ne(this,Jt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=ne(this,Ir).defaultQueryOptions(t),r=ne(this,Ir).getQueryCache().build(ne(this,Ir),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return It(this,un,Ac).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ne(this,vr)))}createResult(t,n){var $;const r=ne(this,Jt),a=this.options,s=ne(this,vr),l=ne(this,Ts),c=ne(this,Kl),d=t!==r?t.state:ne(this,ud),{state:m}=t;let p={...m},y=!1,g;if(n._optimisticResults){const F=this.hasListeners(),W=!F&&sE(t,n),L=F&&lE(t,r,n,a);(W||L)&&(p={...p,...KR(m.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:x,errorUpdatedAt:C,status:T}=p;g=p.data;let S=!1;if(n.placeholderData!==void 0&&g===void 0&&T==="pending"){let F;s!=null&&s.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(F=s.data,S=!0):F=typeof n.placeholderData=="function"?n.placeholderData(($=ne(this,Xl))==null?void 0:$.state.data,ne(this,Xl)):n.placeholderData,F!==void 0&&(T="success",g=db(s==null?void 0:s.data,F,n),y=!0)}if(n.select&&g!==void 0&&!S)if(s&&g===(l==null?void 0:l.data)&&n.select===ne(this,cd))g=ne(this,Gl);else try{Ge(this,cd,n.select),g=n.select(g),g=db(s==null?void 0:s.data,g,n),Ge(this,Gl,g),Ge(this,xo,null)}catch(F){Ge(this,xo,F)}ne(this,xo)&&(x=ne(this,xo),g=ne(this,Gl),C=Date.now(),T="error");const R=p.fetchStatus==="fetching",k=T==="pending",M=T==="error",D=k&&R,O=g!==void 0,_={status:T,fetchStatus:p.fetchStatus,isPending:k,isSuccess:T==="success",isError:M,isInitialLoading:D,isLoading:D,data:g,dataUpdatedAt:p.dataUpdatedAt,error:x,errorUpdatedAt:C,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:R,isRefetching:R&&!k,isLoadingError:M&&!O,isPaused:p.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:M&&O,isStale:_v(t,n),refetch:this.refetch,promise:ne(this,ka),isEnabled:fi(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const F=_.data!==void 0,W=_.status==="error"&&!F,L=Y=>{W?Y.reject(_.error):F&&Y.resolve(_.data)},V=()=>{const Y=Ge(this,ka,_.promise=fb());L(Y)},q=ne(this,ka);switch(q.status){case"pending":t.queryHash===r.queryHash&&L(q);break;case"fulfilled":(W||_.data!==q.value)&&V();break;case"rejected":(!W||_.error!==q.reason)&&V();break}}return _}updateResult(){const t=ne(this,vr),n=this.createResult(ne(this,Jt),this.options);if(Ge(this,Ts,ne(this,Jt).state),Ge(this,Kl,this.options),ne(this,Ts).data!==void 0&&Ge(this,Xl,ne(this,Jt)),Dh(n,t))return;Ge(this,vr,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,s=typeof a=="function"?a():a;if(s==="all"||!s&&!ne(this,Ql).size)return!0;const l=new Set(s??ne(this,Ql));return this.options.throwOnError&&l.add("error"),Object.keys(ne(this,vr)).some(c=>{const f=c;return ne(this,vr)[f]!==t[f]&&l.has(f)})};It(this,un,GR).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&It(this,un,yb).call(this)}},Ir=new WeakMap,Jt=new WeakMap,ud=new WeakMap,vr=new WeakMap,Ts=new WeakMap,Kl=new WeakMap,ka=new WeakMap,xo=new WeakMap,cd=new WeakMap,Gl=new WeakMap,Xl=new WeakMap,Cs=new WeakMap,Rs=new WeakMap,wo=new WeakMap,Ql=new WeakMap,un=new WeakSet,Ac=function(t){It(this,un,xb).call(this);let n=ne(this,Jt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(xr)),n},pb=function(){It(this,un,bb).call(this);const t=Oo(this.options.staleTime,ne(this,Jt));if(Ns||ne(this,vr).isStale||!ub(t))return;const r=UR(ne(this,vr).dataUpdatedAt,t)+1;Ge(this,Cs,ms.setTimeout(()=>{ne(this,vr).isStale||this.updateResult()},r))},mb=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ne(this,Jt)):this.options.refetchInterval)??!1},gb=function(t){It(this,un,vb).call(this),Ge(this,wo,t),!(Ns||fi(this.options.enabled,ne(this,Jt))===!1||!ub(ne(this,wo))||ne(this,wo)===0)&&Ge(this,Rs,ms.setInterval(()=>{(this.options.refetchIntervalInBackground||Lv.isFocused())&&It(this,un,Ac).call(this)},ne(this,wo)))},yb=function(){It(this,un,pb).call(this),It(this,un,gb).call(this,It(this,un,mb).call(this))},bb=function(){ne(this,Cs)&&(ms.clearTimeout(ne(this,Cs)),Ge(this,Cs,void 0))},vb=function(){ne(this,Rs)&&(ms.clearInterval(ne(this,Rs)),Ge(this,Rs,void 0))},xb=function(){const t=ne(this,Ir).getQueryCache().build(ne(this,Ir),this.options);if(t===ne(this,Jt))return;const n=ne(this,Jt);Ge(this,Jt,t),Ge(this,ud,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},GR=function(t){Zn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(ne(this,vr))}),ne(this,Ir).getQueryCache().notify({query:ne(this,Jt),type:"observerResultsUpdated"})})},_R);function pI(e,t){return fi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function sE(e,t){return pI(e,t)||e.state.data!==void 0&&wb(e,t,t.refetchOnMount)}function wb(e,t,n){if(fi(t.enabled,e)!==!1&&Oo(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&_v(e,t)}return!1}function lE(e,t,n,r){return(e!==t||fi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&_v(e,n)}function _v(e,t){return fi(t.enabled,e)!==!1&&e.isStaleByTime(Oo(t.staleTime,e))}function mI(e,t){return!Dh(e.getCurrentResult(),t)}function uE(e){return{onFetch:(t,n)=>{var m,p,y,g,x;const r=t.options,a=(y=(p=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:p.fetchMore)==null?void 0:y.direction,s=((g=t.state.data)==null?void 0:g.pages)||[],l=((x=t.state.data)==null?void 0:x.pageParams)||[];let c={pages:[],pageParams:[]},f=0;const d=async()=>{let C=!1;const T=k=>{oI(k,()=>t.signal,()=>C=!0)},S=qR(t.options,t.fetchOptions),R=async(k,M,D)=>{if(C)return Promise.reject();if(M==null&&k.pages.length)return Promise.resolve(k);const N=(()=>{const W={client:t.client,queryKey:t.queryKey,pageParam:M,direction:D?"backward":"forward",meta:t.options.meta};return T(W),W})(),_=await S(N),{maxPages:$}=t.options,F=D?aI:iI;return{pages:F(k.pages,_,$),pageParams:F(k.pageParams,M,$)}};if(a&&s.length){const k=a==="backward",M=k?gI:cE,D={pages:s,pageParams:l},O=M(r,D);c=await R(D,O,k)}else{const k=e??s.length;do{const M=f===0?l[0]??r.initialPageParam:cE(r,c);if(f>0&&M==null)break;c=await R(c,M),f++}while(f<k)}return c};t.options.persister?t.fetchFn=()=>{var C,T;return(T=(C=t.options).persister)==null?void 0:T.call(C,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function cE(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function gI(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var dd,Hi,fr,ks,Ui,ho,jR,yI=(jR=class extends WR{constructor(t){super();ut(this,Ui);ut(this,dd);ut(this,Hi);ut(this,fr);ut(this,ks);Ge(this,dd,t.client),this.mutationId=t.mutationId,Ge(this,fr,t.mutationCache),Ge(this,Hi,[]),this.state=t.state||XR(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ne(this,Hi).includes(t)||(ne(this,Hi).push(t),this.clearGcTimeout(),ne(this,fr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ge(this,Hi,ne(this,Hi).filter(n=>n!==t)),this.scheduleGc(),ne(this,fr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ne(this,Hi).length||(this.state.status==="pending"?this.scheduleGc():ne(this,fr).remove(this))}continue(){var t;return((t=ne(this,ks))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,c,f,d,m,p,y,g,x,C,T,S,R,k,M,D,O,N;const n=()=>{It(this,Ui,ho).call(this,{type:"continue"})},r={client:ne(this,dd),meta:this.options.meta,mutationKey:this.options.mutationKey};Ge(this,ks,YR({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(_,$)=>{It(this,Ui,ho).call(this,{type:"failed",failureCount:_,error:$})},onPause:()=>{It(this,Ui,ho).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ne(this,fr).canRun(this)}));const a=this.state.status==="pending",s=!ne(this,ks).canStart();try{if(a)n();else{It(this,Ui,ho).call(this,{type:"pending",variables:t,isPaused:s}),ne(this,fr).config.onMutate&&await ne(this,fr).config.onMutate(t,this,r);const $=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t,r));$!==this.state.context&&It(this,Ui,ho).call(this,{type:"pending",context:$,variables:t,isPaused:s})}const _=await ne(this,ks).start();return await((d=(f=ne(this,fr).config).onSuccess)==null?void 0:d.call(f,_,t,this.state.context,this,r)),await((p=(m=this.options).onSuccess)==null?void 0:p.call(m,_,t,this.state.context,r)),await((g=(y=ne(this,fr).config).onSettled)==null?void 0:g.call(y,_,null,this.state.variables,this.state.context,this,r)),await((C=(x=this.options).onSettled)==null?void 0:C.call(x,_,null,t,this.state.context,r)),It(this,Ui,ho).call(this,{type:"success",data:_}),_}catch(_){try{await((S=(T=ne(this,fr).config).onError)==null?void 0:S.call(T,_,t,this.state.context,this,r))}catch($){Promise.reject($)}try{await((k=(R=this.options).onError)==null?void 0:k.call(R,_,t,this.state.context,r))}catch($){Promise.reject($)}try{await((D=(M=ne(this,fr).config).onSettled)==null?void 0:D.call(M,void 0,_,this.state.variables,this.state.context,this,r))}catch($){Promise.reject($)}try{await((N=(O=this.options).onSettled)==null?void 0:N.call(O,void 0,_,t,this.state.context,r))}catch($){Promise.reject($)}throw It(this,Ui,ho).call(this,{type:"error",error:_}),_}finally{ne(this,fr).runNext(this)}}},dd=new WeakMap,Hi=new WeakMap,fr=new WeakMap,ks=new WeakMap,Ui=new WeakSet,ho=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Zn.batch(()=>{ne(this,Hi).forEach(r=>{r.onMutationUpdate(t)}),ne(this,fr).notify({mutation:this,type:"updated",action:t})})},jR);function XR(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ma,Oi,fd,zR,bI=(zR=class extends hu{constructor(t={}){super();ut(this,Ma);ut(this,Oi);ut(this,fd);this.config=t,Ge(this,Ma,new Set),Ge(this,Oi,new Map),Ge(this,fd,0)}build(t,n,r){const a=new yI({client:t,mutationCache:this,mutationId:++Uf(this,fd)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){ne(this,Ma).add(t);const n=Vf(t);if(typeof n=="string"){const r=ne(this,Oi).get(n);r?r.push(t):ne(this,Oi).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(ne(this,Ma).delete(t)){const n=Vf(t);if(typeof n=="string"){const r=ne(this,Oi).get(n);if(r)if(r.length>1){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}else r[0]===t&&ne(this,Oi).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Vf(t);if(typeof n=="string"){const r=ne(this,Oi).get(n),a=r==null?void 0:r.find(s=>s.state.status==="pending");return!a||a===t}else return!0}runNext(t){var r;const n=Vf(t);if(typeof n=="string"){const a=(r=ne(this,Oi).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Zn.batch(()=>{ne(this,Ma).forEach(t=>{this.notify({type:"removed",mutation:t})}),ne(this,Ma).clear(),ne(this,Oi).clear()})}getAll(){return Array.from(ne(this,Ma))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>nE(n,r))}findAll(t={}){return this.getAll().filter(n=>nE(t,n))}notify(t){Zn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Zn.batch(()=>Promise.all(t.map(n=>n.continue().catch(xr))))}},Ma=new WeakMap,Oi=new WeakMap,fd=new WeakMap,zR);function Vf(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Oa,So,Pr,Aa,Da,gh,Sb,FR,vI=(FR=class extends hu{constructor(n,r){super();ut(this,Da);ut(this,Oa);ut(this,So);ut(this,Pr);ut(this,Aa);Ge(this,Oa,n),this.setOptions(r),this.bindMethods(),It(this,Da,gh).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var a;const r=this.options;this.options=ne(this,Oa).defaultMutationOptions(n),Dh(this.options,r)||ne(this,Oa).getMutationCache().notify({type:"observerOptionsUpdated",mutation:ne(this,Pr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Ds(r.mutationKey)!==Ds(this.options.mutationKey)?this.reset():((a=ne(this,Pr))==null?void 0:a.state.status)==="pending"&&ne(this,Pr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=ne(this,Pr))==null||n.removeObserver(this)}onMutationUpdate(n){It(this,Da,gh).call(this),It(this,Da,Sb).call(this,n)}getCurrentResult(){return ne(this,So)}reset(){var n;(n=ne(this,Pr))==null||n.removeObserver(this),Ge(this,Pr,void 0),It(this,Da,gh).call(this),It(this,Da,Sb).call(this)}mutate(n,r){var a;return Ge(this,Aa,r),(a=ne(this,Pr))==null||a.removeObserver(this),Ge(this,Pr,ne(this,Oa).getMutationCache().build(ne(this,Oa),this.options)),ne(this,Pr).addObserver(this),ne(this,Pr).execute(n)}},Oa=new WeakMap,So=new WeakMap,Pr=new WeakMap,Aa=new WeakMap,Da=new WeakSet,gh=function(){var r;const n=((r=ne(this,Pr))==null?void 0:r.state)??XR();Ge(this,So,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Sb=function(n){Zn.batch(()=>{var r,a,s,l,c,f,d,m;if(ne(this,Aa)&&this.hasListeners()){const p=ne(this,So).variables,y=ne(this,So).context,g={client:ne(this,Oa),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(a=(r=ne(this,Aa)).onSuccess)==null||a.call(r,n.data,p,y,g)}catch(x){Promise.reject(x)}try{(l=(s=ne(this,Aa)).onSettled)==null||l.call(s,n.data,null,p,y,g)}catch(x){Promise.reject(x)}}else if((n==null?void 0:n.type)==="error"){try{(f=(c=ne(this,Aa)).onError)==null||f.call(c,n.error,p,y,g)}catch(x){Promise.reject(x)}try{(m=(d=ne(this,Aa)).onSettled)==null||m.call(d,void 0,n.error,p,y,g)}catch(x){Promise.reject(x)}}}this.listeners.forEach(p=>{p(ne(this,So))})})},FR),Vi,BR,xI=(BR=class extends hu{constructor(t={}){super();ut(this,Vi);this.config=t,Ge(this,Vi,new Map)}build(t,n,r){const a=n.queryKey,s=n.queryHash??Dv(a,n);let l=this.get(s);return l||(l=new fI({client:t,queryKey:a,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(l)),l}add(t){ne(this,Vi).has(t.queryHash)||(ne(this,Vi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=ne(this,Vi).get(t.queryHash);n&&(t.destroy(),n===t&&ne(this,Vi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Zn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ne(this,Vi).get(t)}getAll(){return[...ne(this,Vi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>tE(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>tE(t,r)):n}notify(t){Zn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Zn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Zn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Vi=new WeakMap,BR),Pn,Eo,To,Zl,Jl,Co,eu,tu,HR,wI=(HR=class{constructor(e={}){ut(this,Pn);ut(this,Eo);ut(this,To);ut(this,Zl);ut(this,Jl);ut(this,Co);ut(this,eu);ut(this,tu);Ge(this,Pn,e.queryCache||new xI),Ge(this,Eo,e.mutationCache||new bI),Ge(this,To,e.defaultOptions||{}),Ge(this,Zl,new Map),Ge(this,Jl,new Map),Ge(this,Co,0)}mount(){Uf(this,Co)._++,ne(this,Co)===1&&(Ge(this,eu,Lv.subscribe(async e=>{e&&(await this.resumePausedMutations(),ne(this,Pn).onFocus())})),Ge(this,tu,Ih.subscribe(async e=>{e&&(await this.resumePausedMutations(),ne(this,Pn).onOnline())})))}unmount(){var e,t;Uf(this,Co)._--,ne(this,Co)===0&&((e=ne(this,eu))==null||e.call(this),Ge(this,eu,void 0),(t=ne(this,tu))==null||t.call(this),Ge(this,tu,void 0))}isFetching(e){return ne(this,Pn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ne(this,Eo).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ne(this,Pn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=ne(this,Pn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Oo(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return ne(this,Pn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=ne(this,Pn).get(r.queryHash),s=a==null?void 0:a.state.data,l=tI(t,s);if(l!==void 0)return ne(this,Pn).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Zn.batch(()=>ne(this,Pn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ne(this,Pn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=ne(this,Pn);Zn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=ne(this,Pn);return Zn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Zn.batch(()=>ne(this,Pn).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(xr).catch(xr)}invalidateQueries(e,t={}){return Zn.batch(()=>(ne(this,Pn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Zn.batch(()=>ne(this,Pn).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let s=a.fetch(void 0,n);return n.throwOnError||(s=s.catch(xr)),a.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(xr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=ne(this,Pn).build(this,t);return n.isStaleByTime(Oo(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(xr).catch(xr)}fetchInfiniteQuery(e){return e.behavior=uE(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(xr).catch(xr)}ensureInfiniteQueryData(e){return e.behavior=uE(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ih.isOnline()?ne(this,Eo).resumePausedMutations():Promise.resolve()}getQueryCache(){return ne(this,Pn)}getMutationCache(){return ne(this,Eo)}getDefaultOptions(){return ne(this,To)}setDefaultOptions(e){Ge(this,To,e)}setQueryDefaults(e,t){ne(this,Zl).set(Ds(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ne(this,Zl).values()],n={};return t.forEach(r=>{Xc(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){ne(this,Jl).set(Ds(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ne(this,Jl).values()],n={};return t.forEach(r=>{Xc(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...ne(this,To).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Dv(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===Iv&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ne(this,To).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ne(this,Pn).clear(),ne(this,Eo).clear()}},Pn=new WeakMap,Eo=new WeakMap,To=new WeakMap,Zl=new WeakMap,Jl=new WeakMap,Co=new WeakMap,eu=new WeakMap,tu=new WeakMap,HR),ty={exports:{}},Tt={};/**
11
+ * @license React
12
+ * react.production.js
13
+ *
14
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
15
+ *
16
+ * This source code is licensed under the MIT license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */var dE;function SI(){if(dE)return Tt;dE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),y=Symbol.iterator;function g(B){return B===null||typeof B!="object"?null:(B=y&&B[y]||B["@@iterator"],typeof B=="function"?B:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,T={};function S(B,G,I){this.props=B,this.context=G,this.refs=T,this.updater=I||x}S.prototype.isReactComponent={},S.prototype.setState=function(B,G){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,G,"setState")},S.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function R(){}R.prototype=S.prototype;function k(B,G,I){this.props=B,this.context=G,this.refs=T,this.updater=I||x}var M=k.prototype=new R;M.constructor=k,C(M,S.prototype),M.isPureReactComponent=!0;var D=Array.isArray;function O(){}var N={H:null,A:null,T:null,S:null},_=Object.prototype.hasOwnProperty;function $(B,G,I){var Q=I.ref;return{$$typeof:e,type:B,key:G,ref:Q!==void 0?Q:null,props:I}}function F(B,G){return $(B.type,G,B.props)}function W(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function L(B){var G={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(I){return G[I]})}var V=/\/+/g;function q(B,G){return typeof B=="object"&&B!==null&&B.key!=null?L(""+B.key):G.toString(36)}function Y(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(O,O):(B.status="pending",B.then(function(G){B.status==="pending"&&(B.status="fulfilled",B.value=G)},function(G){B.status==="pending"&&(B.status="rejected",B.reason=G)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function j(B,G,I,Q,Z){var ie=typeof B;(ie==="undefined"||ie==="boolean")&&(B=null);var ce=!1;if(B===null)ce=!0;else switch(ie){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(B.$$typeof){case e:case t:ce=!0;break;case m:return ce=B._init,j(ce(B._payload),G,I,Q,Z)}}if(ce)return Z=Z(B),ce=Q===""?"."+q(B,0):Q,D(Z)?(I="",ce!=null&&(I=ce.replace(V,"$&/")+"/"),j(Z,G,I,"",function(_e){return _e})):Z!=null&&(W(Z)&&(Z=F(Z,I+(Z.key==null||B&&B.key===Z.key?"":(""+Z.key).replace(V,"$&/")+"/")+ce)),G.push(Z)),1;ce=0;var ge=Q===""?".":Q+":";if(D(B))for(var Ee=0;Ee<B.length;Ee++)Q=B[Ee],ie=ge+q(Q,Ee),ce+=j(Q,G,I,ie,Z);else if(Ee=g(B),typeof Ee=="function")for(B=Ee.call(B),Ee=0;!(Q=B.next()).done;)Q=Q.value,ie=ge+q(Q,Ee++),ce+=j(Q,G,I,ie,Z);else if(ie==="object"){if(typeof B.then=="function")return j(Y(B),G,I,Q,Z);throw G=String(B),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return ce}function z(B,G,I){if(B==null)return B;var Q=[],Z=0;return j(B,Q,"","",function(ie){return G.call(I,ie,Z++)}),Q}function H(B){if(B._status===-1){var G=B._result;G=G(),G.then(function(I){(B._status===0||B._status===-1)&&(B._status=1,B._result=I)},function(I){(B._status===0||B._status===-1)&&(B._status=2,B._result=I)}),B._status===-1&&(B._status=0,B._result=G)}if(B._status===1)return B._result.default;throw B._result}var K=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},P={map:z,forEach:function(B,G,I){z(B,function(){G.apply(this,arguments)},I)},count:function(B){var G=0;return z(B,function(){G++}),G},toArray:function(B){return z(B,function(G){return G})||[]},only:function(B){if(!W(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return Tt.Activity=p,Tt.Children=P,Tt.Component=S,Tt.Fragment=n,Tt.Profiler=a,Tt.PureComponent=k,Tt.StrictMode=r,Tt.Suspense=f,Tt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,Tt.__COMPILER_RUNTIME={__proto__:null,c:function(B){return N.H.useMemoCache(B)}},Tt.cache=function(B){return function(){return B.apply(null,arguments)}},Tt.cacheSignal=function(){return null},Tt.cloneElement=function(B,G,I){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var Q=C({},B.props),Z=B.key;if(G!=null)for(ie in G.key!==void 0&&(Z=""+G.key),G)!_.call(G,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&G.ref===void 0||(Q[ie]=G[ie]);var ie=arguments.length-2;if(ie===1)Q.children=I;else if(1<ie){for(var ce=Array(ie),ge=0;ge<ie;ge++)ce[ge]=arguments[ge+2];Q.children=ce}return $(B.type,Z,Q)},Tt.createContext=function(B){return B={$$typeof:l,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:s,_context:B},B},Tt.createElement=function(B,G,I){var Q,Z={},ie=null;if(G!=null)for(Q in G.key!==void 0&&(ie=""+G.key),G)_.call(G,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(Z[Q]=G[Q]);var ce=arguments.length-2;if(ce===1)Z.children=I;else if(1<ce){for(var ge=Array(ce),Ee=0;Ee<ce;Ee++)ge[Ee]=arguments[Ee+2];Z.children=ge}if(B&&B.defaultProps)for(Q in ce=B.defaultProps,ce)Z[Q]===void 0&&(Z[Q]=ce[Q]);return $(B,ie,Z)},Tt.createRef=function(){return{current:null}},Tt.forwardRef=function(B){return{$$typeof:c,render:B}},Tt.isValidElement=W,Tt.lazy=function(B){return{$$typeof:m,_payload:{_status:-1,_result:B},_init:H}},Tt.memo=function(B,G){return{$$typeof:d,type:B,compare:G===void 0?null:G}},Tt.startTransition=function(B){var G=N.T,I={};N.T=I;try{var Q=B(),Z=N.S;Z!==null&&Z(I,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(O,K)}catch(ie){K(ie)}finally{G!==null&&I.types!==null&&(G.types=I.types),N.T=G}},Tt.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},Tt.use=function(B){return N.H.use(B)},Tt.useActionState=function(B,G,I){return N.H.useActionState(B,G,I)},Tt.useCallback=function(B,G){return N.H.useCallback(B,G)},Tt.useContext=function(B){return N.H.useContext(B)},Tt.useDebugValue=function(){},Tt.useDeferredValue=function(B,G){return N.H.useDeferredValue(B,G)},Tt.useEffect=function(B,G){return N.H.useEffect(B,G)},Tt.useEffectEvent=function(B){return N.H.useEffectEvent(B)},Tt.useId=function(){return N.H.useId()},Tt.useImperativeHandle=function(B,G,I){return N.H.useImperativeHandle(B,G,I)},Tt.useInsertionEffect=function(B,G){return N.H.useInsertionEffect(B,G)},Tt.useLayoutEffect=function(B,G){return N.H.useLayoutEffect(B,G)},Tt.useMemo=function(B,G){return N.H.useMemo(B,G)},Tt.useOptimistic=function(B,G){return N.H.useOptimistic(B,G)},Tt.useReducer=function(B,G,I){return N.H.useReducer(B,G,I)},Tt.useRef=function(B){return N.H.useRef(B)},Tt.useState=function(B){return N.H.useState(B)},Tt.useSyncExternalStore=function(B,G,I){return N.H.useSyncExternalStore(B,G,I)},Tt.useTransition=function(){return N.H.useTransition()},Tt.version="19.2.4",Tt}var fE;function hd(){return fE||(fE=1,ty.exports=SI()),ty.exports}var w=hd();const Ue=sp(w),jv=WD({__proto__:null,default:Ue},[w]);var QR=w.createContext(void 0),lp=e=>{const t=w.useContext(QR);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},EI=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),E.jsx(QR.Provider,{value:e,children:t})),ZR=w.createContext(!1),TI=()=>w.useContext(ZR);ZR.Provider;function CI(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var RI=w.createContext(CI()),kI=()=>w.useContext(RI),MI=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Pv(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},OI=e=>{w.useEffect(()=>{e.clearReset()},[e])},AI=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||Pv(n,[e.error,r])),NI=e=>{if(e.suspense){const n=a=>a==="static"?a:Math.max(a??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...a)=>n(r(...a)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},DI=(e,t)=>e.isLoading&&e.isFetching&&!t,II=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,hE=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function PI(e,t,n){var y,g,x,C;const r=TI(),a=kI(),s=lp(),l=s.defaultQueryOptions(e);(g=(y=s.getDefaultOptions().queries)==null?void 0:y._experimental_beforeQuery)==null||g.call(y,l);const c=s.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",NI(l),MI(l,a,c),OI(a);const f=!s.getQueryCache().get(l.queryHash),[d]=w.useState(()=>new t(s,l)),m=d.getOptimisticResult(l),p=!r&&e.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(T=>{const S=p?d.subscribe(Zn.batchCalls(T)):xr;return d.updateResult(),S},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),w.useEffect(()=>{d.setOptions(l)},[l,d]),II(l,m))throw hE(l,d,a);if(AI({result:m,errorResetBoundary:a,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw m.error;if((C=(x=s.getDefaultOptions().queries)==null?void 0:x._experimental_afterQuery)==null||C.call(x,l,m),l.experimental_prefetchInRender&&!Ns&&DI(m,r)){const T=f?hE(l,d,a):c==null?void 0:c.promise;T==null||T.catch(xr).finally(()=>{d.updateResult()})}return l.notifyOnChangeProps?m:d.trackResult(m)}function Po(e,t){return PI(e,hI)}function Ph(e,t){const n=lp(),[r]=w.useState(()=>new vI(n,e));w.useEffect(()=>{r.setOptions(e)},[r,e]);const a=w.useSyncExternalStore(w.useCallback(l=>r.subscribe(Zn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=w.useCallback((l,c)=>{r.mutate(l,c).catch(xr)},[r]);if(a.error&&Pv(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:s,mutateAsync:a.mutate}}var ny={exports:{}},pc={},ry={exports:{}},iy={};/**
19
+ * @license React
20
+ * scheduler.production.js
21
+ *
22
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ */var pE;function LI(){return pE||(pE=1,(function(e){function t(j,z){var H=j.length;j.push(z);e:for(;0<H;){var K=H-1>>>1,P=j[K];if(0<a(P,z))j[K]=z,j[H]=P,H=K;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var z=j[0],H=j.pop();if(H!==z){j[0]=H;e:for(var K=0,P=j.length,B=P>>>1;K<B;){var G=2*(K+1)-1,I=j[G],Q=G+1,Z=j[Q];if(0>a(I,H))Q<P&&0>a(Z,I)?(j[K]=Z,j[Q]=H,K=Q):(j[K]=I,j[G]=H,K=G);else if(Q<P&&0>a(Z,H))j[K]=Z,j[Q]=H,K=Q;else break e}}return z}function a(j,z){var H=j.sortIndex-z.sortIndex;return H!==0?H:j.id-z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],d=[],m=1,p=null,y=3,g=!1,x=!1,C=!1,T=!1,S=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function M(j){for(var z=n(d);z!==null;){if(z.callback===null)r(d);else if(z.startTime<=j)r(d),z.sortIndex=z.expirationTime,t(f,z);else break;z=n(d)}}function D(j){if(C=!1,M(j),!x)if(n(f)!==null)x=!0,O||(O=!0,L());else{var z=n(d);z!==null&&Y(D,z.startTime-j)}}var O=!1,N=-1,_=5,$=-1;function F(){return T?!0:!(e.unstable_now()-$<_)}function W(){if(T=!1,O){var j=e.unstable_now();$=j;var z=!0;try{e:{x=!1,C&&(C=!1,R(N),N=-1),g=!0;var H=y;try{t:{for(M(j),p=n(f);p!==null&&!(p.expirationTime>j&&F());){var K=p.callback;if(typeof K=="function"){p.callback=null,y=p.priorityLevel;var P=K(p.expirationTime<=j);if(j=e.unstable_now(),typeof P=="function"){p.callback=P,M(j),z=!0;break t}p===n(f)&&r(f),M(j)}else r(f);p=n(f)}if(p!==null)z=!0;else{var B=n(d);B!==null&&Y(D,B.startTime-j),z=!1}}break e}finally{p=null,y=H,g=!1}z=void 0}}finally{z?L():O=!1}}}var L;if(typeof k=="function")L=function(){k(W)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,q=V.port2;V.port1.onmessage=W,L=function(){q.postMessage(null)}}else L=function(){S(W,0)};function Y(j,z){N=S(function(){j(e.unstable_now())},z)}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(j){j.callback=null},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(j){switch(y){case 1:case 2:case 3:var z=3;break;default:z=y}var H=y;y=z;try{return j()}finally{y=H}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(j,z){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var H=y;y=j;try{return z()}finally{y=H}},e.unstable_scheduleCallback=function(j,z,H){var K=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?K+H:K):H=K,j){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=H+P,j={id:m++,callback:z,priorityLevel:j,startTime:H,expirationTime:P,sortIndex:-1},H>K?(j.sortIndex=H,t(d,j),n(f)===null&&j===n(d)&&(C?(R(N),N=-1):C=!0,Y(D,H-K))):(j.sortIndex=P,t(f,j),x||g||(x=!0,O||(O=!0,L()))),j},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(j){var z=y;return function(){var H=y;y=z;try{return j.apply(this,arguments)}finally{y=H}}}})(iy)),iy}var mE;function _I(){return mE||(mE=1,ry.exports=LI()),ry.exports}var ay={exports:{}},dr={};/**
27
+ * @license React
28
+ * react-dom.production.js
29
+ *
30
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
31
+ *
32
+ * This source code is licensed under the MIT license found in the
33
+ * LICENSE file in the root directory of this source tree.
34
+ */var gE;function jI(){if(gE)return dr;gE=1;var e=hd();function t(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={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},a=Symbol.for("react.portal");function s(f,d,m){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:p==null?null:""+p,children:f,containerInfo:d,implementation:m}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return dr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,dr.createPortal=function(f,d){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return s(f,d,null,m)},dr.flushSync=function(f){var d=l.T,m=r.p;try{if(l.T=null,r.p=2,f)return f()}finally{l.T=d,r.p=m,r.d.f()}},dr.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(f,d))},dr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},dr.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var m=d.as,p=c(m,d.crossOrigin),y=typeof d.integrity=="string"?d.integrity:void 0,g=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;m==="style"?r.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:p,integrity:y,fetchPriority:g}):m==="script"&&r.d.X(f,{crossOrigin:p,integrity:y,fetchPriority:g,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},dr.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var m=c(d.as,d.crossOrigin);r.d.M(f,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(f)},dr.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var m=d.as,p=c(m,d.crossOrigin);r.d.L(f,m,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},dr.preloadModule=function(f,d){if(typeof f=="string")if(d){var m=c(d.as,d.crossOrigin);r.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(f)},dr.requestFormReset=function(f){r.d.r(f)},dr.unstable_batchedUpdates=function(f,d){return f(d)},dr.useFormState=function(f,d,m){return l.H.useFormState(f,d,m)},dr.useFormStatus=function(){return l.H.useHostTransitionStatus()},dr.version="19.2.4",dr}var yE;function JR(){if(yE)return ay.exports;yE=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(),ay.exports=jI(),ay.exports}/**
35
+ * @license React
36
+ * react-dom-client.production.js
37
+ *
38
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
39
+ *
40
+ * This source code is licensed under the MIT license found in the
41
+ * LICENSE file in the root directory of this source tree.
42
+ */var bE;function zI(){if(bE)return pc;bE=1;var e=_I(),t=hd(),n=JR();function r(i){var o="https://react.dev/errors/"+i;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)o+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+i+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function s(i){var o=i,u=i;if(i.alternate)for(;o.return;)o=o.return;else{i=o;do o=i,(o.flags&4098)!==0&&(u=o.return),i=o.return;while(i)}return o.tag===3?u:null}function l(i){if(i.tag===13){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function c(i){if(i.tag===31){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function f(i){if(s(i)!==i)throw Error(r(188))}function d(i){var o=i.alternate;if(!o){if(o=s(i),o===null)throw Error(r(188));return o!==i?null:i}for(var u=i,h=o;;){var b=u.return;if(b===null)break;var v=b.alternate;if(v===null){if(h=b.return,h!==null){u=h;continue}break}if(b.child===v.child){for(v=b.child;v;){if(v===u)return f(b),i;if(v===h)return f(b),o;v=v.sibling}throw Error(r(188))}if(u.return!==h.return)u=b,h=v;else{for(var A=!1,U=b.child;U;){if(U===u){A=!0,u=b,h=v;break}if(U===h){A=!0,h=b,u=v;break}U=U.sibling}if(!A){for(U=v.child;U;){if(U===u){A=!0,u=v,h=b;break}if(U===h){A=!0,h=v,u=b;break}U=U.sibling}if(!A)throw Error(r(189))}}if(u.alternate!==h)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?i:o}function m(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i;for(i=i.child;i!==null;){if(o=m(i),o!==null)return o;i=i.sibling}return null}var p=Object.assign,y=Symbol.for("react.element"),g=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),k=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),W=Symbol.iterator;function L(i){return i===null||typeof i!="object"?null:(i=W&&i[W]||i["@@iterator"],typeof i=="function"?i:null)}var V=Symbol.for("react.client.reference");function q(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===V?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case C:return"Fragment";case S:return"Profiler";case T:return"StrictMode";case D:return"Suspense";case O:return"SuspenseList";case $:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case x:return"Portal";case k:return i.displayName||"Context";case R:return(i._context.displayName||"Context")+".Consumer";case M:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case N:return o=i.displayName||null,o!==null?o:q(i.type)||"Memo";case _:o=i._payload,i=i._init;try{return q(i(o))}catch{}}return null}var Y=Array.isArray,j=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},K=[],P=-1;function B(i){return{current:i}}function G(i){0>P||(i.current=K[P],K[P]=null,P--)}function I(i,o){P++,K[P]=i.current,i.current=o}var Q=B(null),Z=B(null),ie=B(null),ce=B(null);function ge(i,o){switch(I(ie,o),I(Z,i),I(Q,null),o.nodeType){case 9:case 11:i=(i=o.documentElement)&&(i=i.namespaceURI)?x1(i):0;break;default:if(i=o.tagName,o=o.namespaceURI)o=x1(o),i=w1(o,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}G(Q),I(Q,i)}function Ee(){G(Q),G(Z),G(ie)}function _e(i){i.memoizedState!==null&&I(ce,i);var o=Q.current,u=w1(o,i.type);o!==u&&(I(Z,i),I(Q,u))}function Ie(i){Z.current===i&&(G(Q),G(Z)),ce.current===i&&(G(ce),uc._currentValue=H)}var re,he;function be(i){if(re===void 0)try{throw Error()}catch(u){var o=u.stack.trim().match(/\n( *(at )?)/);re=o&&o[1]||"",he=-1<u.stack.indexOf(`
43
+ at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
44
+ `+re+i+he}var Pe=!1;function Ae(i,o){if(!i||Pe)return"";Pe=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(o){var Ne=function(){throw Error()};if(Object.defineProperty(Ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ne,[])}catch(ve){var me=ve}Reflect.construct(i,[],Ne)}else{try{Ne.call()}catch(ve){me=ve}i.call(Ne.prototype)}}else{try{throw Error()}catch(ve){me=ve}(Ne=i())&&typeof Ne.catch=="function"&&Ne.catch(function(){})}}catch(ve){if(ve&&me&&typeof ve.stack=="string")return[ve.stack,me.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=h.DetermineComponentFrameRoot(),A=v[0],U=v[1];if(A&&U){var ee=A.split(`
45
+ `),pe=U.split(`
46
+ `);for(b=h=0;h<ee.length&&!ee[h].includes("DetermineComponentFrameRoot");)h++;for(;b<pe.length&&!pe[b].includes("DetermineComponentFrameRoot");)b++;if(h===ee.length||b===pe.length)for(h=ee.length-1,b=pe.length-1;1<=h&&0<=b&&ee[h]!==pe[b];)b--;for(;1<=h&&0<=b;h--,b--)if(ee[h]!==pe[b]){if(h!==1||b!==1)do if(h--,b--,0>b||ee[h]!==pe[b]){var Te=`
47
+ `+ee[h].replace(" at new "," at ");return i.displayName&&Te.includes("<anonymous>")&&(Te=Te.replace("<anonymous>",i.displayName)),Te}while(1<=h&&0<=b);break}}}finally{Pe=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?be(u):""}function Se(i,o){switch(i.tag){case 26:case 27:case 5:return be(i.type);case 16:return be("Lazy");case 13:return i.child!==o&&o!==null?be("Suspense Fallback"):be("Suspense");case 19:return be("SuspenseList");case 0:case 15:return Ae(i.type,!1);case 11:return Ae(i.type.render,!1);case 1:return Ae(i.type,!0);case 31:return be("Activity");default:return""}}function Ce(i){try{var o="",u=null;do o+=Se(i,u),u=i,i=i.return;while(i);return o}catch(h){return`
48
+ Error generating stack: `+h.message+`
49
+ `+h.stack}}var J=Object.prototype.hasOwnProperty,Re=e.unstable_scheduleCallback,xe=e.unstable_cancelCallback,Be=e.unstable_shouldYield,$e=e.unstable_requestPaint,te=e.unstable_now,De=e.unstable_getCurrentPriorityLevel,se=e.unstable_ImmediatePriority,ye=e.unstable_UserBlockingPriority,we=e.unstable_NormalPriority,Me=e.unstable_LowPriority,Fe=e.unstable_IdlePriority,ct=e.log,bt=e.unstable_setDisableYieldValue,Ot=null,We=null;function ot(i){if(typeof ct=="function"&&bt(i),We&&typeof We.setStrictMode=="function")try{We.setStrictMode(Ot,i)}catch{}}var st=Math.clz32?Math.clz32:gt,jt=Math.log,zt=Math.LN2;function gt(i){return i>>>=0,i===0?32:31-(jt(i)/zt|0)|0}var Rt=256,Je=262144,kt=4194304;function Ft(i){var o=i&42;if(o!==0)return o;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Xe(i,o,u){var h=i.pendingLanes;if(h===0)return 0;var b=0,v=i.suspendedLanes,A=i.pingedLanes;i=i.warmLanes;var U=h&134217727;return U!==0?(h=U&~v,h!==0?b=Ft(h):(A&=U,A!==0?b=Ft(A):u||(u=U&~i,u!==0&&(b=Ft(u))))):(U=h&~v,U!==0?b=Ft(U):A!==0?b=Ft(A):u||(u=h&~i,u!==0&&(b=Ft(u)))),b===0?0:o!==0&&o!==b&&(o&v)===0&&(v=b&-b,u=o&-o,v>=u||v===32&&(u&4194048)!==0)?o:b}function Bt(i,o){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&o)===0}function cn(i,o){switch(i){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 tn(){var i=kt;return kt<<=1,(kt&62914560)===0&&(kt=4194304),i}function Un(i){for(var o=[],u=0;31>u;u++)o.push(i);return o}function nn(i,o){i.pendingLanes|=o,o!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function ft(i,o,u,h,b,v){var A=i.pendingLanes;i.pendingLanes=u,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=u,i.entangledLanes&=u,i.errorRecoveryDisabledLanes&=u,i.shellSuspendCounter=0;var U=i.entanglements,ee=i.expirationTimes,pe=i.hiddenUpdates;for(u=A&~u;0<u;){var Te=31-st(u),Ne=1<<Te;U[Te]=0,ee[Te]=-1;var me=pe[Te];if(me!==null)for(pe[Te]=null,Te=0;Te<me.length;Te++){var ve=me[Te];ve!==null&&(ve.lane&=-536870913)}u&=~Ne}h!==0&&Ht(i,h,0),v!==0&&b===0&&i.tag!==0&&(i.suspendedLanes|=v&~(A&~o))}function Ht(i,o,u){i.pendingLanes|=o,i.suspendedLanes&=~o;var h=31-st(o);i.entangledLanes|=o,i.entanglements[h]=i.entanglements[h]|1073741824|u&261930}function X(i,o){var u=i.entangledLanes|=o;for(i=i.entanglements;u;){var h=31-st(u),b=1<<h;b&o|i[h]&o&&(i[h]|=o),u&=~b}}function ae(i,o){var u=o&-o;return u=(u&42)!==0?1:de(u),(u&(i.suspendedLanes|o))!==0?0:u}function de(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function ke(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function je(){var i=z.p;return i!==0?i:(i=window.event,i===void 0?32:q1(i.type))}function it(i,o){var u=z.p;try{return z.p=i,o()}finally{z.p=u}}var et=Math.random().toString(36).slice(2),qe="__reactFiber$"+et,Ke="__reactProps$"+et,Qe="__reactContainer$"+et,vt="__reactEvents$"+et,lt="__reactListeners$"+et,Mt="__reactHandles$"+et,Ut="__reactResources$"+et,Mn="__reactMarker$"+et;function An(i){delete i[qe],delete i[Ke],delete i[vt],delete i[lt],delete i[Mt]}function Nn(i){var o=i[qe];if(o)return o;for(var u=i.parentNode;u;){if(o=u[Qe]||u[qe]){if(u=o.alternate,o.child!==null||u!==null&&u.child!==null)for(i=M1(i);i!==null;){if(u=i[qe])return u;i=M1(i)}return o}i=u,u=i.parentNode}return null}function Gt(i){if(i=i[qe]||i[Qe]){var o=i.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return i}return null}function er(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i.stateNode;throw Error(r(33))}function Cr(i){var o=i[Ut];return o||(o=i[Ut]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function Rn(i){i[Mn]=!0}var xi=new Set,Fr={};function wi(i,o){ei(i,o),ei(i+"Capture",o)}function ei(i,o){for(Fr[i]=o,i=0;i<o.length;i++)xi.add(o[i])}var ra=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]*$"),$o={},Yo={};function Xt(i){return J.call(Yo,i)?!0:J.call($o,i)?!1:ra.test(i)?Yo[i]=!0:($o[i]=!0,!1)}function zn(i,o,u){if(Xt(o))if(u===null)i.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":i.removeAttribute(o);return;case"boolean":var h=o.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){i.removeAttribute(o);return}}i.setAttribute(o,""+u)}}function Si(i,o,u){if(u===null)i.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttribute(o,""+u)}}function ir(i,o,u,h){if(h===null)i.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(u);return}i.setAttributeNS(o,u,""+h)}}function Qt(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Wo(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Ad(i,o,u){var h=Object.getOwnPropertyDescriptor(i.constructor.prototype,o);if(!i.hasOwnProperty(o)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var b=h.get,v=h.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return b.call(this)},set:function(A){u=""+A,v.call(this,A)}}),Object.defineProperty(i,o,{enumerable:h.enumerable}),{getValue:function(){return u},setValue:function(A){u=""+A},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function Cu(i){if(!i._valueTracker){var o=Wo(i)?"checked":"value";i._valueTracker=Ad(i,o,""+i[o])}}function h0(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var u=o.getValue(),h="";return i&&(h=Wo(i)?i.checked?"true":"false":i.value),i=h,i!==u?(o.setValue(i),!0):!1}function Nd(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var FN=/[\n"\\]/g;function ti(i){return i.replace(FN,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Wp(i,o,u,h,b,v,A,U){i.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?i.type=A:i.removeAttribute("type"),o!=null?A==="number"?(o===0&&i.value===""||i.value!=o)&&(i.value=""+Qt(o)):i.value!==""+Qt(o)&&(i.value=""+Qt(o)):A!=="submit"&&A!=="reset"||i.removeAttribute("value"),o!=null?Kp(i,A,Qt(o)):u!=null?Kp(i,A,Qt(u)):h!=null&&i.removeAttribute("value"),b==null&&v!=null&&(i.defaultChecked=!!v),b!=null&&(i.checked=b&&typeof b!="function"&&typeof b!="symbol"),U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?i.name=""+Qt(U):i.removeAttribute("name")}function p0(i,o,u,h,b,v,A,U){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(i.type=v),o!=null||u!=null){if(!(v!=="submit"&&v!=="reset"||o!=null)){Cu(i);return}u=u!=null?""+Qt(u):"",o=o!=null?""+Qt(o):u,U||o===i.value||(i.value=o),i.defaultValue=o}h=h??b,h=typeof h!="function"&&typeof h!="symbol"&&!!h,i.checked=U?i.checked:!!h,i.defaultChecked=!!h,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(i.name=A),Cu(i)}function Kp(i,o,u){o==="number"&&Nd(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function Ys(i,o,u,h){if(i=i.options,o){o={};for(var b=0;b<u.length;b++)o["$"+u[b]]=!0;for(u=0;u<i.length;u++)b=o.hasOwnProperty("$"+i[u].value),i[u].selected!==b&&(i[u].selected=b),b&&h&&(i[u].defaultSelected=!0)}else{for(u=""+Qt(u),o=null,b=0;b<i.length;b++){if(i[b].value===u){i[b].selected=!0,h&&(i[b].defaultSelected=!0);return}o!==null||i[b].disabled||(o=i[b])}o!==null&&(o.selected=!0)}}function m0(i,o,u){if(o!=null&&(o=""+Qt(o),o!==i.value&&(i.value=o),u==null)){i.defaultValue!==o&&(i.defaultValue=o);return}i.defaultValue=u!=null?""+Qt(u):""}function g0(i,o,u,h){if(o==null){if(h!=null){if(u!=null)throw Error(r(92));if(Y(h)){if(1<h.length)throw Error(r(93));h=h[0]}u=h}u==null&&(u=""),o=u}u=Qt(o),i.defaultValue=u,h=i.textContent,h===u&&h!==""&&h!==null&&(i.value=h),Cu(i)}function Ws(i,o){if(o){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=o;return}}i.textContent=o}var BN=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 y0(i,o,u){var h=o.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?i.setProperty(o,""):o==="float"?i.cssFloat="":i[o]="":h?i.setProperty(o,u):typeof u!="number"||u===0||BN.has(o)?o==="float"?i.cssFloat=u:i[o]=(""+u).trim():i[o]=u+"px"}function b0(i,o,u){if(o!=null&&typeof o!="object")throw Error(r(62));if(i=i.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||o!=null&&o.hasOwnProperty(h)||(h.indexOf("--")===0?i.setProperty(h,""):h==="float"?i.cssFloat="":i[h]="");for(var b in o)h=o[b],o.hasOwnProperty(b)&&u[b]!==h&&y0(i,b,h)}else for(var v in o)o.hasOwnProperty(v)&&y0(i,v,o[v])}function Gp(i){if(i.indexOf("-")===-1)return!1;switch(i){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 HN=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"]]),UN=/^[\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 Dd(i){return UN.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function ia(){}var Xp=null;function Qp(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Ks=null,Gs=null;function v0(i){var o=Gt(i);if(o&&(i=o.stateNode)){var u=i[Ke]||null;e:switch(i=o.stateNode,o.type){case"input":if(Wp(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),o=u.name,u.type==="radio"&&o!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+ti(""+o)+'"][type="radio"]'),o=0;o<u.length;o++){var h=u[o];if(h!==i&&h.form===i.form){var b=h[Ke]||null;if(!b)throw Error(r(90));Wp(h,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(o=0;o<u.length;o++)h=u[o],h.form===i.form&&h0(h)}break e;case"textarea":m0(i,u.value,u.defaultValue);break e;case"select":o=u.value,o!=null&&Ys(i,!!u.multiple,o,!1)}}}var Zp=!1;function x0(i,o,u){if(Zp)return i(o,u);Zp=!0;try{var h=i(o);return h}finally{if(Zp=!1,(Ks!==null||Gs!==null)&&(xf(),Ks&&(o=Ks,i=Gs,Gs=Ks=null,v0(o),i)))for(o=0;o<i.length;o++)v0(i[o])}}function Ru(i,o){var u=i.stateNode;if(u===null)return null;var h=u[Ke]||null;if(h===null)return null;u=h[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":(h=!h.disabled)||(i=i.type,h=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!h;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(r(231,o,typeof u));return u}var aa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Jp=!1;if(aa)try{var ku={};Object.defineProperty(ku,"passive",{get:function(){Jp=!0}}),window.addEventListener("test",ku,ku),window.removeEventListener("test",ku,ku)}catch{Jp=!1}var Ha=null,em=null,Id=null;function w0(){if(Id)return Id;var i,o=em,u=o.length,h,b="value"in Ha?Ha.value:Ha.textContent,v=b.length;for(i=0;i<u&&o[i]===b[i];i++);var A=u-i;for(h=1;h<=A&&o[u-h]===b[v-h];h++);return Id=b.slice(i,1<h?1-h:void 0)}function Pd(i){var o=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&o===13&&(i=13)):i=o,i===10&&(i=13),32<=i||i===13?i:0}function Ld(){return!0}function S0(){return!1}function Rr(i){function o(u,h,b,v,A){this._reactName=u,this._targetInst=b,this.type=h,this.nativeEvent=v,this.target=A,this.currentTarget=null;for(var U in i)i.hasOwnProperty(U)&&(u=i[U],this[U]=u?u(v):v[U]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Ld:S0,this.isPropagationStopped=S0,this}return p(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Ld)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Ld)},persist:function(){},isPersistent:Ld}),o}var Ko={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_d=Rr(Ko),Mu=p({},Ko,{view:0,detail:0}),VN=Rr(Mu),tm,nm,Ou,jd=p({},Mu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:im,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Ou&&(Ou&&i.type==="mousemove"?(tm=i.screenX-Ou.screenX,nm=i.screenY-Ou.screenY):nm=tm=0,Ou=i),tm)},movementY:function(i){return"movementY"in i?i.movementY:nm}}),E0=Rr(jd),qN=p({},jd,{dataTransfer:0}),$N=Rr(qN),YN=p({},Mu,{relatedTarget:0}),rm=Rr(YN),WN=p({},Ko,{animationName:0,elapsedTime:0,pseudoElement:0}),KN=Rr(WN),GN=p({},Ko,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),XN=Rr(GN),QN=p({},Ko,{data:0}),T0=Rr(QN),ZN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},JN={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"},e2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function t2(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=e2[i])?!!o[i]:!1}function im(){return t2}var n2=p({},Mu,{key:function(i){if(i.key){var o=ZN[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=Pd(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?JN[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:im,charCode:function(i){return i.type==="keypress"?Pd(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Pd(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),r2=Rr(n2),i2=p({},jd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),C0=Rr(i2),a2=p({},Mu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:im}),o2=Rr(a2),s2=p({},Ko,{propertyName:0,elapsedTime:0,pseudoElement:0}),l2=Rr(s2),u2=p({},jd,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),c2=Rr(u2),d2=p({},Ko,{newState:0,oldState:0}),f2=Rr(d2),h2=[9,13,27,32],am=aa&&"CompositionEvent"in window,Au=null;aa&&"documentMode"in document&&(Au=document.documentMode);var p2=aa&&"TextEvent"in window&&!Au,R0=aa&&(!am||Au&&8<Au&&11>=Au),k0=" ",M0=!1;function O0(i,o){switch(i){case"keyup":return h2.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function A0(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Xs=!1;function m2(i,o){switch(i){case"compositionend":return A0(o);case"keypress":return o.which!==32?null:(M0=!0,k0);case"textInput":return i=o.data,i===k0&&M0?null:i;default:return null}}function g2(i,o){if(Xs)return i==="compositionend"||!am&&O0(i,o)?(i=w0(),Id=em=Ha=null,Xs=!1,i):null;switch(i){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 R0&&o.locale!=="ko"?null:o.data;default:return null}}var y2={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 N0(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!y2[i.type]:o==="textarea"}function D0(i,o,u,h){Ks?Gs?Gs.push(h):Gs=[h]:Ks=h,o=kf(o,"onChange"),0<o.length&&(u=new _d("onChange","change",null,u,h),i.push({event:u,listeners:o}))}var Nu=null,Du=null;function b2(i){p1(i,0)}function zd(i){var o=er(i);if(h0(o))return i}function I0(i,o){if(i==="change")return o}var P0=!1;if(aa){var om;if(aa){var sm="oninput"in document;if(!sm){var L0=document.createElement("div");L0.setAttribute("oninput","return;"),sm=typeof L0.oninput=="function"}om=sm}else om=!1;P0=om&&(!document.documentMode||9<document.documentMode)}function _0(){Nu&&(Nu.detachEvent("onpropertychange",j0),Du=Nu=null)}function j0(i){if(i.propertyName==="value"&&zd(Du)){var o=[];D0(o,Du,i,Qp(i)),x0(b2,o)}}function v2(i,o,u){i==="focusin"?(_0(),Nu=o,Du=u,Nu.attachEvent("onpropertychange",j0)):i==="focusout"&&_0()}function x2(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return zd(Du)}function w2(i,o){if(i==="click")return zd(o)}function S2(i,o){if(i==="input"||i==="change")return zd(o)}function E2(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var Br=typeof Object.is=="function"?Object.is:E2;function Iu(i,o){if(Br(i,o))return!0;if(typeof i!="object"||i===null||typeof o!="object"||o===null)return!1;var u=Object.keys(i),h=Object.keys(o);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var b=u[h];if(!J.call(o,b)||!Br(i[b],o[b]))return!1}return!0}function z0(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function F0(i,o){var u=z0(i);i=0;for(var h;u;){if(u.nodeType===3){if(h=i+u.textContent.length,i<=o&&h>=o)return{node:u,offset:o-i};i=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=z0(u)}}function B0(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?B0(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function H0(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var o=Nd(i.document);o instanceof i.HTMLIFrameElement;){try{var u=typeof o.contentWindow.location.href=="string"}catch{u=!1}if(u)i=o.contentWindow;else break;o=Nd(i.document)}return o}function lm(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}var T2=aa&&"documentMode"in document&&11>=document.documentMode,Qs=null,um=null,Pu=null,cm=!1;function U0(i,o,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;cm||Qs==null||Qs!==Nd(h)||(h=Qs,"selectionStart"in h&&lm(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Pu&&Iu(Pu,h)||(Pu=h,h=kf(um,"onSelect"),0<h.length&&(o=new _d("onSelect","select",null,o,u),i.push({event:o,listeners:h}),o.target=Qs)))}function Go(i,o){var u={};return u[i.toLowerCase()]=o.toLowerCase(),u["Webkit"+i]="webkit"+o,u["Moz"+i]="moz"+o,u}var Zs={animationend:Go("Animation","AnimationEnd"),animationiteration:Go("Animation","AnimationIteration"),animationstart:Go("Animation","AnimationStart"),transitionrun:Go("Transition","TransitionRun"),transitionstart:Go("Transition","TransitionStart"),transitioncancel:Go("Transition","TransitionCancel"),transitionend:Go("Transition","TransitionEnd")},dm={},V0={};aa&&(V0=document.createElement("div").style,"AnimationEvent"in window||(delete Zs.animationend.animation,delete Zs.animationiteration.animation,delete Zs.animationstart.animation),"TransitionEvent"in window||delete Zs.transitionend.transition);function Xo(i){if(dm[i])return dm[i];if(!Zs[i])return i;var o=Zs[i],u;for(u in o)if(o.hasOwnProperty(u)&&u in V0)return dm[i]=o[u];return i}var q0=Xo("animationend"),$0=Xo("animationiteration"),Y0=Xo("animationstart"),C2=Xo("transitionrun"),R2=Xo("transitionstart"),k2=Xo("transitioncancel"),W0=Xo("transitionend"),K0=new Map,fm="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(" ");fm.push("scrollEnd");function Ei(i,o){K0.set(i,o),wi(o,[i])}var Fd=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=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(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},ni=[],Js=0,hm=0;function Bd(){for(var i=Js,o=hm=Js=0;o<i;){var u=ni[o];ni[o++]=null;var h=ni[o];ni[o++]=null;var b=ni[o];ni[o++]=null;var v=ni[o];if(ni[o++]=null,h!==null&&b!==null){var A=h.pending;A===null?b.next=b:(b.next=A.next,A.next=b),h.pending=b}v!==0&&G0(u,b,v)}}function Hd(i,o,u,h){ni[Js++]=i,ni[Js++]=o,ni[Js++]=u,ni[Js++]=h,hm|=h,i.lanes|=h,i=i.alternate,i!==null&&(i.lanes|=h)}function pm(i,o,u,h){return Hd(i,o,u,h),Ud(i)}function Qo(i,o){return Hd(i,null,null,o),Ud(i)}function G0(i,o,u){i.lanes|=u;var h=i.alternate;h!==null&&(h.lanes|=u);for(var b=!1,v=i.return;v!==null;)v.childLanes|=u,h=v.alternate,h!==null&&(h.childLanes|=u),v.tag===22&&(i=v.stateNode,i===null||i._visibility&1||(b=!0)),i=v,v=v.return;return i.tag===3?(v=i.stateNode,b&&o!==null&&(b=31-st(u),i=v.hiddenUpdates,h=i[b],h===null?i[b]=[o]:h.push(o),o.lane=u|536870912),v):null}function Ud(i){if(50<nc)throw nc=0,Eg=null,Error(r(185));for(var o=i.return;o!==null;)i=o,o=i.return;return i.tag===3?i.stateNode:null}var el={};function M2(i,o,u,h){this.tag=i,this.key=u,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=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Hr(i,o,u,h){return new M2(i,o,u,h)}function mm(i){return i=i.prototype,!(!i||!i.isReactComponent)}function oa(i,o){var u=i.alternate;return u===null?(u=Hr(i.tag,o,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=o,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&65011712,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,o=i.dependencies,u.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u.refCleanup=i.refCleanup,u}function X0(i,o){i.flags&=65011714;var u=i.alternate;return u===null?(i.childLanes=0,i.lanes=o,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=u.childLanes,i.lanes=u.lanes,i.child=u.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=u.memoizedProps,i.memoizedState=u.memoizedState,i.updateQueue=u.updateQueue,i.type=u.type,o=u.dependencies,i.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),i}function Vd(i,o,u,h,b,v){var A=0;if(h=i,typeof i=="function")mm(i)&&(A=1);else if(typeof i=="string")A=ID(i,u,Q.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case $:return i=Hr(31,u,o,b),i.elementType=$,i.lanes=v,i;case C:return Zo(u.children,b,v,o);case T:A=8,b|=24;break;case S:return i=Hr(12,u,o,b|2),i.elementType=S,i.lanes=v,i;case D:return i=Hr(13,u,o,b),i.elementType=D,i.lanes=v,i;case O:return i=Hr(19,u,o,b),i.elementType=O,i.lanes=v,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case k:A=10;break e;case R:A=9;break e;case M:A=11;break e;case N:A=14;break e;case _:A=16,h=null;break e}A=29,u=Error(r(130,i===null?"null":typeof i,"")),h=null}return o=Hr(A,u,o,b),o.elementType=i,o.type=h,o.lanes=v,o}function Zo(i,o,u,h){return i=Hr(7,i,h,o),i.lanes=u,i}function gm(i,o,u){return i=Hr(6,i,null,o),i.lanes=u,i}function Q0(i){var o=Hr(18,null,null,0);return o.stateNode=i,o}function ym(i,o,u){return o=Hr(4,i.children!==null?i.children:[],i.key,o),o.lanes=u,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}var Z0=new WeakMap;function ri(i,o){if(typeof i=="object"&&i!==null){var u=Z0.get(i);return u!==void 0?u:(o={value:i,source:o,stack:Ce(o)},Z0.set(i,o),o)}return{value:i,source:o,stack:Ce(o)}}var tl=[],nl=0,qd=null,Lu=0,ii=[],ai=0,Ua=null,Li=1,_i="";function sa(i,o){tl[nl++]=Lu,tl[nl++]=qd,qd=i,Lu=o}function J0(i,o,u){ii[ai++]=Li,ii[ai++]=_i,ii[ai++]=Ua,Ua=i;var h=Li;i=_i;var b=32-st(h)-1;h&=~(1<<b),u+=1;var v=32-st(o)+b;if(30<v){var A=b-b%5;v=(h&(1<<A)-1).toString(32),h>>=A,b-=A,Li=1<<32-st(o)+b|u<<b|h,_i=v+i}else Li=1<<v|u<<b|h,_i=i}function bm(i){i.return!==null&&(sa(i,1),J0(i,1,0))}function vm(i){for(;i===qd;)qd=tl[--nl],tl[nl]=null,Lu=tl[--nl],tl[nl]=null;for(;i===Ua;)Ua=ii[--ai],ii[ai]=null,_i=ii[--ai],ii[ai]=null,Li=ii[--ai],ii[ai]=null}function ew(i,o){ii[ai++]=Li,ii[ai++]=_i,ii[ai++]=Ua,Li=o.id,_i=o.overflow,Ua=i}var ar=null,En=null,Zt=!1,Va=null,oi=!1,xm=Error(r(519));function qa(i){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw _u(ri(o,i)),xm}function tw(i){var o=i.stateNode,u=i.type,h=i.memoizedProps;switch(o[qe]=i,o[Ke]=h,u){case"dialog":qt("cancel",o),qt("close",o);break;case"iframe":case"object":case"embed":qt("load",o);break;case"video":case"audio":for(u=0;u<ic.length;u++)qt(ic[u],o);break;case"source":qt("error",o);break;case"img":case"image":case"link":qt("error",o),qt("load",o);break;case"details":qt("toggle",o);break;case"input":qt("invalid",o),p0(o,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":qt("invalid",o);break;case"textarea":qt("invalid",o),g0(o,h.value,h.defaultValue,h.children)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||o.textContent===""+u||h.suppressHydrationWarning===!0||b1(o.textContent,u)?(h.popover!=null&&(qt("beforetoggle",o),qt("toggle",o)),h.onScroll!=null&&qt("scroll",o),h.onScrollEnd!=null&&qt("scrollend",o),h.onClick!=null&&(o.onclick=ia),o=!0):o=!1,o||qa(i,!0)}function nw(i){for(ar=i.return;ar;)switch(ar.tag){case 5:case 31:case 13:oi=!1;return;case 27:case 3:oi=!0;return;default:ar=ar.return}}function rl(i){if(i!==ar)return!1;if(!Zt)return nw(i),Zt=!0,!1;var o=i.tag,u;if((u=o!==3&&o!==27)&&((u=o===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||zg(i.type,i.memoizedProps)),u=!u),u&&En&&qa(i),nw(i),o===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));En=k1(i)}else if(o===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));En=k1(i)}else o===27?(o=En,io(i.type)?(i=Vg,Vg=null,En=i):En=o):En=ar?li(i.stateNode.nextSibling):null;return!0}function Jo(){En=ar=null,Zt=!1}function wm(){var i=Va;return i!==null&&(Ar===null?Ar=i:Ar.push.apply(Ar,i),Va=null),i}function _u(i){Va===null?Va=[i]:Va.push(i)}var Sm=B(null),es=null,la=null;function $a(i,o,u){I(Sm,o._currentValue),o._currentValue=u}function ua(i){i._currentValue=Sm.current,G(Sm)}function Em(i,o,u){for(;i!==null;){var h=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,h!==null&&(h.childLanes|=o)):h!==null&&(h.childLanes&o)!==o&&(h.childLanes|=o),i===u)break;i=i.return}}function Tm(i,o,u,h){var b=i.child;for(b!==null&&(b.return=i);b!==null;){var v=b.dependencies;if(v!==null){var A=b.child;v=v.firstContext;e:for(;v!==null;){var U=v;v=b;for(var ee=0;ee<o.length;ee++)if(U.context===o[ee]){v.lanes|=u,U=v.alternate,U!==null&&(U.lanes|=u),Em(v.return,u,i),h||(A=null);break e}v=U.next}}else if(b.tag===18){if(A=b.return,A===null)throw Error(r(341));A.lanes|=u,v=A.alternate,v!==null&&(v.lanes|=u),Em(A,u,i),A=null}else A=b.child;if(A!==null)A.return=b;else for(A=b;A!==null;){if(A===i){A=null;break}if(b=A.sibling,b!==null){b.return=A.return,A=b;break}A=A.return}b=A}}function il(i,o,u,h){i=null;for(var b=o,v=!1;b!==null;){if(!v){if((b.flags&524288)!==0)v=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var A=b.alternate;if(A===null)throw Error(r(387));if(A=A.memoizedProps,A!==null){var U=b.type;Br(b.pendingProps.value,A.value)||(i!==null?i.push(U):i=[U])}}else if(b===ce.current){if(A=b.alternate,A===null)throw Error(r(387));A.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(i!==null?i.push(uc):i=[uc])}b=b.return}i!==null&&Tm(o,i,u,h),o.flags|=262144}function $d(i){for(i=i.firstContext;i!==null;){if(!Br(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function ts(i){es=i,la=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function or(i){return rw(es,i)}function Yd(i,o){return es===null&&ts(i),rw(i,o)}function rw(i,o){var u=o._currentValue;if(o={context:o,memoizedValue:u,next:null},la===null){if(i===null)throw Error(r(308));la=o,i.dependencies={lanes:0,firstContext:o},i.flags|=524288}else la=la.next=o;return u}var O2=typeof AbortController<"u"?AbortController:function(){var i=[],o=this.signal={aborted:!1,addEventListener:function(u,h){i.push(h)}};this.abort=function(){o.aborted=!0,i.forEach(function(u){return u()})}},A2=e.unstable_scheduleCallback,N2=e.unstable_NormalPriority,Vn={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Cm(){return{controller:new O2,data:new Map,refCount:0}}function ju(i){i.refCount--,i.refCount===0&&A2(N2,function(){i.controller.abort()})}var zu=null,Rm=0,al=0,ol=null;function D2(i,o){if(zu===null){var u=zu=[];Rm=0,al=Og(),ol={status:"pending",value:void 0,then:function(h){u.push(h)}}}return Rm++,o.then(iw,iw),o}function iw(){if(--Rm===0&&zu!==null){ol!==null&&(ol.status="fulfilled");var i=zu;zu=null,al=0,ol=null;for(var o=0;o<i.length;o++)(0,i[o])()}}function I2(i,o){var u=[],h={status:"pending",value:null,reason:null,then:function(b){u.push(b)}};return i.then(function(){h.status="fulfilled",h.value=o;for(var b=0;b<u.length;b++)(0,u[b])(o)},function(b){for(h.status="rejected",h.reason=b,b=0;b<u.length;b++)(0,u[b])(void 0)}),h}var aw=j.S;j.S=function(i,o){US=te(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&D2(i,o),aw!==null&&aw(i,o)};var ns=B(null);function km(){var i=ns.current;return i!==null?i:yn.pooledCache}function Wd(i,o){o===null?I(ns,ns.current):I(ns,o.pool)}function ow(){var i=km();return i===null?null:{parent:Vn._currentValue,pool:i}}var sl=Error(r(460)),Mm=Error(r(474)),Kd=Error(r(542)),Gd={then:function(){}};function sw(i){return i=i.status,i==="fulfilled"||i==="rejected"}function lw(i,o,u){switch(u=i[u],u===void 0?i.push(o):u!==o&&(o.then(ia,ia),o=u),o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,cw(i),i;default:if(typeof o.status=="string")o.then(ia,ia);else{if(i=yn,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=o,i.status="pending",i.then(function(h){if(o.status==="pending"){var b=o;b.status="fulfilled",b.value=h}},function(h){if(o.status==="pending"){var b=o;b.status="rejected",b.reason=h}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,cw(i),i}throw is=o,sl}}function rs(i){try{var o=i._init;return o(i._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(is=u,sl):u}}var is=null;function uw(){if(is===null)throw Error(r(459));var i=is;return is=null,i}function cw(i){if(i===sl||i===Kd)throw Error(r(483))}var ll=null,Fu=0;function Xd(i){var o=Fu;return Fu+=1,ll===null&&(ll=[]),lw(ll,i,o)}function Bu(i,o){o=o.props.ref,i.ref=o!==void 0?o:null}function Qd(i,o){throw o.$$typeof===y?Error(r(525)):(i=Object.prototype.toString.call(o),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":i)))}function dw(i){function o(ue,oe){if(i){var fe=ue.deletions;fe===null?(ue.deletions=[oe],ue.flags|=16):fe.push(oe)}}function u(ue,oe){if(!i)return null;for(;oe!==null;)o(ue,oe),oe=oe.sibling;return null}function h(ue){for(var oe=new Map;ue!==null;)ue.key!==null?oe.set(ue.key,ue):oe.set(ue.index,ue),ue=ue.sibling;return oe}function b(ue,oe){return ue=oa(ue,oe),ue.index=0,ue.sibling=null,ue}function v(ue,oe,fe){return ue.index=fe,i?(fe=ue.alternate,fe!==null?(fe=fe.index,fe<oe?(ue.flags|=67108866,oe):fe):(ue.flags|=67108866,oe)):(ue.flags|=1048576,oe)}function A(ue){return i&&ue.alternate===null&&(ue.flags|=67108866),ue}function U(ue,oe,fe,Oe){return oe===null||oe.tag!==6?(oe=gm(fe,ue.mode,Oe),oe.return=ue,oe):(oe=b(oe,fe),oe.return=ue,oe)}function ee(ue,oe,fe,Oe){var dt=fe.type;return dt===C?Te(ue,oe,fe.props.children,Oe,fe.key):oe!==null&&(oe.elementType===dt||typeof dt=="object"&&dt!==null&&dt.$$typeof===_&&rs(dt)===oe.type)?(oe=b(oe,fe.props),Bu(oe,fe),oe.return=ue,oe):(oe=Vd(fe.type,fe.key,fe.props,null,ue.mode,Oe),Bu(oe,fe),oe.return=ue,oe)}function pe(ue,oe,fe,Oe){return oe===null||oe.tag!==4||oe.stateNode.containerInfo!==fe.containerInfo||oe.stateNode.implementation!==fe.implementation?(oe=ym(fe,ue.mode,Oe),oe.return=ue,oe):(oe=b(oe,fe.children||[]),oe.return=ue,oe)}function Te(ue,oe,fe,Oe,dt){return oe===null||oe.tag!==7?(oe=Zo(fe,ue.mode,Oe,dt),oe.return=ue,oe):(oe=b(oe,fe),oe.return=ue,oe)}function Ne(ue,oe,fe){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return oe=gm(""+oe,ue.mode,fe),oe.return=ue,oe;if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case g:return fe=Vd(oe.type,oe.key,oe.props,null,ue.mode,fe),Bu(fe,oe),fe.return=ue,fe;case x:return oe=ym(oe,ue.mode,fe),oe.return=ue,oe;case _:return oe=rs(oe),Ne(ue,oe,fe)}if(Y(oe)||L(oe))return oe=Zo(oe,ue.mode,fe,null),oe.return=ue,oe;if(typeof oe.then=="function")return Ne(ue,Xd(oe),fe);if(oe.$$typeof===k)return Ne(ue,Yd(ue,oe),fe);Qd(ue,oe)}return null}function me(ue,oe,fe,Oe){var dt=oe!==null?oe.key:null;if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return dt!==null?null:U(ue,oe,""+fe,Oe);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case g:return fe.key===dt?ee(ue,oe,fe,Oe):null;case x:return fe.key===dt?pe(ue,oe,fe,Oe):null;case _:return fe=rs(fe),me(ue,oe,fe,Oe)}if(Y(fe)||L(fe))return dt!==null?null:Te(ue,oe,fe,Oe,null);if(typeof fe.then=="function")return me(ue,oe,Xd(fe),Oe);if(fe.$$typeof===k)return me(ue,oe,Yd(ue,fe),Oe);Qd(ue,fe)}return null}function ve(ue,oe,fe,Oe,dt){if(typeof Oe=="string"&&Oe!==""||typeof Oe=="number"||typeof Oe=="bigint")return ue=ue.get(fe)||null,U(oe,ue,""+Oe,dt);if(typeof Oe=="object"&&Oe!==null){switch(Oe.$$typeof){case g:return ue=ue.get(Oe.key===null?fe:Oe.key)||null,ee(oe,ue,Oe,dt);case x:return ue=ue.get(Oe.key===null?fe:Oe.key)||null,pe(oe,ue,Oe,dt);case _:return Oe=rs(Oe),ve(ue,oe,fe,Oe,dt)}if(Y(Oe)||L(Oe))return ue=ue.get(fe)||null,Te(oe,ue,Oe,dt,null);if(typeof Oe.then=="function")return ve(ue,oe,fe,Xd(Oe),dt);if(Oe.$$typeof===k)return ve(ue,oe,fe,Yd(oe,Oe),dt);Qd(oe,Oe)}return null}function Ze(ue,oe,fe,Oe){for(var dt=null,rn=null,at=oe,Nt=oe=0,Wt=null;at!==null&&Nt<fe.length;Nt++){at.index>Nt?(Wt=at,at=null):Wt=at.sibling;var an=me(ue,at,fe[Nt],Oe);if(an===null){at===null&&(at=Wt);break}i&&at&&an.alternate===null&&o(ue,at),oe=v(an,oe,Nt),rn===null?dt=an:rn.sibling=an,rn=an,at=Wt}if(Nt===fe.length)return u(ue,at),Zt&&sa(ue,Nt),dt;if(at===null){for(;Nt<fe.length;Nt++)at=Ne(ue,fe[Nt],Oe),at!==null&&(oe=v(at,oe,Nt),rn===null?dt=at:rn.sibling=at,rn=at);return Zt&&sa(ue,Nt),dt}for(at=h(at);Nt<fe.length;Nt++)Wt=ve(at,ue,Nt,fe[Nt],Oe),Wt!==null&&(i&&Wt.alternate!==null&&at.delete(Wt.key===null?Nt:Wt.key),oe=v(Wt,oe,Nt),rn===null?dt=Wt:rn.sibling=Wt,rn=Wt);return i&&at.forEach(function(uo){return o(ue,uo)}),Zt&&sa(ue,Nt),dt}function mt(ue,oe,fe,Oe){if(fe==null)throw Error(r(151));for(var dt=null,rn=null,at=oe,Nt=oe=0,Wt=null,an=fe.next();at!==null&&!an.done;Nt++,an=fe.next()){at.index>Nt?(Wt=at,at=null):Wt=at.sibling;var uo=me(ue,at,an.value,Oe);if(uo===null){at===null&&(at=Wt);break}i&&at&&uo.alternate===null&&o(ue,at),oe=v(uo,oe,Nt),rn===null?dt=uo:rn.sibling=uo,rn=uo,at=Wt}if(an.done)return u(ue,at),Zt&&sa(ue,Nt),dt;if(at===null){for(;!an.done;Nt++,an=fe.next())an=Ne(ue,an.value,Oe),an!==null&&(oe=v(an,oe,Nt),rn===null?dt=an:rn.sibling=an,rn=an);return Zt&&sa(ue,Nt),dt}for(at=h(at);!an.done;Nt++,an=fe.next())an=ve(at,ue,Nt,an.value,Oe),an!==null&&(i&&an.alternate!==null&&at.delete(an.key===null?Nt:an.key),oe=v(an,oe,Nt),rn===null?dt=an:rn.sibling=an,rn=an);return i&&at.forEach(function(qD){return o(ue,qD)}),Zt&&sa(ue,Nt),dt}function mn(ue,oe,fe,Oe){if(typeof fe=="object"&&fe!==null&&fe.type===C&&fe.key===null&&(fe=fe.props.children),typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case g:e:{for(var dt=fe.key;oe!==null;){if(oe.key===dt){if(dt=fe.type,dt===C){if(oe.tag===7){u(ue,oe.sibling),Oe=b(oe,fe.props.children),Oe.return=ue,ue=Oe;break e}}else if(oe.elementType===dt||typeof dt=="object"&&dt!==null&&dt.$$typeof===_&&rs(dt)===oe.type){u(ue,oe.sibling),Oe=b(oe,fe.props),Bu(Oe,fe),Oe.return=ue,ue=Oe;break e}u(ue,oe);break}else o(ue,oe);oe=oe.sibling}fe.type===C?(Oe=Zo(fe.props.children,ue.mode,Oe,fe.key),Oe.return=ue,ue=Oe):(Oe=Vd(fe.type,fe.key,fe.props,null,ue.mode,Oe),Bu(Oe,fe),Oe.return=ue,ue=Oe)}return A(ue);case x:e:{for(dt=fe.key;oe!==null;){if(oe.key===dt)if(oe.tag===4&&oe.stateNode.containerInfo===fe.containerInfo&&oe.stateNode.implementation===fe.implementation){u(ue,oe.sibling),Oe=b(oe,fe.children||[]),Oe.return=ue,ue=Oe;break e}else{u(ue,oe);break}else o(ue,oe);oe=oe.sibling}Oe=ym(fe,ue.mode,Oe),Oe.return=ue,ue=Oe}return A(ue);case _:return fe=rs(fe),mn(ue,oe,fe,Oe)}if(Y(fe))return Ze(ue,oe,fe,Oe);if(L(fe)){if(dt=L(fe),typeof dt!="function")throw Error(r(150));return fe=dt.call(fe),mt(ue,oe,fe,Oe)}if(typeof fe.then=="function")return mn(ue,oe,Xd(fe),Oe);if(fe.$$typeof===k)return mn(ue,oe,Yd(ue,fe),Oe);Qd(ue,fe)}return typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint"?(fe=""+fe,oe!==null&&oe.tag===6?(u(ue,oe.sibling),Oe=b(oe,fe),Oe.return=ue,ue=Oe):(u(ue,oe),Oe=gm(fe,ue.mode,Oe),Oe.return=ue,ue=Oe),A(ue)):u(ue,oe)}return function(ue,oe,fe,Oe){try{Fu=0;var dt=mn(ue,oe,fe,Oe);return ll=null,dt}catch(at){if(at===sl||at===Kd)throw at;var rn=Hr(29,at,null,ue.mode);return rn.lanes=Oe,rn.return=ue,rn}finally{}}}var as=dw(!0),fw=dw(!1),Ya=!1;function Om(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Am(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Wa(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Ka(i,o,u){var h=i.updateQueue;if(h===null)return null;if(h=h.shared,(ln&2)!==0){var b=h.pending;return b===null?o.next=o:(o.next=b.next,b.next=o),h.pending=o,o=Ud(i),G0(i,null,u),o}return Hd(i,h,o,u),Ud(i)}function Hu(i,o,u){if(o=o.updateQueue,o!==null&&(o=o.shared,(u&4194048)!==0)){var h=o.lanes;h&=i.pendingLanes,u|=h,o.lanes=u,X(i,u)}}function Nm(i,o){var u=i.updateQueue,h=i.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var b=null,v=null;if(u=u.firstBaseUpdate,u!==null){do{var A={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};v===null?b=v=A:v=v.next=A,u=u.next}while(u!==null);v===null?b=v=o:v=v.next=o}else b=v=o;u={baseState:h.baseState,firstBaseUpdate:b,lastBaseUpdate:v,shared:h.shared,callbacks:h.callbacks},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=o:i.next=o,u.lastBaseUpdate=o}var Dm=!1;function Uu(){if(Dm){var i=ol;if(i!==null)throw i}}function Vu(i,o,u,h){Dm=!1;var b=i.updateQueue;Ya=!1;var v=b.firstBaseUpdate,A=b.lastBaseUpdate,U=b.shared.pending;if(U!==null){b.shared.pending=null;var ee=U,pe=ee.next;ee.next=null,A===null?v=pe:A.next=pe,A=ee;var Te=i.alternate;Te!==null&&(Te=Te.updateQueue,U=Te.lastBaseUpdate,U!==A&&(U===null?Te.firstBaseUpdate=pe:U.next=pe,Te.lastBaseUpdate=ee))}if(v!==null){var Ne=b.baseState;A=0,Te=pe=ee=null,U=v;do{var me=U.lane&-536870913,ve=me!==U.lane;if(ve?(Yt&me)===me:(h&me)===me){me!==0&&me===al&&(Dm=!0),Te!==null&&(Te=Te.next={lane:0,tag:U.tag,payload:U.payload,callback:null,next:null});e:{var Ze=i,mt=U;me=o;var mn=u;switch(mt.tag){case 1:if(Ze=mt.payload,typeof Ze=="function"){Ne=Ze.call(mn,Ne,me);break e}Ne=Ze;break e;case 3:Ze.flags=Ze.flags&-65537|128;case 0:if(Ze=mt.payload,me=typeof Ze=="function"?Ze.call(mn,Ne,me):Ze,me==null)break e;Ne=p({},Ne,me);break e;case 2:Ya=!0}}me=U.callback,me!==null&&(i.flags|=64,ve&&(i.flags|=8192),ve=b.callbacks,ve===null?b.callbacks=[me]:ve.push(me))}else ve={lane:me,tag:U.tag,payload:U.payload,callback:U.callback,next:null},Te===null?(pe=Te=ve,ee=Ne):Te=Te.next=ve,A|=me;if(U=U.next,U===null){if(U=b.shared.pending,U===null)break;ve=U,U=ve.next,ve.next=null,b.lastBaseUpdate=ve,b.shared.pending=null}}while(!0);Te===null&&(ee=Ne),b.baseState=ee,b.firstBaseUpdate=pe,b.lastBaseUpdate=Te,v===null&&(b.shared.lanes=0),Ja|=A,i.lanes=A,i.memoizedState=Ne}}function hw(i,o){if(typeof i!="function")throw Error(r(191,i));i.call(o)}function pw(i,o){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)hw(u[i],o)}var ul=B(null),Zd=B(0);function mw(i,o){i=ba,I(Zd,i),I(ul,o),ba=i|o.baseLanes}function Im(){I(Zd,ba),I(ul,ul.current)}function Pm(){ba=Zd.current,G(ul),G(Zd)}var Ur=B(null),si=null;function Ga(i){var o=i.alternate;I(Fn,Fn.current&1),I(Ur,i),si===null&&(o===null||ul.current!==null||o.memoizedState!==null)&&(si=i)}function Lm(i){I(Fn,Fn.current),I(Ur,i),si===null&&(si=i)}function gw(i){i.tag===22?(I(Fn,Fn.current),I(Ur,i),si===null&&(si=i)):Xa()}function Xa(){I(Fn,Fn.current),I(Ur,Ur.current)}function Vr(i){G(Ur),si===i&&(si=null),G(Fn)}var Fn=B(0);function Jd(i){for(var o=i;o!==null;){if(o.tag===13){var u=o.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Hg(u)||Ug(u)))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===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var ca=0,At=null,hn=null,qn=null,ef=!1,cl=!1,os=!1,tf=0,qu=0,dl=null,P2=0;function Dn(){throw Error(r(321))}function _m(i,o){if(o===null)return!1;for(var u=0;u<o.length&&u<i.length;u++)if(!Br(i[u],o[u]))return!1;return!0}function jm(i,o,u,h,b,v){return ca=v,At=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,j.H=i===null||i.memoizedState===null?Jw:Zm,os=!1,v=u(h,b),os=!1,cl&&(v=bw(o,u,h,b)),yw(i),v}function yw(i){j.H=Wu;var o=hn!==null&&hn.next!==null;if(ca=0,qn=hn=At=null,ef=!1,qu=0,dl=null,o)throw Error(r(300));i===null||$n||(i=i.dependencies,i!==null&&$d(i)&&($n=!0))}function bw(i,o,u,h){At=i;var b=0;do{if(cl&&(dl=null),qu=0,cl=!1,25<=b)throw Error(r(301));if(b+=1,qn=hn=null,i.updateQueue!=null){var v=i.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}j.H=eS,v=o(u,h)}while(cl);return v}function L2(){var i=j.H,o=i.useState()[0];return o=typeof o.then=="function"?$u(o):o,i=i.useState()[0],(hn!==null?hn.memoizedState:null)!==i&&(At.flags|=1024),o}function zm(){var i=tf!==0;return tf=0,i}function Fm(i,o,u){o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~u}function Bm(i){if(ef){for(i=i.memoizedState;i!==null;){var o=i.queue;o!==null&&(o.pending=null),i=i.next}ef=!1}ca=0,qn=hn=At=null,cl=!1,qu=tf=0,dl=null}function yr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qn===null?At.memoizedState=qn=i:qn=qn.next=i,qn}function Bn(){if(hn===null){var i=At.alternate;i=i!==null?i.memoizedState:null}else i=hn.next;var o=qn===null?At.memoizedState:qn.next;if(o!==null)qn=o,hn=i;else{if(i===null)throw At.alternate===null?Error(r(467)):Error(r(310));hn=i,i={memoizedState:hn.memoizedState,baseState:hn.baseState,baseQueue:hn.baseQueue,queue:hn.queue,next:null},qn===null?At.memoizedState=qn=i:qn=qn.next=i}return qn}function nf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function $u(i){var o=qu;return qu+=1,dl===null&&(dl=[]),i=lw(dl,i,o),o=At,(qn===null?o.memoizedState:qn.next)===null&&(o=o.alternate,j.H=o===null||o.memoizedState===null?Jw:Zm),i}function rf(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return $u(i);if(i.$$typeof===k)return or(i)}throw Error(r(438,String(i)))}function Hm(i){var o=null,u=At.updateQueue;if(u!==null&&(o=u.memoCache),o==null){var h=At.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(o={data:h.data.map(function(b){return b.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),u===null&&(u=nf(),At.updateQueue=u),u.memoCache=o,u=o.data[o.index],u===void 0)for(u=o.data[o.index]=Array(i),h=0;h<i;h++)u[h]=F;return o.index++,u}function da(i,o){return typeof o=="function"?o(i):o}function af(i){var o=Bn();return Um(o,hn,i)}function Um(i,o,u){var h=i.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=u;var b=i.baseQueue,v=h.pending;if(v!==null){if(b!==null){var A=b.next;b.next=v.next,v.next=A}o.baseQueue=b=v,h.pending=null}if(v=i.baseState,b===null)i.memoizedState=v;else{o=b.next;var U=A=null,ee=null,pe=o,Te=!1;do{var Ne=pe.lane&-536870913;if(Ne!==pe.lane?(Yt&Ne)===Ne:(ca&Ne)===Ne){var me=pe.revertLane;if(me===0)ee!==null&&(ee=ee.next={lane:0,revertLane:0,gesture:null,action:pe.action,hasEagerState:pe.hasEagerState,eagerState:pe.eagerState,next:null}),Ne===al&&(Te=!0);else if((ca&me)===me){pe=pe.next,me===al&&(Te=!0);continue}else Ne={lane:0,revertLane:pe.revertLane,gesture:null,action:pe.action,hasEagerState:pe.hasEagerState,eagerState:pe.eagerState,next:null},ee===null?(U=ee=Ne,A=v):ee=ee.next=Ne,At.lanes|=me,Ja|=me;Ne=pe.action,os&&u(v,Ne),v=pe.hasEagerState?pe.eagerState:u(v,Ne)}else me={lane:Ne,revertLane:pe.revertLane,gesture:pe.gesture,action:pe.action,hasEagerState:pe.hasEagerState,eagerState:pe.eagerState,next:null},ee===null?(U=ee=me,A=v):ee=ee.next=me,At.lanes|=Ne,Ja|=Ne;pe=pe.next}while(pe!==null&&pe!==o);if(ee===null?A=v:ee.next=U,!Br(v,i.memoizedState)&&($n=!0,Te&&(u=ol,u!==null)))throw u;i.memoizedState=v,i.baseState=A,i.baseQueue=ee,h.lastRenderedState=v}return b===null&&(h.lanes=0),[i.memoizedState,h.dispatch]}function Vm(i){var o=Bn(),u=o.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=i;var h=u.dispatch,b=u.pending,v=o.memoizedState;if(b!==null){u.pending=null;var A=b=b.next;do v=i(v,A.action),A=A.next;while(A!==b);Br(v,o.memoizedState)||($n=!0),o.memoizedState=v,o.baseQueue===null&&(o.baseState=v),u.lastRenderedState=v}return[v,h]}function vw(i,o,u){var h=At,b=Bn(),v=Zt;if(v){if(u===void 0)throw Error(r(407));u=u()}else u=o();var A=!Br((hn||b).memoizedState,u);if(A&&(b.memoizedState=u,$n=!0),b=b.queue,Ym(Sw.bind(null,h,b,i),[i]),b.getSnapshot!==o||A||qn!==null&&qn.memoizedState.tag&1){if(h.flags|=2048,fl(9,{destroy:void 0},ww.bind(null,h,b,u,o),null),yn===null)throw Error(r(349));v||(ca&127)!==0||xw(h,o,u)}return u}function xw(i,o,u){i.flags|=16384,i={getSnapshot:o,value:u},o=At.updateQueue,o===null?(o=nf(),At.updateQueue=o,o.stores=[i]):(u=o.stores,u===null?o.stores=[i]:u.push(i))}function ww(i,o,u,h){o.value=u,o.getSnapshot=h,Ew(o)&&Tw(i)}function Sw(i,o,u){return u(function(){Ew(o)&&Tw(i)})}function Ew(i){var o=i.getSnapshot;i=i.value;try{var u=o();return!Br(i,u)}catch{return!0}}function Tw(i){var o=Qo(i,2);o!==null&&Nr(o,i,2)}function qm(i){var o=yr();if(typeof i=="function"){var u=i;if(i=u(),os){ot(!0);try{u()}finally{ot(!1)}}}return o.memoizedState=o.baseState=i,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:i},o}function Cw(i,o,u,h){return i.baseState=u,Um(i,hn,typeof h=="function"?h:da)}function _2(i,o,u,h,b){if(lf(i))throw Error(r(485));if(i=o.action,i!==null){var v={payload:b,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){v.listeners.push(A)}};j.T!==null?u(!0):v.isTransition=!1,h(v),u=o.pending,u===null?(v.next=o.pending=v,Rw(o,v)):(v.next=u.next,o.pending=u.next=v)}}function Rw(i,o){var u=o.action,h=o.payload,b=i.state;if(o.isTransition){var v=j.T,A={};j.T=A;try{var U=u(b,h),ee=j.S;ee!==null&&ee(A,U),kw(i,o,U)}catch(pe){$m(i,o,pe)}finally{v!==null&&A.types!==null&&(v.types=A.types),j.T=v}}else try{v=u(b,h),kw(i,o,v)}catch(pe){$m(i,o,pe)}}function kw(i,o,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){Mw(i,o,h)},function(h){return $m(i,o,h)}):Mw(i,o,u)}function Mw(i,o,u){o.status="fulfilled",o.value=u,Ow(o),i.state=u,o=i.pending,o!==null&&(u=o.next,u===o?i.pending=null:(u=u.next,o.next=u,Rw(i,u)))}function $m(i,o,u){var h=i.pending;if(i.pending=null,h!==null){h=h.next;do o.status="rejected",o.reason=u,Ow(o),o=o.next;while(o!==h)}i.action=null}function Ow(i){i=i.listeners;for(var o=0;o<i.length;o++)(0,i[o])()}function Aw(i,o){return o}function Nw(i,o){if(Zt){var u=yn.formState;if(u!==null){e:{var h=At;if(Zt){if(En){t:{for(var b=En,v=oi;b.nodeType!==8;){if(!v){b=null;break t}if(b=li(b.nextSibling),b===null){b=null;break t}}v=b.data,b=v==="F!"||v==="F"?b:null}if(b){En=li(b.nextSibling),h=b.data==="F!";break e}}qa(h)}h=!1}h&&(o=u[0])}}return u=yr(),u.memoizedState=u.baseState=o,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Aw,lastRenderedState:o},u.queue=h,u=Xw.bind(null,At,h),h.dispatch=u,h=qm(!1),v=Qm.bind(null,At,!1,h.queue),h=yr(),b={state:o,dispatch:null,action:i,pending:null},h.queue=b,u=_2.bind(null,At,b,v,u),b.dispatch=u,h.memoizedState=i,[o,u,!1]}function Dw(i){var o=Bn();return Iw(o,hn,i)}function Iw(i,o,u){if(o=Um(i,o,Aw)[0],i=af(da)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var h=$u(o)}catch(A){throw A===sl?Kd:A}else h=o;o=Bn();var b=o.queue,v=b.dispatch;return u!==o.memoizedState&&(At.flags|=2048,fl(9,{destroy:void 0},j2.bind(null,b,u),null)),[h,v,i]}function j2(i,o){i.action=o}function Pw(i){var o=Bn(),u=hn;if(u!==null)return Iw(o,u,i);Bn(),o=o.memoizedState,u=Bn();var h=u.queue.dispatch;return u.memoizedState=i,[o,h,!1]}function fl(i,o,u,h){return i={tag:i,create:u,deps:h,inst:o,next:null},o=At.updateQueue,o===null&&(o=nf(),At.updateQueue=o),u=o.lastEffect,u===null?o.lastEffect=i.next=i:(h=u.next,u.next=i,i.next=h,o.lastEffect=i),i}function Lw(){return Bn().memoizedState}function of(i,o,u,h){var b=yr();At.flags|=i,b.memoizedState=fl(1|o,{destroy:void 0},u,h===void 0?null:h)}function sf(i,o,u,h){var b=Bn();h=h===void 0?null:h;var v=b.memoizedState.inst;hn!==null&&h!==null&&_m(h,hn.memoizedState.deps)?b.memoizedState=fl(o,v,u,h):(At.flags|=i,b.memoizedState=fl(1|o,v,u,h))}function _w(i,o){of(8390656,8,i,o)}function Ym(i,o){sf(2048,8,i,o)}function z2(i){At.flags|=4;var o=At.updateQueue;if(o===null)o=nf(),At.updateQueue=o,o.events=[i];else{var u=o.events;u===null?o.events=[i]:u.push(i)}}function jw(i){var o=Bn().memoizedState;return z2({ref:o,nextImpl:i}),function(){if((ln&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function zw(i,o){return sf(4,2,i,o)}function Fw(i,o){return sf(4,4,i,o)}function Bw(i,o){if(typeof o=="function"){i=i();var u=o(i);return function(){typeof u=="function"?u():o(null)}}if(o!=null)return i=i(),o.current=i,function(){o.current=null}}function Hw(i,o,u){u=u!=null?u.concat([i]):null,sf(4,4,Bw.bind(null,o,i),u)}function Wm(){}function Uw(i,o){var u=Bn();o=o===void 0?null:o;var h=u.memoizedState;return o!==null&&_m(o,h[1])?h[0]:(u.memoizedState=[i,o],i)}function Vw(i,o){var u=Bn();o=o===void 0?null:o;var h=u.memoizedState;if(o!==null&&_m(o,h[1]))return h[0];if(h=i(),os){ot(!0);try{i()}finally{ot(!1)}}return u.memoizedState=[h,o],h}function Km(i,o,u){return u===void 0||(ca&1073741824)!==0&&(Yt&261930)===0?i.memoizedState=o:(i.memoizedState=u,i=qS(),At.lanes|=i,Ja|=i,u)}function qw(i,o,u,h){return Br(u,o)?u:ul.current!==null?(i=Km(i,u,h),Br(i,o)||($n=!0),i):(ca&42)===0||(ca&1073741824)!==0&&(Yt&261930)===0?($n=!0,i.memoizedState=u):(i=qS(),At.lanes|=i,Ja|=i,o)}function $w(i,o,u,h,b){var v=z.p;z.p=v!==0&&8>v?v:8;var A=j.T,U={};j.T=U,Qm(i,!1,o,u);try{var ee=b(),pe=j.S;if(pe!==null&&pe(U,ee),ee!==null&&typeof ee=="object"&&typeof ee.then=="function"){var Te=I2(ee,h);Yu(i,o,Te,Yr(i))}else Yu(i,o,h,Yr(i))}catch(Ne){Yu(i,o,{then:function(){},status:"rejected",reason:Ne},Yr())}finally{z.p=v,A!==null&&U.types!==null&&(A.types=U.types),j.T=A}}function F2(){}function Gm(i,o,u,h){if(i.tag!==5)throw Error(r(476));var b=Yw(i).queue;$w(i,b,o,H,u===null?F2:function(){return Ww(i),u(h)})}function Yw(i){var o=i.memoizedState;if(o!==null)return o;o={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:H},next:null};var u={};return o.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:u},next:null},i.memoizedState=o,i=i.alternate,i!==null&&(i.memoizedState=o),o}function Ww(i){var o=Yw(i);o.next===null&&(o=i.alternate.memoizedState),Yu(i,o.next.queue,{},Yr())}function Xm(){return or(uc)}function Kw(){return Bn().memoizedState}function Gw(){return Bn().memoizedState}function B2(i){for(var o=i.return;o!==null;){switch(o.tag){case 24:case 3:var u=Yr();i=Wa(u);var h=Ka(o,i,u);h!==null&&(Nr(h,o,u),Hu(h,o,u)),o={cache:Cm()},i.payload=o;return}o=o.return}}function H2(i,o,u){var h=Yr();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},lf(i)?Qw(o,u):(u=pm(i,o,u,h),u!==null&&(Nr(u,i,h),Zw(u,o,h)))}function Xw(i,o,u){var h=Yr();Yu(i,o,u,h)}function Yu(i,o,u,h){var b={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(lf(i))Qw(o,b);else{var v=i.alternate;if(i.lanes===0&&(v===null||v.lanes===0)&&(v=o.lastRenderedReducer,v!==null))try{var A=o.lastRenderedState,U=v(A,u);if(b.hasEagerState=!0,b.eagerState=U,Br(U,A))return Hd(i,o,b,0),yn===null&&Bd(),!1}catch{}finally{}if(u=pm(i,o,b,h),u!==null)return Nr(u,i,h),Zw(u,o,h),!0}return!1}function Qm(i,o,u,h){if(h={lane:2,revertLane:Og(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},lf(i)){if(o)throw Error(r(479))}else o=pm(i,u,h,2),o!==null&&Nr(o,i,2)}function lf(i){var o=i.alternate;return i===At||o!==null&&o===At}function Qw(i,o){cl=ef=!0;var u=i.pending;u===null?o.next=o:(o.next=u.next,u.next=o),i.pending=o}function Zw(i,o,u){if((u&4194048)!==0){var h=o.lanes;h&=i.pendingLanes,u|=h,o.lanes=u,X(i,u)}}var Wu={readContext:or,use:rf,useCallback:Dn,useContext:Dn,useEffect:Dn,useImperativeHandle:Dn,useLayoutEffect:Dn,useInsertionEffect:Dn,useMemo:Dn,useReducer:Dn,useRef:Dn,useState:Dn,useDebugValue:Dn,useDeferredValue:Dn,useTransition:Dn,useSyncExternalStore:Dn,useId:Dn,useHostTransitionStatus:Dn,useFormState:Dn,useActionState:Dn,useOptimistic:Dn,useMemoCache:Dn,useCacheRefresh:Dn};Wu.useEffectEvent=Dn;var Jw={readContext:or,use:rf,useCallback:function(i,o){return yr().memoizedState=[i,o===void 0?null:o],i},useContext:or,useEffect:_w,useImperativeHandle:function(i,o,u){u=u!=null?u.concat([i]):null,of(4194308,4,Bw.bind(null,o,i),u)},useLayoutEffect:function(i,o){return of(4194308,4,i,o)},useInsertionEffect:function(i,o){of(4,2,i,o)},useMemo:function(i,o){var u=yr();o=o===void 0?null:o;var h=i();if(os){ot(!0);try{i()}finally{ot(!1)}}return u.memoizedState=[h,o],h},useReducer:function(i,o,u){var h=yr();if(u!==void 0){var b=u(o);if(os){ot(!0);try{u(o)}finally{ot(!1)}}}else b=o;return h.memoizedState=h.baseState=b,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:b},h.queue=i,i=i.dispatch=H2.bind(null,At,i),[h.memoizedState,i]},useRef:function(i){var o=yr();return i={current:i},o.memoizedState=i},useState:function(i){i=qm(i);var o=i.queue,u=Xw.bind(null,At,o);return o.dispatch=u,[i.memoizedState,u]},useDebugValue:Wm,useDeferredValue:function(i,o){var u=yr();return Km(u,i,o)},useTransition:function(){var i=qm(!1);return i=$w.bind(null,At,i.queue,!0,!1),yr().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,o,u){var h=At,b=yr();if(Zt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=o(),yn===null)throw Error(r(349));(Yt&127)!==0||xw(h,o,u)}b.memoizedState=u;var v={value:u,getSnapshot:o};return b.queue=v,_w(Sw.bind(null,h,v,i),[i]),h.flags|=2048,fl(9,{destroy:void 0},ww.bind(null,h,v,u,o),null),u},useId:function(){var i=yr(),o=yn.identifierPrefix;if(Zt){var u=_i,h=Li;u=(h&~(1<<32-st(h)-1)).toString(32)+u,o="_"+o+"R_"+u,u=tf++,0<u&&(o+="H"+u.toString(32)),o+="_"}else u=P2++,o="_"+o+"r_"+u.toString(32)+"_";return i.memoizedState=o},useHostTransitionStatus:Xm,useFormState:Nw,useActionState:Nw,useOptimistic:function(i){var o=yr();o.memoizedState=o.baseState=i;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=u,o=Qm.bind(null,At,!0,u),u.dispatch=o,[i,o]},useMemoCache:Hm,useCacheRefresh:function(){return yr().memoizedState=B2.bind(null,At)},useEffectEvent:function(i){var o=yr(),u={impl:i};return o.memoizedState=u,function(){if((ln&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},Zm={readContext:or,use:rf,useCallback:Uw,useContext:or,useEffect:Ym,useImperativeHandle:Hw,useInsertionEffect:zw,useLayoutEffect:Fw,useMemo:Vw,useReducer:af,useRef:Lw,useState:function(){return af(da)},useDebugValue:Wm,useDeferredValue:function(i,o){var u=Bn();return qw(u,hn.memoizedState,i,o)},useTransition:function(){var i=af(da)[0],o=Bn().memoizedState;return[typeof i=="boolean"?i:$u(i),o]},useSyncExternalStore:vw,useId:Kw,useHostTransitionStatus:Xm,useFormState:Dw,useActionState:Dw,useOptimistic:function(i,o){var u=Bn();return Cw(u,hn,i,o)},useMemoCache:Hm,useCacheRefresh:Gw};Zm.useEffectEvent=jw;var eS={readContext:or,use:rf,useCallback:Uw,useContext:or,useEffect:Ym,useImperativeHandle:Hw,useInsertionEffect:zw,useLayoutEffect:Fw,useMemo:Vw,useReducer:Vm,useRef:Lw,useState:function(){return Vm(da)},useDebugValue:Wm,useDeferredValue:function(i,o){var u=Bn();return hn===null?Km(u,i,o):qw(u,hn.memoizedState,i,o)},useTransition:function(){var i=Vm(da)[0],o=Bn().memoizedState;return[typeof i=="boolean"?i:$u(i),o]},useSyncExternalStore:vw,useId:Kw,useHostTransitionStatus:Xm,useFormState:Pw,useActionState:Pw,useOptimistic:function(i,o){var u=Bn();return hn!==null?Cw(u,hn,i,o):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:Hm,useCacheRefresh:Gw};eS.useEffectEvent=jw;function Jm(i,o,u,h){o=i.memoizedState,u=u(h,o),u=u==null?o:p({},o,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var eg={enqueueSetState:function(i,o,u){i=i._reactInternals;var h=Yr(),b=Wa(h);b.payload=o,u!=null&&(b.callback=u),o=Ka(i,b,h),o!==null&&(Nr(o,i,h),Hu(o,i,h))},enqueueReplaceState:function(i,o,u){i=i._reactInternals;var h=Yr(),b=Wa(h);b.tag=1,b.payload=o,u!=null&&(b.callback=u),o=Ka(i,b,h),o!==null&&(Nr(o,i,h),Hu(o,i,h))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var u=Yr(),h=Wa(u);h.tag=2,o!=null&&(h.callback=o),o=Ka(i,h,u),o!==null&&(Nr(o,i,u),Hu(o,i,u))}};function tS(i,o,u,h,b,v,A){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(h,v,A):o.prototype&&o.prototype.isPureReactComponent?!Iu(u,h)||!Iu(b,v):!0}function nS(i,o,u,h){i=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(u,h),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(u,h),o.state!==i&&eg.enqueueReplaceState(o,o.state,null)}function ss(i,o){var u=o;if("ref"in o){u={};for(var h in o)h!=="ref"&&(u[h]=o[h])}if(i=i.defaultProps){u===o&&(u=p({},u));for(var b in i)u[b]===void 0&&(u[b]=i[b])}return u}function rS(i){Fd(i)}function iS(i){console.error(i)}function aS(i){Fd(i)}function uf(i,o){try{var u=i.onUncaughtError;u(o.value,{componentStack:o.stack})}catch(h){setTimeout(function(){throw h})}}function oS(i,o,u){try{var h=i.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function tg(i,o,u){return u=Wa(u),u.tag=3,u.payload={element:null},u.callback=function(){uf(i,o)},u}function sS(i){return i=Wa(i),i.tag=3,i}function lS(i,o,u,h){var b=u.type.getDerivedStateFromError;if(typeof b=="function"){var v=h.value;i.payload=function(){return b(v)},i.callback=function(){oS(o,u,h)}}var A=u.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(i.callback=function(){oS(o,u,h),typeof b!="function"&&(eo===null?eo=new Set([this]):eo.add(this));var U=h.stack;this.componentDidCatch(h.value,{componentStack:U!==null?U:""})})}function U2(i,o,u,h,b){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(o=u.alternate,o!==null&&il(o,u,b,!0),u=Ur.current,u!==null){switch(u.tag){case 31:case 13:return si===null?wf():u.alternate===null&&In===0&&(In=3),u.flags&=-257,u.flags|=65536,u.lanes=b,h===Gd?u.flags|=16384:(o=u.updateQueue,o===null?u.updateQueue=new Set([h]):o.add(h),Rg(i,h,b)),!1;case 22:return u.flags|=65536,h===Gd?u.flags|=16384:(o=u.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=o):(u=o.retryQueue,u===null?o.retryQueue=new Set([h]):u.add(h)),Rg(i,h,b)),!1}throw Error(r(435,u.tag))}return Rg(i,h,b),wf(),!1}if(Zt)return o=Ur.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=b,h!==xm&&(i=Error(r(422),{cause:h}),_u(ri(i,u)))):(h!==xm&&(o=Error(r(423),{cause:h}),_u(ri(o,u))),i=i.current.alternate,i.flags|=65536,b&=-b,i.lanes|=b,h=ri(h,u),b=tg(i.stateNode,h,b),Nm(i,b),In!==4&&(In=2)),!1;var v=Error(r(520),{cause:h});if(v=ri(v,u),tc===null?tc=[v]:tc.push(v),In!==4&&(In=2),o===null)return!0;h=ri(h,u),u=o;do{switch(u.tag){case 3:return u.flags|=65536,i=b&-b,u.lanes|=i,i=tg(u.stateNode,h,i),Nm(u,i),!1;case 1:if(o=u.type,v=u.stateNode,(u.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(eo===null||!eo.has(v))))return u.flags|=65536,b&=-b,u.lanes|=b,b=sS(b),lS(b,i,u,h),Nm(u,b),!1}u=u.return}while(u!==null);return!1}var ng=Error(r(461)),$n=!1;function sr(i,o,u,h){o.child=i===null?fw(o,null,u,h):as(o,i.child,u,h)}function uS(i,o,u,h,b){u=u.render;var v=o.ref;if("ref"in h){var A={};for(var U in h)U!=="ref"&&(A[U]=h[U])}else A=h;return ts(o),h=jm(i,o,u,A,v,b),U=zm(),i!==null&&!$n?(Fm(i,o,b),fa(i,o,b)):(Zt&&U&&bm(o),o.flags|=1,sr(i,o,h,b),o.child)}function cS(i,o,u,h,b){if(i===null){var v=u.type;return typeof v=="function"&&!mm(v)&&v.defaultProps===void 0&&u.compare===null?(o.tag=15,o.type=v,dS(i,o,v,h,b)):(i=Vd(u.type,null,h,o,o.mode,b),i.ref=o.ref,i.return=o,o.child=i)}if(v=i.child,!cg(i,b)){var A=v.memoizedProps;if(u=u.compare,u=u!==null?u:Iu,u(A,h)&&i.ref===o.ref)return fa(i,o,b)}return o.flags|=1,i=oa(v,h),i.ref=o.ref,i.return=o,o.child=i}function dS(i,o,u,h,b){if(i!==null){var v=i.memoizedProps;if(Iu(v,h)&&i.ref===o.ref)if($n=!1,o.pendingProps=h=v,cg(i,b))(i.flags&131072)!==0&&($n=!0);else return o.lanes=i.lanes,fa(i,o,b)}return rg(i,o,u,h,b)}function fS(i,o,u,h){var b=h.children,v=i!==null?i.memoizedState:null;if(i===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((o.flags&128)!==0){if(v=v!==null?v.baseLanes|u:u,i!==null){for(h=o.child=i.child,b=0;h!==null;)b=b|h.lanes|h.childLanes,h=h.sibling;h=b&~v}else h=0,o.child=null;return hS(i,o,v,u,h)}if((u&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},i!==null&&Wd(o,v!==null?v.cachePool:null),v!==null?mw(o,v):Im(),gw(o);else return h=o.lanes=536870912,hS(i,o,v!==null?v.baseLanes|u:u,u,h)}else v!==null?(Wd(o,v.cachePool),mw(o,v),Xa(),o.memoizedState=null):(i!==null&&Wd(o,null),Im(),Xa());return sr(i,o,b,u),o.child}function Ku(i,o){return i!==null&&i.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function hS(i,o,u,h,b){var v=km();return v=v===null?null:{parent:Vn._currentValue,pool:v},o.memoizedState={baseLanes:u,cachePool:v},i!==null&&Wd(o,null),Im(),gw(o),i!==null&&il(i,o,h,!0),o.childLanes=b,null}function cf(i,o){return o=ff({mode:o.mode,children:o.children},i.mode),o.ref=i.ref,i.child=o,o.return=i,o}function pS(i,o,u){return as(o,i.child,null,u),i=cf(o,o.pendingProps),i.flags|=2,Vr(o),o.memoizedState=null,i}function V2(i,o,u){var h=o.pendingProps,b=(o.flags&128)!==0;if(o.flags&=-129,i===null){if(Zt){if(h.mode==="hidden")return i=cf(o,h),o.lanes=536870912,Ku(null,i);if(Lm(o),(i=En)?(i=R1(i,oi),i=i!==null&&i.data==="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:Ua!==null?{id:Li,overflow:_i}:null,retryLane:536870912,hydrationErrors:null},u=Q0(i),u.return=o,o.child=u,ar=o,En=null)):i=null,i===null)throw qa(o);return o.lanes=536870912,null}return cf(o,h)}var v=i.memoizedState;if(v!==null){var A=v.dehydrated;if(Lm(o),b)if(o.flags&256)o.flags&=-257,o=pS(i,o,u);else if(o.memoizedState!==null)o.child=i.child,o.flags|=128,o=null;else throw Error(r(558));else if($n||il(i,o,u,!1),b=(u&i.childLanes)!==0,$n||b){if(h=yn,h!==null&&(A=ae(h,u),A!==0&&A!==v.retryLane))throw v.retryLane=A,Qo(i,A),Nr(h,i,A),ng;wf(),o=pS(i,o,u)}else i=v.treeContext,En=li(A.nextSibling),ar=o,Zt=!0,Va=null,oi=!1,i!==null&&ew(o,i),o=cf(o,h),o.flags|=4096;return o}return i=oa(i.child,{mode:h.mode,children:h.children}),i.ref=o.ref,o.child=i,i.return=o,i}function df(i,o){var u=o.ref;if(u===null)i!==null&&i.ref!==null&&(o.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(i===null||i.ref!==u)&&(o.flags|=4194816)}}function rg(i,o,u,h,b){return ts(o),u=jm(i,o,u,h,void 0,b),h=zm(),i!==null&&!$n?(Fm(i,o,b),fa(i,o,b)):(Zt&&h&&bm(o),o.flags|=1,sr(i,o,u,b),o.child)}function mS(i,o,u,h,b,v){return ts(o),o.updateQueue=null,u=bw(o,h,u,b),yw(i),h=zm(),i!==null&&!$n?(Fm(i,o,v),fa(i,o,v)):(Zt&&h&&bm(o),o.flags|=1,sr(i,o,u,v),o.child)}function gS(i,o,u,h,b){if(ts(o),o.stateNode===null){var v=el,A=u.contextType;typeof A=="object"&&A!==null&&(v=or(A)),v=new u(h,v),o.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=eg,o.stateNode=v,v._reactInternals=o,v=o.stateNode,v.props=h,v.state=o.memoizedState,v.refs={},Om(o),A=u.contextType,v.context=typeof A=="object"&&A!==null?or(A):el,v.state=o.memoizedState,A=u.getDerivedStateFromProps,typeof A=="function"&&(Jm(o,u,A,h),v.state=o.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(A=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),A!==v.state&&eg.enqueueReplaceState(v,v.state,null),Vu(o,h,v,b),Uu(),v.state=o.memoizedState),typeof v.componentDidMount=="function"&&(o.flags|=4194308),h=!0}else if(i===null){v=o.stateNode;var U=o.memoizedProps,ee=ss(u,U);v.props=ee;var pe=v.context,Te=u.contextType;A=el,typeof Te=="object"&&Te!==null&&(A=or(Te));var Ne=u.getDerivedStateFromProps;Te=typeof Ne=="function"||typeof v.getSnapshotBeforeUpdate=="function",U=o.pendingProps!==U,Te||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(U||pe!==A)&&nS(o,v,h,A),Ya=!1;var me=o.memoizedState;v.state=me,Vu(o,h,v,b),Uu(),pe=o.memoizedState,U||me!==pe||Ya?(typeof Ne=="function"&&(Jm(o,u,Ne,h),pe=o.memoizedState),(ee=Ya||tS(o,u,ee,h,me,pe,A))?(Te||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=h,o.memoizedState=pe),v.props=h,v.state=pe,v.context=A,h=ee):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),h=!1)}else{v=o.stateNode,Am(i,o),A=o.memoizedProps,Te=ss(u,A),v.props=Te,Ne=o.pendingProps,me=v.context,pe=u.contextType,ee=el,typeof pe=="object"&&pe!==null&&(ee=or(pe)),U=u.getDerivedStateFromProps,(pe=typeof U=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(A!==Ne||me!==ee)&&nS(o,v,h,ee),Ya=!1,me=o.memoizedState,v.state=me,Vu(o,h,v,b),Uu();var ve=o.memoizedState;A!==Ne||me!==ve||Ya||i!==null&&i.dependencies!==null&&$d(i.dependencies)?(typeof U=="function"&&(Jm(o,u,U,h),ve=o.memoizedState),(Te=Ya||tS(o,u,Te,h,me,ve,ee)||i!==null&&i.dependencies!==null&&$d(i.dependencies))?(pe||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(h,ve,ee),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(h,ve,ee)),typeof v.componentDidUpdate=="function"&&(o.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof v.componentDidUpdate!="function"||A===i.memoizedProps&&me===i.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||A===i.memoizedProps&&me===i.memoizedState||(o.flags|=1024),o.memoizedProps=h,o.memoizedState=ve),v.props=h,v.state=ve,v.context=ee,h=Te):(typeof v.componentDidUpdate!="function"||A===i.memoizedProps&&me===i.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||A===i.memoizedProps&&me===i.memoizedState||(o.flags|=1024),h=!1)}return v=h,df(i,o),h=(o.flags&128)!==0,v||h?(v=o.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:v.render(),o.flags|=1,i!==null&&h?(o.child=as(o,i.child,null,b),o.child=as(o,null,u,b)):sr(i,o,u,b),o.memoizedState=v.state,i=o.child):i=fa(i,o,b),i}function yS(i,o,u,h){return Jo(),o.flags|=256,sr(i,o,u,h),o.child}var ig={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ag(i){return{baseLanes:i,cachePool:ow()}}function og(i,o,u){return i=i!==null?i.childLanes&~u:0,o&&(i|=$r),i}function bS(i,o,u){var h=o.pendingProps,b=!1,v=(o.flags&128)!==0,A;if((A=v)||(A=i!==null&&i.memoizedState===null?!1:(Fn.current&2)!==0),A&&(b=!0,o.flags&=-129),A=(o.flags&32)!==0,o.flags&=-33,i===null){if(Zt){if(b?Ga(o):Xa(),(i=En)?(i=R1(i,oi),i=i!==null&&i.data!=="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:Ua!==null?{id:Li,overflow:_i}:null,retryLane:536870912,hydrationErrors:null},u=Q0(i),u.return=o,o.child=u,ar=o,En=null)):i=null,i===null)throw qa(o);return Ug(i)?o.lanes=32:o.lanes=536870912,null}var U=h.children;return h=h.fallback,b?(Xa(),b=o.mode,U=ff({mode:"hidden",children:U},b),h=Zo(h,b,u,null),U.return=o,h.return=o,U.sibling=h,o.child=U,h=o.child,h.memoizedState=ag(u),h.childLanes=og(i,A,u),o.memoizedState=ig,Ku(null,h)):(Ga(o),sg(o,U))}var ee=i.memoizedState;if(ee!==null&&(U=ee.dehydrated,U!==null)){if(v)o.flags&256?(Ga(o),o.flags&=-257,o=lg(i,o,u)):o.memoizedState!==null?(Xa(),o.child=i.child,o.flags|=128,o=null):(Xa(),U=h.fallback,b=o.mode,h=ff({mode:"visible",children:h.children},b),U=Zo(U,b,u,null),U.flags|=2,h.return=o,U.return=o,h.sibling=U,o.child=h,as(o,i.child,null,u),h=o.child,h.memoizedState=ag(u),h.childLanes=og(i,A,u),o.memoizedState=ig,o=Ku(null,h));else if(Ga(o),Ug(U)){if(A=U.nextSibling&&U.nextSibling.dataset,A)var pe=A.dgst;A=pe,h=Error(r(419)),h.stack="",h.digest=A,_u({value:h,source:null,stack:null}),o=lg(i,o,u)}else if($n||il(i,o,u,!1),A=(u&i.childLanes)!==0,$n||A){if(A=yn,A!==null&&(h=ae(A,u),h!==0&&h!==ee.retryLane))throw ee.retryLane=h,Qo(i,h),Nr(A,i,h),ng;Hg(U)||wf(),o=lg(i,o,u)}else Hg(U)?(o.flags|=192,o.child=i.child,o=null):(i=ee.treeContext,En=li(U.nextSibling),ar=o,Zt=!0,Va=null,oi=!1,i!==null&&ew(o,i),o=sg(o,h.children),o.flags|=4096);return o}return b?(Xa(),U=h.fallback,b=o.mode,ee=i.child,pe=ee.sibling,h=oa(ee,{mode:"hidden",children:h.children}),h.subtreeFlags=ee.subtreeFlags&65011712,pe!==null?U=oa(pe,U):(U=Zo(U,b,u,null),U.flags|=2),U.return=o,h.return=o,h.sibling=U,o.child=h,Ku(null,h),h=o.child,U=i.child.memoizedState,U===null?U=ag(u):(b=U.cachePool,b!==null?(ee=Vn._currentValue,b=b.parent!==ee?{parent:ee,pool:ee}:b):b=ow(),U={baseLanes:U.baseLanes|u,cachePool:b}),h.memoizedState=U,h.childLanes=og(i,A,u),o.memoizedState=ig,Ku(i.child,h)):(Ga(o),u=i.child,i=u.sibling,u=oa(u,{mode:"visible",children:h.children}),u.return=o,u.sibling=null,i!==null&&(A=o.deletions,A===null?(o.deletions=[i],o.flags|=16):A.push(i)),o.child=u,o.memoizedState=null,u)}function sg(i,o){return o=ff({mode:"visible",children:o},i.mode),o.return=i,i.child=o}function ff(i,o){return i=Hr(22,i,null,o),i.lanes=0,i}function lg(i,o,u){return as(o,i.child,null,u),i=sg(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function vS(i,o,u){i.lanes|=o;var h=i.alternate;h!==null&&(h.lanes|=o),Em(i.return,o,u)}function ug(i,o,u,h,b,v){var A=i.memoizedState;A===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:b,treeForkCount:v}:(A.isBackwards=o,A.rendering=null,A.renderingStartTime=0,A.last=h,A.tail=u,A.tailMode=b,A.treeForkCount=v)}function xS(i,o,u){var h=o.pendingProps,b=h.revealOrder,v=h.tail;h=h.children;var A=Fn.current,U=(A&2)!==0;if(U?(A=A&1|2,o.flags|=128):A&=1,I(Fn,A),sr(i,o,h,u),h=Zt?Lu:0,!U&&i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&vS(i,u,o);else if(i.tag===19)vS(i,u,o);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break e;for(;i.sibling===null;){if(i.return===null||i.return===o)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(b){case"forwards":for(u=o.child,b=null;u!==null;)i=u.alternate,i!==null&&Jd(i)===null&&(b=u),u=u.sibling;u=b,u===null?(b=o.child,o.child=null):(b=u.sibling,u.sibling=null),ug(o,!1,b,u,v,h);break;case"backwards":case"unstable_legacy-backwards":for(u=null,b=o.child,o.child=null;b!==null;){if(i=b.alternate,i!==null&&Jd(i)===null){o.child=b;break}i=b.sibling,b.sibling=u,u=b,b=i}ug(o,!0,u,null,v,h);break;case"together":ug(o,!1,null,null,void 0,h);break;default:o.memoizedState=null}return o.child}function fa(i,o,u){if(i!==null&&(o.dependencies=i.dependencies),Ja|=o.lanes,(u&o.childLanes)===0)if(i!==null){if(il(i,o,u,!1),(u&o.childLanes)===0)return null}else return null;if(i!==null&&o.child!==i.child)throw Error(r(153));if(o.child!==null){for(i=o.child,u=oa(i,i.pendingProps),o.child=u,u.return=o;i.sibling!==null;)i=i.sibling,u=u.sibling=oa(i,i.pendingProps),u.return=o;u.sibling=null}return o.child}function cg(i,o){return(i.lanes&o)!==0?!0:(i=i.dependencies,!!(i!==null&&$d(i)))}function q2(i,o,u){switch(o.tag){case 3:ge(o,o.stateNode.containerInfo),$a(o,Vn,i.memoizedState.cache),Jo();break;case 27:case 5:_e(o);break;case 4:ge(o,o.stateNode.containerInfo);break;case 10:$a(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,Lm(o),null;break;case 13:var h=o.memoizedState;if(h!==null)return h.dehydrated!==null?(Ga(o),o.flags|=128,null):(u&o.child.childLanes)!==0?bS(i,o,u):(Ga(o),i=fa(i,o,u),i!==null?i.sibling:null);Ga(o);break;case 19:var b=(i.flags&128)!==0;if(h=(u&o.childLanes)!==0,h||(il(i,o,u,!1),h=(u&o.childLanes)!==0),b){if(h)return xS(i,o,u);o.flags|=128}if(b=o.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),I(Fn,Fn.current),h)break;return null;case 22:return o.lanes=0,fS(i,o,u,o.pendingProps);case 24:$a(o,Vn,i.memoizedState.cache)}return fa(i,o,u)}function wS(i,o,u){if(i!==null)if(i.memoizedProps!==o.pendingProps)$n=!0;else{if(!cg(i,u)&&(o.flags&128)===0)return $n=!1,q2(i,o,u);$n=(i.flags&131072)!==0}else $n=!1,Zt&&(o.flags&1048576)!==0&&J0(o,Lu,o.index);switch(o.lanes=0,o.tag){case 16:e:{var h=o.pendingProps;if(i=rs(o.elementType),o.type=i,typeof i=="function")mm(i)?(h=ss(i,h),o.tag=1,o=gS(null,o,i,h,u)):(o.tag=0,o=rg(null,o,i,h,u));else{if(i!=null){var b=i.$$typeof;if(b===M){o.tag=11,o=uS(null,o,i,h,u);break e}else if(b===N){o.tag=14,o=cS(null,o,i,h,u);break e}}throw o=q(i)||i,Error(r(306,o,""))}}return o;case 0:return rg(i,o,o.type,o.pendingProps,u);case 1:return h=o.type,b=ss(h,o.pendingProps),gS(i,o,h,b,u);case 3:e:{if(ge(o,o.stateNode.containerInfo),i===null)throw Error(r(387));h=o.pendingProps;var v=o.memoizedState;b=v.element,Am(i,o),Vu(o,h,null,u);var A=o.memoizedState;if(h=A.cache,$a(o,Vn,h),h!==v.cache&&Tm(o,[Vn],u,!0),Uu(),h=A.element,v.isDehydrated)if(v={element:h,isDehydrated:!1,cache:A.cache},o.updateQueue.baseState=v,o.memoizedState=v,o.flags&256){o=yS(i,o,h,u);break e}else if(h!==b){b=ri(Error(r(424)),o),_u(b),o=yS(i,o,h,u);break e}else{switch(i=o.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(En=li(i.firstChild),ar=o,Zt=!0,Va=null,oi=!0,u=fw(o,null,h,u),o.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Jo(),h===b){o=fa(i,o,u);break e}sr(i,o,h,u)}o=o.child}return o;case 26:return df(i,o),i===null?(u=D1(o.type,null,o.pendingProps,null))?o.memoizedState=u:Zt||(u=o.type,i=o.pendingProps,h=Mf(ie.current).createElement(u),h[qe]=o,h[Ke]=i,lr(h,u,i),Rn(h),o.stateNode=h):o.memoizedState=D1(o.type,i.memoizedProps,o.pendingProps,i.memoizedState),null;case 27:return _e(o),i===null&&Zt&&(h=o.stateNode=O1(o.type,o.pendingProps,ie.current),ar=o,oi=!0,b=En,io(o.type)?(Vg=b,En=li(h.firstChild)):En=b),sr(i,o,o.pendingProps.children,u),df(i,o),i===null&&(o.flags|=4194304),o.child;case 5:return i===null&&Zt&&((b=h=En)&&(h=xD(h,o.type,o.pendingProps,oi),h!==null?(o.stateNode=h,ar=o,En=li(h.firstChild),oi=!1,b=!0):b=!1),b||qa(o)),_e(o),b=o.type,v=o.pendingProps,A=i!==null?i.memoizedProps:null,h=v.children,zg(b,v)?h=null:A!==null&&zg(b,A)&&(o.flags|=32),o.memoizedState!==null&&(b=jm(i,o,L2,null,null,u),uc._currentValue=b),df(i,o),sr(i,o,h,u),o.child;case 6:return i===null&&Zt&&((i=u=En)&&(u=wD(u,o.pendingProps,oi),u!==null?(o.stateNode=u,ar=o,En=null,i=!0):i=!1),i||qa(o)),null;case 13:return bS(i,o,u);case 4:return ge(o,o.stateNode.containerInfo),h=o.pendingProps,i===null?o.child=as(o,null,h,u):sr(i,o,h,u),o.child;case 11:return uS(i,o,o.type,o.pendingProps,u);case 7:return sr(i,o,o.pendingProps,u),o.child;case 8:return sr(i,o,o.pendingProps.children,u),o.child;case 12:return sr(i,o,o.pendingProps.children,u),o.child;case 10:return h=o.pendingProps,$a(o,o.type,h.value),sr(i,o,h.children,u),o.child;case 9:return b=o.type._context,h=o.pendingProps.children,ts(o),b=or(b),h=h(b),o.flags|=1,sr(i,o,h,u),o.child;case 14:return cS(i,o,o.type,o.pendingProps,u);case 15:return dS(i,o,o.type,o.pendingProps,u);case 19:return xS(i,o,u);case 31:return V2(i,o,u);case 22:return fS(i,o,u,o.pendingProps);case 24:return ts(o),h=or(Vn),i===null?(b=km(),b===null&&(b=yn,v=Cm(),b.pooledCache=v,v.refCount++,v!==null&&(b.pooledCacheLanes|=u),b=v),o.memoizedState={parent:h,cache:b},Om(o),$a(o,Vn,b)):((i.lanes&u)!==0&&(Am(i,o),Vu(o,null,null,u),Uu()),b=i.memoizedState,v=o.memoizedState,b.parent!==h?(b={parent:h,cache:h},o.memoizedState=b,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=b),$a(o,Vn,h)):(h=v.cache,$a(o,Vn,h),h!==b.cache&&Tm(o,[Vn],u,!0))),sr(i,o,o.pendingProps.children,u),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function ha(i){i.flags|=4}function dg(i,o,u,h,b){if((o=(i.mode&32)!==0)&&(o=!1),o){if(i.flags|=16777216,(b&335544128)===b)if(i.stateNode.complete)i.flags|=8192;else if(KS())i.flags|=8192;else throw is=Gd,Mm}else i.flags&=-16777217}function SS(i,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!j1(o))if(KS())i.flags|=8192;else throw is=Gd,Mm}function hf(i,o){o!==null&&(i.flags|=4),i.flags&16384&&(o=i.tag!==22?tn():536870912,i.lanes|=o,gl|=o)}function Gu(i,o){if(!Zt)switch(i.tailMode){case"hidden":o=i.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?o||i.tail===null?i.tail=null:i.tail.sibling=null:h.sibling=null}}function Tn(i){var o=i.alternate!==null&&i.alternate.child===i.child,u=0,h=0;if(o)for(var b=i.child;b!==null;)u|=b.lanes|b.childLanes,h|=b.subtreeFlags&65011712,h|=b.flags&65011712,b.return=i,b=b.sibling;else for(b=i.child;b!==null;)u|=b.lanes|b.childLanes,h|=b.subtreeFlags,h|=b.flags,b.return=i,b=b.sibling;return i.subtreeFlags|=h,i.childLanes=u,o}function $2(i,o,u){var h=o.pendingProps;switch(vm(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tn(o),null;case 1:return Tn(o),null;case 3:return u=o.stateNode,h=null,i!==null&&(h=i.memoizedState.cache),o.memoizedState.cache!==h&&(o.flags|=2048),ua(Vn),Ee(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(rl(o)?ha(o):i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,wm())),Tn(o),null;case 26:var b=o.type,v=o.memoizedState;return i===null?(ha(o),v!==null?(Tn(o),SS(o,v)):(Tn(o),dg(o,b,null,h,u))):v?v!==i.memoizedState?(ha(o),Tn(o),SS(o,v)):(Tn(o),o.flags&=-16777217):(i=i.memoizedProps,i!==h&&ha(o),Tn(o),dg(o,b,i,h,u)),null;case 27:if(Ie(o),u=ie.current,b=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==h&&ha(o);else{if(!h){if(o.stateNode===null)throw Error(r(166));return Tn(o),null}i=Q.current,rl(o)?tw(o):(i=O1(b,h,u),o.stateNode=i,ha(o))}return Tn(o),null;case 5:if(Ie(o),b=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==h&&ha(o);else{if(!h){if(o.stateNode===null)throw Error(r(166));return Tn(o),null}if(v=Q.current,rl(o))tw(o);else{var A=Mf(ie.current);switch(v){case 1:v=A.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:v=A.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":v=A.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":v=A.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":v=A.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof h.is=="string"?A.createElement("select",{is:h.is}):A.createElement("select"),h.multiple?v.multiple=!0:h.size&&(v.size=h.size);break;default:v=typeof h.is=="string"?A.createElement(b,{is:h.is}):A.createElement(b)}}v[qe]=o,v[Ke]=h;e:for(A=o.child;A!==null;){if(A.tag===5||A.tag===6)v.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===o)break e;for(;A.sibling===null;){if(A.return===null||A.return===o)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}o.stateNode=v;e:switch(lr(v,b,h),b){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&ha(o)}}return Tn(o),dg(o,o.type,i===null?null:i.memoizedProps,o.pendingProps,u),null;case 6:if(i&&o.stateNode!=null)i.memoizedProps!==h&&ha(o);else{if(typeof h!="string"&&o.stateNode===null)throw Error(r(166));if(i=ie.current,rl(o)){if(i=o.stateNode,u=o.memoizedProps,h=null,b=ar,b!==null)switch(b.tag){case 27:case 5:h=b.memoizedProps}i[qe]=o,i=!!(i.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||b1(i.nodeValue,u)),i||qa(o,!0)}else i=Mf(i).createTextNode(h),i[qe]=o,o.stateNode=i}return Tn(o),null;case 31:if(u=o.memoizedState,i===null||i.memoizedState!==null){if(h=rl(o),u!==null){if(i===null){if(!h)throw Error(r(318));if(i=o.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[qe]=o}else Jo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Tn(o),i=!1}else u=wm(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=u),i=!0;if(!i)return o.flags&256?(Vr(o),o):(Vr(o),null);if((o.flags&128)!==0)throw Error(r(558))}return Tn(o),null;case 13:if(h=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(b=rl(o),h!==null&&h.dehydrated!==null){if(i===null){if(!b)throw Error(r(318));if(b=o.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[qe]=o}else Jo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Tn(o),b=!1}else b=wm(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=b),b=!0;if(!b)return o.flags&256?(Vr(o),o):(Vr(o),null)}return Vr(o),(o.flags&128)!==0?(o.lanes=u,o):(u=h!==null,i=i!==null&&i.memoizedState!==null,u&&(h=o.child,b=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(b=h.alternate.memoizedState.cachePool.pool),v=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(v=h.memoizedState.cachePool.pool),v!==b&&(h.flags|=2048)),u!==i&&u&&(o.child.flags|=8192),hf(o,o.updateQueue),Tn(o),null);case 4:return Ee(),i===null&&Ig(o.stateNode.containerInfo),Tn(o),null;case 10:return ua(o.type),Tn(o),null;case 19:if(G(Fn),h=o.memoizedState,h===null)return Tn(o),null;if(b=(o.flags&128)!==0,v=h.rendering,v===null)if(b)Gu(h,!1);else{if(In!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(v=Jd(i),v!==null){for(o.flags|=128,Gu(h,!1),i=v.updateQueue,o.updateQueue=i,hf(o,i),o.subtreeFlags=0,i=u,u=o.child;u!==null;)X0(u,i),u=u.sibling;return I(Fn,Fn.current&1|2),Zt&&sa(o,h.treeForkCount),o.child}i=i.sibling}h.tail!==null&&te()>bf&&(o.flags|=128,b=!0,Gu(h,!1),o.lanes=4194304)}else{if(!b)if(i=Jd(v),i!==null){if(o.flags|=128,b=!0,i=i.updateQueue,o.updateQueue=i,hf(o,i),Gu(h,!0),h.tail===null&&h.tailMode==="hidden"&&!v.alternate&&!Zt)return Tn(o),null}else 2*te()-h.renderingStartTime>bf&&u!==536870912&&(o.flags|=128,b=!0,Gu(h,!1),o.lanes=4194304);h.isBackwards?(v.sibling=o.child,o.child=v):(i=h.last,i!==null?i.sibling=v:o.child=v,h.last=v)}return h.tail!==null?(i=h.tail,h.rendering=i,h.tail=i.sibling,h.renderingStartTime=te(),i.sibling=null,u=Fn.current,I(Fn,b?u&1|2:u&1),Zt&&sa(o,h.treeForkCount),i):(Tn(o),null);case 22:case 23:return Vr(o),Pm(),h=o.memoizedState!==null,i!==null?i.memoizedState!==null!==h&&(o.flags|=8192):h&&(o.flags|=8192),h?(u&536870912)!==0&&(o.flags&128)===0&&(Tn(o),o.subtreeFlags&6&&(o.flags|=8192)):Tn(o),u=o.updateQueue,u!==null&&hf(o,u.retryQueue),u=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==u&&(o.flags|=2048),i!==null&&G(ns),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),ua(Vn),Tn(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function Y2(i,o){switch(vm(o),o.tag){case 1:return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return ua(Vn),Ee(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 26:case 27:case 5:return Ie(o),null;case 31:if(o.memoizedState!==null){if(Vr(o),o.alternate===null)throw Error(r(340));Jo()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 13:if(Vr(o),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Jo()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return G(Fn),null;case 4:return Ee(),null;case 10:return ua(o.type),null;case 22:case 23:return Vr(o),Pm(),i!==null&&G(ns),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 24:return ua(Vn),null;case 25:return null;default:return null}}function ES(i,o){switch(vm(o),o.tag){case 3:ua(Vn),Ee();break;case 26:case 27:case 5:Ie(o);break;case 4:Ee();break;case 31:o.memoizedState!==null&&Vr(o);break;case 13:Vr(o);break;case 19:G(Fn);break;case 10:ua(o.type);break;case 22:case 23:Vr(o),Pm(),i!==null&&G(ns);break;case 24:ua(Vn)}}function Xu(i,o){try{var u=o.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var b=h.next;u=b;do{if((u.tag&i)===i){h=void 0;var v=u.create,A=u.inst;h=v(),A.destroy=h}u=u.next}while(u!==b)}}catch(U){fn(o,o.return,U)}}function Qa(i,o,u){try{var h=o.updateQueue,b=h!==null?h.lastEffect:null;if(b!==null){var v=b.next;h=v;do{if((h.tag&i)===i){var A=h.inst,U=A.destroy;if(U!==void 0){A.destroy=void 0,b=o;var ee=u,pe=U;try{pe()}catch(Te){fn(b,ee,Te)}}}h=h.next}while(h!==v)}}catch(Te){fn(o,o.return,Te)}}function TS(i){var o=i.updateQueue;if(o!==null){var u=i.stateNode;try{pw(o,u)}catch(h){fn(i,i.return,h)}}}function CS(i,o,u){u.props=ss(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(h){fn(i,o,h)}}function Qu(i,o){try{var u=i.ref;if(u!==null){switch(i.tag){case 26:case 27:case 5:var h=i.stateNode;break;case 30:h=i.stateNode;break;default:h=i.stateNode}typeof u=="function"?i.refCleanup=u(h):u.current=h}}catch(b){fn(i,o,b)}}function ji(i,o){var u=i.ref,h=i.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(b){fn(i,o,b)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(b){fn(i,o,b)}else u.current=null}function RS(i){var o=i.type,u=i.memoizedProps,h=i.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(b){fn(i,i.return,b)}}function fg(i,o,u){try{var h=i.stateNode;pD(h,i.type,u,o),h[Ke]=o}catch(b){fn(i,i.return,b)}}function kS(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&io(i.type)||i.tag===4}function hg(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||kS(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&io(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function pg(i,o,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,o?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(i,o):(o=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,o.appendChild(i),u=u._reactRootContainer,u!=null||o.onclick!==null||(o.onclick=ia));else if(h!==4&&(h===27&&io(i.type)&&(u=i.stateNode,o=null),i=i.child,i!==null))for(pg(i,o,u),i=i.sibling;i!==null;)pg(i,o,u),i=i.sibling}function pf(i,o,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,o?u.insertBefore(i,o):u.appendChild(i);else if(h!==4&&(h===27&&io(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(pf(i,o,u),i=i.sibling;i!==null;)pf(i,o,u),i=i.sibling}function MS(i){var o=i.stateNode,u=i.memoizedProps;try{for(var h=i.type,b=o.attributes;b.length;)o.removeAttributeNode(b[0]);lr(o,h,u),o[qe]=i,o[Ke]=u}catch(v){fn(i,i.return,v)}}var pa=!1,Yn=!1,mg=!1,OS=typeof WeakSet=="function"?WeakSet:Set,tr=null;function W2(i,o){if(i=i.containerInfo,_g=Lf,i=H0(i),lm(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var b=h.anchorOffset,v=h.focusNode;h=h.focusOffset;try{u.nodeType,v.nodeType}catch{u=null;break e}var A=0,U=-1,ee=-1,pe=0,Te=0,Ne=i,me=null;t:for(;;){for(var ve;Ne!==u||b!==0&&Ne.nodeType!==3||(U=A+b),Ne!==v||h!==0&&Ne.nodeType!==3||(ee=A+h),Ne.nodeType===3&&(A+=Ne.nodeValue.length),(ve=Ne.firstChild)!==null;)me=Ne,Ne=ve;for(;;){if(Ne===i)break t;if(me===u&&++pe===b&&(U=A),me===v&&++Te===h&&(ee=A),(ve=Ne.nextSibling)!==null)break;Ne=me,me=Ne.parentNode}Ne=ve}u=U===-1||ee===-1?null:{start:U,end:ee}}else u=null}u=u||{start:0,end:0}}else u=null;for(jg={focusedElem:i,selectionRange:u},Lf=!1,tr=o;tr!==null;)if(o=tr,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,tr=i;else for(;tr!==null;){switch(o=tr,v=o.alternate,i=o.flags,o.tag){case 0:if((i&4)!==0&&(i=o.updateQueue,i=i!==null?i.events:null,i!==null))for(u=0;u<i.length;u++)b=i[u],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&v!==null){i=void 0,u=o,b=v.memoizedProps,v=v.memoizedState,h=u.stateNode;try{var Ze=ss(u.type,b);i=h.getSnapshotBeforeUpdate(Ze,v),h.__reactInternalSnapshotBeforeUpdate=i}catch(mt){fn(u,u.return,mt)}}break;case 3:if((i&1024)!==0){if(i=o.stateNode.containerInfo,u=i.nodeType,u===9)Bg(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Bg(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=o.sibling,i!==null){i.return=o.return,tr=i;break}tr=o.return}}function AS(i,o,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:ga(i,u),h&4&&Xu(5,u);break;case 1:if(ga(i,u),h&4)if(i=u.stateNode,o===null)try{i.componentDidMount()}catch(A){fn(u,u.return,A)}else{var b=ss(u.type,o.memoizedProps);o=o.memoizedState;try{i.componentDidUpdate(b,o,i.__reactInternalSnapshotBeforeUpdate)}catch(A){fn(u,u.return,A)}}h&64&&TS(u),h&512&&Qu(u,u.return);break;case 3:if(ga(i,u),h&64&&(i=u.updateQueue,i!==null)){if(o=null,u.child!==null)switch(u.child.tag){case 27:case 5:o=u.child.stateNode;break;case 1:o=u.child.stateNode}try{pw(i,o)}catch(A){fn(u,u.return,A)}}break;case 27:o===null&&h&4&&MS(u);case 26:case 5:ga(i,u),o===null&&h&4&&RS(u),h&512&&Qu(u,u.return);break;case 12:ga(i,u);break;case 31:ga(i,u),h&4&&IS(i,u);break;case 13:ga(i,u),h&4&&PS(i,u),h&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=nD.bind(null,u),SD(i,u))));break;case 22:if(h=u.memoizedState!==null||pa,!h){o=o!==null&&o.memoizedState!==null||Yn,b=pa;var v=Yn;pa=h,(Yn=o)&&!v?ya(i,u,(u.subtreeFlags&8772)!==0):ga(i,u),pa=b,Yn=v}break;case 30:break;default:ga(i,u)}}function NS(i){var o=i.alternate;o!==null&&(i.alternate=null,NS(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&An(o)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var kn=null,kr=!1;function ma(i,o,u){for(u=u.child;u!==null;)DS(i,o,u),u=u.sibling}function DS(i,o,u){if(We&&typeof We.onCommitFiberUnmount=="function")try{We.onCommitFiberUnmount(Ot,u)}catch{}switch(u.tag){case 26:Yn||ji(u,o),ma(i,o,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Yn||ji(u,o);var h=kn,b=kr;io(u.type)&&(kn=u.stateNode,kr=!1),ma(i,o,u),oc(u.stateNode),kn=h,kr=b;break;case 5:Yn||ji(u,o);case 6:if(h=kn,b=kr,kn=null,ma(i,o,u),kn=h,kr=b,kn!==null)if(kr)try{(kn.nodeType===9?kn.body:kn.nodeName==="HTML"?kn.ownerDocument.body:kn).removeChild(u.stateNode)}catch(v){fn(u,o,v)}else try{kn.removeChild(u.stateNode)}catch(v){fn(u,o,v)}break;case 18:kn!==null&&(kr?(i=kn,T1(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),Tl(i)):T1(kn,u.stateNode));break;case 4:h=kn,b=kr,kn=u.stateNode.containerInfo,kr=!0,ma(i,o,u),kn=h,kr=b;break;case 0:case 11:case 14:case 15:Qa(2,u,o),Yn||Qa(4,u,o),ma(i,o,u);break;case 1:Yn||(ji(u,o),h=u.stateNode,typeof h.componentWillUnmount=="function"&&CS(u,o,h)),ma(i,o,u);break;case 21:ma(i,o,u);break;case 22:Yn=(h=Yn)||u.memoizedState!==null,ma(i,o,u),Yn=h;break;default:ma(i,o,u)}}function IS(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Tl(i)}catch(u){fn(o,o.return,u)}}}function PS(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Tl(i)}catch(u){fn(o,o.return,u)}}function K2(i){switch(i.tag){case 31:case 13:case 19:var o=i.stateNode;return o===null&&(o=i.stateNode=new OS),o;case 22:return i=i.stateNode,o=i._retryCache,o===null&&(o=i._retryCache=new OS),o;default:throw Error(r(435,i.tag))}}function mf(i,o){var u=K2(i);o.forEach(function(h){if(!u.has(h)){u.add(h);var b=rD.bind(null,i,h);h.then(b,b)}})}function Mr(i,o){var u=o.deletions;if(u!==null)for(var h=0;h<u.length;h++){var b=u[h],v=i,A=o,U=A;e:for(;U!==null;){switch(U.tag){case 27:if(io(U.type)){kn=U.stateNode,kr=!1;break e}break;case 5:kn=U.stateNode,kr=!1;break e;case 3:case 4:kn=U.stateNode.containerInfo,kr=!0;break e}U=U.return}if(kn===null)throw Error(r(160));DS(v,A,b),kn=null,kr=!1,v=b.alternate,v!==null&&(v.return=null),b.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)LS(o,i),o=o.sibling}var Ti=null;function LS(i,o){var u=i.alternate,h=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Mr(o,i),Or(i),h&4&&(Qa(3,i,i.return),Xu(3,i),Qa(5,i,i.return));break;case 1:Mr(o,i),Or(i),h&512&&(Yn||u===null||ji(u,u.return)),h&64&&pa&&(i=i.updateQueue,i!==null&&(h=i.callbacks,h!==null&&(u=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var b=Ti;if(Mr(o,i),Or(i),h&512&&(Yn||u===null||ji(u,u.return)),h&4){var v=u!==null?u.memoizedState:null;if(h=i.memoizedState,u===null)if(h===null)if(i.stateNode===null){e:{h=i.type,u=i.memoizedProps,b=b.ownerDocument||b;t:switch(h){case"title":v=b.getElementsByTagName("title")[0],(!v||v[Mn]||v[qe]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=b.createElement(h),b.head.insertBefore(v,b.querySelector("head > title"))),lr(v,h,u),v[qe]=i,Rn(v),h=v;break e;case"link":var A=L1("link","href",b).get(h+(u.href||""));if(A){for(var U=0;U<A.length;U++)if(v=A[U],v.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&v.getAttribute("rel")===(u.rel==null?null:u.rel)&&v.getAttribute("title")===(u.title==null?null:u.title)&&v.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){A.splice(U,1);break t}}v=b.createElement(h),lr(v,h,u),b.head.appendChild(v);break;case"meta":if(A=L1("meta","content",b).get(h+(u.content||""))){for(U=0;U<A.length;U++)if(v=A[U],v.getAttribute("content")===(u.content==null?null:""+u.content)&&v.getAttribute("name")===(u.name==null?null:u.name)&&v.getAttribute("property")===(u.property==null?null:u.property)&&v.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&v.getAttribute("charset")===(u.charSet==null?null:u.charSet)){A.splice(U,1);break t}}v=b.createElement(h),lr(v,h,u),b.head.appendChild(v);break;default:throw Error(r(468,h))}v[qe]=i,Rn(v),h=v}i.stateNode=h}else _1(b,i.type,i.stateNode);else i.stateNode=P1(b,h,i.memoizedProps);else v!==h?(v===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):v.count--,h===null?_1(b,i.type,i.stateNode):P1(b,h,i.memoizedProps)):h===null&&i.stateNode!==null&&fg(i,i.memoizedProps,u.memoizedProps)}break;case 27:Mr(o,i),Or(i),h&512&&(Yn||u===null||ji(u,u.return)),u!==null&&h&4&&fg(i,i.memoizedProps,u.memoizedProps);break;case 5:if(Mr(o,i),Or(i),h&512&&(Yn||u===null||ji(u,u.return)),i.flags&32){b=i.stateNode;try{Ws(b,"")}catch(Ze){fn(i,i.return,Ze)}}h&4&&i.stateNode!=null&&(b=i.memoizedProps,fg(i,b,u!==null?u.memoizedProps:b)),h&1024&&(mg=!0);break;case 6:if(Mr(o,i),Or(i),h&4){if(i.stateNode===null)throw Error(r(162));h=i.memoizedProps,u=i.stateNode;try{u.nodeValue=h}catch(Ze){fn(i,i.return,Ze)}}break;case 3:if(Nf=null,b=Ti,Ti=Of(o.containerInfo),Mr(o,i),Ti=b,Or(i),h&4&&u!==null&&u.memoizedState.isDehydrated)try{Tl(o.containerInfo)}catch(Ze){fn(i,i.return,Ze)}mg&&(mg=!1,_S(i));break;case 4:h=Ti,Ti=Of(i.stateNode.containerInfo),Mr(o,i),Or(i),Ti=h;break;case 12:Mr(o,i),Or(i);break;case 31:Mr(o,i),Or(i),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,mf(i,h)));break;case 13:Mr(o,i),Or(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(yf=te()),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,mf(i,h)));break;case 22:b=i.memoizedState!==null;var ee=u!==null&&u.memoizedState!==null,pe=pa,Te=Yn;if(pa=pe||b,Yn=Te||ee,Mr(o,i),Yn=Te,pa=pe,Or(i),h&8192)e:for(o=i.stateNode,o._visibility=b?o._visibility&-2:o._visibility|1,b&&(u===null||ee||pa||Yn||ls(i)),u=null,o=i;;){if(o.tag===5||o.tag===26){if(u===null){ee=u=o;try{if(v=ee.stateNode,b)A=v.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{U=ee.stateNode;var Ne=ee.memoizedProps.style,me=Ne!=null&&Ne.hasOwnProperty("display")?Ne.display:null;U.style.display=me==null||typeof me=="boolean"?"":(""+me).trim()}}catch(Ze){fn(ee,ee.return,Ze)}}}else if(o.tag===6){if(u===null){ee=o;try{ee.stateNode.nodeValue=b?"":ee.memoizedProps}catch(Ze){fn(ee,ee.return,Ze)}}}else if(o.tag===18){if(u===null){ee=o;try{var ve=ee.stateNode;b?C1(ve,!0):C1(ee.stateNode,!1)}catch(Ze){fn(ee,ee.return,Ze)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===i)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break e;for(;o.sibling===null;){if(o.return===null||o.return===i)break e;u===o&&(u=null),o=o.return}u===o&&(u=null),o.sibling.return=o.return,o=o.sibling}h&4&&(h=i.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,mf(i,u))));break;case 19:Mr(o,i),Or(i),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,mf(i,h)));break;case 30:break;case 21:break;default:Mr(o,i),Or(i)}}function Or(i){var o=i.flags;if(o&2){try{for(var u,h=i.return;h!==null;){if(kS(h)){u=h;break}h=h.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var b=u.stateNode,v=hg(i);pf(i,v,b);break;case 5:var A=u.stateNode;u.flags&32&&(Ws(A,""),u.flags&=-33);var U=hg(i);pf(i,U,A);break;case 3:case 4:var ee=u.stateNode.containerInfo,pe=hg(i);pg(i,pe,ee);break;default:throw Error(r(161))}}catch(Te){fn(i,i.return,Te)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function _S(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var o=i;_S(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),i=i.sibling}}function ga(i,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)AS(i,o.alternate,o),o=o.sibling}function ls(i){for(i=i.child;i!==null;){var o=i;switch(o.tag){case 0:case 11:case 14:case 15:Qa(4,o,o.return),ls(o);break;case 1:ji(o,o.return);var u=o.stateNode;typeof u.componentWillUnmount=="function"&&CS(o,o.return,u),ls(o);break;case 27:oc(o.stateNode);case 26:case 5:ji(o,o.return),ls(o);break;case 22:o.memoizedState===null&&ls(o);break;case 30:ls(o);break;default:ls(o)}i=i.sibling}}function ya(i,o,u){for(u=u&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var h=o.alternate,b=i,v=o,A=v.flags;switch(v.tag){case 0:case 11:case 15:ya(b,v,u),Xu(4,v);break;case 1:if(ya(b,v,u),h=v,b=h.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(pe){fn(h,h.return,pe)}if(h=v,b=h.updateQueue,b!==null){var U=h.stateNode;try{var ee=b.shared.hiddenCallbacks;if(ee!==null)for(b.shared.hiddenCallbacks=null,b=0;b<ee.length;b++)hw(ee[b],U)}catch(pe){fn(h,h.return,pe)}}u&&A&64&&TS(v),Qu(v,v.return);break;case 27:MS(v);case 26:case 5:ya(b,v,u),u&&h===null&&A&4&&RS(v),Qu(v,v.return);break;case 12:ya(b,v,u);break;case 31:ya(b,v,u),u&&A&4&&IS(b,v);break;case 13:ya(b,v,u),u&&A&4&&PS(b,v);break;case 22:v.memoizedState===null&&ya(b,v,u),Qu(v,v.return);break;case 30:break;default:ya(b,v,u)}o=o.sibling}}function gg(i,o){var u=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),i=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(i=o.memoizedState.cachePool.pool),i!==u&&(i!=null&&i.refCount++,u!=null&&ju(u))}function yg(i,o){i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&ju(i))}function Ci(i,o,u,h){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)jS(i,o,u,h),o=o.sibling}function jS(i,o,u,h){var b=o.flags;switch(o.tag){case 0:case 11:case 15:Ci(i,o,u,h),b&2048&&Xu(9,o);break;case 1:Ci(i,o,u,h);break;case 3:Ci(i,o,u,h),b&2048&&(i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&ju(i)));break;case 12:if(b&2048){Ci(i,o,u,h),i=o.stateNode;try{var v=o.memoizedProps,A=v.id,U=v.onPostCommit;typeof U=="function"&&U(A,o.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(ee){fn(o,o.return,ee)}}else Ci(i,o,u,h);break;case 31:Ci(i,o,u,h);break;case 13:Ci(i,o,u,h);break;case 23:break;case 22:v=o.stateNode,A=o.alternate,o.memoizedState!==null?v._visibility&2?Ci(i,o,u,h):Zu(i,o):v._visibility&2?Ci(i,o,u,h):(v._visibility|=2,hl(i,o,u,h,(o.subtreeFlags&10256)!==0||!1)),b&2048&&gg(A,o);break;case 24:Ci(i,o,u,h),b&2048&&yg(o.alternate,o);break;default:Ci(i,o,u,h)}}function hl(i,o,u,h,b){for(b=b&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var v=i,A=o,U=u,ee=h,pe=A.flags;switch(A.tag){case 0:case 11:case 15:hl(v,A,U,ee,b),Xu(8,A);break;case 23:break;case 22:var Te=A.stateNode;A.memoizedState!==null?Te._visibility&2?hl(v,A,U,ee,b):Zu(v,A):(Te._visibility|=2,hl(v,A,U,ee,b)),b&&pe&2048&&gg(A.alternate,A);break;case 24:hl(v,A,U,ee,b),b&&pe&2048&&yg(A.alternate,A);break;default:hl(v,A,U,ee,b)}o=o.sibling}}function Zu(i,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var u=i,h=o,b=h.flags;switch(h.tag){case 22:Zu(u,h),b&2048&&gg(h.alternate,h);break;case 24:Zu(u,h),b&2048&&yg(h.alternate,h);break;default:Zu(u,h)}o=o.sibling}}var Ju=8192;function pl(i,o,u){if(i.subtreeFlags&Ju)for(i=i.child;i!==null;)zS(i,o,u),i=i.sibling}function zS(i,o,u){switch(i.tag){case 26:pl(i,o,u),i.flags&Ju&&i.memoizedState!==null&&PD(u,Ti,i.memoizedState,i.memoizedProps);break;case 5:pl(i,o,u);break;case 3:case 4:var h=Ti;Ti=Of(i.stateNode.containerInfo),pl(i,o,u),Ti=h;break;case 22:i.memoizedState===null&&(h=i.alternate,h!==null&&h.memoizedState!==null?(h=Ju,Ju=16777216,pl(i,o,u),Ju=h):pl(i,o,u));break;default:pl(i,o,u)}}function FS(i){var o=i.alternate;if(o!==null&&(i=o.child,i!==null)){o.child=null;do o=i.sibling,i.sibling=null,i=o;while(i!==null)}}function ec(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var u=0;u<o.length;u++){var h=o[u];tr=h,HS(h,i)}FS(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)BS(i),i=i.sibling}function BS(i){switch(i.tag){case 0:case 11:case 15:ec(i),i.flags&2048&&Qa(9,i,i.return);break;case 3:ec(i);break;case 12:ec(i);break;case 22:var o=i.stateNode;i.memoizedState!==null&&o._visibility&2&&(i.return===null||i.return.tag!==13)?(o._visibility&=-3,gf(i)):ec(i);break;default:ec(i)}}function gf(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var u=0;u<o.length;u++){var h=o[u];tr=h,HS(h,i)}FS(i)}for(i=i.child;i!==null;){switch(o=i,o.tag){case 0:case 11:case 15:Qa(8,o,o.return),gf(o);break;case 22:u=o.stateNode,u._visibility&2&&(u._visibility&=-3,gf(o));break;default:gf(o)}i=i.sibling}}function HS(i,o){for(;tr!==null;){var u=tr;switch(u.tag){case 0:case 11:case 15:Qa(8,u,o);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:ju(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,tr=h;else e:for(u=i;tr!==null;){h=tr;var b=h.sibling,v=h.return;if(NS(h),h===u){tr=null;break e}if(b!==null){b.return=v,tr=b;break e}tr=v}}}var G2={getCacheForType:function(i){var o=or(Vn),u=o.data.get(i);return u===void 0&&(u=i(),o.data.set(i,u)),u},cacheSignal:function(){return or(Vn).controller.signal}},X2=typeof WeakMap=="function"?WeakMap:Map,ln=0,yn=null,Vt=null,Yt=0,dn=0,qr=null,Za=!1,ml=!1,bg=!1,ba=0,In=0,Ja=0,us=0,vg=0,$r=0,gl=0,tc=null,Ar=null,xg=!1,yf=0,US=0,bf=1/0,vf=null,eo=null,Gn=0,to=null,yl=null,va=0,wg=0,Sg=null,VS=null,nc=0,Eg=null;function Yr(){return(ln&2)!==0&&Yt!==0?Yt&-Yt:j.T!==null?Og():je()}function qS(){if($r===0)if((Yt&536870912)===0||Zt){var i=Je;Je<<=1,(Je&3932160)===0&&(Je=262144),$r=i}else $r=536870912;return i=Ur.current,i!==null&&(i.flags|=32),$r}function Nr(i,o,u){(i===yn&&(dn===2||dn===9)||i.cancelPendingCommit!==null)&&(bl(i,0),no(i,Yt,$r,!1)),nn(i,u),((ln&2)===0||i!==yn)&&(i===yn&&((ln&2)===0&&(us|=u),In===4&&no(i,Yt,$r,!1)),zi(i))}function $S(i,o,u){if((ln&6)!==0)throw Error(r(327));var h=!u&&(o&127)===0&&(o&i.expiredLanes)===0||Bt(i,o),b=h?J2(i,o):Cg(i,o,!0),v=h;do{if(b===0){ml&&!h&&no(i,o,0,!1);break}else{if(u=i.current.alternate,v&&!Q2(u)){b=Cg(i,o,!1),v=!1;continue}if(b===2){if(v=o,i.errorRecoveryDisabledLanes&v)var A=0;else A=i.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){o=A;e:{var U=i;b=tc;var ee=U.current.memoizedState.isDehydrated;if(ee&&(bl(U,A).flags|=256),A=Cg(U,A,!1),A!==2){if(bg&&!ee){U.errorRecoveryDisabledLanes|=v,us|=v,b=4;break e}v=Ar,Ar=b,v!==null&&(Ar===null?Ar=v:Ar.push.apply(Ar,v))}b=A}if(v=!1,b!==2)continue}}if(b===1){bl(i,0),no(i,o,0,!0);break}e:{switch(h=i,v=b,v){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:no(h,o,$r,!Za);break e;case 2:Ar=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(b=yf+300-te(),10<b)){if(no(h,o,$r,!Za),Xe(h,0,!0)!==0)break e;va=o,h.timeoutHandle=S1(YS.bind(null,h,u,Ar,vf,xg,o,$r,us,gl,Za,v,"Throttled",-0,0),b);break e}YS(h,u,Ar,vf,xg,o,$r,us,gl,Za,v,null,-0,0)}}break}while(!0);zi(i)}function YS(i,o,u,h,b,v,A,U,ee,pe,Te,Ne,me,ve){if(i.timeoutHandle=-1,Ne=o.subtreeFlags,Ne&8192||(Ne&16785408)===16785408){Ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ia},zS(o,v,Ne);var Ze=(v&62914560)===v?yf-te():(v&4194048)===v?US-te():0;if(Ze=LD(Ne,Ze),Ze!==null){va=v,i.cancelPendingCommit=Ze(e1.bind(null,i,o,v,u,h,b,A,U,ee,Te,Ne,null,me,ve)),no(i,v,A,!pe);return}}e1(i,o,v,u,h,b,A,U,ee)}function Q2(i){for(var o=i;;){var u=o.tag;if((u===0||u===11||u===15)&&o.flags&16384&&(u=o.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var h=0;h<u.length;h++){var b=u[h],v=b.getSnapshot;b=b.value;try{if(!Br(v(),b))return!1}catch{return!1}}if(u=o.child,o.subtreeFlags&16384&&u!==null)u.return=o,o=u;else{if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function no(i,o,u,h){o&=~vg,o&=~us,i.suspendedLanes|=o,i.pingedLanes&=~o,h&&(i.warmLanes|=o),h=i.expirationTimes;for(var b=o;0<b;){var v=31-st(b),A=1<<v;h[v]=-1,b&=~A}u!==0&&Ht(i,u,o)}function xf(){return(ln&6)===0?(rc(0),!1):!0}function Tg(){if(Vt!==null){if(dn===0)var i=Vt.return;else i=Vt,la=es=null,Bm(i),ll=null,Fu=0,i=Vt;for(;i!==null;)ES(i.alternate,i),i=i.return;Vt=null}}function bl(i,o){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,yD(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),va=0,Tg(),yn=i,Vt=u=oa(i.current,null),Yt=o,dn=0,qr=null,Za=!1,ml=Bt(i,o),bg=!1,gl=$r=vg=us=Ja=In=0,Ar=tc=null,xg=!1,(o&8)!==0&&(o|=o&32);var h=i.entangledLanes;if(h!==0)for(i=i.entanglements,h&=o;0<h;){var b=31-st(h),v=1<<b;o|=i[b],h&=~v}return ba=o,Bd(),u}function WS(i,o){At=null,j.H=Wu,o===sl||o===Kd?(o=uw(),dn=3):o===Mm?(o=uw(),dn=4):dn=o===ng?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,qr=o,Vt===null&&(In=1,uf(i,ri(o,i.current)))}function KS(){var i=Ur.current;return i===null?!0:(Yt&4194048)===Yt?si===null:(Yt&62914560)===Yt||(Yt&536870912)!==0?i===si:!1}function GS(){var i=j.H;return j.H=Wu,i===null?Wu:i}function XS(){var i=j.A;return j.A=G2,i}function wf(){In=4,Za||(Yt&4194048)!==Yt&&Ur.current!==null||(ml=!0),(Ja&134217727)===0&&(us&134217727)===0||yn===null||no(yn,Yt,$r,!1)}function Cg(i,o,u){var h=ln;ln|=2;var b=GS(),v=XS();(yn!==i||Yt!==o)&&(vf=null,bl(i,o)),o=!1;var A=In;e:do try{if(dn!==0&&Vt!==null){var U=Vt,ee=qr;switch(dn){case 8:Tg(),A=6;break e;case 3:case 2:case 9:case 6:Ur.current===null&&(o=!0);var pe=dn;if(dn=0,qr=null,vl(i,U,ee,pe),u&&ml){A=0;break e}break;default:pe=dn,dn=0,qr=null,vl(i,U,ee,pe)}}Z2(),A=In;break}catch(Te){WS(i,Te)}while(!0);return o&&i.shellSuspendCounter++,la=es=null,ln=h,j.H=b,j.A=v,Vt===null&&(yn=null,Yt=0,Bd()),A}function Z2(){for(;Vt!==null;)QS(Vt)}function J2(i,o){var u=ln;ln|=2;var h=GS(),b=XS();yn!==i||Yt!==o?(vf=null,bf=te()+500,bl(i,o)):ml=Bt(i,o);e:do try{if(dn!==0&&Vt!==null){o=Vt;var v=qr;t:switch(dn){case 1:dn=0,qr=null,vl(i,o,v,1);break;case 2:case 9:if(sw(v)){dn=0,qr=null,ZS(o);break}o=function(){dn!==2&&dn!==9||yn!==i||(dn=7),zi(i)},v.then(o,o);break e;case 3:dn=7;break e;case 4:dn=5;break e;case 7:sw(v)?(dn=0,qr=null,ZS(o)):(dn=0,qr=null,vl(i,o,v,7));break;case 5:var A=null;switch(Vt.tag){case 26:A=Vt.memoizedState;case 5:case 27:var U=Vt;if(A?j1(A):U.stateNode.complete){dn=0,qr=null;var ee=U.sibling;if(ee!==null)Vt=ee;else{var pe=U.return;pe!==null?(Vt=pe,Sf(pe)):Vt=null}break t}}dn=0,qr=null,vl(i,o,v,5);break;case 6:dn=0,qr=null,vl(i,o,v,6);break;case 8:Tg(),In=6;break e;default:throw Error(r(462))}}eD();break}catch(Te){WS(i,Te)}while(!0);return la=es=null,j.H=h,j.A=b,ln=u,Vt!==null?0:(yn=null,Yt=0,Bd(),In)}function eD(){for(;Vt!==null&&!Be();)QS(Vt)}function QS(i){var o=wS(i.alternate,i,ba);i.memoizedProps=i.pendingProps,o===null?Sf(i):Vt=o}function ZS(i){var o=i,u=o.alternate;switch(o.tag){case 15:case 0:o=mS(u,o,o.pendingProps,o.type,void 0,Yt);break;case 11:o=mS(u,o,o.pendingProps,o.type.render,o.ref,Yt);break;case 5:Bm(o);default:ES(u,o),o=Vt=X0(o,ba),o=wS(u,o,ba)}i.memoizedProps=i.pendingProps,o===null?Sf(i):Vt=o}function vl(i,o,u,h){la=es=null,Bm(o),ll=null,Fu=0;var b=o.return;try{if(U2(i,b,o,u,Yt)){In=1,uf(i,ri(u,i.current)),Vt=null;return}}catch(v){if(b!==null)throw Vt=b,v;In=1,uf(i,ri(u,i.current)),Vt=null;return}o.flags&32768?(Zt||h===1?i=!0:ml||(Yt&536870912)!==0?i=!1:(Za=i=!0,(h===2||h===9||h===3||h===6)&&(h=Ur.current,h!==null&&h.tag===13&&(h.flags|=16384))),JS(o,i)):Sf(o)}function Sf(i){var o=i;do{if((o.flags&32768)!==0){JS(o,Za);return}i=o.return;var u=$2(o.alternate,o,ba);if(u!==null){Vt=u;return}if(o=o.sibling,o!==null){Vt=o;return}Vt=o=i}while(o!==null);In===0&&(In=5)}function JS(i,o){do{var u=Y2(i.alternate,i);if(u!==null){u.flags&=32767,Vt=u;return}if(u=i.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!o&&(i=i.sibling,i!==null)){Vt=i;return}Vt=i=u}while(i!==null);In=6,Vt=null}function e1(i,o,u,h,b,v,A,U,ee){i.cancelPendingCommit=null;do Ef();while(Gn!==0);if((ln&6)!==0)throw Error(r(327));if(o!==null){if(o===i.current)throw Error(r(177));if(v=o.lanes|o.childLanes,v|=hm,ft(i,u,v,A,U,ee),i===yn&&(Vt=yn=null,Yt=0),yl=o,to=i,va=u,wg=v,Sg=b,VS=h,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,iD(we,function(){return a1(),null})):(i.callbackNode=null,i.callbackPriority=0),h=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||h){h=j.T,j.T=null,b=z.p,z.p=2,A=ln,ln|=4;try{W2(i,o,u)}finally{ln=A,z.p=b,j.T=h}}Gn=1,t1(),n1(),r1()}}function t1(){if(Gn===1){Gn=0;var i=to,o=yl,u=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||u){u=j.T,j.T=null;var h=z.p;z.p=2;var b=ln;ln|=4;try{LS(o,i);var v=jg,A=H0(i.containerInfo),U=v.focusedElem,ee=v.selectionRange;if(A!==U&&U&&U.ownerDocument&&B0(U.ownerDocument.documentElement,U)){if(ee!==null&&lm(U)){var pe=ee.start,Te=ee.end;if(Te===void 0&&(Te=pe),"selectionStart"in U)U.selectionStart=pe,U.selectionEnd=Math.min(Te,U.value.length);else{var Ne=U.ownerDocument||document,me=Ne&&Ne.defaultView||window;if(me.getSelection){var ve=me.getSelection(),Ze=U.textContent.length,mt=Math.min(ee.start,Ze),mn=ee.end===void 0?mt:Math.min(ee.end,Ze);!ve.extend&&mt>mn&&(A=mn,mn=mt,mt=A);var ue=F0(U,mt),oe=F0(U,mn);if(ue&&oe&&(ve.rangeCount!==1||ve.anchorNode!==ue.node||ve.anchorOffset!==ue.offset||ve.focusNode!==oe.node||ve.focusOffset!==oe.offset)){var fe=Ne.createRange();fe.setStart(ue.node,ue.offset),ve.removeAllRanges(),mt>mn?(ve.addRange(fe),ve.extend(oe.node,oe.offset)):(fe.setEnd(oe.node,oe.offset),ve.addRange(fe))}}}}for(Ne=[],ve=U;ve=ve.parentNode;)ve.nodeType===1&&Ne.push({element:ve,left:ve.scrollLeft,top:ve.scrollTop});for(typeof U.focus=="function"&&U.focus(),U=0;U<Ne.length;U++){var Oe=Ne[U];Oe.element.scrollLeft=Oe.left,Oe.element.scrollTop=Oe.top}}Lf=!!_g,jg=_g=null}finally{ln=b,z.p=h,j.T=u}}i.current=o,Gn=2}}function n1(){if(Gn===2){Gn=0;var i=to,o=yl,u=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||u){u=j.T,j.T=null;var h=z.p;z.p=2;var b=ln;ln|=4;try{AS(i,o.alternate,o)}finally{ln=b,z.p=h,j.T=u}}Gn=3}}function r1(){if(Gn===4||Gn===3){Gn=0,$e();var i=to,o=yl,u=va,h=VS;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?Gn=5:(Gn=0,yl=to=null,i1(i,i.pendingLanes));var b=i.pendingLanes;if(b===0&&(eo=null),ke(u),o=o.stateNode,We&&typeof We.onCommitFiberRoot=="function")try{We.onCommitFiberRoot(Ot,o,void 0,(o.current.flags&128)===128)}catch{}if(h!==null){o=j.T,b=z.p,z.p=2,j.T=null;try{for(var v=i.onRecoverableError,A=0;A<h.length;A++){var U=h[A];v(U.value,{componentStack:U.stack})}}finally{j.T=o,z.p=b}}(va&3)!==0&&Ef(),zi(i),b=i.pendingLanes,(u&261930)!==0&&(b&42)!==0?i===Eg?nc++:(nc=0,Eg=i):nc=0,rc(0)}}function i1(i,o){(i.pooledCacheLanes&=o)===0&&(o=i.pooledCache,o!=null&&(i.pooledCache=null,ju(o)))}function Ef(){return t1(),n1(),r1(),a1()}function a1(){if(Gn!==5)return!1;var i=to,o=wg;wg=0;var u=ke(va),h=j.T,b=z.p;try{z.p=32>u?32:u,j.T=null,u=Sg,Sg=null;var v=to,A=va;if(Gn=0,yl=to=null,va=0,(ln&6)!==0)throw Error(r(331));var U=ln;if(ln|=4,BS(v.current),jS(v,v.current,A,u),ln=U,rc(0,!1),We&&typeof We.onPostCommitFiberRoot=="function")try{We.onPostCommitFiberRoot(Ot,v)}catch{}return!0}finally{z.p=b,j.T=h,i1(i,o)}}function o1(i,o,u){o=ri(u,o),o=tg(i.stateNode,o,2),i=Ka(i,o,2),i!==null&&(nn(i,2),zi(i))}function fn(i,o,u){if(i.tag===3)o1(i,i,u);else for(;o!==null;){if(o.tag===3){o1(o,i,u);break}else if(o.tag===1){var h=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(eo===null||!eo.has(h))){i=ri(u,i),u=sS(2),h=Ka(o,u,2),h!==null&&(lS(u,h,o,i),nn(h,2),zi(h));break}}o=o.return}}function Rg(i,o,u){var h=i.pingCache;if(h===null){h=i.pingCache=new X2;var b=new Set;h.set(o,b)}else b=h.get(o),b===void 0&&(b=new Set,h.set(o,b));b.has(u)||(bg=!0,b.add(u),i=tD.bind(null,i,o,u),o.then(i,i))}function tD(i,o,u){var h=i.pingCache;h!==null&&h.delete(o),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,yn===i&&(Yt&u)===u&&(In===4||In===3&&(Yt&62914560)===Yt&&300>te()-yf?(ln&2)===0&&bl(i,0):vg|=u,gl===Yt&&(gl=0)),zi(i)}function s1(i,o){o===0&&(o=tn()),i=Qo(i,o),i!==null&&(nn(i,o),zi(i))}function nD(i){var o=i.memoizedState,u=0;o!==null&&(u=o.retryLane),s1(i,u)}function rD(i,o){var u=0;switch(i.tag){case 31:case 13:var h=i.stateNode,b=i.memoizedState;b!==null&&(u=b.retryLane);break;case 19:h=i.stateNode;break;case 22:h=i.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(o),s1(i,u)}function iD(i,o){return Re(i,o)}var Tf=null,xl=null,kg=!1,Cf=!1,Mg=!1,ro=0;function zi(i){i!==xl&&i.next===null&&(xl===null?Tf=xl=i:xl=xl.next=i),Cf=!0,kg||(kg=!0,oD())}function rc(i,o){if(!Mg&&Cf){Mg=!0;do for(var u=!1,h=Tf;h!==null;){if(i!==0){var b=h.pendingLanes;if(b===0)var v=0;else{var A=h.suspendedLanes,U=h.pingedLanes;v=(1<<31-st(42|i)+1)-1,v&=b&~(A&~U),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(u=!0,d1(h,v))}else v=Yt,v=Xe(h,h===yn?v:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(v&3)===0||Bt(h,v)||(u=!0,d1(h,v));h=h.next}while(u);Mg=!1}}function aD(){l1()}function l1(){Cf=kg=!1;var i=0;ro!==0&&gD()&&(i=ro);for(var o=te(),u=null,h=Tf;h!==null;){var b=h.next,v=u1(h,o);v===0?(h.next=null,u===null?Tf=b:u.next=b,b===null&&(xl=u)):(u=h,(i!==0||(v&3)!==0)&&(Cf=!0)),h=b}Gn!==0&&Gn!==5||rc(i),ro!==0&&(ro=0)}function u1(i,o){for(var u=i.suspendedLanes,h=i.pingedLanes,b=i.expirationTimes,v=i.pendingLanes&-62914561;0<v;){var A=31-st(v),U=1<<A,ee=b[A];ee===-1?((U&u)===0||(U&h)!==0)&&(b[A]=cn(U,o)):ee<=o&&(i.expiredLanes|=U),v&=~U}if(o=yn,u=Yt,u=Xe(i,i===o?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h=i.callbackNode,u===0||i===o&&(dn===2||dn===9)||i.cancelPendingCommit!==null)return h!==null&&h!==null&&xe(h),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||Bt(i,u)){if(o=u&-u,o===i.callbackPriority)return o;switch(h!==null&&xe(h),ke(u)){case 2:case 8:u=ye;break;case 32:u=we;break;case 268435456:u=Fe;break;default:u=we}return h=c1.bind(null,i),u=Re(u,h),i.callbackPriority=o,i.callbackNode=u,o}return h!==null&&h!==null&&xe(h),i.callbackPriority=2,i.callbackNode=null,2}function c1(i,o){if(Gn!==0&&Gn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(Ef()&&i.callbackNode!==u)return null;var h=Yt;return h=Xe(i,i===yn?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h===0?null:($S(i,h,o),u1(i,te()),i.callbackNode!=null&&i.callbackNode===u?c1.bind(null,i):null)}function d1(i,o){if(Ef())return null;$S(i,o,!0)}function oD(){bD(function(){(ln&6)!==0?Re(se,aD):l1()})}function Og(){if(ro===0){var i=al;i===0&&(i=Rt,Rt<<=1,(Rt&261888)===0&&(Rt=256)),ro=i}return ro}function f1(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Dd(""+i)}function h1(i,o){var u=o.ownerDocument.createElement("input");return u.name=o.name,u.value=o.value,i.id&&u.setAttribute("form",i.id),o.parentNode.insertBefore(u,o),i=new FormData(i),u.parentNode.removeChild(u),i}function sD(i,o,u,h,b){if(o==="submit"&&u&&u.stateNode===b){var v=f1((b[Ke]||null).action),A=h.submitter;A&&(o=(o=A[Ke]||null)?f1(o.formAction):A.getAttribute("formAction"),o!==null&&(v=o,A=null));var U=new _d("action","action",null,h,b);i.push({event:U,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(ro!==0){var ee=A?h1(b,A):new FormData(b);Gm(u,{pending:!0,data:ee,method:b.method,action:v},null,ee)}}else typeof v=="function"&&(U.preventDefault(),ee=A?h1(b,A):new FormData(b),Gm(u,{pending:!0,data:ee,method:b.method,action:v},v,ee))},currentTarget:b}]})}}for(var Ag=0;Ag<fm.length;Ag++){var Ng=fm[Ag],lD=Ng.toLowerCase(),uD=Ng[0].toUpperCase()+Ng.slice(1);Ei(lD,"on"+uD)}Ei(q0,"onAnimationEnd"),Ei($0,"onAnimationIteration"),Ei(Y0,"onAnimationStart"),Ei("dblclick","onDoubleClick"),Ei("focusin","onFocus"),Ei("focusout","onBlur"),Ei(C2,"onTransitionRun"),Ei(R2,"onTransitionStart"),Ei(k2,"onTransitionCancel"),Ei(W0,"onTransitionEnd"),ei("onMouseEnter",["mouseout","mouseover"]),ei("onMouseLeave",["mouseout","mouseover"]),ei("onPointerEnter",["pointerout","pointerover"]),ei("onPointerLeave",["pointerout","pointerover"]),wi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),wi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),wi("onBeforeInput",["compositionend","keypress","textInput","paste"]),wi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),wi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),wi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ic="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(" "),cD=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ic));function p1(i,o){o=(o&4)!==0;for(var u=0;u<i.length;u++){var h=i[u],b=h.event;h=h.listeners;e:{var v=void 0;if(o)for(var A=h.length-1;0<=A;A--){var U=h[A],ee=U.instance,pe=U.currentTarget;if(U=U.listener,ee!==v&&b.isPropagationStopped())break e;v=U,b.currentTarget=pe;try{v(b)}catch(Te){Fd(Te)}b.currentTarget=null,v=ee}else for(A=0;A<h.length;A++){if(U=h[A],ee=U.instance,pe=U.currentTarget,U=U.listener,ee!==v&&b.isPropagationStopped())break e;v=U,b.currentTarget=pe;try{v(b)}catch(Te){Fd(Te)}b.currentTarget=null,v=ee}}}}function qt(i,o){var u=o[vt];u===void 0&&(u=o[vt]=new Set);var h=i+"__bubble";u.has(h)||(m1(o,i,2,!1),u.add(h))}function Dg(i,o,u){var h=0;o&&(h|=4),m1(u,i,h,o)}var Rf="_reactListening"+Math.random().toString(36).slice(2);function Ig(i){if(!i[Rf]){i[Rf]=!0,xi.forEach(function(u){u!=="selectionchange"&&(cD.has(u)||Dg(u,!1,i),Dg(u,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[Rf]||(o[Rf]=!0,Dg("selectionchange",!1,o))}}function m1(i,o,u,h){switch(q1(o)){case 2:var b=zD;break;case 8:b=FD;break;default:b=Kg}u=b.bind(null,o,u,i),b=void 0,!Jp||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(b=!0),h?b!==void 0?i.addEventListener(o,u,{capture:!0,passive:b}):i.addEventListener(o,u,!0):b!==void 0?i.addEventListener(o,u,{passive:b}):i.addEventListener(o,u,!1)}function Pg(i,o,u,h,b){var v=h;if((o&1)===0&&(o&2)===0&&h!==null)e:for(;;){if(h===null)return;var A=h.tag;if(A===3||A===4){var U=h.stateNode.containerInfo;if(U===b)break;if(A===4)for(A=h.return;A!==null;){var ee=A.tag;if((ee===3||ee===4)&&A.stateNode.containerInfo===b)return;A=A.return}for(;U!==null;){if(A=Nn(U),A===null)return;if(ee=A.tag,ee===5||ee===6||ee===26||ee===27){h=v=A;continue e}U=U.parentNode}}h=h.return}x0(function(){var pe=v,Te=Qp(u),Ne=[];e:{var me=K0.get(i);if(me!==void 0){var ve=_d,Ze=i;switch(i){case"keypress":if(Pd(u)===0)break e;case"keydown":case"keyup":ve=r2;break;case"focusin":Ze="focus",ve=rm;break;case"focusout":Ze="blur",ve=rm;break;case"beforeblur":case"afterblur":ve=rm;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ve=E0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ve=$N;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ve=o2;break;case q0:case $0:case Y0:ve=KN;break;case W0:ve=l2;break;case"scroll":case"scrollend":ve=VN;break;case"wheel":ve=c2;break;case"copy":case"cut":case"paste":ve=XN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ve=C0;break;case"toggle":case"beforetoggle":ve=f2}var mt=(o&4)!==0,mn=!mt&&(i==="scroll"||i==="scrollend"),ue=mt?me!==null?me+"Capture":null:me;mt=[];for(var oe=pe,fe;oe!==null;){var Oe=oe;if(fe=Oe.stateNode,Oe=Oe.tag,Oe!==5&&Oe!==26&&Oe!==27||fe===null||ue===null||(Oe=Ru(oe,ue),Oe!=null&&mt.push(ac(oe,Oe,fe))),mn)break;oe=oe.return}0<mt.length&&(me=new ve(me,Ze,null,u,Te),Ne.push({event:me,listeners:mt}))}}if((o&7)===0){e:{if(me=i==="mouseover"||i==="pointerover",ve=i==="mouseout"||i==="pointerout",me&&u!==Xp&&(Ze=u.relatedTarget||u.fromElement)&&(Nn(Ze)||Ze[Qe]))break e;if((ve||me)&&(me=Te.window===Te?Te:(me=Te.ownerDocument)?me.defaultView||me.parentWindow:window,ve?(Ze=u.relatedTarget||u.toElement,ve=pe,Ze=Ze?Nn(Ze):null,Ze!==null&&(mn=s(Ze),mt=Ze.tag,Ze!==mn||mt!==5&&mt!==27&&mt!==6)&&(Ze=null)):(ve=null,Ze=pe),ve!==Ze)){if(mt=E0,Oe="onMouseLeave",ue="onMouseEnter",oe="mouse",(i==="pointerout"||i==="pointerover")&&(mt=C0,Oe="onPointerLeave",ue="onPointerEnter",oe="pointer"),mn=ve==null?me:er(ve),fe=Ze==null?me:er(Ze),me=new mt(Oe,oe+"leave",ve,u,Te),me.target=mn,me.relatedTarget=fe,Oe=null,Nn(Te)===pe&&(mt=new mt(ue,oe+"enter",Ze,u,Te),mt.target=fe,mt.relatedTarget=mn,Oe=mt),mn=Oe,ve&&Ze)t:{for(mt=dD,ue=ve,oe=Ze,fe=0,Oe=ue;Oe;Oe=mt(Oe))fe++;Oe=0;for(var dt=oe;dt;dt=mt(dt))Oe++;for(;0<fe-Oe;)ue=mt(ue),fe--;for(;0<Oe-fe;)oe=mt(oe),Oe--;for(;fe--;){if(ue===oe||oe!==null&&ue===oe.alternate){mt=ue;break t}ue=mt(ue),oe=mt(oe)}mt=null}else mt=null;ve!==null&&g1(Ne,me,ve,mt,!1),Ze!==null&&mn!==null&&g1(Ne,mn,Ze,mt,!0)}}e:{if(me=pe?er(pe):window,ve=me.nodeName&&me.nodeName.toLowerCase(),ve==="select"||ve==="input"&&me.type==="file")var rn=I0;else if(N0(me))if(P0)rn=S2;else{rn=x2;var at=v2}else ve=me.nodeName,!ve||ve.toLowerCase()!=="input"||me.type!=="checkbox"&&me.type!=="radio"?pe&&Gp(pe.elementType)&&(rn=I0):rn=w2;if(rn&&(rn=rn(i,pe))){D0(Ne,rn,u,Te);break e}at&&at(i,me,pe),i==="focusout"&&pe&&me.type==="number"&&pe.memoizedProps.value!=null&&Kp(me,"number",me.value)}switch(at=pe?er(pe):window,i){case"focusin":(N0(at)||at.contentEditable==="true")&&(Qs=at,um=pe,Pu=null);break;case"focusout":Pu=um=Qs=null;break;case"mousedown":cm=!0;break;case"contextmenu":case"mouseup":case"dragend":cm=!1,U0(Ne,u,Te);break;case"selectionchange":if(T2)break;case"keydown":case"keyup":U0(Ne,u,Te)}var Nt;if(am)e:{switch(i){case"compositionstart":var Wt="onCompositionStart";break e;case"compositionend":Wt="onCompositionEnd";break e;case"compositionupdate":Wt="onCompositionUpdate";break e}Wt=void 0}else Xs?O0(i,u)&&(Wt="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(Wt="onCompositionStart");Wt&&(R0&&u.locale!=="ko"&&(Xs||Wt!=="onCompositionStart"?Wt==="onCompositionEnd"&&Xs&&(Nt=w0()):(Ha=Te,em="value"in Ha?Ha.value:Ha.textContent,Xs=!0)),at=kf(pe,Wt),0<at.length&&(Wt=new T0(Wt,i,null,u,Te),Ne.push({event:Wt,listeners:at}),Nt?Wt.data=Nt:(Nt=A0(u),Nt!==null&&(Wt.data=Nt)))),(Nt=p2?m2(i,u):g2(i,u))&&(Wt=kf(pe,"onBeforeInput"),0<Wt.length&&(at=new T0("onBeforeInput","beforeinput",null,u,Te),Ne.push({event:at,listeners:Wt}),at.data=Nt)),sD(Ne,i,pe,u,Te)}p1(Ne,o)})}function ac(i,o,u){return{instance:i,listener:o,currentTarget:u}}function kf(i,o){for(var u=o+"Capture",h=[];i!==null;){var b=i,v=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||v===null||(b=Ru(i,u),b!=null&&h.unshift(ac(i,b,v)),b=Ru(i,o),b!=null&&h.push(ac(i,b,v))),i.tag===3)return h;i=i.return}return[]}function dD(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function g1(i,o,u,h,b){for(var v=o._reactName,A=[];u!==null&&u!==h;){var U=u,ee=U.alternate,pe=U.stateNode;if(U=U.tag,ee!==null&&ee===h)break;U!==5&&U!==26&&U!==27||pe===null||(ee=pe,b?(pe=Ru(u,v),pe!=null&&A.unshift(ac(u,pe,ee))):b||(pe=Ru(u,v),pe!=null&&A.push(ac(u,pe,ee)))),u=u.return}A.length!==0&&i.push({event:o,listeners:A})}var fD=/\r\n?/g,hD=/\u0000|\uFFFD/g;function y1(i){return(typeof i=="string"?i:""+i).replace(fD,`
50
+ `).replace(hD,"")}function b1(i,o){return o=y1(o),y1(i)===o}function pn(i,o,u,h,b,v){switch(u){case"children":typeof h=="string"?o==="body"||o==="textarea"&&h===""||Ws(i,h):(typeof h=="number"||typeof h=="bigint")&&o!=="body"&&Ws(i,""+h);break;case"className":Si(i,"class",h);break;case"tabIndex":Si(i,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":Si(i,u,h);break;case"style":b0(i,h,v);break;case"data":if(o!=="object"){Si(i,"data",h);break}case"src":case"href":if(h===""&&(o!=="a"||u!=="href")){i.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){i.removeAttribute(u);break}h=Dd(""+h),i.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){i.setAttribute(u,"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"&&(u==="formAction"?(o!=="input"&&pn(i,o,"name",b.name,b,null),pn(i,o,"formEncType",b.formEncType,b,null),pn(i,o,"formMethod",b.formMethod,b,null),pn(i,o,"formTarget",b.formTarget,b,null)):(pn(i,o,"encType",b.encType,b,null),pn(i,o,"method",b.method,b,null),pn(i,o,"target",b.target,b,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){i.removeAttribute(u);break}h=Dd(""+h),i.setAttribute(u,h);break;case"onClick":h!=null&&(i.onclick=ia);break;case"onScroll":h!=null&&qt("scroll",i);break;case"onScrollEnd":h!=null&&qt("scrollend",i);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(b.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"multiple":i.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":i.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){i.removeAttribute("xlink:href");break}u=Dd(""+h),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(u,""+h):i.removeAttribute(u);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":h&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(u,""):i.removeAttribute(u);break;case"capture":case"download":h===!0?i.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(u,h):i.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?i.setAttribute(u,h):i.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?i.removeAttribute(u):i.setAttribute(u,h);break;case"popover":qt("beforetoggle",i),qt("toggle",i),zn(i,"popover",h);break;case"xlinkActuate":ir(i,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":ir(i,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":ir(i,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":ir(i,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":ir(i,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":ir(i,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":ir(i,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":ir(i,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":ir(i,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":zn(i,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=HN.get(u)||u,zn(i,u,h))}}function Lg(i,o,u,h,b,v){switch(u){case"style":b0(i,h,v);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(b.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"children":typeof h=="string"?Ws(i,h):(typeof h=="number"||typeof h=="bigint")&&Ws(i,""+h);break;case"onScroll":h!=null&&qt("scroll",i);break;case"onScrollEnd":h!=null&&qt("scrollend",i);break;case"onClick":h!=null&&(i.onclick=ia);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Fr.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(b=u.endsWith("Capture"),o=u.slice(2,b?u.length-7:void 0),v=i[Ke]||null,v=v!=null?v[u]:null,typeof v=="function"&&i.removeEventListener(o,v,b),typeof h=="function")){typeof v!="function"&&v!==null&&(u in i?i[u]=null:i.hasAttribute(u)&&i.removeAttribute(u)),i.addEventListener(o,h,b);break e}u in i?i[u]=h:h===!0?i.setAttribute(u,""):zn(i,u,h)}}}function lr(i,o,u){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":qt("error",i),qt("load",i);var h=!1,b=!1,v;for(v in u)if(u.hasOwnProperty(v)){var A=u[v];if(A!=null)switch(v){case"src":h=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:pn(i,o,v,A,u,null)}}b&&pn(i,o,"srcSet",u.srcSet,u,null),h&&pn(i,o,"src",u.src,u,null);return;case"input":qt("invalid",i);var U=v=A=b=null,ee=null,pe=null;for(h in u)if(u.hasOwnProperty(h)){var Te=u[h];if(Te!=null)switch(h){case"name":b=Te;break;case"type":A=Te;break;case"checked":ee=Te;break;case"defaultChecked":pe=Te;break;case"value":v=Te;break;case"defaultValue":U=Te;break;case"children":case"dangerouslySetInnerHTML":if(Te!=null)throw Error(r(137,o));break;default:pn(i,o,h,Te,u,null)}}p0(i,v,U,ee,pe,A,b,!1);return;case"select":qt("invalid",i),h=A=v=null;for(b in u)if(u.hasOwnProperty(b)&&(U=u[b],U!=null))switch(b){case"value":v=U;break;case"defaultValue":A=U;break;case"multiple":h=U;default:pn(i,o,b,U,u,null)}o=v,u=A,i.multiple=!!h,o!=null?Ys(i,!!h,o,!1):u!=null&&Ys(i,!!h,u,!0);return;case"textarea":qt("invalid",i),v=b=h=null;for(A in u)if(u.hasOwnProperty(A)&&(U=u[A],U!=null))switch(A){case"value":h=U;break;case"defaultValue":b=U;break;case"children":v=U;break;case"dangerouslySetInnerHTML":if(U!=null)throw Error(r(91));break;default:pn(i,o,A,U,u,null)}g0(i,h,b,v);return;case"option":for(ee in u)if(u.hasOwnProperty(ee)&&(h=u[ee],h!=null))switch(ee){case"selected":i.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:pn(i,o,ee,h,u,null)}return;case"dialog":qt("beforetoggle",i),qt("toggle",i),qt("cancel",i),qt("close",i);break;case"iframe":case"object":qt("load",i);break;case"video":case"audio":for(h=0;h<ic.length;h++)qt(ic[h],i);break;case"image":qt("error",i),qt("load",i);break;case"details":qt("toggle",i);break;case"embed":case"source":case"link":qt("error",i),qt("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(pe in u)if(u.hasOwnProperty(pe)&&(h=u[pe],h!=null))switch(pe){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:pn(i,o,pe,h,u,null)}return;default:if(Gp(o)){for(Te in u)u.hasOwnProperty(Te)&&(h=u[Te],h!==void 0&&Lg(i,o,Te,h,u,void 0));return}}for(U in u)u.hasOwnProperty(U)&&(h=u[U],h!=null&&pn(i,o,U,h,u,null))}function pD(i,o,u,h){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,v=null,A=null,U=null,ee=null,pe=null,Te=null;for(ve in u){var Ne=u[ve];if(u.hasOwnProperty(ve)&&Ne!=null)switch(ve){case"checked":break;case"value":break;case"defaultValue":ee=Ne;default:h.hasOwnProperty(ve)||pn(i,o,ve,null,h,Ne)}}for(var me in h){var ve=h[me];if(Ne=u[me],h.hasOwnProperty(me)&&(ve!=null||Ne!=null))switch(me){case"type":v=ve;break;case"name":b=ve;break;case"checked":pe=ve;break;case"defaultChecked":Te=ve;break;case"value":A=ve;break;case"defaultValue":U=ve;break;case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(r(137,o));break;default:ve!==Ne&&pn(i,o,me,ve,h,Ne)}}Wp(i,A,U,ee,pe,Te,v,b);return;case"select":ve=A=U=me=null;for(v in u)if(ee=u[v],u.hasOwnProperty(v)&&ee!=null)switch(v){case"value":break;case"multiple":ve=ee;default:h.hasOwnProperty(v)||pn(i,o,v,null,h,ee)}for(b in h)if(v=h[b],ee=u[b],h.hasOwnProperty(b)&&(v!=null||ee!=null))switch(b){case"value":me=v;break;case"defaultValue":U=v;break;case"multiple":A=v;default:v!==ee&&pn(i,o,b,v,h,ee)}o=U,u=A,h=ve,me!=null?Ys(i,!!u,me,!1):!!h!=!!u&&(o!=null?Ys(i,!!u,o,!0):Ys(i,!!u,u?[]:"",!1));return;case"textarea":ve=me=null;for(U in u)if(b=u[U],u.hasOwnProperty(U)&&b!=null&&!h.hasOwnProperty(U))switch(U){case"value":break;case"children":break;default:pn(i,o,U,null,h,b)}for(A in h)if(b=h[A],v=u[A],h.hasOwnProperty(A)&&(b!=null||v!=null))switch(A){case"value":me=b;break;case"defaultValue":ve=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==v&&pn(i,o,A,b,h,v)}m0(i,me,ve);return;case"option":for(var Ze in u)if(me=u[Ze],u.hasOwnProperty(Ze)&&me!=null&&!h.hasOwnProperty(Ze))switch(Ze){case"selected":i.selected=!1;break;default:pn(i,o,Ze,null,h,me)}for(ee in h)if(me=h[ee],ve=u[ee],h.hasOwnProperty(ee)&&me!==ve&&(me!=null||ve!=null))switch(ee){case"selected":i.selected=me&&typeof me!="function"&&typeof me!="symbol";break;default:pn(i,o,ee,me,h,ve)}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 mt in u)me=u[mt],u.hasOwnProperty(mt)&&me!=null&&!h.hasOwnProperty(mt)&&pn(i,o,mt,null,h,me);for(pe in h)if(me=h[pe],ve=u[pe],h.hasOwnProperty(pe)&&me!==ve&&(me!=null||ve!=null))switch(pe){case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,o));break;default:pn(i,o,pe,me,h,ve)}return;default:if(Gp(o)){for(var mn in u)me=u[mn],u.hasOwnProperty(mn)&&me!==void 0&&!h.hasOwnProperty(mn)&&Lg(i,o,mn,void 0,h,me);for(Te in h)me=h[Te],ve=u[Te],!h.hasOwnProperty(Te)||me===ve||me===void 0&&ve===void 0||Lg(i,o,Te,me,h,ve);return}}for(var ue in u)me=u[ue],u.hasOwnProperty(ue)&&me!=null&&!h.hasOwnProperty(ue)&&pn(i,o,ue,null,h,me);for(Ne in h)me=h[Ne],ve=u[Ne],!h.hasOwnProperty(Ne)||me===ve||me==null&&ve==null||pn(i,o,Ne,me,h,ve)}function v1(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function mD(){if(typeof performance.getEntriesByType=="function"){for(var i=0,o=0,u=performance.getEntriesByType("resource"),h=0;h<u.length;h++){var b=u[h],v=b.transferSize,A=b.initiatorType,U=b.duration;if(v&&U&&v1(A)){for(A=0,U=b.responseEnd,h+=1;h<u.length;h++){var ee=u[h],pe=ee.startTime;if(pe>U)break;var Te=ee.transferSize,Ne=ee.initiatorType;Te&&v1(Ne)&&(ee=ee.responseEnd,A+=Te*(ee<U?1:(U-pe)/(ee-pe)))}if(--h,o+=8*(v+A)/(b.duration/1e3),i++,10<i)break}}if(0<i)return o/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var _g=null,jg=null;function Mf(i){return i.nodeType===9?i:i.ownerDocument}function x1(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function w1(i,o){if(i===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&o==="foreignObject"?0:i}function zg(i,o){return i==="textarea"||i==="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 Fg=null;function gD(){var i=window.event;return i&&i.type==="popstate"?i===Fg?!1:(Fg=i,!0):(Fg=null,!1)}var S1=typeof setTimeout=="function"?setTimeout:void 0,yD=typeof clearTimeout=="function"?clearTimeout:void 0,E1=typeof Promise=="function"?Promise:void 0,bD=typeof queueMicrotask=="function"?queueMicrotask:typeof E1<"u"?function(i){return E1.resolve(null).then(i).catch(vD)}:S1;function vD(i){setTimeout(function(){throw i})}function io(i){return i==="head"}function T1(i,o){var u=o,h=0;do{var b=u.nextSibling;if(i.removeChild(u),b&&b.nodeType===8)if(u=b.data,u==="/$"||u==="/&"){if(h===0){i.removeChild(b),Tl(o);return}h--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")h++;else if(u==="html")oc(i.ownerDocument.documentElement);else if(u==="head"){u=i.ownerDocument.head,oc(u);for(var v=u.firstChild;v;){var A=v.nextSibling,U=v.nodeName;v[Mn]||U==="SCRIPT"||U==="STYLE"||U==="LINK"&&v.rel.toLowerCase()==="stylesheet"||u.removeChild(v),v=A}}else u==="body"&&oc(i.ownerDocument.body);u=b}while(u);Tl(o)}function C1(i,o){var u=i;i=0;do{var h=u.nextSibling;if(u.nodeType===1?o?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(o?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),h&&h.nodeType===8)if(u=h.data,u==="/$"){if(i===0)break;i--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||i++;u=h}while(u)}function Bg(i){var o=i.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var u=o;switch(o=o.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Bg(u),An(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function xD(i,o,u,h){for(;i.nodeType===1;){var b=u;if(i.nodeName.toLowerCase()!==o.toLowerCase()){if(!h&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(h){if(!i[Mn])switch(o){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(v=i.getAttribute("rel"),v==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(v!==b.rel||i.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||i.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||i.getAttribute("title")!==(b.title==null?null:b.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(v=i.getAttribute("src"),(v!==(b.src==null?null:b.src)||i.getAttribute("type")!==(b.type==null?null:b.type)||i.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&v&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(o==="input"&&i.type==="hidden"){var v=b.name==null?null:""+b.name;if(b.type==="hidden"&&i.getAttribute("name")===v)return i}else return i;if(i=li(i.nextSibling),i===null)break}return null}function wD(i,o,u){if(o==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=li(i.nextSibling),i===null))return null;return i}function R1(i,o){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=li(i.nextSibling),i===null))return null;return i}function Hg(i){return i.data==="$?"||i.data==="$~"}function Ug(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function SD(i,o){var u=i.ownerDocument;if(i.data==="$~")i._reactRetry=o;else if(i.data!=="$?"||u.readyState!=="loading")o();else{var h=function(){o(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),i._reactRetry=h}}function li(i){for(;i!=null;i=i.nextSibling){var o=i.nodeType;if(o===1||o===3)break;if(o===8){if(o=i.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return i}var Vg=null;function k1(i){i=i.nextSibling;for(var o=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"||u==="/&"){if(o===0)return li(i.nextSibling);o--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||o++}i=i.nextSibling}return null}function M1(i){i=i.previousSibling;for(var o=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(o===0)return i;o--}else u!=="/$"&&u!=="/&"||o++}i=i.previousSibling}return null}function O1(i,o,u){switch(o=Mf(u),i){case"html":if(i=o.documentElement,!i)throw Error(r(452));return i;case"head":if(i=o.head,!i)throw Error(r(453));return i;case"body":if(i=o.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function oc(i){for(var o=i.attributes;o.length;)i.removeAttributeNode(o[0]);An(i)}var ui=new Map,A1=new Set;function Of(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var xa=z.d;z.d={f:ED,r:TD,D:CD,C:RD,L:kD,m:MD,X:AD,S:OD,M:ND};function ED(){var i=xa.f(),o=xf();return i||o}function TD(i){var o=Gt(i);o!==null&&o.tag===5&&o.type==="form"?Ww(o):xa.r(i)}var wl=typeof document>"u"?null:document;function N1(i,o,u){var h=wl;if(h&&typeof o=="string"&&o){var b=ti(o);b='link[rel="'+i+'"][href="'+b+'"]',typeof u=="string"&&(b+='[crossorigin="'+u+'"]'),A1.has(b)||(A1.add(b),i={rel:i,crossOrigin:u,href:o},h.querySelector(b)===null&&(o=h.createElement("link"),lr(o,"link",i),Rn(o),h.head.appendChild(o)))}}function CD(i){xa.D(i),N1("dns-prefetch",i,null)}function RD(i,o){xa.C(i,o),N1("preconnect",i,o)}function kD(i,o,u){xa.L(i,o,u);var h=wl;if(h&&i&&o){var b='link[rel="preload"][as="'+ti(o)+'"]';o==="image"&&u&&u.imageSrcSet?(b+='[imagesrcset="'+ti(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(b+='[imagesizes="'+ti(u.imageSizes)+'"]')):b+='[href="'+ti(i)+'"]';var v=b;switch(o){case"style":v=Sl(i);break;case"script":v=El(i)}ui.has(v)||(i=p({rel:"preload",href:o==="image"&&u&&u.imageSrcSet?void 0:i,as:o},u),ui.set(v,i),h.querySelector(b)!==null||o==="style"&&h.querySelector(sc(v))||o==="script"&&h.querySelector(lc(v))||(o=h.createElement("link"),lr(o,"link",i),Rn(o),h.head.appendChild(o)))}}function MD(i,o){xa.m(i,o);var u=wl;if(u&&i){var h=o&&typeof o.as=="string"?o.as:"script",b='link[rel="modulepreload"][as="'+ti(h)+'"][href="'+ti(i)+'"]',v=b;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=El(i)}if(!ui.has(v)&&(i=p({rel:"modulepreload",href:i},o),ui.set(v,i),u.querySelector(b)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(lc(v)))return}h=u.createElement("link"),lr(h,"link",i),Rn(h),u.head.appendChild(h)}}}function OD(i,o,u){xa.S(i,o,u);var h=wl;if(h&&i){var b=Cr(h).hoistableStyles,v=Sl(i);o=o||"default";var A=b.get(v);if(!A){var U={loading:0,preload:null};if(A=h.querySelector(sc(v)))U.loading=5;else{i=p({rel:"stylesheet",href:i,"data-precedence":o},u),(u=ui.get(v))&&qg(i,u);var ee=A=h.createElement("link");Rn(ee),lr(ee,"link",i),ee._p=new Promise(function(pe,Te){ee.onload=pe,ee.onerror=Te}),ee.addEventListener("load",function(){U.loading|=1}),ee.addEventListener("error",function(){U.loading|=2}),U.loading|=4,Af(A,o,h)}A={type:"stylesheet",instance:A,count:1,state:U},b.set(v,A)}}}function AD(i,o){xa.X(i,o);var u=wl;if(u&&i){var h=Cr(u).hoistableScripts,b=El(i),v=h.get(b);v||(v=u.querySelector(lc(b)),v||(i=p({src:i,async:!0},o),(o=ui.get(b))&&$g(i,o),v=u.createElement("script"),Rn(v),lr(v,"link",i),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},h.set(b,v))}}function ND(i,o){xa.M(i,o);var u=wl;if(u&&i){var h=Cr(u).hoistableScripts,b=El(i),v=h.get(b);v||(v=u.querySelector(lc(b)),v||(i=p({src:i,async:!0,type:"module"},o),(o=ui.get(b))&&$g(i,o),v=u.createElement("script"),Rn(v),lr(v,"link",i),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},h.set(b,v))}}function D1(i,o,u,h){var b=(b=ie.current)?Of(b):null;if(!b)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(o=Sl(u.href),u=Cr(b).hoistableStyles,h=u.get(o),h||(h={type:"style",instance:null,count:0,state:null},u.set(o,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){i=Sl(u.href);var v=Cr(b).hoistableStyles,A=v.get(i);if(A||(b=b.ownerDocument||b,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(i,A),(v=b.querySelector(sc(i)))&&!v._p&&(A.instance=v,A.state.loading=5),ui.has(i)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},ui.set(i,u),v||DD(b,i,u,A.state))),o&&h===null)throw Error(r(528,""));return A}if(o&&h!==null)throw Error(r(529,""));return null;case"script":return o=u.async,u=u.src,typeof u=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=El(u),u=Cr(b).hoistableScripts,h=u.get(o),h||(h={type:"script",instance:null,count:0,state:null},u.set(o,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Sl(i){return'href="'+ti(i)+'"'}function sc(i){return'link[rel="stylesheet"]['+i+"]"}function I1(i){return p({},i,{"data-precedence":i.precedence,precedence:null})}function DD(i,o,u,h){i.querySelector('link[rel="preload"][as="style"]['+o+"]")?h.loading=1:(o=i.createElement("link"),h.preload=o,o.addEventListener("load",function(){return h.loading|=1}),o.addEventListener("error",function(){return h.loading|=2}),lr(o,"link",u),Rn(o),i.head.appendChild(o))}function El(i){return'[src="'+ti(i)+'"]'}function lc(i){return"script[async]"+i}function P1(i,o,u){if(o.count++,o.instance===null)switch(o.type){case"style":var h=i.querySelector('style[data-href~="'+ti(u.href)+'"]');if(h)return o.instance=h,Rn(h),h;var b=p({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(i.ownerDocument||i).createElement("style"),Rn(h),lr(h,"style",b),Af(h,u.precedence,i),o.instance=h;case"stylesheet":b=Sl(u.href);var v=i.querySelector(sc(b));if(v)return o.state.loading|=4,o.instance=v,Rn(v),v;h=I1(u),(b=ui.get(b))&&qg(h,b),v=(i.ownerDocument||i).createElement("link"),Rn(v);var A=v;return A._p=new Promise(function(U,ee){A.onload=U,A.onerror=ee}),lr(v,"link",h),o.state.loading|=4,Af(v,u.precedence,i),o.instance=v;case"script":return v=El(u.src),(b=i.querySelector(lc(v)))?(o.instance=b,Rn(b),b):(h=u,(b=ui.get(v))&&(h=p({},u),$g(h,b)),i=i.ownerDocument||i,b=i.createElement("script"),Rn(b),lr(b,"link",h),i.head.appendChild(b),o.instance=b);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(h=o.instance,o.state.loading|=4,Af(h,u.precedence,i));return o.instance}function Af(i,o,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=h.length?h[h.length-1]:null,v=b,A=0;A<h.length;A++){var U=h[A];if(U.dataset.precedence===o)v=U;else if(v!==b)break}v?v.parentNode.insertBefore(i,v.nextSibling):(o=u.nodeType===9?u.head:u,o.insertBefore(i,o.firstChild))}function qg(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.title==null&&(i.title=o.title)}function $g(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.integrity==null&&(i.integrity=o.integrity)}var Nf=null;function L1(i,o,u){if(Nf===null){var h=new Map,b=Nf=new Map;b.set(u,h)}else b=Nf,h=b.get(u),h||(h=new Map,b.set(u,h));if(h.has(i))return h;for(h.set(i,null),u=u.getElementsByTagName(i),b=0;b<u.length;b++){var v=u[b];if(!(v[Mn]||v[qe]||i==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var A=v.getAttribute(o)||"";A=i+A;var U=h.get(A);U?U.push(v):h.set(A,[v])}}return h}function _1(i,o,u){i=i.ownerDocument||i,i.head.insertBefore(u,o==="title"?i.querySelector("head > title"):null)}function ID(i,o,u){if(u===1||o.itemProp!=null)return!1;switch(i){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;switch(o.rel){case"stylesheet":return i=o.disabled,typeof o.precedence=="string"&&i==null;default:return!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 j1(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function PD(i,o,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var b=Sl(h.href),v=o.querySelector(sc(b));if(v){o=v._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(i.count++,i=Df.bind(i),o.then(i,i)),u.state.loading|=4,u.instance=v,Rn(v);return}v=o.ownerDocument||o,h=I1(h),(b=ui.get(b))&&qg(h,b),v=v.createElement("link"),Rn(v);var A=v;A._p=new Promise(function(U,ee){A.onload=U,A.onerror=ee}),lr(v,"link",h),u.instance=v}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(u,o),(o=u.state.preload)&&(u.state.loading&3)===0&&(i.count++,u=Df.bind(i),o.addEventListener("load",u),o.addEventListener("error",u))}}var Yg=0;function LD(i,o){return i.stylesheets&&i.count===0&&Pf(i,i.stylesheets),0<i.count||0<i.imgCount?function(u){var h=setTimeout(function(){if(i.stylesheets&&Pf(i,i.stylesheets),i.unsuspend){var v=i.unsuspend;i.unsuspend=null,v()}},6e4+o);0<i.imgBytes&&Yg===0&&(Yg=62500*mD());var b=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Pf(i,i.stylesheets),i.unsuspend)){var v=i.unsuspend;i.unsuspend=null,v()}},(i.imgBytes>Yg?50:800)+o);return i.unsuspend=u,function(){i.unsuspend=null,clearTimeout(h),clearTimeout(b)}}:null}function Df(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Pf(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var If=null;function Pf(i,o){i.stylesheets=null,i.unsuspend!==null&&(i.count++,If=new Map,o.forEach(_D,i),If=null,Df.call(i))}function _D(i,o){if(!(o.state.loading&4)){var u=If.get(i);if(u)var h=u.get(null);else{u=new Map,If.set(i,u);for(var b=i.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<b.length;v++){var A=b[v];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(u.set(A.dataset.precedence,A),h=A)}h&&u.set(null,h)}b=o.instance,A=b.getAttribute("data-precedence"),v=u.get(A)||h,v===h&&u.set(null,b),u.set(A,b),this.count++,h=Df.bind(this),b.addEventListener("load",h),b.addEventListener("error",h),v?v.parentNode.insertBefore(b,v.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(b,i.firstChild)),o.state.loading|=4}}var uc={$$typeof:k,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function jD(i,o,u,h,b,v,A,U,ee){this.tag=1,this.containerInfo=i,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=Un(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Un(0),this.hiddenUpdates=Un(null),this.identifierPrefix=h,this.onUncaughtError=b,this.onCaughtError=v,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ee,this.incompleteTransitions=new Map}function z1(i,o,u,h,b,v,A,U,ee,pe,Te,Ne){return i=new jD(i,o,u,A,ee,pe,Te,Ne,U),o=1,v===!0&&(o|=24),v=Hr(3,null,null,o),i.current=v,v.stateNode=i,o=Cm(),o.refCount++,i.pooledCache=o,o.refCount++,v.memoizedState={element:h,isDehydrated:u,cache:o},Om(v),i}function F1(i){return i?(i=el,i):el}function B1(i,o,u,h,b,v){b=F1(b),h.context===null?h.context=b:h.pendingContext=b,h=Wa(o),h.payload={element:u},v=v===void 0?null:v,v!==null&&(h.callback=v),u=Ka(i,h,o),u!==null&&(Nr(u,i,o),Hu(u,i,o))}function H1(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<o?u:o}}function Wg(i,o){H1(i,o),(i=i.alternate)&&H1(i,o)}function U1(i){if(i.tag===13||i.tag===31){var o=Qo(i,67108864);o!==null&&Nr(o,i,67108864),Wg(i,67108864)}}function V1(i){if(i.tag===13||i.tag===31){var o=Yr();o=de(o);var u=Qo(i,o);u!==null&&Nr(u,i,o),Wg(i,o)}}var Lf=!0;function zD(i,o,u,h){var b=j.T;j.T=null;var v=z.p;try{z.p=2,Kg(i,o,u,h)}finally{z.p=v,j.T=b}}function FD(i,o,u,h){var b=j.T;j.T=null;var v=z.p;try{z.p=8,Kg(i,o,u,h)}finally{z.p=v,j.T=b}}function Kg(i,o,u,h){if(Lf){var b=Gg(h);if(b===null)Pg(i,o,h,_f,u),$1(i,h);else if(HD(b,i,o,u,h))h.stopPropagation();else if($1(i,h),o&4&&-1<BD.indexOf(i)){for(;b!==null;){var v=Gt(b);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var A=Ft(v.pendingLanes);if(A!==0){var U=v;for(U.pendingLanes|=2,U.entangledLanes|=2;A;){var ee=1<<31-st(A);U.entanglements[1]|=ee,A&=~ee}zi(v),(ln&6)===0&&(bf=te()+500,rc(0))}}break;case 31:case 13:U=Qo(v,2),U!==null&&Nr(U,v,2),xf(),Wg(v,2)}if(v=Gg(h),v===null&&Pg(i,o,h,_f,u),v===b)break;b=v}b!==null&&h.stopPropagation()}else Pg(i,o,h,null,u)}}function Gg(i){return i=Qp(i),Xg(i)}var _f=null;function Xg(i){if(_f=null,i=Nn(i),i!==null){var o=s(i);if(o===null)i=null;else{var u=o.tag;if(u===13){if(i=l(o),i!==null)return i;i=null}else if(u===31){if(i=c(o),i!==null)return i;i=null}else if(u===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null)}}return _f=i,null}function q1(i){switch(i){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(De()){case se:return 2;case ye:return 8;case we:case Me:return 32;case Fe:return 268435456;default:return 32}default:return 32}}var Qg=!1,ao=null,oo=null,so=null,cc=new Map,dc=new Map,lo=[],BD="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 $1(i,o){switch(i){case"focusin":case"focusout":ao=null;break;case"dragenter":case"dragleave":oo=null;break;case"mouseover":case"mouseout":so=null;break;case"pointerover":case"pointerout":cc.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":dc.delete(o.pointerId)}}function fc(i,o,u,h,b,v){return i===null||i.nativeEvent!==v?(i={blockedOn:o,domEventName:u,eventSystemFlags:h,nativeEvent:v,targetContainers:[b]},o!==null&&(o=Gt(o),o!==null&&U1(o)),i):(i.eventSystemFlags|=h,o=i.targetContainers,b!==null&&o.indexOf(b)===-1&&o.push(b),i)}function HD(i,o,u,h,b){switch(o){case"focusin":return ao=fc(ao,i,o,u,h,b),!0;case"dragenter":return oo=fc(oo,i,o,u,h,b),!0;case"mouseover":return so=fc(so,i,o,u,h,b),!0;case"pointerover":var v=b.pointerId;return cc.set(v,fc(cc.get(v)||null,i,o,u,h,b)),!0;case"gotpointercapture":return v=b.pointerId,dc.set(v,fc(dc.get(v)||null,i,o,u,h,b)),!0}return!1}function Y1(i){var o=Nn(i.target);if(o!==null){var u=s(o);if(u!==null){if(o=u.tag,o===13){if(o=l(u),o!==null){i.blockedOn=o,it(i.priority,function(){V1(u)});return}}else if(o===31){if(o=c(u),o!==null){i.blockedOn=o,it(i.priority,function(){V1(u)});return}}else if(o===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function jf(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var u=Gg(i.nativeEvent);if(u===null){u=i.nativeEvent;var h=new u.constructor(u.type,u);Xp=h,u.target.dispatchEvent(h),Xp=null}else return o=Gt(u),o!==null&&U1(o),i.blockedOn=u,!1;o.shift()}return!0}function W1(i,o,u){jf(i)&&u.delete(o)}function UD(){Qg=!1,ao!==null&&jf(ao)&&(ao=null),oo!==null&&jf(oo)&&(oo=null),so!==null&&jf(so)&&(so=null),cc.forEach(W1),dc.forEach(W1)}function zf(i,o){i.blockedOn===o&&(i.blockedOn=null,Qg||(Qg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,UD)))}var Ff=null;function K1(i){Ff!==i&&(Ff=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Ff===i&&(Ff=null);for(var o=0;o<i.length;o+=3){var u=i[o],h=i[o+1],b=i[o+2];if(typeof h!="function"){if(Xg(h||u)===null)continue;break}var v=Gt(u);v!==null&&(i.splice(o,3),o-=3,Gm(v,{pending:!0,data:b,method:u.method,action:h},h,b))}}))}function Tl(i){function o(ee){return zf(ee,i)}ao!==null&&zf(ao,i),oo!==null&&zf(oo,i),so!==null&&zf(so,i),cc.forEach(o),dc.forEach(o);for(var u=0;u<lo.length;u++){var h=lo[u];h.blockedOn===i&&(h.blockedOn=null)}for(;0<lo.length&&(u=lo[0],u.blockedOn===null);)Y1(u),u.blockedOn===null&&lo.shift();if(u=(i.ownerDocument||i).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var b=u[h],v=u[h+1],A=b[Ke]||null;if(typeof v=="function")A||K1(u);else if(A){var U=null;if(v&&v.hasAttribute("formAction")){if(b=v,A=v[Ke]||null)U=A.formAction;else if(Xg(b)!==null)continue}else U=A.action;typeof U=="function"?u[h+1]=U:(u.splice(h,3),h-=3),K1(u)}}}function G1(){function i(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(A){return b=A})},focusReset:"manual",scroll:"manual"})}function o(){b!==null&&(b(),b=null),h||setTimeout(u,20)}function u(){if(!h&&!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 h=!1,b=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(u,100),function(){h=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),b!==null&&(b(),b=null)}}}function Zg(i){this._internalRoot=i}Bf.prototype.render=Zg.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(r(409));var u=o.current,h=Yr();B1(u,h,i,o,null,null)},Bf.prototype.unmount=Zg.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;B1(i.current,2,null,i,null,null),xf(),o[Qe]=null}};function Bf(i){this._internalRoot=i}Bf.prototype.unstable_scheduleHydration=function(i){if(i){var o=je();i={blockedOn:null,target:i,priority:o};for(var u=0;u<lo.length&&o!==0&&o<lo[u].priority;u++);lo.splice(u,0,i),u===0&&Y1(i)}};var X1=t.version;if(X1!=="19.2.4")throw Error(r(527,X1,"19.2.4"));z.findDOMNode=function(i){var o=i._reactInternals;if(o===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=d(o),i=i!==null?m(i):null,i=i===null?null:i.stateNode,i};var VD={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Hf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hf.isDisabled&&Hf.supportsFiber)try{Ot=Hf.inject(VD),We=Hf}catch{}}return pc.createRoot=function(i,o){if(!a(i))throw Error(r(299));var u=!1,h="",b=rS,v=iS,A=aS;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(h=o.identifierPrefix),o.onUncaughtError!==void 0&&(b=o.onUncaughtError),o.onCaughtError!==void 0&&(v=o.onCaughtError),o.onRecoverableError!==void 0&&(A=o.onRecoverableError)),o=z1(i,1,!1,null,null,u,h,null,b,v,A,G1),i[Qe]=o.current,Ig(i),new Zg(o)},pc.hydrateRoot=function(i,o,u){if(!a(i))throw Error(r(299));var h=!1,b="",v=rS,A=iS,U=aS,ee=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(b=u.identifierPrefix),u.onUncaughtError!==void 0&&(v=u.onUncaughtError),u.onCaughtError!==void 0&&(A=u.onCaughtError),u.onRecoverableError!==void 0&&(U=u.onRecoverableError),u.formState!==void 0&&(ee=u.formState)),o=z1(i,1,!0,o,u??null,h,b,ee,v,A,U,G1),o.context=F1(null),u=o.current,h=Yr(),h=de(h),b=Wa(h),b.callback=null,Ka(u,b,h),u=h,o.current.lanes=u,nn(o,u),zi(o),i[Qe]=o.current,Ig(i),new Bf(o)},pc.version="19.2.4",pc}var vE;function FI(){if(vE)return ny.exports;vE=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(),ny.exports=zI(),ny.exports}var BI=FI();/**
51
+ * react-router v7.13.0
52
+ *
53
+ * Copyright (c) Remix Software Inc.
54
+ *
55
+ * This source code is licensed under the MIT license found in the
56
+ * LICENSE.md file in the root directory of this source tree.
57
+ *
58
+ * @license MIT
59
+ */var ek=e=>{throw TypeError(e)},HI=(e,t,n)=>t.has(e)||ek("Cannot "+n),oy=(e,t,n)=>(HI(e,t,"read from private field"),n?n.call(e):t.get(e)),UI=(e,t,n)=>t.has(e)?ek("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),xE="popstate";function VI(e={}){function t(r,a){let{pathname:s,search:l,hash:c}=r.location;return Qc("",{pathname:s,search:l,hash:c},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:Gi(a)}return $I(t,n,null,e)}function Lt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Kn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function qI(){return Math.random().toString(36).substring(2,10)}function wE(e,t){return{usr:e.state,key:e.key,idx:t}}function Qc(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?jo(t):t,state:n,key:t&&t.key||r||qI()}}function Gi({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function jo(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function $I(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:s=!1}=r,l=a.history,c="POP",f=null,d=m();d==null&&(d=0,l.replaceState({...l.state,idx:d},""));function m(){return(l.state||{idx:null}).idx}function p(){c="POP";let T=m(),S=T==null?null:T-d;d=T,f&&f({action:c,location:C.location,delta:S})}function y(T,S){c="PUSH";let R=Qc(C.location,T,S);d=m()+1;let k=wE(R,d),M=C.createHref(R);try{l.pushState(k,"",M)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;a.location.assign(M)}s&&f&&f({action:c,location:C.location,delta:1})}function g(T,S){c="REPLACE";let R=Qc(C.location,T,S);d=m();let k=wE(R,d),M=C.createHref(R);l.replaceState(k,"",M),s&&f&&f({action:c,location:C.location,delta:0})}function x(T){return tk(T)}let C={get action(){return c},get location(){return e(a,l)},listen(T){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(xE,p),f=T,()=>{a.removeEventListener(xE,p),f=null}},createHref(T){return t(a,T)},createURL:x,encodeLocation(T){let S=x(T);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:y,replace:g,go(T){return l.go(T)}};return C}function tk(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Lt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Gi(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Nc,SE=class{constructor(e){if(UI(this,Nc,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(oy(this,Nc).has(e))return oy(this,Nc).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){oy(this,Nc).set(e,t)}};Nc=new WeakMap;var YI=new Set(["lazy","caseSensitive","path","id","index","children"]);function WI(e){return YI.has(e)}var KI=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function GI(e){return KI.has(e)}function XI(e){return e.index===!0}function Zc(e,t,n=[],r={},a=!1){return e.map((s,l)=>{let c=[...n,String(l)],f=typeof s.id=="string"?s.id:c.join("-");if(Lt(s.index!==!0||!s.children,"Cannot specify children on an index route"),Lt(a||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),XI(s)){let d={...s,id:f};return r[f]=EE(d,t(d)),d}else{let d={...s,id:f,children:void 0};return r[f]=EE(d,t(d)),s.children&&(d.children=Zc(s.children,t,c,r,a)),d}})}function EE(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function mo(e,t,n="/"){return Dc(e,t,n,!1)}function Dc(e,t,n,r){let a=typeof t=="string"?jo(t):t,s=gi(a.pathname||"/",n);if(s==null)return null;let l=nk(e);ZI(l);let c=null;for(let f=0;c==null&&f<l.length;++f){let d=ik(s);c=sP(l[f],d,r)}return c}function QI(e,t){let{route:n,pathname:r,params:a}=e;return{id:n.id,pathname:r,params:a,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function nk(e,t=[],n=[],r="",a=!1){let s=(l,c,f=a,d)=>{let m={relativePath:d===void 0?l.path||"":d,caseSensitive:l.caseSensitive===!0,childrenIndex:c,route:l};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&f)return;Lt(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let p=Yi([r,m.relativePath]),y=n.concat(m);l.children&&l.children.length>0&&(Lt(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),nk(l.children,t,y,p,f)),!(l.path==null&&!l.index)&&t.push({path:p,score:aP(p,l.index),routesMeta:y})};return e.forEach((l,c)=>{var f;if(l.path===""||!((f=l.path)!=null&&f.includes("?")))s(l,c);else for(let d of rk(l.path))s(l,c,!0,d)}),t}function rk(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return a?[s,""]:[s];let l=rk(r.join("/")),c=[];return c.push(...l.map(f=>f===""?s:[s,f].join("/"))),a&&c.push(...l),c.map(f=>e.startsWith("/")&&f===""?"/":f)}function ZI(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:oP(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var JI=/^:[\w-]+$/,eP=3,tP=2,nP=1,rP=10,iP=-2,TE=e=>e==="*";function aP(e,t){let n=e.split("/"),r=n.length;return n.some(TE)&&(r+=iP),t&&(r+=tP),n.filter(a=>!TE(a)).reduce((a,s)=>a+(JI.test(s)?eP:s===""?nP:rP),r)}function oP(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function sP(e,t,n=!1){let{routesMeta:r}=e,a={},s="/",l=[];for(let c=0;c<r.length;++c){let f=r[c],d=c===r.length-1,m=s==="/"?t:t.slice(s.length)||"/",p=nu({path:f.relativePath,caseSensitive:f.caseSensitive,end:d},m),y=f.route;if(!p&&d&&n&&!r[r.length-1].route.index&&(p=nu({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!p)return null;Object.assign(a,p.params),l.push({params:a,pathname:Yi([s,p.pathname]),pathnameBase:dP(Yi([s,p.pathnameBase])),route:y}),p.pathnameBase!=="/"&&(s=Yi([s,p.pathnameBase]))}return l}function nu(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=lP(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let s=a[0],l=s.replace(/(.)\/+$/,"$1"),c=a.slice(1);return{params:r.reduce((d,{paramName:m,isOptional:p},y)=>{if(m==="*"){let x=c[y]||"";l=s.slice(0,s.length-x.length).replace(/(.)\/+$/,"$1")}const g=c[y];return p&&!g?d[m]=void 0:d[m]=(g||"").replace(/%2F/g,"/"),d},{}),pathname:s,pathnameBase:l,pattern:e}}function lP(e,t=!1,n=!0){Kn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,c,f)=>(r.push({paramName:c,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function ik(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Kn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function gi(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function uP({basename:e,pathname:t}){return t==="/"?e:Yi([e,t])}var ak=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,zv=e=>ak.test(e);function cP(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?jo(e):e,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=CE(n.substring(1),"/"):s=CE(n,t)):s=t,{pathname:s,search:fP(r),hash:hP(a)}}function CE(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function sy(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ok(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Fv(e){let t=ok(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Bv(e,t,n,r=!1){let a;typeof e=="string"?a=jo(e):(a={...e},Lt(!a.pathname||!a.pathname.includes("?"),sy("?","pathname","search",a)),Lt(!a.pathname||!a.pathname.includes("#"),sy("#","pathname","hash",a)),Lt(!a.search||!a.search.includes("#"),sy("#","search","hash",a)));let s=e===""||a.pathname==="",l=s?"/":a.pathname,c;if(l==null)c=n;else{let p=t.length-1;if(!r&&l.startsWith("..")){let y=l.split("/");for(;y[0]==="..";)y.shift(),p-=1;a.pathname=y.join("/")}c=p>=0?t[p]:"/"}let f=cP(a,c),d=l&&l!=="/"&&l.endsWith("/"),m=(s||l===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(d||m)&&(f.pathname+="/"),f}var Yi=e=>e.join("/").replace(/\/\/+/g,"/"),dP=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),fP=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,hP=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,pd=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Jc(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function md(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var sk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function lk(e,t){let n=e;if(typeof n!="string"||!ak.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(sk)try{let s=new URL(window.location.href),l=n.startsWith("//")?new URL(s.protocol+n):new URL(n),c=gi(l.pathname,t);l.origin===s.origin&&c!=null?n=c+l.search+l.hash:a=!0}catch{Kn(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:a,to:n}}var Ro=Symbol("Uninstrumented");function pP(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(a=>a({id:t.id,index:t.index,path:t.path,instrument(s){let l=Object.keys(n);for(let c of l)s[c]&&n[c].push(s[c])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let a=Il(n.lazy,t.lazy,()=>{});a&&(r.lazy=a)}if(typeof t.lazy=="object"){let a=t.lazy;["middleware","loader","action"].forEach(s=>{let l=a[s],c=n[`lazy.${s}`];if(typeof l=="function"&&c.length>0){let f=Il(c,l,()=>{});f&&(r.lazy=Object.assign(r.lazy||{},{[s]:f}))}})}return["loader","action"].forEach(a=>{let s=t[a];if(typeof s=="function"&&n[a].length>0){let l=s[Ro]??s,c=Il(n[a],l,(...f)=>RE(f[0]));c&&(a==="loader"&&l.hydrate===!0&&(c.hydrate=!0),c[Ro]=l,r[a]=c)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(a=>{let s=a[Ro]??a,l=Il(n.middleware,s,(...c)=>RE(c[0]));return l?(l[Ro]=s,l):a})),r}function mP(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(a){let s=Object.keys(a);for(let l of s)a[l]&&n[l].push(a[l])}})),n.navigate.length>0){let r=e.navigate[Ro]??e.navigate,a=Il(n.navigate,r,(...s)=>{let[l,c]=s;return{to:typeof l=="number"||typeof l=="string"?l:l?Gi(l):".",...kE(e,c??{})}});a&&(a[Ro]=r,e.navigate=a)}if(n.fetch.length>0){let r=e.fetch[Ro]??e.fetch,a=Il(n.fetch,r,(...s)=>{let[l,,c,f]=s;return{href:c??".",fetcherKey:l,...kE(e,f??{})}});a&&(a[Ro]=r,e.fetch=a)}return e}function Il(e,t,n){return e.length===0?null:async(...r)=>{let a=await uk(e,n(...r),()=>t(...r),e.length-1);if(a.type==="error")throw a.value;return a.value}}async function uk(e,t,n,r){let a=e[r],s;if(a){let l,c=async()=>(l?console.error("You cannot call instrumented handlers more than once"):l=uk(e,t,n,r-1),s=await l,Lt(s,"Expected a result"),s.type==="error"&&s.value instanceof Error?{status:"error",error:s.value}:{status:"success",error:void 0});try{await a(c,t)}catch(f){console.error("An instrumentation function threw an error:",f)}l||await c(),await l}else try{s={type:"success",value:await n()}}catch(l){s={type:"error",value:l}}return s||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function RE(e){let{request:t,context:n,params:r,unstable_pattern:a}=e;return{request:gP(t),params:{...r},unstable_pattern:a,context:yP(n)}}function kE(e,t){return{currentUrl:Gi(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function gP(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function yP(e){if(vP(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var bP=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function vP(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===bP}var ck=["POST","PUT","PATCH","DELETE"],xP=new Set(ck),wP=["GET",...ck],SP=new Set(wP),dk=new Set([301,302,303,307,308]),EP=new Set([307,308]),ly={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},TP={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},mc={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},CP=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),fk="remix-router-transitions",hk=Symbol("ResetLoaderData");function RP(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";Lt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],a=e.mapRouteProperties||CP,s=a;if(e.unstable_instrumentations){let X=e.unstable_instrumentations;s=ae=>({...a(ae),...pP(X.map(de=>de.route).filter(Boolean),ae)})}let l={},c=Zc(e.routes,s,void 0,l),f,d=e.basename||"/";d.startsWith("/")||(d=`/${d}`);let m=e.dataStrategy||NP,p={...e.future},y=null,g=new Set,x=null,C=null,T=null,S=e.hydrationData!=null,R=mo(c,e.history.location,d),k=!1,M=null,D;if(R==null&&!e.patchRoutesOnNavigation){let X=di(404,{pathname:e.history.location.pathname}),{matches:ae,route:de}=qf(c);D=!0,R=ae,M={[de.id]:X}}else if(R&&!e.hydrationData&&tn(R,c,e.history.location.pathname).active&&(R=null),R)if(R.some(X=>X.route.lazy))D=!1;else if(!R.some(X=>Hv(X.route)))D=!0;else{let X=e.hydrationData?e.hydrationData.loaderData:null,ae=e.hydrationData?e.hydrationData.errors:null;if(ae){let de=R.findIndex(ke=>ae[ke.route.id]!==void 0);D=R.slice(0,de+1).every(ke=>!Tb(ke.route,X,ae))}else D=R.every(de=>!Tb(de.route,X,ae))}else{D=!1,R=[];let X=tn(null,c,e.history.location.pathname);X.active&&X.matches&&(k=!0,R=X.matches)}let O,N={historyAction:e.history.action,location:e.history.location,matches:R,initialized:D,navigation:ly,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||M,fetchers:new Map,blockers:new Map},_="POP",$=null,F=!1,W,L=!1,V=new Map,q=null,Y=!1,j=!1,z=new Set,H=new Map,K=0,P=-1,B=new Map,G=new Set,I=new Map,Q=new Map,Z=new Set,ie=new Map,ce,ge=null;function Ee(){if(y=e.history.listen(({action:X,location:ae,delta:de})=>{if(ce){ce(),ce=void 0;return}Kn(ie.size===0||de!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ke=Je({currentLocation:N.location,nextLocation:ae,historyAction:X});if(ke&&de!=null){let je=new Promise(it=>{ce=it});e.history.go(de*-1),Rt(ke,{state:"blocked",location:ae,proceed(){Rt(ke,{state:"proceeding",proceed:void 0,reset:void 0,location:ae}),je.then(()=>e.history.go(de))},reset(){let it=new Map(N.blockers);it.set(ke,mc),re({blockers:it})}}),$==null||$.resolve(),$=null;return}return Ae(X,ae)}),n){GP(t,V);let X=()=>XP(t,V);t.addEventListener("pagehide",X),q=()=>t.removeEventListener("pagehide",X)}return N.initialized||Ae("POP",N.location,{initialHydration:!0}),O}function _e(){y&&y(),q&&q(),g.clear(),W&&W.abort(),N.fetchers.forEach((X,ae)=>bt(ae)),N.blockers.forEach((X,ae)=>gt(ae))}function Ie(X){return g.add(X),()=>g.delete(X)}function re(X,ae={}){X.matches&&(X.matches=X.matches.map(je=>{let it=l[je.route.id],et=je.route;return et.element!==it.element||et.errorElement!==it.errorElement||et.hydrateFallbackElement!==it.hydrateFallbackElement?{...je,route:it}:je})),N={...N,...X};let de=[],ke=[];N.fetchers.forEach((je,it)=>{je.state==="idle"&&(Z.has(it)?de.push(it):ke.push(it))}),Z.forEach(je=>{!N.fetchers.has(je)&&!H.has(je)&&de.push(je)}),[...g].forEach(je=>je(N,{deletedFetchers:de,newErrors:X.errors??null,viewTransitionOpts:ae.viewTransitionOpts,flushSync:ae.flushSync===!0})),de.forEach(je=>bt(je)),ke.forEach(je=>N.fetchers.delete(je))}function he(X,ae,{flushSync:de}={}){var vt,lt;let ke=N.actionData!=null&&N.navigation.formMethod!=null&&hr(N.navigation.formMethod)&&N.navigation.state==="loading"&&((vt=X.state)==null?void 0:vt._isRedirect)!==!0,je;ae.actionData?Object.keys(ae.actionData).length>0?je=ae.actionData:je=null:ke?je=N.actionData:je=null;let it=ae.loaderData?jE(N.loaderData,ae.loaderData,ae.matches||[],ae.errors):N.loaderData,et=N.blockers;et.size>0&&(et=new Map(et),et.forEach((Mt,Ut)=>et.set(Ut,mc)));let qe=Y?!1:cn(X,ae.matches||N.matches),Ke=F===!0||N.navigation.formMethod!=null&&hr(N.navigation.formMethod)&&((lt=X.state)==null?void 0:lt._isRedirect)!==!0;f&&(c=f,f=void 0),Y||_==="POP"||(_==="PUSH"?e.history.push(X,X.state):_==="REPLACE"&&e.history.replace(X,X.state));let Qe;if(_==="POP"){let Mt=V.get(N.location.pathname);Mt&&Mt.has(X.pathname)?Qe={currentLocation:N.location,nextLocation:X}:V.has(X.pathname)&&(Qe={currentLocation:X,nextLocation:N.location})}else if(L){let Mt=V.get(N.location.pathname);Mt?Mt.add(X.pathname):(Mt=new Set([X.pathname]),V.set(N.location.pathname,Mt)),Qe={currentLocation:N.location,nextLocation:X}}re({...ae,actionData:je,loaderData:it,historyAction:_,location:X,initialized:!0,navigation:ly,revalidation:"idle",restoreScrollPosition:qe,preventScrollReset:Ke,blockers:et},{viewTransitionOpts:Qe,flushSync:de===!0}),_="POP",F=!1,L=!1,Y=!1,j=!1,$==null||$.resolve(),$=null,ge==null||ge.resolve(),ge=null}async function be(X,ae){if($==null||$.resolve(),$=null,typeof X=="number"){$||($=HE());let Ut=$.promise;return e.history.go(X),Ut}let de=Eb(N.location,N.matches,d,X,ae==null?void 0:ae.fromRouteId,ae==null?void 0:ae.relative),{path:ke,submission:je,error:it}=ME(!1,de,ae),et=N.location,qe=Qc(N.location,ke,ae&&ae.state);qe={...qe,...e.history.encodeLocation(qe)};let Ke=ae&&ae.replace!=null?ae.replace:void 0,Qe="PUSH";Ke===!0?Qe="REPLACE":Ke===!1||je!=null&&hr(je.formMethod)&&je.formAction===N.location.pathname+N.location.search&&(Qe="REPLACE");let vt=ae&&"preventScrollReset"in ae?ae.preventScrollReset===!0:void 0,lt=(ae&&ae.flushSync)===!0,Mt=Je({currentLocation:et,nextLocation:qe,historyAction:Qe});if(Mt){Rt(Mt,{state:"blocked",location:qe,proceed(){Rt(Mt,{state:"proceeding",proceed:void 0,reset:void 0,location:qe}),be(X,ae)},reset(){let Ut=new Map(N.blockers);Ut.set(Mt,mc),re({blockers:Ut})}});return}await Ae(Qe,qe,{submission:je,pendingError:it,preventScrollReset:vt,replace:ae&&ae.replace,enableViewTransition:ae&&ae.viewTransition,flushSync:lt,callSiteDefaultShouldRevalidate:ae&&ae.unstable_defaultShouldRevalidate})}function Pe(){ge||(ge=HE()),ye(),re({revalidation:"loading"});let X=ge.promise;return N.navigation.state==="submitting"?X:N.navigation.state==="idle"?(Ae(N.historyAction,N.location,{startUninterruptedRevalidation:!0}),X):(Ae(_||N.historyAction,N.navigation.location,{overrideNavigation:N.navigation,enableViewTransition:L===!0}),X)}async function Ae(X,ae,de){W&&W.abort(),W=null,_=X,Y=(de&&de.startUninterruptedRevalidation)===!0,Bt(N.location,N.matches),F=(de&&de.preventScrollReset)===!0,L=(de&&de.enableViewTransition)===!0;let ke=f||c,je=de&&de.overrideNavigation,it=de!=null&&de.initialHydration&&N.matches&&N.matches.length>0&&!k?N.matches:mo(ke,ae,d),et=(de&&de.flushSync)===!0;if(it&&N.initialized&&!j&&FP(N.location,ae)&&!(de&&de.submission&&hr(de.submission.formMethod))){he(ae,{matches:it},{flushSync:et});return}let qe=tn(it,ke,ae.pathname);if(qe.active&&qe.matches&&(it=qe.matches),!it){let{error:An,notFoundMatches:Nn,route:Gt}=kt(ae.pathname);he(ae,{matches:Nn,loaderData:{},errors:{[Gt.id]:An}},{flushSync:et});return}W=new AbortController;let Ke=Al(e.history,ae,W.signal,de&&de.submission),Qe=e.getContext?await e.getContext():new SE,vt;if(de&&de.pendingError)vt=[go(it).route.id,{type:"error",error:de.pendingError}];else if(de&&de.submission&&hr(de.submission.formMethod)){let An=await Se(Ke,ae,de.submission,it,Qe,qe.active,de&&de.initialHydration===!0,{replace:de.replace,flushSync:et});if(An.shortCircuited)return;if(An.pendingActionResult){let[Nn,Gt]=An.pendingActionResult;if(Kr(Gt)&&Jc(Gt.error)&&Gt.error.status===404){W=null,he(ae,{matches:An.matches,loaderData:{},errors:{[Nn]:Gt.error}});return}}it=An.matches||it,vt=An.pendingActionResult,je=uy(ae,de.submission),et=!1,qe.active=!1,Ke=Al(e.history,Ke.url,Ke.signal)}let{shortCircuited:lt,matches:Mt,loaderData:Ut,errors:Mn}=await Ce(Ke,ae,it,Qe,qe.active,je,de&&de.submission,de&&de.fetcherSubmission,de&&de.replace,de&&de.initialHydration===!0,et,vt,de&&de.callSiteDefaultShouldRevalidate);lt||(W=null,he(ae,{matches:Mt||it,...zE(vt),loaderData:Ut,errors:Mn}))}async function Se(X,ae,de,ke,je,it,et,qe={}){ye();let Ke=WP(ae,de);if(re({navigation:Ke},{flushSync:qe.flushSync===!0}),it){let lt=await Un(ke,ae.pathname,X.signal);if(lt.type==="aborted")return{shortCircuited:!0};if(lt.type==="error"){if(lt.partialMatches.length===0){let{matches:Ut,route:Mn}=qf(c);return{matches:Ut,pendingActionResult:[Mn.id,{type:"error",error:lt.error}]}}let Mt=go(lt.partialMatches).route.id;return{matches:lt.partialMatches,pendingActionResult:[Mt,{type:"error",error:lt.error}]}}else if(lt.matches)ke=lt.matches;else{let{notFoundMatches:Mt,error:Ut,route:Mn}=kt(ae.pathname);return{matches:Mt,pendingActionResult:[Mn.id,{type:"error",error:Ut}]}}}let Qe,vt=yh(ke,ae);if(!vt.route.action&&!vt.route.lazy)Qe={type:"error",error:di(405,{method:X.method,pathname:ae.pathname,routeId:vt.route.id})};else{let lt=Ll(s,l,X,ke,vt,et?[]:r,je),Mt=await De(X,lt,je,null);if(Qe=Mt[vt.route.id],!Qe){for(let Ut of ke)if(Mt[Ut.route.id]){Qe=Mt[Ut.route.id];break}}if(X.signal.aborted)return{shortCircuited:!0}}if(gs(Qe)){let lt;return qe&&qe.replace!=null?lt=qe.replace:lt=PE(Qe.response.headers.get("Location"),new URL(X.url),d,e.history)===N.location.pathname+N.location.search,await te(X,Qe,!0,{submission:de,replace:lt}),{shortCircuited:!0}}if(Kr(Qe)){let lt=go(ke,vt.route.id);return(qe&&qe.replace)!==!0&&(_="PUSH"),{matches:ke,pendingActionResult:[lt.route.id,Qe,vt.route.id]}}return{matches:ke,pendingActionResult:[vt.route.id,Qe]}}async function Ce(X,ae,de,ke,je,it,et,qe,Ke,Qe,vt,lt,Mt){let Ut=it||uy(ae,et),Mn=et||qe||BE(Ut),An=!Y&&!Qe;if(je){if(An){let zn=J(lt);re({navigation:Ut,...zn!==void 0?{actionData:zn}:{}},{flushSync:vt})}let Xt=await Un(de,ae.pathname,X.signal);if(Xt.type==="aborted")return{shortCircuited:!0};if(Xt.type==="error"){if(Xt.partialMatches.length===0){let{matches:Si,route:ir}=qf(c);return{matches:Si,loaderData:{},errors:{[ir.id]:Xt.error}}}let zn=go(Xt.partialMatches).route.id;return{matches:Xt.partialMatches,loaderData:{},errors:{[zn]:Xt.error}}}else if(Xt.matches)de=Xt.matches;else{let{error:zn,notFoundMatches:Si,route:ir}=kt(ae.pathname);return{matches:Si,loaderData:{},errors:{[ir.id]:zn}}}}let Nn=f||c,{dsMatches:Gt,revalidatingFetchers:er}=OE(X,ke,s,l,e.history,N,de,Mn,ae,Qe?[]:r,Qe===!0,j,z,Z,I,G,Nn,d,e.patchRoutesOnNavigation!=null,lt,Mt);if(P=++K,!e.dataStrategy&&!Gt.some(Xt=>Xt.shouldLoad)&&!Gt.some(Xt=>Xt.route.middleware&&Xt.route.middleware.length>0)&&er.length===0){let Xt=st();return he(ae,{matches:de,loaderData:{},errors:lt&&Kr(lt[1])?{[lt[0]]:lt[1].error}:null,...zE(lt),...Xt?{fetchers:new Map(N.fetchers)}:{}},{flushSync:vt}),{shortCircuited:!0}}if(An){let Xt={};if(!je){Xt.navigation=Ut;let zn=J(lt);zn!==void 0&&(Xt.actionData=zn)}er.length>0&&(Xt.fetchers=Re(er)),re(Xt,{flushSync:vt})}er.forEach(Xt=>{We(Xt.key),Xt.controller&&H.set(Xt.key,Xt.controller)});let Cr=()=>er.forEach(Xt=>We(Xt.key));W&&W.signal.addEventListener("abort",Cr);let{loaderResults:Rn,fetcherResults:xi}=await se(Gt,er,X,ke);if(X.signal.aborted)return{shortCircuited:!0};W&&W.signal.removeEventListener("abort",Cr),er.forEach(Xt=>H.delete(Xt.key));let Fr=$f(Rn);if(Fr)return await te(X,Fr.result,!0,{replace:Ke}),{shortCircuited:!0};if(Fr=$f(xi),Fr)return G.add(Fr.key),await te(X,Fr.result,!0,{replace:Ke}),{shortCircuited:!0};let{loaderData:wi,errors:ei}=_E(N,de,Rn,lt,er,xi);Qe&&N.errors&&(ei={...N.errors,...ei});let ra=st(),$o=jt(P),Yo=ra||$o||er.length>0;return{matches:de,loaderData:wi,errors:ei,...Yo?{fetchers:new Map(N.fetchers)}:{}}}function J(X){if(X&&!Kr(X[1]))return{[X[0]]:X[1].data};if(N.actionData)return Object.keys(N.actionData).length===0?null:N.actionData}function Re(X){return X.forEach(ae=>{let de=N.fetchers.get(ae.key),ke=gc(void 0,de?de.data:void 0);N.fetchers.set(ae.key,ke)}),new Map(N.fetchers)}async function xe(X,ae,de,ke){We(X);let je=(ke&&ke.flushSync)===!0,it=f||c,et=Eb(N.location,N.matches,d,de,ae,ke==null?void 0:ke.relative),qe=mo(it,et,d),Ke=tn(qe,it,et);if(Ke.active&&Ke.matches&&(qe=Ke.matches),!qe){Me(X,ae,di(404,{pathname:et}),{flushSync:je});return}let{path:Qe,submission:vt,error:lt}=ME(!0,et,ke);if(lt){Me(X,ae,lt,{flushSync:je});return}let Mt=e.getContext?await e.getContext():new SE,Ut=(ke&&ke.preventScrollReset)===!0;if(vt&&hr(vt.formMethod)){await Be(X,ae,Qe,qe,Mt,Ke.active,je,Ut,vt,ke&&ke.unstable_defaultShouldRevalidate);return}I.set(X,{routeId:ae,path:Qe}),await $e(X,ae,Qe,qe,Mt,Ke.active,je,Ut,vt)}async function Be(X,ae,de,ke,je,it,et,qe,Ke,Qe){ye(),I.delete(X);let vt=N.fetchers.get(X);we(X,KP(Ke,vt),{flushSync:et});let lt=new AbortController,Mt=Al(e.history,de,lt.signal,Ke);if(it){let Qt=await Un(ke,new URL(Mt.url).pathname,Mt.signal,X);if(Qt.type==="aborted")return;if(Qt.type==="error"){Me(X,ae,Qt.error,{flushSync:et});return}else if(Qt.matches)ke=Qt.matches;else{Me(X,ae,di(404,{pathname:de}),{flushSync:et});return}}let Ut=yh(ke,de);if(!Ut.route.action&&!Ut.route.lazy){let Qt=di(405,{method:Ke.formMethod,pathname:de,routeId:ae});Me(X,ae,Qt,{flushSync:et});return}H.set(X,lt);let Mn=K,An=Ll(s,l,Mt,ke,Ut,r,je),Nn=await De(Mt,An,je,X),Gt=Nn[Ut.route.id];if(!Gt){for(let Qt of An)if(Nn[Qt.route.id]){Gt=Nn[Qt.route.id];break}}if(Mt.signal.aborted){H.get(X)===lt&&H.delete(X);return}if(Z.has(X)){if(gs(Gt)||Kr(Gt)){we(X,Ea(void 0));return}}else{if(gs(Gt))if(H.delete(X),P>Mn){we(X,Ea(void 0));return}else return G.add(X),we(X,gc(Ke)),te(Mt,Gt,!1,{fetcherSubmission:Ke,preventScrollReset:qe});if(Kr(Gt)){Me(X,ae,Gt.error);return}}let er=N.navigation.location||N.location,Cr=Al(e.history,er,lt.signal),Rn=f||c,xi=N.navigation.state!=="idle"?mo(Rn,N.navigation.location,d):N.matches;Lt(xi,"Didn't find any matches after fetcher action");let Fr=++K;B.set(X,Fr);let wi=gc(Ke,Gt.data);N.fetchers.set(X,wi);let{dsMatches:ei,revalidatingFetchers:ra}=OE(Cr,je,s,l,e.history,N,xi,Ke,er,r,!1,j,z,Z,I,G,Rn,d,e.patchRoutesOnNavigation!=null,[Ut.route.id,Gt],Qe);ra.filter(Qt=>Qt.key!==X).forEach(Qt=>{let Wo=Qt.key,Ad=N.fetchers.get(Wo),Cu=gc(void 0,Ad?Ad.data:void 0);N.fetchers.set(Wo,Cu),We(Wo),Qt.controller&&H.set(Wo,Qt.controller)}),re({fetchers:new Map(N.fetchers)});let $o=()=>ra.forEach(Qt=>We(Qt.key));lt.signal.addEventListener("abort",$o);let{loaderResults:Yo,fetcherResults:Xt}=await se(ei,ra,Cr,je);if(lt.signal.aborted)return;if(lt.signal.removeEventListener("abort",$o),B.delete(X),H.delete(X),ra.forEach(Qt=>H.delete(Qt.key)),N.fetchers.has(X)){let Qt=Ea(Gt.data);N.fetchers.set(X,Qt)}let zn=$f(Yo);if(zn)return te(Cr,zn.result,!1,{preventScrollReset:qe});if(zn=$f(Xt),zn)return G.add(zn.key),te(Cr,zn.result,!1,{preventScrollReset:qe});let{loaderData:Si,errors:ir}=_E(N,xi,Yo,void 0,ra,Xt);jt(Fr),N.navigation.state==="loading"&&Fr>P?(Lt(_,"Expected pending action"),W&&W.abort(),he(N.navigation.location,{matches:xi,loaderData:Si,errors:ir,fetchers:new Map(N.fetchers)})):(re({errors:ir,loaderData:jE(N.loaderData,Si,xi,ir),fetchers:new Map(N.fetchers)}),j=!1)}async function $e(X,ae,de,ke,je,it,et,qe,Ke){let Qe=N.fetchers.get(X);we(X,gc(Ke,Qe?Qe.data:void 0),{flushSync:et});let vt=new AbortController,lt=Al(e.history,de,vt.signal);if(it){let Gt=await Un(ke,new URL(lt.url).pathname,lt.signal,X);if(Gt.type==="aborted")return;if(Gt.type==="error"){Me(X,ae,Gt.error,{flushSync:et});return}else if(Gt.matches)ke=Gt.matches;else{Me(X,ae,di(404,{pathname:de}),{flushSync:et});return}}let Mt=yh(ke,de);H.set(X,vt);let Ut=K,Mn=Ll(s,l,lt,ke,Mt,r,je),Nn=(await De(lt,Mn,je,X))[Mt.route.id];if(H.get(X)===vt&&H.delete(X),!lt.signal.aborted){if(Z.has(X)){we(X,Ea(void 0));return}if(gs(Nn))if(P>Ut){we(X,Ea(void 0));return}else{G.add(X),await te(lt,Nn,!1,{preventScrollReset:qe});return}if(Kr(Nn)){Me(X,ae,Nn.error);return}we(X,Ea(Nn.data))}}async function te(X,ae,de,{submission:ke,fetcherSubmission:je,preventScrollReset:it,replace:et}={}){de||($==null||$.resolve(),$=null),ae.response.headers.has("X-Remix-Revalidate")&&(j=!0);let qe=ae.response.headers.get("Location");Lt(qe,"Expected a Location header on the redirect Response"),qe=PE(qe,new URL(X.url),d,e.history);let Ke=Qc(N.location,qe,{_isRedirect:!0});if(n){let Mn=!1;if(ae.response.headers.has("X-Remix-Reload-Document"))Mn=!0;else if(zv(qe)){const An=tk(qe,!0);Mn=An.origin!==t.location.origin||gi(An.pathname,d)==null}if(Mn){et?t.location.replace(qe):t.location.assign(qe);return}}W=null;let Qe=et===!0||ae.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:vt,formAction:lt,formEncType:Mt}=N.navigation;!ke&&!je&&vt&&lt&&Mt&&(ke=BE(N.navigation));let Ut=ke||je;if(EP.has(ae.response.status)&&Ut&&hr(Ut.formMethod))await Ae(Qe,Ke,{submission:{...Ut,formAction:qe},preventScrollReset:it||F,enableViewTransition:de?L:void 0});else{let Mn=uy(Ke,ke);await Ae(Qe,Ke,{overrideNavigation:Mn,fetcherSubmission:je,preventScrollReset:it||F,enableViewTransition:de?L:void 0})}}async function De(X,ae,de,ke){var et;let je,it={};try{je=await IP(m,X,ae,ke,de,!1)}catch(qe){return ae.filter(Ke=>Ke.shouldLoad).forEach(Ke=>{it[Ke.route.id]={type:"error",error:qe}}),it}if(X.signal.aborted)return it;if(!hr(X.method))for(let qe of ae){if(((et=je[qe.route.id])==null?void 0:et.type)==="error")break;!je.hasOwnProperty(qe.route.id)&&!N.loaderData.hasOwnProperty(qe.route.id)&&(!N.errors||!N.errors.hasOwnProperty(qe.route.id))&&qe.shouldCallHandler()&&(je[qe.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${qe.route.id}`)})}for(let[qe,Ke]of Object.entries(je))if(VP(Ke)){let Qe=Ke.result;it[qe]={type:"redirect",response:jP(Qe,X,qe,ae,d)}}else it[qe]=await _P(Ke);return it}async function se(X,ae,de,ke){let je=De(de,X,ke,null),it=Promise.all(ae.map(async Ke=>{if(Ke.matches&&Ke.match&&Ke.request&&Ke.controller){let vt=(await De(Ke.request,Ke.matches,ke,Ke.key))[Ke.match.route.id];return{[Ke.key]:vt}}else return Promise.resolve({[Ke.key]:{type:"error",error:di(404,{pathname:Ke.path})}})})),et=await je,qe=(await it).reduce((Ke,Qe)=>Object.assign(Ke,Qe),{});return{loaderResults:et,fetcherResults:qe}}function ye(){j=!0,I.forEach((X,ae)=>{H.has(ae)&&z.add(ae),We(ae)})}function we(X,ae,de={}){N.fetchers.set(X,ae),re({fetchers:new Map(N.fetchers)},{flushSync:(de&&de.flushSync)===!0})}function Me(X,ae,de,ke={}){let je=go(N.matches,ae);bt(X),re({errors:{[je.route.id]:de},fetchers:new Map(N.fetchers)},{flushSync:(ke&&ke.flushSync)===!0})}function Fe(X){return Q.set(X,(Q.get(X)||0)+1),Z.has(X)&&Z.delete(X),N.fetchers.get(X)||TP}function ct(X,ae){We(X,ae==null?void 0:ae.reason),we(X,Ea(null))}function bt(X){let ae=N.fetchers.get(X);H.has(X)&&!(ae&&ae.state==="loading"&&B.has(X))&&We(X),I.delete(X),B.delete(X),G.delete(X),Z.delete(X),z.delete(X),N.fetchers.delete(X)}function Ot(X){let ae=(Q.get(X)||0)-1;ae<=0?(Q.delete(X),Z.add(X)):Q.set(X,ae),re({fetchers:new Map(N.fetchers)})}function We(X,ae){let de=H.get(X);de&&(de.abort(ae),H.delete(X))}function ot(X){for(let ae of X){let de=Fe(ae),ke=Ea(de.data);N.fetchers.set(ae,ke)}}function st(){let X=[],ae=!1;for(let de of G){let ke=N.fetchers.get(de);Lt(ke,`Expected fetcher: ${de}`),ke.state==="loading"&&(G.delete(de),X.push(de),ae=!0)}return ot(X),ae}function jt(X){let ae=[];for(let[de,ke]of B)if(ke<X){let je=N.fetchers.get(de);Lt(je,`Expected fetcher: ${de}`),je.state==="loading"&&(We(de),B.delete(de),ae.push(de))}return ot(ae),ae.length>0}function zt(X,ae){let de=N.blockers.get(X)||mc;return ie.get(X)!==ae&&ie.set(X,ae),de}function gt(X){N.blockers.delete(X),ie.delete(X)}function Rt(X,ae){let de=N.blockers.get(X)||mc;Lt(de.state==="unblocked"&&ae.state==="blocked"||de.state==="blocked"&&ae.state==="blocked"||de.state==="blocked"&&ae.state==="proceeding"||de.state==="blocked"&&ae.state==="unblocked"||de.state==="proceeding"&&ae.state==="unblocked",`Invalid blocker state transition: ${de.state} -> ${ae.state}`);let ke=new Map(N.blockers);ke.set(X,ae),re({blockers:ke})}function Je({currentLocation:X,nextLocation:ae,historyAction:de}){if(ie.size===0)return;ie.size>1&&Kn(!1,"A router only supports one blocker at a time");let ke=Array.from(ie.entries()),[je,it]=ke[ke.length-1],et=N.blockers.get(je);if(!(et&&et.state==="proceeding")&&it({currentLocation:X,nextLocation:ae,historyAction:de}))return je}function kt(X){let ae=di(404,{pathname:X}),de=f||c,{matches:ke,route:je}=qf(de);return{notFoundMatches:ke,route:je,error:ae}}function Ft(X,ae,de){if(x=X,T=ae,C=de||null,!S&&N.navigation===ly){S=!0;let ke=cn(N.location,N.matches);ke!=null&&re({restoreScrollPosition:ke})}return()=>{x=null,T=null,C=null}}function Xe(X,ae){return C&&C(X,ae.map(ke=>QI(ke,N.loaderData)))||X.key}function Bt(X,ae){if(x&&T){let de=Xe(X,ae);x[de]=T()}}function cn(X,ae){if(x){let de=Xe(X,ae),ke=x[de];if(typeof ke=="number")return ke}return null}function tn(X,ae,de){if(e.patchRoutesOnNavigation)if(X){if(Object.keys(X[0].params).length>0)return{active:!0,matches:Dc(ae,de,d,!0)}}else return{active:!0,matches:Dc(ae,de,d,!0)||[]};return{active:!1,matches:null}}async function Un(X,ae,de,ke){if(!e.patchRoutesOnNavigation)return{type:"success",matches:X};let je=X;for(;;){let it=f==null,et=f||c,qe=l;try{await e.patchRoutesOnNavigation({signal:de,path:ae,matches:je,fetcherKey:ke,patch:(vt,lt)=>{de.aborted||AE(vt,lt,et,qe,s,!1)}})}catch(vt){return{type:"error",error:vt,partialMatches:je}}finally{it&&!de.aborted&&(c=[...c])}if(de.aborted)return{type:"aborted"};let Ke=mo(et,ae,d),Qe=null;if(Ke){if(Object.keys(Ke[0].params).length===0)return{type:"success",matches:Ke};if(Qe=Dc(et,ae,d,!0),!(Qe&&je.length<Qe.length&&nn(je,Qe.slice(0,je.length))))return{type:"success",matches:Ke}}if(Qe||(Qe=Dc(et,ae,d,!0)),!Qe||nn(je,Qe))return{type:"success",matches:null};je=Qe}}function nn(X,ae){return X.length===ae.length&&X.every((de,ke)=>de.route.id===ae[ke].route.id)}function ft(X){l={},f=Zc(X,s,void 0,l)}function Ht(X,ae,de=!1){let ke=f==null;AE(X,ae,f||c,l,s,de),ke&&(c=[...c],re({}))}return O={get basename(){return d},get future(){return p},get state(){return N},get routes(){return c},get window(){return t},initialize:Ee,subscribe:Ie,enableScrollRestoration:Ft,navigate:be,fetch:xe,revalidate:Pe,createHref:X=>e.history.createHref(X),encodeLocation:X=>e.history.encodeLocation(X),getFetcher:Fe,resetFetcher:ct,deleteFetcher:Ot,dispose:_e,getBlocker:zt,deleteBlocker:gt,patchRoutes:Ht,_internalFetchControllers:H,_internalSetRoutes:ft,_internalSetStateDoNotUseOrYouWillBreakYourApp(X){re(X)}},e.unstable_instrumentations&&(O=mP(O,e.unstable_instrumentations.map(X=>X.router).filter(Boolean))),O}function kP(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Eb(e,t,n,r,a,s){let l,c;if(a){l=[];for(let d of t)if(l.push(d),d.route.id===a){c=d;break}}else l=t,c=t[t.length-1];let f=Bv(r||".",Fv(l),gi(e.pathname,n)||e.pathname,s==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&c){let d=Vv(f.search);if(c.route.index&&!d)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&d){let m=new URLSearchParams(f.search),p=m.getAll("index");m.delete("index"),p.filter(g=>g).forEach(g=>m.append("index",g));let y=m.toString();f.search=y?`?${y}`:""}}return n!=="/"&&(f.pathname=uP({basename:n,pathname:f.pathname})),Gi(f)}function ME(e,t,n){if(!n||!kP(n))return{path:t};if(n.formMethod&&!YP(n.formMethod))return{path:t,error:di(405,{method:n.formMethod})};let r=()=>({path:t,error:di(400,{type:"invalid-body"})}),s=(n.formMethod||"get").toUpperCase(),l=vk(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!hr(s))return r();let p=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((y,[g,x])=>`${y}${g}=${x}
60
+ `,""):String(n.body);return{path:t,submission:{formMethod:s,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:p}}}else if(n.formEncType==="application/json"){if(!hr(s))return r();try{let p=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:s,formAction:l,formEncType:n.formEncType,formData:void 0,json:p,text:void 0}}}catch{return r()}}}Lt(typeof FormData=="function","FormData is not available in this environment");let c,f;if(n.formData)c=Rb(n.formData),f=n.formData;else if(n.body instanceof FormData)c=Rb(n.body),f=n.body;else if(n.body instanceof URLSearchParams)c=n.body,f=LE(c);else if(n.body==null)c=new URLSearchParams,f=new FormData;else try{c=new URLSearchParams(n.body),f=LE(c)}catch{return r()}let d={formMethod:s,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(hr(d.formMethod))return{path:t,submission:d};let m=jo(t);return e&&m.search&&Vv(m.search)&&c.append("index",""),m.search=`?${c}`,{path:Gi(m),submission:d}}function OE(e,t,n,r,a,s,l,c,f,d,m,p,y,g,x,C,T,S,R,k,M){var Y;let D=k?Kr(k[1])?k[1].error:k[1].data:void 0,O=a.createURL(s.location),N=a.createURL(f),_;if(m&&s.errors){let j=Object.keys(s.errors)[0];_=l.findIndex(z=>z.route.id===j)}else if(k&&Kr(k[1])){let j=k[0];_=l.findIndex(z=>z.route.id===j)-1}let $=k?k[1].statusCode:void 0,F=$&&$>=400,W={currentUrl:O,currentParams:((Y=s.matches[0])==null?void 0:Y.params)||{},nextUrl:N,nextParams:l[0].params,...c,actionResult:D,actionStatus:$},L=md(l),V=l.map((j,z)=>{let{route:H}=j,K=null;if(_!=null&&z>_?K=!1:H.lazy?K=!0:Hv(H)?m?K=Tb(H,s.loaderData,s.errors):MP(s.loaderData,s.matches[z],j)&&(K=!0):K=!1,K!==null)return Cb(n,r,e,L,j,d,t,K);let P=!1;typeof M=="boolean"?P=M:F?P=!1:(p||O.pathname+O.search===N.pathname+N.search||O.search!==N.search||OP(s.matches[z],j))&&(P=!0);let B={...W,defaultShouldRevalidate:P},G=_c(j,B);return Cb(n,r,e,L,j,d,t,G,B,M)}),q=[];return x.forEach((j,z)=>{if(m||!l.some(Z=>Z.route.id===j.routeId)||g.has(z))return;let H=s.fetchers.get(z),K=H&&H.state!=="idle"&&H.data===void 0,P=mo(T,j.path,S);if(!P){if(R&&K)return;q.push({key:z,routeId:j.routeId,path:j.path,matches:null,match:null,request:null,controller:null});return}if(C.has(z))return;let B=yh(P,j.path),G=new AbortController,I=Al(a,j.path,G.signal),Q=null;if(y.has(z))y.delete(z),Q=Ll(n,r,I,P,B,d,t);else if(K)p&&(Q=Ll(n,r,I,P,B,d,t));else{let Z;typeof M=="boolean"?Z=M:F?Z=!1:Z=p;let ie={...W,defaultShouldRevalidate:Z};_c(B,ie)&&(Q=Ll(n,r,I,P,B,d,t,ie))}Q&&q.push({key:z,routeId:j.routeId,path:j.path,matches:Q,match:B,request:I,controller:G})}),{dsMatches:V,revalidatingFetchers:q}}function Hv(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Tb(e,t,n){if(e.lazy)return!0;if(!Hv(e))return!1;let r=t!=null&&e.id in t,a=n!=null&&n[e.id]!==void 0;return!r&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!a}function MP(e,t,n){let r=!t||n.route.id!==t.route.id,a=!e.hasOwnProperty(n.route.id);return r||a}function OP(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function _c(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function AE(e,t,n,r,a,s){let l;if(e){let d=r[e];Lt(d,`No route found to patch children into: routeId = ${e}`),d.children||(d.children=[]),l=d.children}else l=n;let c=[],f=[];if(t.forEach(d=>{let m=l.find(p=>pk(d,p));m?f.push({existingRoute:m,newRoute:d}):c.push(d)}),c.length>0){let d=Zc(c,a,[e||"_","patch",String((l==null?void 0:l.length)||"0")],r);l.push(...d)}if(s&&f.length>0)for(let d=0;d<f.length;d++){let{existingRoute:m,newRoute:p}=f[d],y=m,[g]=Zc([p],a,[],{},!0);Object.assign(y,{element:g.element?g.element:y.element,errorElement:g.errorElement?g.errorElement:y.errorElement,hydrateFallbackElement:g.hydrateFallbackElement?g.hydrateFallbackElement:y.hydrateFallbackElement})}}function pk(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var a;return(a=t.children)==null?void 0:a.some(s=>pk(n,s))}):!1}var NE=new WeakMap,mk=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let a=n[t.id];if(Lt(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let s=a.lazy[e];if(!s)return;let l=NE.get(a);l||(l={},NE.set(a,l));let c=l[e];if(c)return c;let f=(async()=>{let d=WI(e),p=a[e]!==void 0&&e!=="hasErrorBoundary";if(d)Kn(!d,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),l[e]=Promise.resolve();else if(p)Kn(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let y=await s();y!=null&&(Object.assign(a,{[e]:y}),Object.assign(a,r(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(y=>y===void 0)&&(a.lazy=void 0))})();return l[e]=f,f},DE=new WeakMap;function AP(e,t,n,r,a){let s=n[e.id];if(Lt(s,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=DE.get(s);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let p=(async()=>{Lt(typeof e.lazy=="function","No lazy route function found");let y=await e.lazy(),g={};for(let x in y){let C=y[x];if(C===void 0)continue;let T=GI(x),R=s[x]!==void 0&&x!=="hasErrorBoundary";T?Kn(!T,"Route property "+x+" is not a supported property to be returned from a lazy route function. This property will be ignored."):R?Kn(!R,`Route "${s.id}" has a static property "${x}" defined but its lazy function is also returning a value for this property. The lazy route property "${x}" will be ignored.`):g[x]=C}Object.assign(s,g),Object.assign(s,{...r(s),lazy:void 0})})();return DE.set(s,p),p.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:p}}let l=Object.keys(e.lazy),c=[],f;for(let m of l){if(a&&a.includes(m))continue;let p=mk({key:m,route:e,manifest:n,mapRouteProperties:r});p&&(c.push(p),m===t&&(f=p))}let d=c.length>0?Promise.all(c).then(()=>{}):void 0;return d==null||d.catch(()=>{}),f==null||f.catch(()=>{}),{lazyRoutePromise:d,lazyHandlerPromise:f}}async function IE(e){let t=e.matches.filter(a=>a.shouldLoad),n={};return(await Promise.all(t.map(a=>a.resolve()))).forEach((a,s)=>{n[t[s].route.id]=a}),n}async function NP(e){return e.matches.some(t=>t.route.middleware)?gk(e,()=>IE(e)):IE(e)}function gk(e,t){return DP(e,t,r=>{if($P(r))throw r;return r},HP,n);function n(r,a,s){if(s)return Promise.resolve(Object.assign(s.value,{[a]:{type:"error",result:r}}));{let{matches:l}=e,c=Math.min(Math.max(l.findIndex(d=>d.route.id===a),0),Math.max(l.findIndex(d=>d.shouldCallHandler()),0)),f=go(l,l[c].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function DP(e,t,n,r,a){let{matches:s,request:l,params:c,context:f,unstable_pattern:d}=e,m=s.flatMap(y=>y.route.middleware?y.route.middleware.map(g=>[y.route.id,g]):[]);return await yk({request:l,params:c,context:f,unstable_pattern:d},m,t,n,r,a)}async function yk(e,t,n,r,a,s,l=0){let{request:c}=e;if(c.signal.aborted)throw c.signal.reason??new Error(`Request aborted: ${c.method} ${c.url}`);let f=t[l];if(!f)return await n();let[d,m]=f,p,y=async()=>{if(p)throw new Error("You may only call `next()` once per middleware");try{return p={value:await yk(e,t,n,r,a,s,l+1)},p.value}catch(g){return p={value:await s(g,d,p)},p.value}};try{let g=await m(e,y),x=g!=null?r(g):void 0;return a(x)?x:p?x??p.value:(p={value:await y()},p.value)}catch(g){return await s(g,d,p)}}function bk(e,t,n,r,a){let s=mk({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),l=AP(r.route,hr(n.method)?"action":"loader",t,e,a);return{middleware:s,route:l.lazyRoutePromise,handler:l.lazyHandlerPromise}}function Cb(e,t,n,r,a,s,l,c,f=null,d){let m=!1,p=bk(e,t,n,a,s);return{...a,_lazyPromises:p,shouldLoad:c,shouldRevalidateArgs:f,shouldCallHandler(y){return m=!0,f?typeof d=="boolean"?_c(a,{...f,defaultShouldRevalidate:d}):typeof y=="boolean"?_c(a,{...f,defaultShouldRevalidate:y}):_c(a,f):c},resolve(y){let{lazy:g,loader:x,middleware:C}=a.route,T=m||c||y&&!hr(n.method)&&(g||x),S=C&&C.length>0&&!x&&!g;return T&&(hr(n.method)||!S)?PP({request:n,unstable_pattern:r,match:a,lazyHandlerPromise:p==null?void 0:p.handler,lazyRoutePromise:p==null?void 0:p.route,handlerOverride:y,scopedContext:l}):Promise.resolve({type:"data",result:void 0})}}}function Ll(e,t,n,r,a,s,l,c=null){return r.map(f=>f.route.id!==a.route.id?{...f,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:bk(e,t,n,f,s),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Cb(e,t,n,md(r),f,s,l,!0,c))}async function IP(e,t,n,r,a,s){n.some(d=>{var m;return(m=d._lazyPromises)==null?void 0:m.middleware})&&await Promise.all(n.map(d=>{var m;return(m=d._lazyPromises)==null?void 0:m.middleware}));let l={request:t,unstable_pattern:md(n),params:n[0].params,context:a,matches:n},f=await e({...l,fetcherKey:r,runClientMiddleware:d=>{let m=l;return gk(m,()=>d({...m,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(d=>{var m,p;return[(m=d._lazyPromises)==null?void 0:m.handler,(p=d._lazyPromises)==null?void 0:p.route]}))}catch{}return f}async function PP({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:a,handlerOverride:s,scopedContext:l}){let c,f,d=hr(e.method),m=d?"action":"loader",p=y=>{let g,x=new Promise((S,R)=>g=R);f=()=>g(),e.signal.addEventListener("abort",f);let C=S=>typeof y!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${n.route.id}]`)):y({request:e,unstable_pattern:t,params:n.params,context:l},...S!==void 0?[S]:[]),T=(async()=>{try{return{type:"data",result:await(s?s(R=>C(R)):C())}}catch(S){return{type:"error",result:S}}})();return Promise.race([T,x])};try{let y=d?n.route.action:n.route.loader;if(r||a)if(y){let g,[x]=await Promise.all([p(y).catch(C=>{g=C}),r,a]);if(g!==void 0)throw g;c=x}else{await r;let g=d?n.route.action:n.route.loader;if(g)[c]=await Promise.all([p(g),a]);else if(m==="action"){let x=new URL(e.url),C=x.pathname+x.search;throw di(405,{method:e.method,pathname:C,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(y)c=await p(y);else{let g=new URL(e.url),x=g.pathname+g.search;throw di(404,{pathname:x})}}catch(y){return{type:"error",result:y}}finally{f&&e.signal.removeEventListener("abort",f)}return c}async function LP(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function _P(e){var r,a,s,l,c;let{result:t,type:n}=e;if(Uv(t)){let f;try{f=await LP(t)}catch(d){return{type:"error",error:d}}return n==="error"?{type:"error",error:new pd(t.status,t.statusText,f),statusCode:t.status,headers:t.headers}:{type:"data",data:f,statusCode:t.status,headers:t.headers}}return n==="error"?FE(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}:{type:"error",error:BP(t),statusCode:Jc(t)?t.status:void 0,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Jc(t)?t.status:void 0}:FE(t)?{type:"data",data:t.data,statusCode:(l=t.init)==null?void 0:l.status,headers:(c=t.init)!=null&&c.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function jP(e,t,n,r,a){let s=e.headers.get("Location");if(Lt(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!zv(s)){let l=r.slice(0,r.findIndex(c=>c.route.id===n)+1);s=Eb(new URL(t.url),l,a,s),e.headers.set("Location",s)}return e}function PE(e,t,n,r){let a=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(zv(e)){let s=e,l=s.startsWith("//")?new URL(t.protocol+s):new URL(s);if(a.includes(l.protocol))throw new Error("Invalid redirect location");let c=gi(l.pathname,n)!=null;if(l.origin===t.origin&&c)return l.pathname+l.search+l.hash}try{let s=r.createURL(e);if(a.includes(s.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Al(e,t,n,r){let a=e.createURL(vk(t)).toString(),s={signal:n};if(r&&hr(r.formMethod)){let{formMethod:l,formEncType:c}=r;s.method=l.toUpperCase(),c==="application/json"?(s.headers=new Headers({"Content-Type":c}),s.body=JSON.stringify(r.json)):c==="text/plain"?s.body=r.text:c==="application/x-www-form-urlencoded"&&r.formData?s.body=Rb(r.formData):s.body=r.formData}return new Request(a,s)}function Rb(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function LE(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function zP(e,t,n,r=!1,a=!1){let s={},l=null,c,f=!1,d={},m=n&&Kr(n[1])?n[1].error:void 0;return e.forEach(p=>{if(!(p.route.id in t))return;let y=p.route.id,g=t[y];if(Lt(!gs(g),"Cannot handle redirect results in processLoaderData"),Kr(g)){let x=g.error;if(m!==void 0&&(x=m,m=void 0),l=l||{},a)l[y]=x;else{let C=go(e,y);l[C.route.id]==null&&(l[C.route.id]=x)}r||(s[y]=hk),f||(f=!0,c=Jc(g.error)?g.error.status:500),g.headers&&(d[y]=g.headers)}else s[y]=g.data,g.statusCode&&g.statusCode!==200&&!f&&(c=g.statusCode),g.headers&&(d[y]=g.headers)}),m!==void 0&&n&&(l={[n[0]]:m},n[2]&&(s[n[2]]=void 0)),{loaderData:s,errors:l,statusCode:c||200,loaderHeaders:d}}function _E(e,t,n,r,a,s){let{loaderData:l,errors:c}=zP(t,n,r);return a.filter(f=>!f.matches||f.matches.some(d=>d.shouldLoad)).forEach(f=>{let{key:d,match:m,controller:p}=f;if(p&&p.signal.aborted)return;let y=s[d];if(Lt(y,"Did not find corresponding fetcher result"),Kr(y)){let g=go(e.matches,m==null?void 0:m.route.id);c&&c[g.route.id]||(c={...c,[g.route.id]:y.error}),e.fetchers.delete(d)}else if(gs(y))Lt(!1,"Unhandled fetcher revalidation redirect");else{let g=Ea(y.data);e.fetchers.set(d,g)}}),{loaderData:l,errors:c}}function jE(e,t,n,r){let a=Object.entries(t).filter(([,s])=>s!==hk).reduce((s,[l,c])=>(s[l]=c,s),{});for(let s of n){let l=s.route.id;if(!t.hasOwnProperty(l)&&e.hasOwnProperty(l)&&s.route.loader&&(a[l]=e[l]),r&&r.hasOwnProperty(l))break}return a}function zE(e){return e?Kr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function go(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function qf(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function di(e,{pathname:t,routeId:n,method:r,type:a,message:s}={}){let l="Unknown Server Error",c="Unknown @remix-run/router error";return e===400?(l="Bad Request",r&&t&&n?c=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:a==="invalid-body"&&(c="Unable to encode submission body")):e===403?(l="Forbidden",c=`Route "${n}" does not match URL "${t}"`):e===404?(l="Not Found",c=`No route matches URL "${t}"`):e===405&&(l="Method Not Allowed",r&&t&&n?c=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(c=`Invalid request method "${r.toUpperCase()}"`)),new pd(e||500,l,new Error(c),!0)}function $f(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,a]=t[n];if(gs(a))return{key:r,result:a}}}function vk(e){let t=typeof e=="string"?jo(e):e;return Gi({...t,hash:""})}function FP(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function BP(e){var t,n;return new pd(((t=e.init)==null?void 0:t.status)??500,((n=e.init)==null?void 0:n.statusText)??"Internal Server Error",e.data)}function HP(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&UP(n))}function UP(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function VP(e){return Uv(e.result)&&dk.has(e.result.status)}function Kr(e){return e.type==="error"}function gs(e){return(e&&e.type)==="redirect"}function FE(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Uv(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function qP(e){return dk.has(e)}function $P(e){return Uv(e)&&qP(e.status)&&e.headers.has("Location")}function YP(e){return SP.has(e.toUpperCase())}function hr(e){return xP.has(e.toUpperCase())}function Vv(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function yh(e,t){let n=typeof t=="string"?jo(t).search:t.search;if(e[e.length-1].route.index&&Vv(n||""))return e[e.length-1];let r=ok(e);return r[r.length-1]}function BE(e){let{formMethod:t,formAction:n,formEncType:r,text:a,formData:s,json:l}=e;if(!(!t||!n||!r)){if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:a};if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:s,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:l,text:void 0}}}function uy(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function WP(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function gc(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function KP(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Ea(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function GP(e,t){try{let n=e.sessionStorage.getItem(fk);if(n){let r=JSON.parse(n);for(let[a,s]of Object.entries(r||{}))s&&Array.isArray(s)&&t.set(a,new Set(s||[]))}}catch{}}function XP(e,t){if(t.size>0){let n={};for(let[r,a]of t)n[r]=[...a];try{e.sessionStorage.setItem(fk,JSON.stringify(n))}catch(r){Kn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function HE(){let e,t,n=new Promise((r,a)=>{e=async s=>{r(s);try{await n}catch{}},t=async s=>{a(s);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Us=w.createContext(null);Us.displayName="DataRouter";var gd=w.createContext(null);gd.displayName="DataRouterState";var xk=w.createContext(!1);function QP(){return w.useContext(xk)}var qv=w.createContext({isTransitioning:!1});qv.displayName="ViewTransition";var wk=w.createContext(new Map);wk.displayName="Fetchers";var ZP=w.createContext(null);ZP.displayName="Await";var vi=w.createContext(null);vi.displayName="Navigation";var up=w.createContext(null);up.displayName="Location";var Ii=w.createContext({outlet:null,matches:[],isDataRoute:!1});Ii.displayName="Route";var $v=w.createContext(null);$v.displayName="RouteError";var Sk="REACT_ROUTER_ERROR",JP="REDIRECT",eL="ROUTE_ERROR_RESPONSE";function tL(e){if(e.startsWith(`${Sk}:${JP}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function nL(e){if(e.startsWith(`${Sk}:${eL}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new pd(t.status,t.statusText,t.data)}catch{}}function rL(e,{relative:t}={}){Lt(pu(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=w.useContext(vi),{hash:a,pathname:s,search:l}=yd(e,{relative:t}),c=s;return n!=="/"&&(c=s==="/"?n:Yi([n,s])),r.createHref({pathname:c,search:l,hash:a})}function pu(){return w.useContext(up)!=null}function Zi(){return Lt(pu(),"useLocation() may be used only in the context of a <Router> component."),w.useContext(up).location}function iL(e){Lt(pu(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=Zi();return w.useMemo(()=>nu(e,ik(t)),[t,e])}var Ek="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Tk(e){w.useContext(vi).static||w.useLayoutEffect(e)}function Yv(){let{isDataRoute:e}=w.useContext(Ii);return e?xL():aL()}function aL(){Lt(pu(),"useNavigate() may be used only in the context of a <Router> component.");let e=w.useContext(Us),{basename:t,navigator:n}=w.useContext(vi),{matches:r}=w.useContext(Ii),{pathname:a}=Zi(),s=JSON.stringify(Fv(r)),l=w.useRef(!1);return Tk(()=>{l.current=!0}),w.useCallback((f,d={})=>{if(Kn(l.current,Ek),!l.current)return;if(typeof f=="number"){n.go(f);return}let m=Bv(f,JSON.parse(s),a,d.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Yi([t,m.pathname])),(d.replace?n.replace:n.push)(m,d.state,d)},[t,n,s,a,e])}var oL=w.createContext(null);function sL(e){let t=w.useContext(Ii).outlet;return w.useMemo(()=>t&&w.createElement(oL.Provider,{value:e},t),[t,e])}function lL(){let{matches:e}=w.useContext(Ii),t=e[e.length-1];return t?t.params:{}}function yd(e,{relative:t}={}){let{matches:n}=w.useContext(Ii),{pathname:r}=Zi(),a=JSON.stringify(Fv(n));return w.useMemo(()=>Bv(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function uL(e,t,n,r,a){Lt(pu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=w.useContext(vi),{matches:l}=w.useContext(Ii),c=l[l.length-1],f=c?c.params:{},d=c?c.pathname:"/",m=c?c.pathnameBase:"/",p=c&&c.route;{let R=p&&p.path||"";Rk(d,!p||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${R}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
61
+
62
+ Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let y=Zi(),g;g=y;let x=g.pathname||"/",C=x;if(m!=="/"){let R=m.replace(/^\//,"").split("/");C="/"+x.replace(/^\//,"").split("/").slice(R.length).join("/")}let T=mo(e,{pathname:C});return Kn(p||T!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Kn(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),pL(T&&T.map(R=>Object.assign({},R,{params:Object.assign({},f,R.params),pathname:Yi([m,s.encodeLocation?s.encodeLocation(R.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?m:Yi([m,s.encodeLocation?s.encodeLocation(R.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),l,n,r,a)}function cL(){let e=vL(),t=Jc(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:s},"ErrorBoundary")," or"," ",w.createElement("code",{style:s},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),n?w.createElement("pre",{style:a},n):null,l)}var dL=w.createElement(cL,null),Ck=class extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=nL(e.digest);n&&(e=n)}let t=e!==void 0?w.createElement(Ii.Provider,{value:this.props.routeContext},w.createElement($v.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?w.createElement(fL,{error:e},t):t}};Ck.contextType=xk;var cy=new WeakMap;function fL({children:e,error:t}){let{basename:n}=w.useContext(vi);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=tL(t.digest);if(r){let a=cy.get(t);if(a)throw a;let s=lk(r.location,n);if(sk&&!cy.get(t))if(s.isExternal||r.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:r.replace}));throw cy.set(t,l),l}return w.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function hL({routeContext:e,match:t,children:n}){let r=w.useContext(Us);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),w.createElement(Ii.Provider,{value:e},n)}function pL(e,t=[],n=null,r=null,a=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,l=n==null?void 0:n.errors;if(l!=null){let m=s.findIndex(p=>p.route.id&&(l==null?void 0:l[p.route.id])!==void 0);Lt(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),s=s.slice(0,Math.min(s.length,m+1))}let c=!1,f=-1;if(n)for(let m=0;m<s.length;m++){let p=s[m];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(f=m),p.route.id){let{loaderData:y,errors:g}=n,x=p.route.loader&&!y.hasOwnProperty(p.route.id)&&(!g||g[p.route.id]===void 0);if(p.route.lazy||x){c=!0,f>=0?s=s.slice(0,f+1):s=[s[0]];break}}}let d=n&&r?(m,p)=>{var y,g;r(m,{location:n.location,params:((g=(y=n.matches)==null?void 0:y[0])==null?void 0:g.params)??{},unstable_pattern:md(n.matches),errorInfo:p})}:void 0;return s.reduceRight((m,p,y)=>{let g,x=!1,C=null,T=null;n&&(g=l&&p.route.id?l[p.route.id]:void 0,C=p.route.errorElement||dL,c&&(f<0&&y===0?(Rk("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,T=null):f===y&&(x=!0,T=p.route.hydrateFallbackElement||null)));let S=t.concat(s.slice(0,y+1)),R=()=>{let k;return g?k=C:x?k=T:p.route.Component?k=w.createElement(p.route.Component,null):p.route.element?k=p.route.element:k=m,w.createElement(hL,{match:p,routeContext:{outlet:m,matches:S,isDataRoute:n!=null},children:k})};return n&&(p.route.ErrorBoundary||p.route.errorElement||y===0)?w.createElement(Ck,{location:n.location,revalidation:n.revalidation,component:C,error:g,children:R(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:d}):R()},null)}function Wv(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function mL(e){let t=w.useContext(Us);return Lt(t,Wv(e)),t}function gL(e){let t=w.useContext(gd);return Lt(t,Wv(e)),t}function yL(e){let t=w.useContext(Ii);return Lt(t,Wv(e)),t}function Kv(e){let t=yL(e),n=t.matches[t.matches.length-1];return Lt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function bL(){return Kv("useRouteId")}function vL(){var r;let e=w.useContext($v),t=gL("useRouteError"),n=Kv("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function xL(){let{router:e}=mL("useNavigate"),t=Kv("useNavigate"),n=w.useRef(!1);return Tk(()=>{n.current=!0}),w.useCallback(async(a,s={})=>{Kn(n.current,Ek),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...s}))},[e,t])}var UE={};function Rk(e,t,n){!t&&!UE[e]&&(UE[e]=!0,Kn(!1,n))}var VE={};function qE(e,t){!e&&!VE[t]&&(VE[t]=!0,console.warn(t))}var wL="useOptimistic",$E=jv[wL],SL=()=>{};function EL(e){return $E?$E(e):[e,SL]}function TL(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Kn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:w.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Kn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:w.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Kn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:w.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var CL=["HydrateFallback","hydrateFallbackElement"],RL=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function kL({router:e,flushSync:t,onError:n,unstable_useTransitions:r}){r=QP()||r;let[s,l]=w.useState(e.state),[c,f]=EL(s),[d,m]=w.useState(),[p,y]=w.useState({isTransitioning:!1}),[g,x]=w.useState(),[C,T]=w.useState(),[S,R]=w.useState(),k=w.useRef(new Map),M=w.useCallback((_,{deletedFetchers:$,newErrors:F,flushSync:W,viewTransitionOpts:L})=>{F&&n&&Object.values(F).forEach(q=>{var Y;return n(q,{location:_.location,params:((Y=_.matches[0])==null?void 0:Y.params)??{},unstable_pattern:md(_.matches)})}),_.fetchers.forEach((q,Y)=>{q.data!==void 0&&k.current.set(Y,q.data)}),$.forEach(q=>k.current.delete(q)),qE(W===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let V=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(qE(L==null||V,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!L||!V){t&&W?t(()=>l(_)):r===!1?l(_):w.startTransition(()=>{r===!0&&f(q=>YE(q,_)),l(_)});return}if(t&&W){t(()=>{C&&(g==null||g.resolve(),C.skipTransition()),y({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let q=e.window.document.startViewTransition(()=>{t(()=>l(_))});q.finished.finally(()=>{t(()=>{x(void 0),T(void 0),m(void 0),y({isTransitioning:!1})})}),t(()=>T(q));return}C?(g==null||g.resolve(),C.skipTransition(),R({state:_,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(m(_),y({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[e.window,t,C,g,r,f,n]);w.useLayoutEffect(()=>e.subscribe(M),[e,M]),w.useEffect(()=>{p.isTransitioning&&!p.flushSync&&x(new RL)},[p]),w.useEffect(()=>{if(g&&d&&e.window){let _=d,$=g.promise,F=e.window.document.startViewTransition(async()=>{r===!1?l(_):w.startTransition(()=>{r===!0&&f(W=>YE(W,_)),l(_)}),await $});F.finished.finally(()=>{x(void 0),T(void 0),m(void 0),y({isTransitioning:!1})}),T(F)}},[d,g,e.window,r,f]),w.useEffect(()=>{g&&d&&c.location.key===d.location.key&&g.resolve()},[g,C,c.location,d]),w.useEffect(()=>{!p.isTransitioning&&S&&(m(S.state),y({isTransitioning:!0,flushSync:!1,currentLocation:S.currentLocation,nextLocation:S.nextLocation}),R(void 0))},[p.isTransitioning,S]);let D=w.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:_=>e.navigate(_),push:(_,$,F)=>e.navigate(_,{state:$,preventScrollReset:F==null?void 0:F.preventScrollReset}),replace:(_,$,F)=>e.navigate(_,{replace:!0,state:$,preventScrollReset:F==null?void 0:F.preventScrollReset})}),[e]),O=e.basename||"/",N=w.useMemo(()=>({router:e,navigator:D,static:!1,basename:O,onError:n}),[e,D,O,n]);return w.createElement(w.Fragment,null,w.createElement(Us.Provider,{value:N},w.createElement(gd.Provider,{value:c},w.createElement(wk.Provider,{value:k.current},w.createElement(qv.Provider,{value:p},w.createElement(NL,{basename:O,location:c.location,navigationType:c.historyAction,navigator:D,unstable_useTransitions:r},w.createElement(ML,{routes:e.routes,future:e.future,state:c,onError:n})))))),null)}function YE(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var ML=w.memo(OL);function OL({routes:e,future:t,state:n,onError:r}){return uL(e,void 0,n,r,t)}function AL(e){return sL(e.context)}function NL({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:s=!1,unstable_useTransitions:l}){Lt(!pu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),f=w.useMemo(()=>({basename:c,navigator:a,static:s,unstable_useTransitions:l,future:{}}),[c,a,s,l]);typeof n=="string"&&(n=jo(n));let{pathname:d="/",search:m="",hash:p="",state:y=null,key:g="default"}=n,x=w.useMemo(()=>{let C=gi(d,c);return C==null?null:{location:{pathname:C,search:m,hash:p,state:y,key:g},navigationType:r}},[c,d,m,p,y,g,r]);return Kn(x!=null,`<Router basename="${c}"> is not able to match the URL "${d}${m}${p}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:w.createElement(vi.Provider,{value:f},w.createElement(up.Provider,{children:t,value:x}))}var bh="get",vh="application/x-www-form-urlencoded";function cp(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function DL(e){return cp(e)&&e.tagName.toLowerCase()==="button"}function IL(e){return cp(e)&&e.tagName.toLowerCase()==="form"}function PL(e){return cp(e)&&e.tagName.toLowerCase()==="input"}function LL(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function _L(e,t){return e.button===0&&(!t||t==="_self")&&!LL(e)}var Yf=null;function jL(){if(Yf===null)try{new FormData(document.createElement("form"),0),Yf=!1}catch{Yf=!0}return Yf}var zL=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function dy(e){return e!=null&&!zL.has(e)?(Kn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${vh}"`),null):e}function FL(e,t){let n,r,a,s,l;if(IL(e)){let c=e.getAttribute("action");r=c?gi(c,t):null,n=e.getAttribute("method")||bh,a=dy(e.getAttribute("enctype"))||vh,s=new FormData(e)}else if(DL(e)||PL(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||c.getAttribute("action");if(r=f?gi(f,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||bh,a=dy(e.getAttribute("formenctype"))||dy(c.getAttribute("enctype"))||vh,s=new FormData(c,e),!jL()){let{name:d,type:m,value:p}=e;if(m==="image"){let y=d?`${d}.`:"";s.append(`${y}x`,"0"),s.append(`${y}y`,"0")}else d&&s.append(d,p)}}else{if(cp(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=bh,r=null,a=vh,l=e}return s&&a==="text/plain"&&(l=s,s=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:s,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Gv(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function BL(e,t,n,r){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${r}`:a.pathname=`${a.pathname}.${r}`:a.pathname==="/"?a.pathname=`_root.${r}`:t&&gi(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a}async function HL(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function UL(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function VL(e,t,n){let r=await Promise.all(e.map(async a=>{let s=t.routes[a.route.id];if(s){let l=await HL(s,n);return l.links?l.links():[]}return[]}));return WL(r.flat(1).filter(UL).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function WE(e,t,n,r,a,s){let l=(f,d)=>n[d]?f.route.id!==n[d].route.id:!0,c=(f,d)=>{var m;return n[d].pathname!==f.pathname||((m=n[d].route.path)==null?void 0:m.endsWith("*"))&&n[d].params["*"]!==f.params["*"]};return s==="assets"?t.filter((f,d)=>l(f,d)||c(f,d)):s==="data"?t.filter((f,d)=>{var p;let m=r.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(l(f,d)||c(f,d))return!0;if(f.route.shouldRevalidate){let y=f.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function qL(e,t,{includeHydrateFallback:n}={}){return $L(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let s=[a.module];return a.clientActionModule&&(s=s.concat(a.clientActionModule)),a.clientLoaderModule&&(s=s.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(s=s.concat(a.hydrateFallbackModule)),a.imports&&(s=s.concat(a.imports)),s}).flat(1))}function $L(e){return[...new Set(e)]}function YL(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function WL(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let s=JSON.stringify(YL(a));return n.has(s)||(n.add(s),r.push({key:s,link:a})),r},[])}function kk(){let e=w.useContext(Us);return Gv(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function KL(){let e=w.useContext(gd);return Gv(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Xv=w.createContext(void 0);Xv.displayName="FrameworkContext";function Mk(){let e=w.useContext(Xv);return Gv(e,"You must render this element inside a <HydratedRouter> element"),e}function GL(e,t){let n=w.useContext(Xv),[r,a]=w.useState(!1),[s,l]=w.useState(!1),{onFocus:c,onBlur:f,onMouseEnter:d,onMouseLeave:m,onTouchStart:p}=t,y=w.useRef(null);w.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let C=S=>{S.forEach(R=>{l(R.isIntersecting)})},T=new IntersectionObserver(C,{threshold:.5});return y.current&&T.observe(y.current),()=>{T.disconnect()}}},[e]),w.useEffect(()=>{if(r){let C=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(C)}}},[r]);let g=()=>{a(!0)},x=()=>{a(!1),l(!1)};return n?e!=="intent"?[s,y,{}]:[s,y,{onFocus:yc(c,g),onBlur:yc(f,x),onMouseEnter:yc(d,g),onMouseLeave:yc(m,x),onTouchStart:yc(p,g)}]:[!1,y,{}]}function yc(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function XL({page:e,...t}){let{router:n}=kk(),r=w.useMemo(()=>mo(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?w.createElement(ZL,{page:e,matches:r,...t}):null}function QL(e){let{manifest:t,routeModules:n}=Mk(),[r,a]=w.useState([]);return w.useEffect(()=>{let s=!1;return VL(e,t,n).then(l=>{s||a(l)}),()=>{s=!0}},[e,t,n]),r}function ZL({page:e,matches:t,...n}){let r=Zi(),{future:a,manifest:s,routeModules:l}=Mk(),{basename:c}=kk(),{loaderData:f,matches:d}=KL(),m=w.useMemo(()=>WE(e,t,d,s,r,"data"),[e,t,d,s,r]),p=w.useMemo(()=>WE(e,t,d,s,r,"assets"),[e,t,d,s,r]),y=w.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let C=new Set,T=!1;if(t.forEach(R=>{var M;let k=s.routes[R.route.id];!k||!k.hasLoader||(!m.some(D=>D.route.id===R.route.id)&&R.route.id in f&&((M=l[R.route.id])!=null&&M.shouldRevalidate)||k.hasClientLoader?T=!0:C.add(R.route.id))}),C.size===0)return[];let S=BL(e,c,a.unstable_trailingSlashAwareDataRequests,"data");return T&&C.size>0&&S.searchParams.set("_routes",t.filter(R=>C.has(R.route.id)).map(R=>R.route.id).join(",")),[S.pathname+S.search]},[c,a.unstable_trailingSlashAwareDataRequests,f,r,s,m,t,e,l]),g=w.useMemo(()=>qL(p,s),[p,s]),x=QL(p);return w.createElement(w.Fragment,null,y.map(C=>w.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...n})),g.map(C=>w.createElement("link",{key:C,rel:"modulepreload",href:C,...n})),x.map(({key:C,link:T})=>w.createElement("link",{key:C,nonce:n.nonce,...T,crossOrigin:T.crossOrigin??n.crossOrigin})))}function JL(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var e_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{e_&&(window.__reactRouterVersion="7.13.0")}catch{}function t_(e,t){return RP({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:VI({window:t==null?void 0:t.window}),hydrationData:n_(),routes:e,mapRouteProperties:TL,hydrationRouteProperties:CL,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window,unstable_instrumentations:t==null?void 0:t.unstable_instrumentations}).initialize()}function n_(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:r_(e.errors)}),e}function r_(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,a]of t)if(a&&a.__type==="RouteErrorResponse")n[r]=new pd(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let s=window[a.__subType];if(typeof s=="function")try{let l=new s(a.message);l.stack="",n[r]=l}catch{}}if(n[r]==null){let s=new Error(a.message);s.stack="",n[r]=s}}else n[r]=a;return n}var Ok=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qv=w.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:s,replace:l,state:c,target:f,to:d,preventScrollReset:m,viewTransition:p,unstable_defaultShouldRevalidate:y,...g},x){let{basename:C,unstable_useTransitions:T}=w.useContext(vi),S=typeof d=="string"&&Ok.test(d),R=lk(d,C);d=R.to;let k=rL(d,{relative:a}),[M,D,O]=GL(r,g),N=s_(d,{replace:l,state:c,target:f,preventScrollReset:m,relative:a,viewTransition:p,unstable_defaultShouldRevalidate:y,unstable_useTransitions:T});function _(F){t&&t(F),F.defaultPrevented||N(F)}let $=w.createElement("a",{...g,...O,href:R.absoluteURL||k,onClick:R.isExternal||s?t:_,ref:JL(x,D),target:f,"data-discover":!S&&n==="render"?"true":void 0});return M&&!S?w.createElement(w.Fragment,null,$,w.createElement(XL,{page:k})):$});Qv.displayName="Link";var i_=w.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:s,to:l,viewTransition:c,children:f,...d},m){let p=yd(l,{relative:d.relative}),y=Zi(),g=w.useContext(gd),{navigator:x,basename:C}=w.useContext(vi),T=g!=null&&f_(p)&&c===!0,S=x.encodeLocation?x.encodeLocation(p).pathname:p.pathname,R=y.pathname,k=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;n||(R=R.toLowerCase(),k=k?k.toLowerCase():null,S=S.toLowerCase()),k&&C&&(k=gi(k,C)||k);const M=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let D=R===S||!a&&R.startsWith(S)&&R.charAt(M)==="/",O=k!=null&&(k===S||!a&&k.startsWith(S)&&k.charAt(S.length)==="/"),N={isActive:D,isPending:O,isTransitioning:T},_=D?t:void 0,$;typeof r=="function"?$=r(N):$=[r,D?"active":null,O?"pending":null,T?"transitioning":null].filter(Boolean).join(" ");let F=typeof s=="function"?s(N):s;return w.createElement(Qv,{...d,"aria-current":_,className:$,ref:m,style:F,to:l,viewTransition:c},typeof f=="function"?f(N):f)});i_.displayName="NavLink";var a_=w.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:s,method:l=bh,action:c,onSubmit:f,relative:d,preventScrollReset:m,viewTransition:p,unstable_defaultShouldRevalidate:y,...g},x)=>{let{unstable_useTransitions:C}=w.useContext(vi),T=c_(),S=d_(c,{relative:d}),R=l.toLowerCase()==="get"?"get":"post",k=typeof c=="string"&&Ok.test(c),M=D=>{if(f&&f(D),D.defaultPrevented)return;D.preventDefault();let O=D.nativeEvent.submitter,N=(O==null?void 0:O.getAttribute("formmethod"))||l,_=()=>T(O||D.currentTarget,{fetcherKey:t,method:N,navigate:n,replace:a,state:s,relative:d,preventScrollReset:m,viewTransition:p,unstable_defaultShouldRevalidate:y});C&&n!==!1?w.startTransition(()=>_()):_()};return w.createElement("form",{ref:x,method:R,action:S,onSubmit:r?f:M,...g,"data-discover":!k&&e==="render"?"true":void 0})});a_.displayName="Form";function o_(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ak(e){let t=w.useContext(Us);return Lt(t,o_(e)),t}function s_(e,{target:t,replace:n,state:r,preventScrollReset:a,relative:s,viewTransition:l,unstable_defaultShouldRevalidate:c,unstable_useTransitions:f}={}){let d=Yv(),m=Zi(),p=yd(e,{relative:s});return w.useCallback(y=>{if(_L(y,t)){y.preventDefault();let g=n!==void 0?n:Gi(m)===Gi(p),x=()=>d(e,{replace:g,state:r,preventScrollReset:a,relative:s,viewTransition:l,unstable_defaultShouldRevalidate:c});f?w.startTransition(()=>x()):x()}},[m,d,p,n,r,t,e,a,s,l,c,f])}var l_=0,u_=()=>`__${String(++l_)}__`;function c_(){let{router:e}=Ak("useSubmit"),{basename:t}=w.useContext(vi),n=bL(),r=e.fetch,a=e.navigate;return w.useCallback(async(s,l={})=>{let{action:c,method:f,encType:d,formData:m,body:p}=FL(s,t);if(l.navigate===!1){let y=l.fetcherKey||u_();await r(y,n,l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:p,formMethod:l.method||f,formEncType:l.encType||d,flushSync:l.flushSync})}else await a(l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:p,formMethod:l.method||f,formEncType:l.encType||d,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,a,t,n])}function d_(e,{relative:t}={}){let{basename:n}=w.useContext(vi),r=w.useContext(Ii);Lt(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),s={...yd(e||".",{relative:t})},l=Zi();if(e==null){s.search=l.search;let c=new URLSearchParams(s.search),f=c.getAll("index");if(f.some(m=>m==="")){c.delete("index"),f.filter(p=>p).forEach(p=>c.append("index",p));let m=c.toString();s.search=m?`?${m}`:""}}return(!e||e===".")&&a.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:Yi([n,s.pathname])),Gi(s)}function f_(e,{relative:t}={}){let n=w.useContext(qv);Lt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Ak("useViewTransitionState"),a=yd(e,{relative:t});if(!n.isTransitioning)return!1;let s=gi(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=gi(n.nextLocation.pathname,r)||n.nextLocation.pathname;return nu(a.pathname,l)!=null||nu(a.pathname,s)!=null}var yi=JR();const h_=sp(yi);function p_(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const m_=e=>{switch(e){case"success":return b_;case"info":return x_;case"warning":return v_;case"error":return w_;default:return null}},g_=Array(12).fill(0),y_=({visible:e,className:t})=>Ue.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Ue.createElement("div",{className:"sonner-spinner"},g_.map((n,r)=>Ue.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),b_=Ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ue.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),v_=Ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Ue.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),x_=Ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ue.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),w_=Ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ue.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),S_=Ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Ue.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ue.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),E_=()=>{const[e,t]=Ue.useState(document.hidden);return Ue.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let kb=1;class T_{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...a}=t,s=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:kb++,l=this.toasts.find(f=>f.id===s),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),l?this.toasts=this.toasts.map(f=>f.id===s?(this.publish({...f,...t,id:s,title:r}),{...f,...t,id:s,dismissible:c,title:r}):f):this.addToast({title:r,...a,dismissible:c,id:s}),s},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const a=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,l;const c=a.then(async d=>{if(l=["resolve",d],Ue.isValidElement(d))s=!1,this.create({id:r,type:"default",message:d});else if(R_(d)&&!d.ok){s=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,y=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,x=typeof p=="object"&&!Ue.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:y,...x})}else if(d instanceof Error){s=!1;const p=typeof n.error=="function"?await n.error(d):n.error,y=typeof n.description=="function"?await n.description(d):n.description,x=typeof p=="object"&&!Ue.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:y,...x})}else if(n.success!==void 0){s=!1;const p=typeof n.success=="function"?await n.success(d):n.success,y=typeof n.description=="function"?await n.description(d):n.description,x=typeof p=="object"&&!Ue.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:y,...x})}}).catch(async d=>{if(l=["reject",d],n.error!==void 0){s=!1;const m=typeof n.error=="function"?await n.error(d):n.error,p=typeof n.description=="function"?await n.description(d):n.description,g=typeof m=="object"&&!Ue.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:p,...g})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),f=()=>new Promise((d,m)=>c.then(()=>l[0]==="reject"?m(l[1]):d(l[1])).catch(m));return typeof r!="string"&&typeof r!="number"?{unwrap:f}:Object.assign(r,{unwrap:f})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||kb++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Lr=new T_,C_=(e,t)=>{const n=(t==null?void 0:t.id)||kb++;return Lr.addToast({title:e,...t,id:n}),n},R_=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",k_=C_,M_=()=>Lr.toasts,O_=()=>Lr.getActiveToasts(),gn=Object.assign(k_,{success:Lr.success,info:Lr.info,warning:Lr.warning,error:Lr.error,custom:Lr.custom,message:Lr.message,promise:Lr.promise,dismiss:Lr.dismiss,loading:Lr.loading},{getHistory:M_,getToasts:O_});p_("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Wf(e){return e.label!==void 0}const A_=3,N_="24px",D_="16px",KE=4e3,I_=356,P_=14,L_=45,__=200;function Fi(...e){return e.filter(Boolean).join(" ")}function j_(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const z_=e=>{var t,n,r,a,s,l,c,f,d;const{invert:m,toast:p,unstyled:y,interacting:g,setHeights:x,visibleToasts:C,heights:T,index:S,toasts:R,expanded:k,removeToast:M,defaultRichColors:D,closeButton:O,style:N,cancelButtonStyle:_,actionButtonStyle:$,className:F="",descriptionClassName:W="",duration:L,position:V,gap:q,expandByDefault:Y,classNames:j,icons:z,closeButtonAriaLabel:H="Close toast"}=e,[K,P]=Ue.useState(null),[B,G]=Ue.useState(null),[I,Q]=Ue.useState(!1),[Z,ie]=Ue.useState(!1),[ce,ge]=Ue.useState(!1),[Ee,_e]=Ue.useState(!1),[Ie,re]=Ue.useState(!1),[he,be]=Ue.useState(0),[Pe,Ae]=Ue.useState(0),Se=Ue.useRef(p.duration||L||KE),Ce=Ue.useRef(null),J=Ue.useRef(null),Re=S===0,xe=S+1<=C,Be=p.type,$e=p.dismissible!==!1,te=p.className||"",De=p.descriptionClassName||"",se=Ue.useMemo(()=>T.findIndex(Xe=>Xe.toastId===p.id)||0,[T,p.id]),ye=Ue.useMemo(()=>{var Xe;return(Xe=p.closeButton)!=null?Xe:O},[p.closeButton,O]),we=Ue.useMemo(()=>p.duration||L||KE,[p.duration,L]),Me=Ue.useRef(0),Fe=Ue.useRef(0),ct=Ue.useRef(0),bt=Ue.useRef(null),[Ot,We]=V.split("-"),ot=Ue.useMemo(()=>T.reduce((Xe,Bt,cn)=>cn>=se?Xe:Xe+Bt.height,0),[T,se]),st=E_(),jt=p.invert||m,zt=Be==="loading";Fe.current=Ue.useMemo(()=>se*q+ot,[se,ot]),Ue.useEffect(()=>{Se.current=we},[we]),Ue.useEffect(()=>{Q(!0)},[]),Ue.useEffect(()=>{const Xe=J.current;if(Xe){const Bt=Xe.getBoundingClientRect().height;return Ae(Bt),x(cn=>[{toastId:p.id,height:Bt,position:p.position},...cn]),()=>x(cn=>cn.filter(tn=>tn.toastId!==p.id))}},[x,p.id]),Ue.useLayoutEffect(()=>{if(!I)return;const Xe=J.current,Bt=Xe.style.height;Xe.style.height="auto";const cn=Xe.getBoundingClientRect().height;Xe.style.height=Bt,Ae(cn),x(tn=>tn.find(nn=>nn.toastId===p.id)?tn.map(nn=>nn.toastId===p.id?{...nn,height:cn}:nn):[{toastId:p.id,height:cn,position:p.position},...tn])},[I,p.title,p.description,x,p.id,p.jsx,p.action,p.cancel]);const gt=Ue.useCallback(()=>{ie(!0),be(Fe.current),x(Xe=>Xe.filter(Bt=>Bt.toastId!==p.id)),setTimeout(()=>{M(p)},__)},[p,M,x,Fe]);Ue.useEffect(()=>{if(p.promise&&Be==="loading"||p.duration===1/0||p.type==="loading")return;let Xe;return k||g||st?(()=>{if(ct.current<Me.current){const tn=new Date().getTime()-Me.current;Se.current=Se.current-tn}ct.current=new Date().getTime()})():(()=>{Se.current!==1/0&&(Me.current=new Date().getTime(),Xe=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),gt()},Se.current))})(),()=>clearTimeout(Xe)},[k,g,p,Be,st,gt]),Ue.useEffect(()=>{p.delete&&(gt(),p.onDismiss==null||p.onDismiss.call(p,p))},[gt,p.delete]);function Rt(){var Xe;if(z!=null&&z.loading){var Bt;return Ue.createElement("div",{className:Fi(j==null?void 0:j.loader,p==null||(Bt=p.classNames)==null?void 0:Bt.loader,"sonner-loader"),"data-visible":Be==="loading"},z.loading)}return Ue.createElement(y_,{className:Fi(j==null?void 0:j.loader,p==null||(Xe=p.classNames)==null?void 0:Xe.loader),visible:Be==="loading"})}const Je=p.icon||(z==null?void 0:z[Be])||m_(Be);var kt,Ft;return Ue.createElement("li",{tabIndex:0,ref:J,className:Fi(F,te,j==null?void 0:j.toast,p==null||(t=p.classNames)==null?void 0:t.toast,j==null?void 0:j.default,j==null?void 0:j[Be],p==null||(n=p.classNames)==null?void 0:n[Be]),"data-sonner-toast":"","data-rich-colors":(kt=p.richColors)!=null?kt:D,"data-styled":!(p.jsx||p.unstyled||y),"data-mounted":I,"data-promise":!!p.promise,"data-swiped":Ie,"data-removed":Z,"data-visible":xe,"data-y-position":Ot,"data-x-position":We,"data-index":S,"data-front":Re,"data-swiping":ce,"data-dismissible":$e,"data-type":Be,"data-invert":jt,"data-swipe-out":Ee,"data-swipe-direction":B,"data-expanded":!!(k||Y&&I),"data-testid":p.testId,style:{"--index":S,"--toasts-before":S,"--z-index":R.length-S,"--offset":`${Z?he:Fe.current}px`,"--initial-height":Y?"auto":`${Pe}px`,...N,...p.style},onDragEnd:()=>{ge(!1),P(null),bt.current=null},onPointerDown:Xe=>{Xe.button!==2&&(zt||!$e||(Ce.current=new Date,be(Fe.current),Xe.target.setPointerCapture(Xe.pointerId),Xe.target.tagName!=="BUTTON"&&(ge(!0),bt.current={x:Xe.clientX,y:Xe.clientY})))},onPointerUp:()=>{var Xe,Bt,cn;if(Ee||!$e)return;bt.current=null;const tn=Number(((Xe=J.current)==null?void 0:Xe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Un=Number(((Bt=J.current)==null?void 0:Bt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),nn=new Date().getTime()-((cn=Ce.current)==null?void 0:cn.getTime()),ft=K==="x"?tn:Un,Ht=Math.abs(ft)/nn;if(Math.abs(ft)>=L_||Ht>.11){be(Fe.current),p.onDismiss==null||p.onDismiss.call(p,p),G(K==="x"?tn>0?"right":"left":Un>0?"down":"up"),gt(),_e(!0);return}else{var X,ae;(X=J.current)==null||X.style.setProperty("--swipe-amount-x","0px"),(ae=J.current)==null||ae.style.setProperty("--swipe-amount-y","0px")}re(!1),ge(!1),P(null)},onPointerMove:Xe=>{var Bt,cn,tn;if(!bt.current||!$e||((Bt=window.getSelection())==null?void 0:Bt.toString().length)>0)return;const nn=Xe.clientY-bt.current.y,ft=Xe.clientX-bt.current.x;var Ht;const X=(Ht=e.swipeDirections)!=null?Ht:j_(V);!K&&(Math.abs(ft)>1||Math.abs(nn)>1)&&P(Math.abs(ft)>Math.abs(nn)?"x":"y");let ae={x:0,y:0};const de=ke=>1/(1.5+Math.abs(ke)/20);if(K==="y"){if(X.includes("top")||X.includes("bottom"))if(X.includes("top")&&nn<0||X.includes("bottom")&&nn>0)ae.y=nn;else{const ke=nn*de(nn);ae.y=Math.abs(ke)<Math.abs(nn)?ke:nn}}else if(K==="x"&&(X.includes("left")||X.includes("right")))if(X.includes("left")&&ft<0||X.includes("right")&&ft>0)ae.x=ft;else{const ke=ft*de(ft);ae.x=Math.abs(ke)<Math.abs(ft)?ke:ft}(Math.abs(ae.x)>0||Math.abs(ae.y)>0)&&re(!0),(cn=J.current)==null||cn.style.setProperty("--swipe-amount-x",`${ae.x}px`),(tn=J.current)==null||tn.style.setProperty("--swipe-amount-y",`${ae.y}px`)}},ye&&!p.jsx&&Be!=="loading"?Ue.createElement("button",{"aria-label":H,"data-disabled":zt,"data-close-button":!0,onClick:zt||!$e?()=>{}:()=>{gt(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Fi(j==null?void 0:j.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(Ft=z==null?void 0:z.close)!=null?Ft:S_):null,(Be||p.icon||p.promise)&&p.icon!==null&&((z==null?void 0:z[Be])!==null||p.icon)?Ue.createElement("div",{"data-icon":"",className:Fi(j==null?void 0:j.icon,p==null||(a=p.classNames)==null?void 0:a.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Rt():null,p.type!=="loading"?Je:null):null,Ue.createElement("div",{"data-content":"",className:Fi(j==null?void 0:j.content,p==null||(s=p.classNames)==null?void 0:s.content)},Ue.createElement("div",{"data-title":"",className:Fi(j==null?void 0:j.title,p==null||(l=p.classNames)==null?void 0:l.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?Ue.createElement("div",{"data-description":"",className:Fi(W,De,j==null?void 0:j.description,p==null||(c=p.classNames)==null?void 0:c.description)},typeof p.description=="function"?p.description():p.description):null),Ue.isValidElement(p.cancel)?p.cancel:p.cancel&&Wf(p.cancel)?Ue.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||_,onClick:Xe=>{Wf(p.cancel)&&$e&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Xe),gt())},className:Fi(j==null?void 0:j.cancelButton,p==null||(f=p.classNames)==null?void 0:f.cancelButton)},p.cancel.label):null,Ue.isValidElement(p.action)?p.action:p.action&&Wf(p.action)?Ue.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||$,onClick:Xe=>{Wf(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Xe),!Xe.defaultPrevented&&gt())},className:Fi(j==null?void 0:j.actionButton,p==null||(d=p.classNames)==null?void 0:d.actionButton)},p.action.label):null)};function GE(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function F_(e,t){const n={};return[e,t].forEach((r,a)=>{const s=a===1,l=s?"--mobile-offset":"--offset",c=s?D_:N_;function f(d){["top","right","bottom","left"].forEach(m=>{n[`${l}-${m}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?f(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${l}-${d}`]=c:n[`${l}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):f(c)}),n}const B_=Ue.forwardRef(function(t,n){const{id:r,invert:a,position:s="bottom-right",hotkey:l=["altKey","KeyT"],expand:c,closeButton:f,className:d,offset:m,mobileOffset:p,theme:y="light",richColors:g,duration:x,style:C,visibleToasts:T=A_,toastOptions:S,dir:R=GE(),gap:k=P_,icons:M,containerAriaLabel:D="Notifications"}=t,[O,N]=Ue.useState([]),_=Ue.useMemo(()=>r?O.filter(I=>I.toasterId===r):O.filter(I=>!I.toasterId),[O,r]),$=Ue.useMemo(()=>Array.from(new Set([s].concat(_.filter(I=>I.position).map(I=>I.position)))),[_,s]),[F,W]=Ue.useState([]),[L,V]=Ue.useState(!1),[q,Y]=Ue.useState(!1),[j,z]=Ue.useState(y!=="system"?y:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=Ue.useRef(null),K=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=Ue.useRef(null),B=Ue.useRef(!1),G=Ue.useCallback(I=>{N(Q=>{var Z;return(Z=Q.find(ie=>ie.id===I.id))!=null&&Z.delete||Lr.dismiss(I.id),Q.filter(({id:ie})=>ie!==I.id)})},[]);return Ue.useEffect(()=>Lr.subscribe(I=>{if(I.dismiss){requestAnimationFrame(()=>{N(Q=>Q.map(Z=>Z.id===I.id?{...Z,delete:!0}:Z))});return}setTimeout(()=>{h_.flushSync(()=>{N(Q=>{const Z=Q.findIndex(ie=>ie.id===I.id);return Z!==-1?[...Q.slice(0,Z),{...Q[Z],...I},...Q.slice(Z+1)]:[I,...Q]})})})}),[O]),Ue.useEffect(()=>{if(y!=="system"){z(y);return}if(y==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;const I=window.matchMedia("(prefers-color-scheme: dark)");try{I.addEventListener("change",({matches:Q})=>{z(Q?"dark":"light")})}catch{I.addListener(({matches:Z})=>{try{z(Z?"dark":"light")}catch(ie){console.error(ie)}})}},[y]),Ue.useEffect(()=>{O.length<=1&&V(!1)},[O]),Ue.useEffect(()=>{const I=Q=>{var Z;if(l.every(ge=>Q[ge]||Q.code===ge)){var ce;V(!0),(ce=H.current)==null||ce.focus()}Q.code==="Escape"&&(document.activeElement===H.current||(Z=H.current)!=null&&Z.contains(document.activeElement))&&V(!1)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[l]),Ue.useEffect(()=>{if(H.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,B.current=!1)}},[H.current]),Ue.createElement("section",{ref:n,"aria-label":`${D} ${K}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},$.map((I,Q)=>{var Z;const[ie,ce]=I.split("-");return _.length?Ue.createElement("ol",{key:I,dir:R==="auto"?GE():R,tabIndex:-1,ref:H,className:d,"data-sonner-toaster":!0,"data-sonner-theme":j,"data-y-position":ie,"data-x-position":ce,style:{"--front-toast-height":`${((Z=F[0])==null?void 0:Z.height)||0}px`,"--width":`${I_}px`,"--gap":`${k}px`,...C,...F_(m,p)},onBlur:ge=>{B.current&&!ge.currentTarget.contains(ge.relatedTarget)&&(B.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:ge=>{ge.target instanceof HTMLElement&&ge.target.dataset.dismissible==="false"||B.current||(B.current=!0,P.current=ge.relatedTarget)},onMouseEnter:()=>V(!0),onMouseMove:()=>V(!0),onMouseLeave:()=>{q||V(!1)},onDragEnd:()=>V(!1),onPointerDown:ge=>{ge.target instanceof HTMLElement&&ge.target.dataset.dismissible==="false"||Y(!0)},onPointerUp:()=>Y(!1)},_.filter(ge=>!ge.position&&Q===0||ge.position===I).map((ge,Ee)=>{var _e,Ie;return Ue.createElement(z_,{key:ge.id,icons:M,index:Ee,toast:ge,defaultRichColors:g,duration:(_e=S==null?void 0:S.duration)!=null?_e:x,className:S==null?void 0:S.className,descriptionClassName:S==null?void 0:S.descriptionClassName,invert:a,visibleToasts:T,closeButton:(Ie=S==null?void 0:S.closeButton)!=null?Ie:f,interacting:q,position:I,style:S==null?void 0:S.style,unstyled:S==null?void 0:S.unstyled,classNames:S==null?void 0:S.classNames,cancelButtonStyle:S==null?void 0:S.cancelButtonStyle,actionButtonStyle:S==null?void 0:S.actionButtonStyle,closeButtonAriaLabel:S==null?void 0:S.closeButtonAriaLabel,removeToast:G,toasts:_.filter(re=>re.position==ge.position),heights:F.filter(re=>re.position==ge.position),setHeights:W,expandByDefault:c,gap:k,expanded:L,swipeDirections:t.swipeDirections})})):null}))}),wt=e=>typeof e=="string",bc=()=>{let e,t;const n=new Promise((r,a)=>{e=r,t=a});return n.resolve=e,n.reject=t,n},XE=e=>e==null?"":""+e,H_=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},U_=/###/g,QE=e=>e&&e.indexOf("###")>-1?e.replace(U_,"."):e,ZE=e=>!e||wt(e),jc=(e,t,n)=>{const r=wt(t)?t.split("."):t;let a=0;for(;a<r.length-1;){if(ZE(e))return{};const s=QE(r[a]);!e[s]&&n&&(e[s]=new n),Object.prototype.hasOwnProperty.call(e,s)?e=e[s]:e={},++a}return ZE(e)?{}:{obj:e,k:QE(r[a])}},JE=(e,t,n)=>{const{obj:r,k:a}=jc(e,t,Object);if(r!==void 0||t.length===1){r[a]=n;return}let s=t[t.length-1],l=t.slice(0,t.length-1),c=jc(e,l,Object);for(;c.obj===void 0&&l.length;)s=`${l[l.length-1]}.${s}`,l=l.slice(0,l.length-1),c=jc(e,l,Object),c!=null&&c.obj&&typeof c.obj[`${c.k}.${s}`]<"u"&&(c.obj=void 0);c.obj[`${c.k}.${s}`]=n},V_=(e,t,n,r)=>{const{obj:a,k:s}=jc(e,t,Object);a[s]=a[s]||[],a[s].push(n)},Lh=(e,t)=>{const{obj:n,k:r}=jc(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},q_=(e,t,n)=>{const r=Lh(e,n);return r!==void 0?r:Lh(t,n)},Nk=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?wt(e[r])||e[r]instanceof String||wt(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Nk(e[r],t[r],n):e[r]=t[r]);return e},Cl=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var $_={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Y_=e=>wt(e)?e.replace(/[&<>"'\/]/g,t=>$_[t]):e;class W_{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const K_=[" ",",","?","!",";"],G_=new W_(20),X_=(e,t,n)=>{t=t||"",n=n||"";const r=K_.filter(l=>t.indexOf(l)<0&&n.indexOf(l)<0);if(r.length===0)return!0;const a=G_.getRegExp(`(${r.map(l=>l==="?"?"\\?":l).join("|")})`);let s=!a.test(e);if(!s){const l=e.indexOf(n);l>0&&!a.test(e.substring(0,l))&&(s=!0)}return s},Mb=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let a=e;for(let s=0;s<r.length;){if(!a||typeof a!="object")return;let l,c="";for(let f=s;f<r.length;++f)if(f!==s&&(c+=n),c+=r[f],l=a[c],l!==void 0){if(["string","number","boolean"].indexOf(typeof l)>-1&&f<r.length-1)continue;s+=f-s+1;break}a=l}return a},ed=e=>e==null?void 0:e.replace("_","-"),Q_={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,r;(r=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||r.call(n,console,t)}};class _h{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||Q_,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,a){return a&&!this.debug?null:(wt(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new _h(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new _h(this.logger,t)}}var $i=new _h;class dp{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const a=this.observers[r].get(n)||0;this.observers[r].set(n,a+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([a,s])=>{for(let l=0;l<s;l++)a(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([a,s])=>{for(let l=0;l<s;l++)a.apply(a,[t,...n])})}}class eT extends dp{constructor(t,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r,a={}){var d,m;const s=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,l=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure;let c;t.indexOf(".")>-1?c=t.split("."):(c=[t,n],r&&(Array.isArray(r)?c.push(...r):wt(r)&&s?c.push(...r.split(s)):c.push(r)));const f=Lh(this.data,c);return!f&&!n&&!r&&t.indexOf(".")>-1&&(t=c[0],n=c[1],r=c.slice(2).join(".")),f||!l||!wt(r)?f:Mb((m=(d=this.data)==null?void 0:d[t])==null?void 0:m[n],r,s)}addResource(t,n,r,a,s={silent:!1}){const l=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let c=[t,n];r&&(c=c.concat(l?r.split(l):r)),t.indexOf(".")>-1&&(c=t.split("."),a=n,n=c[1]),this.addNamespaces(n),JE(this.data,c,a),s.silent||this.emit("added",t,n,r,a)}addResources(t,n,r,a={silent:!1}){for(const s in r)(wt(r[s])||Array.isArray(r[s]))&&this.addResource(t,n,s,r[s],{silent:!0});a.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,a,s,l={silent:!1,skipCopy:!1}){let c=[t,n];t.indexOf(".")>-1&&(c=t.split("."),a=r,r=n,n=c[1]),this.addNamespaces(n);let f=Lh(this.data,c)||{};l.skipCopy||(r=JSON.parse(JSON.stringify(r))),a?Nk(f,r,s):f={...f,...r},JE(this.data,c,f),l.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(a=>n[a]&&Object.keys(n[a]).length>0)}toJSON(){return this.data}}var Dk={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,a){return e.forEach(s=>{var l;t=((l=this.processors[s])==null?void 0:l.process(t,n,r,a))??t}),t}};const Ik=Symbol("i18next/PATH_KEY");function Z_(){const e=[],t=Object.create(null);let n;return t.get=(r,a)=>{var s;return(s=n==null?void 0:n.revoke)==null||s.call(n),a===Ik?e:(e.push(a),n=Proxy.revocable(r,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Ob(e,t){const{[Ik]:n}=e(Z_());return n.join((t==null?void 0:t.keySeparator)??".")}const tT={},fy=e=>!wt(e)&&typeof e!="boolean"&&typeof e!="number";class jh extends dp{constructor(t,n={}){super(),H_(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=$i.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const a=this.resolve(t,r);if((a==null?void 0:a.res)===void 0)return!1;const s=fy(a.res);return!(r.returnObjects===!1&&s)}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const l=r&&t.indexOf(r)>-1,c=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!X_(t,r,a);if(l&&!c){const f=t.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:t,namespaces:wt(s)?[s]:s};const d=t.split(r);(r!==a||r===a&&this.options.ns.indexOf(d[0])>-1)&&(s=d.shift()),t=d.join(a)}return{key:t,namespaces:wt(s)?[s]:s}}translate(t,n,r){let a=typeof n=="object"?{...n}:n;if(typeof a!="object"&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),typeof a=="object"&&(a={...a}),a||(a={}),t==null)return"";typeof t=="function"&&(t=Ob(t,{...this.options,...a})),Array.isArray(t)||(t=[String(t)]);const s=a.returnDetails!==void 0?a.returnDetails:this.options.returnDetails,l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,{key:c,namespaces:f}=this.extractFromKey(t[t.length-1],a),d=f[f.length-1];let m=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;m===void 0&&(m=":");const p=a.lng||this.language,y=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((p==null?void 0:p.toLowerCase())==="cimode")return y?s?{res:`${d}${m}${c}`,usedKey:c,exactUsedKey:c,usedLng:p,usedNS:d,usedParams:this.getUsedParamsDetails(a)}:`${d}${m}${c}`:s?{res:c,usedKey:c,exactUsedKey:c,usedLng:p,usedNS:d,usedParams:this.getUsedParamsDetails(a)}:c;const g=this.resolve(t,a);let x=g==null?void 0:g.res;const C=(g==null?void 0:g.usedKey)||c,T=(g==null?void 0:g.exactUsedKey)||c,S=["[object Number]","[object Function]","[object RegExp]"],R=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,k=!this.i18nFormat||this.i18nFormat.handleAsObject,M=a.count!==void 0&&!wt(a.count),D=jh.hasDefaultValue(a),O=M?this.pluralResolver.getSuffix(p,a.count,a):"",N=a.ordinal&&M?this.pluralResolver.getSuffix(p,a.count,{ordinal:!1}):"",_=M&&!a.ordinal&&a.count===0,$=_&&a[`defaultValue${this.options.pluralSeparator}zero`]||a[`defaultValue${O}`]||a[`defaultValue${N}`]||a.defaultValue;let F=x;k&&!x&&D&&(F=$);const W=fy(F),L=Object.prototype.toString.apply(F);if(k&&F&&W&&S.indexOf(L)<0&&!(wt(R)&&Array.isArray(F))){if(!a.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const V=this.options.returnedObjectHandler?this.options.returnedObjectHandler(C,F,{...a,ns:f}):`key '${c} (${this.language})' returned an object instead of string.`;return s?(g.res=V,g.usedParams=this.getUsedParamsDetails(a),g):V}if(l){const V=Array.isArray(F),q=V?[]:{},Y=V?T:C;for(const j in F)if(Object.prototype.hasOwnProperty.call(F,j)){const z=`${Y}${l}${j}`;D&&!x?q[j]=this.translate(z,{...a,defaultValue:fy($)?$[j]:void 0,joinArrays:!1,ns:f}):q[j]=this.translate(z,{...a,joinArrays:!1,ns:f}),q[j]===z&&(q[j]=F[j])}x=q}}else if(k&&wt(R)&&Array.isArray(x))x=x.join(R),x&&(x=this.extendTranslation(x,t,a,r));else{let V=!1,q=!1;!this.isValidLookup(x)&&D&&(V=!0,x=$),this.isValidLookup(x)||(q=!0,x=c);const j=(a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&q?void 0:x,z=D&&$!==x&&this.options.updateMissing;if(q||V||z){if(this.logger.log(z?"updateKey":"missingKey",p,d,c,z?$:x),l){const B=this.resolve(c,{...a,keySeparator:!1});B&&B.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let H=[];const K=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&K&&K[0])for(let B=0;B<K.length;B++)H.push(K[B]);else this.options.saveMissingTo==="all"?H=this.languageUtils.toResolveHierarchy(a.lng||this.language):H.push(a.lng||this.language);const P=(B,G,I)=>{var Z;const Q=D&&I!==x?I:j;this.options.missingKeyHandler?this.options.missingKeyHandler(B,d,G,Q,z,a):(Z=this.backendConnector)!=null&&Z.saveMissing&&this.backendConnector.saveMissing(B,d,G,Q,z,a),this.emit("missingKey",B,d,G,x)};this.options.saveMissing&&(this.options.saveMissingPlurals&&M?H.forEach(B=>{const G=this.pluralResolver.getSuffixes(B,a);_&&a[`defaultValue${this.options.pluralSeparator}zero`]&&G.indexOf(`${this.options.pluralSeparator}zero`)<0&&G.push(`${this.options.pluralSeparator}zero`),G.forEach(I=>{P([B],c+I,a[`defaultValue${I}`]||$)})}):P(H,c,$))}x=this.extendTranslation(x,t,a,g,r),q&&x===c&&this.options.appendNamespaceToMissingKey&&(x=`${d}${m}${c}`),(q||V)&&this.options.parseMissingKeyHandler&&(x=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${d}${m}${c}`:c,V?x:void 0,a))}return s?(g.res=x,g.usedParams=this.getUsedParamsDetails(a),g):x}extendTranslation(t,n,r,a,s){var f,d;if((f=this.i18nFormat)!=null&&f.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const m=wt(t)&&(((d=r==null?void 0:r.interpolation)==null?void 0:d.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(m){const g=t.match(this.interpolator.nestingRegexp);p=g&&g.length}let y=r.replace&&!wt(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(y={...this.options.interpolation.defaultVariables,...y}),t=this.interpolator.interpolate(t,y,r.lng||this.language||a.usedLng,r),m){const g=t.match(this.interpolator.nestingRegexp),x=g&&g.length;p<x&&(r.nest=!1)}!r.lng&&a&&a.res&&(r.lng=this.language||a.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...g)=>(s==null?void 0:s[0])===g[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${g[0]} in key: ${n[0]}`),null):this.translate(...g,n),r)),r.interpolation&&this.interpolator.reset()}const l=r.postProcess||this.options.postProcess,c=wt(l)?[l]:l;return t!=null&&(c!=null&&c.length)&&r.applyPostProcessor!==!1&&(t=Dk.handle(c,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...a,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,a,s,l,c;return wt(t)&&(t=[t]),t.forEach(f=>{if(this.isValidLookup(r))return;const d=this.extractFromKey(f,n),m=d.key;a=m;let p=d.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));const y=n.count!==void 0&&!wt(n.count),g=y&&!n.ordinal&&n.count===0,x=n.context!==void 0&&(wt(n.context)||typeof n.context=="number")&&n.context!=="",C=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);p.forEach(T=>{var S,R;this.isValidLookup(r)||(c=T,!tT[`${C[0]}-${T}`]&&((S=this.utils)!=null&&S.hasLoadedNamespace)&&!((R=this.utils)!=null&&R.hasLoadedNamespace(c))&&(tT[`${C[0]}-${T}`]=!0,this.logger.warn(`key "${a}" for languages "${C.join(", ")}" won't get resolved as namespace "${c}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),C.forEach(k=>{var O;if(this.isValidLookup(r))return;l=k;const M=[m];if((O=this.i18nFormat)!=null&&O.addLookupKeys)this.i18nFormat.addLookupKeys(M,m,k,T,n);else{let N;y&&(N=this.pluralResolver.getSuffix(k,n.count,n));const _=`${this.options.pluralSeparator}zero`,$=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(y&&(n.ordinal&&N.indexOf($)===0&&M.push(m+N.replace($,this.options.pluralSeparator)),M.push(m+N),g&&M.push(m+_)),x){const F=`${m}${this.options.contextSeparator||"_"}${n.context}`;M.push(F),y&&(n.ordinal&&N.indexOf($)===0&&M.push(F+N.replace($,this.options.pluralSeparator)),M.push(F+N),g&&M.push(F+_))}}let D;for(;D=M.pop();)this.isValidLookup(r)||(s=D,r=this.getResource(k,T,D,n))}))})}),{res:r,usedKey:a,exactUsedKey:s,usedLng:l,usedNS:c}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,a={}){var s;return(s=this.i18nFormat)!=null&&s.getResource?this.i18nFormat.getResource(t,n,r,a):this.resourceStore.getResource(t,n,r,a)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!wt(t.replace);let a=r?t.replace:t;if(r&&typeof t.count<"u"&&(a.count=t.count),this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),!r){a={...a};for(const s of n)delete a[s]}return a}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class nT{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=$i.create("languageUtils")}getScriptPartFromCode(t){if(t=ed(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=ed(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(wt(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const a=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(a))&&(n=a)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const a=this.getScriptPartFromCode(r);if(this.isSupportedCode(a))return n=a;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(l=>{if(l===s)return l;if(!(l.indexOf("-")<0&&s.indexOf("-")<0)&&(l.indexOf("-")>0&&s.indexOf("-")<0&&l.substring(0,l.indexOf("-"))===s||l.indexOf(s)===0&&s.length>1))return l})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),wt(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),a=[],s=l=>{l&&(this.isSupportedCode(l)?a.push(l):this.logger.warn(`rejecting language code not found in supportedLngs: ${l}`))};return wt(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(t))):wt(t)&&s(this.formatLanguageCode(t)),r.forEach(l=>{a.indexOf(l)<0&&s(this.formatLanguageCode(l))}),a}}const rT={zero:0,one:1,two:2,few:3,many:4,other:5},iT={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class J_{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=$i.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=ed(t==="dev"?"en":t),a=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:r,type:a});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let l;try{l=new Intl.PluralRules(r,{type:a})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),iT;if(!t.match(/-|_/))return iT;const f=this.languageUtils.getLanguagePartFromCode(t);l=this.getRule(f,n)}return this.pluralRulesCache[s]=l,l}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(a=>`${n}${a}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((a,s)=>rT[a]-rT[s]).map(a=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${a}`):[]}getSuffix(t,n,r={}){const a=this.getRule(t,r);return a?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${a.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const aT=(e,t,n,r=".",a=!0)=>{let s=q_(e,t,n);return!s&&a&&wt(n)&&(s=Mb(e,n,r),s===void 0&&(s=Mb(t,n,r))),s},hy=e=>e.replace(/\$/g,"$$$$");class oT{constructor(t={}){var n;this.logger=$i.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(r=>r),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:a,prefix:s,prefixEscaped:l,suffix:c,suffixEscaped:f,formatSeparator:d,unescapeSuffix:m,unescapePrefix:p,nestingPrefix:y,nestingPrefixEscaped:g,nestingSuffix:x,nestingSuffixEscaped:C,nestingOptionsSeparator:T,maxReplaces:S,alwaysFormat:R}=t.interpolation;this.escape=n!==void 0?n:Y_,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=a!==void 0?a:!1,this.prefix=s?Cl(s):l||"{{",this.suffix=c?Cl(c):f||"}}",this.formatSeparator=d||",",this.unescapePrefix=m?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":m||"",this.nestingPrefix=y?Cl(y):g||Cl("$t("),this.nestingSuffix=x?Cl(x):C||Cl(")"),this.nestingOptionsSeparator=T||",",this.maxReplaces=S||1e3,this.alwaysFormat=R!==void 0?R:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,r,a){var g;let s,l,c;const f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},d=x=>{if(x.indexOf(this.formatSeparator)<0){const R=aT(n,f,x,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(R,void 0,r,{...a,...n,interpolationkey:x}):R}const C=x.split(this.formatSeparator),T=C.shift().trim(),S=C.join(this.formatSeparator).trim();return this.format(aT(n,f,T,this.options.keySeparator,this.options.ignoreJSONStructure),S,r,{...a,...n,interpolationkey:T})};this.resetRegExp();const m=(a==null?void 0:a.missingInterpolationHandler)||this.options.missingInterpolationHandler,p=((g=a==null?void 0:a.interpolation)==null?void 0:g.skipOnVariables)!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:x=>hy(x)},{regex:this.regexp,safeValue:x=>this.escapeValue?hy(this.escape(x)):hy(x)}].forEach(x=>{for(c=0;s=x.regex.exec(t);){const C=s[1].trim();if(l=d(C),l===void 0)if(typeof m=="function"){const S=m(t,s,a);l=wt(S)?S:""}else if(a&&Object.prototype.hasOwnProperty.call(a,C))l="";else if(p){l=s[0];continue}else this.logger.warn(`missed to pass in variable ${C} for interpolating ${t}`),l="";else!wt(l)&&!this.useRawValueToEscape&&(l=XE(l));const T=x.safeValue(l);if(t=t.replace(s[0],T),p?(x.regex.lastIndex+=l.length,x.regex.lastIndex-=s[0].length):x.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),t}nest(t,n,r={}){let a,s,l;const c=(f,d)=>{const m=this.nestingOptionsSeparator;if(f.indexOf(m)<0)return f;const p=f.split(new RegExp(`${m}[ ]*{`));let y=`{${p[1]}`;f=p[0],y=this.interpolate(y,l);const g=y.match(/'/g),x=y.match(/"/g);(((g==null?void 0:g.length)??0)%2===0&&!x||x.length%2!==0)&&(y=y.replace(/'/g,'"'));try{l=JSON.parse(y),d&&(l={...d,...l})}catch(C){return this.logger.warn(`failed parsing options string in nesting for key ${f}`,C),`${f}${m}${y}`}return l.defaultValue&&l.defaultValue.indexOf(this.prefix)>-1&&delete l.defaultValue,f};for(;a=this.nestingRegexp.exec(t);){let f=[];l={...r},l=l.replace&&!wt(l.replace)?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;const d=/{.*}/.test(a[1])?a[1].lastIndexOf("}")+1:a[1].indexOf(this.formatSeparator);if(d!==-1&&(f=a[1].slice(d).split(this.formatSeparator).map(m=>m.trim()).filter(Boolean),a[1]=a[1].slice(0,d)),s=n(c.call(this,a[1].trim(),l),l),s&&a[0]===t&&!wt(s))return s;wt(s)||(s=XE(s)),s||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${t}`),s=""),f.length&&(s=f.reduce((m,p)=>this.format(m,p,r.lng,{...r,interpolationkey:a[1].trim()}),s.trim())),t=t.replace(a[0],s),this.regexp.lastIndex=0}return t}}const ej=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const a=r[1].substring(0,r[1].length-1);t==="currency"&&a.indexOf(":")<0?n.currency||(n.currency=a.trim()):t==="relativetime"&&a.indexOf(":")<0?n.range||(n.range=a.trim()):a.split(";").forEach(l=>{if(l){const[c,...f]=l.split(":"),d=f.join(":").trim().replace(/^'+|'+$/g,""),m=c.trim();n[m]||(n[m]=d),d==="false"&&(n[m]=!1),d==="true"&&(n[m]=!0),isNaN(d)||(n[m]=parseInt(d,10))}})}return{formatName:t,formatOptions:n}},sT=e=>{const t={};return(n,r,a)=>{let s=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(s={...s,[a.interpolationkey]:void 0});const l=r+JSON.stringify(s);let c=t[l];return c||(c=e(ed(r),a),t[l]=c),c(n)}},tj=e=>(t,n,r)=>e(ed(n),r)(t);class nj{constructor(t={}){this.logger=$i.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?sT:tj;this.formats={number:r((a,s)=>{const l=new Intl.NumberFormat(a,{...s});return c=>l.format(c)}),currency:r((a,s)=>{const l=new Intl.NumberFormat(a,{...s,style:"currency"});return c=>l.format(c)}),datetime:r((a,s)=>{const l=new Intl.DateTimeFormat(a,{...s});return c=>l.format(c)}),relativetime:r((a,s)=>{const l=new Intl.RelativeTimeFormat(a,{...s});return c=>l.format(c,s.range||"day")}),list:r((a,s)=>{const l=new Intl.ListFormat(a,{...s});return c=>l.format(c)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=sT(n)}format(t,n,r,a={}){const s=n.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&s[0].indexOf(")")<0&&s.find(c=>c.indexOf(")")>-1)){const c=s.findIndex(f=>f.indexOf(")")>-1);s[0]=[s[0],...s.splice(1,c)].join(this.formatSeparator)}return s.reduce((c,f)=>{var p;const{formatName:d,formatOptions:m}=ej(f);if(this.formats[d]){let y=c;try{const g=((p=a==null?void 0:a.formatParams)==null?void 0:p[a.interpolationkey])||{},x=g.locale||g.lng||a.locale||a.lng||r;y=this.formats[d](c,x,{...m,...a,...g})}catch(g){this.logger.warn(g)}return y}else this.logger.warn(`there was no format function for ${d}`);return c},t)}}const rj=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class ij extends dp{constructor(t,n,r,a={}){var s,l;super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=a,this.logger=$i.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=a.maxParallelReads||10,this.readingCalls=0,this.maxRetries=a.maxRetries>=0?a.maxRetries:5,this.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,this.state={},this.queue=[],(l=(s=this.backend)==null?void 0:s.init)==null||l.call(s,r,a.backend,a)}queueLoad(t,n,r,a){const s={},l={},c={},f={};return t.forEach(d=>{let m=!0;n.forEach(p=>{const y=`${d}|${p}`;!r.reload&&this.store.hasResourceBundle(d,p)?this.state[y]=2:this.state[y]<0||(this.state[y]===1?l[y]===void 0&&(l[y]=!0):(this.state[y]=1,m=!1,l[y]===void 0&&(l[y]=!0),s[y]===void 0&&(s[y]=!0),f[p]===void 0&&(f[p]=!0)))}),m||(c[d]=!0)}),(Object.keys(s).length||Object.keys(l).length)&&this.queue.push({pending:l,pendingCount:Object.keys(l).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(s),pending:Object.keys(l),toLoadLanguages:Object.keys(c),toLoadNamespaces:Object.keys(f)}}loaded(t,n,r){const a=t.split("|"),s=a[0],l=a[1];n&&this.emit("failedLoading",s,l,n),!n&&r&&this.store.addResourceBundle(s,l,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const c={};this.queue.forEach(f=>{V_(f.loaded,[s],l),rj(f,t),n&&f.errors.push(n),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(d=>{c[d]||(c[d]={});const m=f.loaded[d];m.length&&m.forEach(p=>{c[d][p]===void 0&&(c[d][p]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(f=>!f.done)}read(t,n,r,a=0,s=this.retryTimeout,l){if(!t.length)return l(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:a,wait:s,callback:l});return}this.readingCalls++;const c=(d,m)=>{if(this.readingCalls--,this.waitingReads.length>0){const p=this.waitingReads.shift();this.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(d&&m&&a<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,a+1,s*2,l)},s);return}l(d,m)},f=this.backend[r].bind(this.backend);if(f.length===2){try{const d=f(t,n);d&&typeof d.then=="function"?d.then(m=>c(null,m)).catch(c):c(null,d)}catch(d){c(d)}return}return f(t,n,c)}prepareLoading(t,n,r={},a){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();wt(t)&&(t=this.languageUtils.toResolveHierarchy(t)),wt(n)&&(n=[n]);const s=this.queueLoad(t,n,r,a);if(!s.toLoad.length)return s.pending.length||a(),null;s.toLoad.forEach(l=>{this.loadOne(l)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){const r=t.split("|"),a=r[0],s=r[1];this.read(a,s,"read",void 0,void 0,(l,c)=>{l&&this.logger.warn(`${n}loading namespace ${s} for language ${a} failed`,l),!l&&c&&this.logger.log(`${n}loaded namespace ${s} for language ${a}`,c),this.loaded(t,l,c)})}saveMissing(t,n,r,a,s,l={},c=()=>{}){var f,d,m,p,y;if((d=(f=this.services)==null?void 0:f.utils)!=null&&d.hasLoadedNamespace&&!((p=(m=this.services)==null?void 0:m.utils)!=null&&p.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((y=this.backend)!=null&&y.create){const g={...l,isUpdate:s},x=this.backend.create.bind(this.backend);if(x.length<6)try{let C;x.length===5?C=x(t,n,r,a,g):C=x(t,n,r,a),C&&typeof C.then=="function"?C.then(T=>c(null,T)).catch(c):c(null,C)}catch(C){c(C)}else x(t,n,r,a,c,g)}!t||!t[0]||this.store.addResource(t[0],n,r,a)}}}const py=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),wt(e[1])&&(t.defaultValue=e[1]),wt(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),lT=e=>{var t,n;return wt(e.ns)&&(e.ns=[e.ns]),wt(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),wt(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((n=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:n.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},Kf=()=>{},aj=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})},oj=e=>{var t,n,r,a,s,l,c,f,d;return!!(((r=(n=(t=e==null?void 0:e.modules)==null?void 0:t.backend)==null?void 0:n.name)==null?void 0:r.indexOf("Locize"))>0||((c=(l=(s=(a=e==null?void 0:e.modules)==null?void 0:a.backend)==null?void 0:s.constructor)==null?void 0:l.name)==null?void 0:c.indexOf("Locize"))>0||(d=(f=e==null?void 0:e.options)==null?void 0:f.backend)!=null&&d.backends&&e.options.backend.backends.some(m=>{var p,y,g;return((p=m==null?void 0:m.name)==null?void 0:p.indexOf("Locize"))>0||((g=(y=m==null?void 0:m.constructor)==null?void 0:y.name)==null?void 0:g.indexOf("Locize"))>0}))};class zc extends dp{constructor(t={},n){if(super(),this.options=lT(t),this.services={},this.logger=$i,this.modules={external:[]},aj(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(wt(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=py();this.options={...r,...this.options,...lT(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!oj(this)&&typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙");const a=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?$i.init(a(this.modules.logger),this.options):$i.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:d=nj;const m=new nT(this.options);this.store=new eT(this.options.resources,this.options);const p=this.services;p.logger=$i,p.resourceStore=this.store,p.languageUtils=m,p.pluralResolver=new J_(m,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),d&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(p.formatter=a(d),p.formatter.init&&p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new oT(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new ij(a(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",(g,...x)=>{this.emit(g,...x)}),this.modules.languageDetector&&(p.languageDetector=a(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=a(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new jh(this.services,this.options),this.translator.on("*",(g,...x)=>{this.emit(g,...x)}),this.modules.external.forEach(g=>{g.init&&g.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Kf),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=(...m)=>this.store[d](...m)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=(...m)=>(this.store[d](...m),this)});const c=bc(),f=()=>{const d=(m,p)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(p),n(m,p)};if(this.languages&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initAsync?f():setTimeout(f,0),c}loadResources(t,n=Kf){var s,l;let r=n;const a=wt(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if((a==null?void 0:a.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const c=[],f=d=>{if(!d||d==="cimode")return;this.services.languageUtils.toResolveHierarchy(d).forEach(p=>{p!=="cimode"&&c.indexOf(p)<0&&c.push(p)})};a?f(a):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(m=>f(m)),(l=(s=this.options.preload)==null?void 0:s.forEach)==null||l.call(s,d=>f(d)),this.services.backendConnector.load(c,this.options.ns,d=>{!d&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(d)})}else r(null)}reloadResources(t,n,r){const a=bc();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Kf),this.services.backendConnector.reload(t,n,s=>{a.resolve(),r(s)}),a}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&Dk.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=bc();this.emit("languageChanging",t);const a=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},s=(c,f)=>{f?this.isLanguageChangingTo===t&&(a(f),this.translator.changeLanguage(f),this.isLanguageChangingTo=void 0,this.emit("languageChanged",f),this.logger.log("languageChanged",f)):this.isLanguageChangingTo=void 0,r.resolve((...d)=>this.t(...d)),n&&n(c,(...d)=>this.t(...d))},l=c=>{var m,p;!t&&!c&&this.services.languageDetector&&(c=[]);const f=wt(c)?c:c&&c[0],d=this.store.hasLanguageSomeTranslations(f)?f:this.services.languageUtils.getBestMatchFromCodes(wt(c)?[c]:c);d&&(this.language||a(d),this.translator.language||this.translator.changeLanguage(d),(p=(m=this.services.languageDetector)==null?void 0:m.cacheUserLanguage)==null||p.call(m,d)),this.loadResources(d,y=>{s(y,d)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(t),r}getFixedT(t,n,r){const a=(s,l,...c)=>{let f;typeof l!="object"?f=this.options.overloadTranslationOptionHandler([s,l].concat(c)):f={...l},f.lng=f.lng||a.lng,f.lngs=f.lngs||a.lngs,f.ns=f.ns||a.ns,f.keyPrefix!==""&&(f.keyPrefix=f.keyPrefix||r||a.keyPrefix);const d=this.options.keySeparator||".";let m;return f.keyPrefix&&Array.isArray(s)?m=s.map(p=>(typeof p=="function"&&(p=Ob(p,{...this.options,...l})),`${f.keyPrefix}${d}${p}`)):(typeof s=="function"&&(s=Ob(s,{...this.options,...l})),m=f.keyPrefix?`${f.keyPrefix}${d}${s}`:s),this.t(m,f)};return wt(t)?a.lng=t:a.lngs=t,a.ns=n,a.keyPrefix=r,a}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],a=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const l=(c,f)=>{const d=this.services.backendConnector.state[`${c}|${f}`];return d===-1||d===0||d===2};if(n.precheck){const c=n.precheck(this,l);if(c!==void 0)return c}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||l(r,t)&&(!a||l(s,t)))}loadNamespaces(t,n){const r=bc();return this.options.ns?(wt(t)&&(t=[t]),t.forEach(a=>{this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=bc();wt(t)&&(t=[t]);const a=this.options.preload||[],s=t.filter(l=>a.indexOf(l)<0&&this.services.languageUtils.isSupportedCode(l));return s.length?(this.options.preload=a.concat(s),this.loadResources(l=>{r.resolve(),n&&n(l)}),r):(n&&n(),Promise.resolve())}dir(t){var a,s;if(t||(t=this.resolvedLanguage||(((a=this.languages)==null?void 0:a.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const l=new Intl.Locale(t);if(l&&l.getTextInfo){const c=l.getTextInfo();if(c&&c.direction)return c.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((s=this.services)==null?void 0:s.languageUtils)||new nT(py());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const r=new zc(t,n);return r.createInstance=zc.createInstance,r}cloneInstance(t={},n=Kf){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const a={...this.options,...t,isClone:!0},s=new zc(a);if((t.debug!==void 0||t.prefix!==void 0)&&(s.logger=s.logger.clone(t)),["store","services","language"].forEach(c=>{s[c]=this[c]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},r){const c=Object.keys(this.store.data).reduce((f,d)=>(f[d]={...this.store.data[d]},f[d]=Object.keys(f[d]).reduce((m,p)=>(m[p]={...f[d][p]},m),f[d]),f),{});s.store=new eT(c,a),s.services.resourceStore=s.store}if(t.interpolation){const f={...py().interpolation,...this.options.interpolation,...t.interpolation},d={...a,interpolation:f};s.services.interpolator=new oT(d)}return s.translator=new jh(s.services,a),s.translator.on("*",(c,...f)=>{s.emit(c,...f)}),s.init(a,n),s.translator.options=a,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const wn=zc.createInstance();wn.createInstance;wn.dir;wn.init;wn.loadResources;wn.reloadResources;wn.use;wn.changeLanguage;wn.getFixedT;wn.t;wn.exists;wn.setDefaultNamespace;wn.hasLoadedNamespace;wn.loadNamespaces;wn.loadLanguages;const sj=(e,t,n,r)=>{var s,l,c,f;const a=[n,{code:t,...r||{}}];if((l=(s=e==null?void 0:e.services)==null?void 0:s.logger)!=null&&l.forward)return e.services.logger.forward(a,"warn","react-i18next::",!0);Is(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),(f=(c=e==null?void 0:e.services)==null?void 0:c.logger)!=null&&f.warn?e.services.logger.warn(...a):console!=null&&console.warn&&console.warn(...a)},uT={},Pk=(e,t,n,r)=>{Is(n)&&uT[n]||(Is(n)&&(uT[n]=new Date),sj(e,t,n,r))},Lk=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},Ab=(e,t,n)=>{e.loadNamespaces(t,Lk(e,n))},cT=(e,t,n,r)=>{if(Is(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Ab(e,n,r);n.forEach(a=>{e.options.ns.indexOf(a)<0&&e.options.ns.push(a)}),e.loadLanguages(t,Lk(e,r))},lj=(e,t,n={})=>!t.languages||!t.languages.length?(Pk(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,a)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!a(r.isLanguageChangingTo,e))return!1}}),Is=e=>typeof e=="string",uj=e=>typeof e=="object"&&e!==null,cj=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,dj={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},fj=e=>dj[e],hj=e=>e.replace(cj,fj);let Nb={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:hj,transDefaultProps:void 0};const pj=(e={})=>{Nb={...Nb,...e}},mj=()=>Nb;let _k;const gj=e=>{_k=e},yj=()=>_k,bj={type:"3rdParty",init(e){pj(e.options.react),gj(e)}},vj=w.createContext();class xj{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var my={exports:{}},gy={};/**
63
+ * @license React
64
+ * use-sync-external-store-shim.production.js
65
+ *
66
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
67
+ *
68
+ * This source code is licensed under the MIT license found in the
69
+ * LICENSE file in the root directory of this source tree.
70
+ */var dT;function wj(){if(dT)return gy;dT=1;var e=hd();function t(p,y){return p===y&&(p!==0||1/p===1/y)||p!==p&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,s=e.useLayoutEffect,l=e.useDebugValue;function c(p,y){var g=y(),x=r({inst:{value:g,getSnapshot:y}}),C=x[0].inst,T=x[1];return s(function(){C.value=g,C.getSnapshot=y,f(C)&&T({inst:C})},[p,g,y]),a(function(){return f(C)&&T({inst:C}),p(function(){f(C)&&T({inst:C})})},[p]),l(g),g}function f(p){var y=p.getSnapshot;p=p.value;try{var g=y();return!n(p,g)}catch{return!0}}function d(p,y){return y()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return gy.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,gy}var fT;function jk(){return fT||(fT=1,my.exports=wj()),my.exports}var Zv=jk();const Sj=(e,t)=>Is(t)?t:uj(t)&&Is(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,Ej={t:Sj,ready:!1},Tj=()=>()=>{},xn=(e,t={})=>{var $,F,W;const{i18n:n}=t,{i18n:r,defaultNS:a}=w.useContext(vj)||{},s=n||r||yj();s&&!s.reportNamespaces&&(s.reportNamespaces=new xj),s||Pk(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const l=w.useMemo(()=>{var L;return{...mj(),...(L=s==null?void 0:s.options)==null?void 0:L.react,...t}},[s,t]),{useSuspense:c,keyPrefix:f}=l,d=a||(($=s==null?void 0:s.options)==null?void 0:$.defaultNS),m=Is(d)?[d]:d||["translation"],p=w.useMemo(()=>m,m);(W=(F=s==null?void 0:s.reportNamespaces)==null?void 0:F.addUsedNamespaces)==null||W.call(F,p);const y=w.useRef(0),g=w.useCallback(L=>{if(!s)return Tj;const{bindI18n:V,bindI18nStore:q}=l,Y=()=>{y.current+=1,L()};return V&&s.on(V,Y),q&&s.store.on(q,Y),()=>{V&&V.split(" ").forEach(j=>s.off(j,Y)),q&&q.split(" ").forEach(j=>s.store.off(j,Y))}},[s,l]),x=w.useRef(),C=w.useCallback(()=>{if(!s)return Ej;const L=!!(s.isInitialized||s.initializedStoreOnce)&&p.every(H=>lj(H,s,l)),V=t.lng||s.language,q=y.current,Y=x.current;if(Y&&Y.ready===L&&Y.lng===V&&Y.keyPrefix===f&&Y.revision===q)return Y;const z={t:s.getFixedT(V,l.nsMode==="fallback"?p:p[0],f),ready:L,lng:V,keyPrefix:f,revision:q};return x.current=z,z},[s,p,f,l,t.lng]),[T,S]=w.useState(0),{t:R,ready:k}=Zv.useSyncExternalStore(g,C,C);w.useEffect(()=>{if(s&&!k&&!c){const L=()=>S(V=>V+1);t.lng?cT(s,t.lng,p,L):Ab(s,p,L)}},[s,t.lng,p,k,c,T]);const M=s||{},D=w.useRef(null),O=w.useRef(),N=L=>{const V=Object.getOwnPropertyDescriptors(L);V.__original&&delete V.__original;const q=Object.create(Object.getPrototypeOf(L),V);if(!Object.prototype.hasOwnProperty.call(q,"__original"))try{Object.defineProperty(q,"__original",{value:L,writable:!1,enumerable:!1,configurable:!1})}catch{}return q},_=w.useMemo(()=>{const L=M,V=L==null?void 0:L.language;let q=L;L&&(D.current&&D.current.__original===L?O.current!==V?(q=N(L),D.current=q,O.current=V):q=D.current:(q=N(L),D.current=q,O.current=V));const Y=[R,q,k];return Y.t=R,Y.i18n=q,Y.ready=k,Y},[R,M,k,M.resolvedLanguage,M.language,M.languages]);if(s&&c&&!k)throw new Promise(L=>{const V=()=>L();t.lng?cT(s,t.lng,p,V):Ab(s,p,V)});return _},Cj={en_US:{translation:{common:{loading:"Loading...",save:"Save",saving:"Saving...",cancel:"Cancel",add:"Add",delete:"Delete",edit:"Edit",confirm:"Confirm",close:"Close",expand:"Expand",collapse:"Collapse",refresh:"Refresh",test:"Test",send:"Send",success:"Success",error:"Error",warning:"Warning",info:"Info",yes:"Yes",no:"No",enabled:"Enabled",disabled:"Disabled",pending:"Pending",authorized:"Authorized",unknown:"Unknown",empty:"Empty",none:"None",default:"Default",optional:"Optional",required:"Required",pwaInstallTitle:"Install as app",pwaInstallHintIOSSafari:'iOS Safari does not show an automatic install prompt. Tap Share, then "Add to Home Screen".',pwaInstallHintIOSChrome:'iOS Chrome does not show an automatic install prompt. Tap Share, then "Add to Home Screen".'},nav:{manageDevices:"Manage Devices",settings:"Settings",sidebarExpand:"Expand Sidebar",sidebarCollapse:"Collapse Sidebar",openSidebar:"Open Sidebar",closeSidebar:"Close Sidebar",jumpToLatest:"Jump to Latest",switchToEditor:"Switch to Editor Input",switchToDirect:"Switch to Direct Input",refreshPage:"Refresh Page",refreshPageConfirm:"Are you sure you want to refresh the page? Unsaved content will be lost."},device:{title:"Device Management",devices:"Devices",addDevice:"Add Device",addDeviceDescription:"Fill in device details and choose a connection method",addFirstDevice:"Add First Device",editDevice:"Edit Device",editDeviceDescription:"Update device configuration",sectionBasic:"Basic Info",sectionConnection:"Connection",sectionAuth:"Authentication",noDevices:"No Devices",noDevicesDescription:"Add a local or SSH device to get started",name:"Device Name",namePlaceholder:"e.g., My Server",type:"Type",typeLocal:"Local Device",typeSSH:"SSH Remote Device",typeSSHBadge:"SSH",host:"Host",hostPlaceholder:"example.com",port:"Port",username:"Username",usernamePlaceholder:"root",session:"Tmux Session Name",sessionPlaceholder:"tmex",sessionHint:'Leave empty to use default "tmex"',authMode:"Authentication Mode",authPassword:"Password",authKey:"Private Key",authAgent:"SSH Agent",authConfigRef:"SSH Config",password:"Password",privateKey:"Private Key",privateKeyPlaceholder:"-----BEGIN OPENSSH PRIVATE KEY-----",privateKeyPassphrase:"Private Key Passphrase (Optional)",passphrase:"Passphrase",connect:"Connect",connected:"Connected",disconnect:"Disconnect",disconnected:"Disconnected",connecting:"Connecting...",deleteConfirm:"Delete this device?",deleteDescription:'Device "{{name}}" will be permanently removed. This action cannot be undone.',deleteSuccess:"Device deleted",createSuccess:"Device created",updateSuccess:"Device updated",deleteFailed:"Failed to delete device",createFailed:"Failed to create device",updateFailed:"Failed to update device",loadFailed:"Failed to load devices",localDevice:"Local Device",subtitle:"{{username}}@{{host}}:{{port}}",modify:"Modify Device",delete:"Delete"},terminal:{initializing:"Initializing terminal...",connecting:"Connecting to device...",initFailed:"Terminal initialization failed",inputPlaceholder:"Type command here...",clear:"Clear",deviceError:"Device Error",deviceErrorWithType:"[{{type}}] Device Error",noDeviceSelected:"No device selected",windowClosed:"Current window has been closed, please select a window from the sidebar.",paneClosed:"Current pane has been closed, please select a pane from the sidebar.",bellNotification:"Terminal Bell Notification",bellDescription:"Window {{window}} · Pane {{pane}}",bellFallback:"Received tmux bell",paneTitle:"Pane {{index}}",activePane:"Current Pane",activeWindow:"Current Window",editorPlaceholder:"Enter commands here...",editorClear:"Clear",editorSendWithEnter:"Send with Enter",editorSendLineByLine:"Send Line by Line",editorSend:"Send",sendShortcut:"Send {{key}}",inputModeDirect:"Direct Input",inputModeEditor:"Editor",newWindow:"New Window",closeWindow:"Close Window",closePane:"Close Pane",copy:"Copy",paste:"Paste",copied:"Copied to clipboard",copyFailed:"Copy failed",pasteFailed:"Could not read clipboard, check browser permissions",clearSelection:"Dismiss selection"},settings:{title:"System Settings",siteSettings:"Site Settings",siteName:"Site Name",siteNamePlaceholder:"tmex",siteUrl:"Site URL",siteUrlPlaceholder:"http://localhost:3000",bellThrottle:"Bell Throttle (seconds)",notificationThrottle:"Notification Throttle (seconds)",enableBrowserBellToast:"Enable Browser Bell Toast",enableBrowserNotificationToast:"Enable Browser Notification Toast",enableTelegramBellPush:"Enable Telegram Bell Push",enableTelegramNotificationPush:"Enable Telegram Notification Push",sshReconnectRetries:"SSH Reconnect Retries",sshReconnectDelay:"SSH Reconnect Delay (seconds)",language:"Language",languagePlaceholder:"Select language",language_en_US:"English",language_zh_CN:"简体中文",language_ja_JP:"日本語",theme:"Theme",themeLight:"Light",themeDark:"Dark",siteTab:"Site",notificationsTab:"Notifications",refreshToApply:"Refresh to apply language change",saveSettings:"Save Settings",settingsSaved:"Settings saved",saveFailed:"Failed to save settings",loadFailed:"Failed to load settings",restartGateway:"Restart Gateway",restartScheduled:"Gateway restart scheduled",restartConfirm:"Are you sure you want to restart Gateway? This will interrupt all active connections.",restartFailed:"Failed to restart gateway",sshReconnectMaxRetries:"SSH Reconnect Retries",llm:{title:"LLM Providers",name:"Name",namePlaceholder:"e.g. OpenAI",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.openai.com",baseUrlHint:"Adds /v1 automatically; end with / to keep the path as-is",protocol:"Protocol",apiKey:"API Key",apiKeyPlaceholder:"Enter API key",apiKeySetPlaceholder:"Already set, leave blank to keep",addProvider:"Add Provider",editProvider:"Edit Provider",formHint:"Configure the provider connection",models:"Models",modelsTitle:"Models for {{name}}",modelsHint:"Manage the available models for this provider: toggle and add manually",modelManual:"Manual",addModelPlaceholder:"Add a model ID",empty:"No providers yet",refreshModels:"Refresh Models",modelsCount:"{{total}} models",modelsNotFetched:"Models not fetched yet",modelsFetchFailed:"Failed to fetch models: {{error}}",deleteProvider:"Delete Provider",deleteConfirm:'Delete provider "{{name}}"?',defaults:"Global Defaults",defaultProvider:"Default Provider",defaultProviderNone:"Not set",defaultModel:"Default Model",defaultModelPlaceholder:"Type or pick a model ID",saveDefaults:"Save Defaults",loadFailed:"Failed to load LLM providers",createFailed:"Failed to create provider",updateFailed:"Failed to update provider",deleteFailed:"Failed to delete provider",refreshModelsFailed:"Failed to refresh models",settingsLoadFailed:"Failed to load LLM settings",settingsSaveFailed:"Failed to save LLM settings"},search:{title:"Search",provider:"Search Provider",providerNone:"Disabled",tavilyApiKey:"Tavily API Key",braveApiKey:"Brave API Key",keyPlaceholder:"Enter API key",keySetPlaceholder:"Already set, leave blank to keep",clearKey:"Clear",clearKeyConfirm:"Clear this API key? You will need to enter it again.",loadFailed:"Failed to load search settings",saveFailed:"Failed to save search settings"}},telegram:{title:"Telegram Bot Management",botName:"Bot Name",botNamePlaceholder:"e.g., ops-bot",botToken:"Bot Token",botTokenPlaceholder:"123456:AA...",addBot:"Add Bot",enableBot:"Enable Bot",allowAuthRequests:"Allow Authorization Requests",pendingChats:"Pending Authorization",chats:"Authorized Chats",authorizedChats:"Authorized",noPendingChats:"No pending chats",noAuthorizedChats:"No authorized chats",approve:"Approve",authorize:"Authorize",reject:"Reject",revokeAuth:"Revoke Authorization",testMessage:"Test Message",sendTestMessage:"Send Test Message",deleteBot:"Delete Bot",tokenOptional:"Token (leave empty to keep unchanged)",tokenPlaceholder:"Enter new token",botCreated:"Bot created",botUpdated:"Bot updated",botDeleted:"Bot deleted",authApproved:"Authorization approved",chatRemoved:"Chat removed",testMessageSent:"Test message sent",createFailed:"Failed to create bot",updateFailed:"Failed to update bot",deleteFailed:"Failed to delete bot",approveFailed:"Failed to approve authorization",removeFailed:"Failed to remove chat",testMessageFailed:"Failed to send test message",loadBotsFailed:"Failed to load bot list",loadChatsFailed:"Failed to load chat list",noBots:"No bots yet, add one first.",expand:"Expand",collapse:"Collapse",authCount:"{{authorized}} authorized / {{pending}} pending (max 8)",chatId:"Chat ID",applyTime:"Application Time",gatewayOnline:"🟢 Gateway online @ {{siteName}}",deviceConnectionError:`🔴 {{siteName}}: Connection error on device "{{deviceName}}" ({{host}}) [{{category}}]
71
+ {{error}}`,agentCredentialWarning:'⚠️ {{siteName}}: A message in agent session "{{sessionTitle}}" appears to contain credentials ({{types}}). It will be sent to the LLM and stored — risk of leakage.',authSuccess:"✅ Authorized. You will now receive notifications.",authPending:"⏳ Authorization request received. Please approve in tmex settings.",authFailed:"❌ Authorization request failed. Please contact administrator.",testMessageTemplate:`🧪 Test Message
72
+ Site: {{siteName}}
73
+ Time: {{time}}`,approveMessageTemplate:`✅ Authorized via tmex.
74
+ Bot: {{botName}}
75
+ Time: {{time}}`,botNotFound:"Bot not found or unavailable",botNotRunning:"Bot is not running or unavailable"},webhook:{title:"Webhooks",url:"Webhook URL",secret:"Secret",secretPlaceholder:"Used to sign payloads (HMAC-SHA256)",enabled:"Enabled",eventMask:"Events",add:"Add Webhook",empty:"No webhooks yet.",createFailed:"Failed to create webhook",deleteFailed:"Failed to delete webhook",loadFailed:"Failed to load webhooks"},sshError:{sshConfigRefNotSupported:"SSH Config reference is not supported in this version. Please use host + username with Agent/Key/Password authentication.",configRefNotSupported:"SSH Config reference is not supported in this version. Please use host + username with Agent/Key/Password authentication.",agentUnavailable:"SSH Agent unavailable: SSH_AUTH_SOCK not detected. Please check agent environment.",agentNoIdentity:"SSH Agent has no available keys. Please run ssh-add first.",agentNoIdentities:"SSH Agent has no available keys. Please run ssh-add first.",authFailed:"Authentication failed: incorrect username, password, or key. Please check device configuration.",authFailedGeneric:"Authentication failed: incorrect username, password, or key. Please check device configuration.",networkUnreachable:"Network unreachable: Please check routing, firewall, or VPN configuration.",connectionRefused:"Connection refused: Unable to connect to target host. Please check host address and port.",timeout:"Connection timeout: Unable to connect to device. Please check network or firewall settings.",connectionTimeout:"Connection timeout: Unable to connect to device. Please check network or firewall settings.",hostNotFound:"Host not found: Unable to resolve hostname. Please check DNS or hostname configuration.",handshakeFailed:"Handshake failed: Unable to establish secure connection. Possibly incompatible key exchange algorithm.",tmuxUnavailable:"Remote tmux unavailable or failed to start. Please ensure tmux is installed and available in the remote shell PATH.",connectionClosed:"Connection closed, attempting to reconnect",unknown:"Connection failed: {{message}}",reconnecting:"Connection interrupted, reconnecting in {{delay}} seconds ({{attempt}}/{{maxRetries}})",reconnectFailed:"Auto-reconnect failed, please retry manually",reconnected:"Device reconnected automatically"},deviceStatus:{reconnecting:"Reconnecting {{delay}}s",offline:"Offline",errorBadge:{authFailed:"Auth failed",agentUnavailable:"Agent unavailable",agentNoIdentity:"Agent has no keys",configRefNotSupported:"SSH Config unsupported",networkUnreachable:"Network unreachable",connectionRefused:"Refused",timeout:"Timeout",hostNotFound:"Host not found",handshakeFailed:"Handshake failed",tmuxUnavailable:"Tmux unavailable",connectionClosed:"Disconnected",unknown:"Connection error"}},websocket:{error:"WebSocket connection error",checkGateway:"Please check Gateway status",upgradeFailed:"Upgrade failed",invalidMessage:"Invalid message format"},wsError:{checkGateway:"Please check Gateway status"},apiError:{siteNameRequired:"Site name cannot be empty",siteUrlInvalid:"Site URL must start with http:// or https://",bellThrottleInvalid:"Bell throttle seconds must be between 0-300",sshRetriesInvalid:"SSH reconnect retries must be between 0-20",sshDelayInvalid:"SSH reconnect delay must be between 1-300 seconds",languageInvalid:"Language must be one of the supported locales",botNameRequired:"Bot name cannot be empty",botTokenRequired:"Bot token cannot be empty",missingFields:"Missing required fields",sshRequiresHost:"SSH device requires host or sshConfigRef",invalidRequest:"Invalid request",deviceNotFound:"Device not found",botNotFound:"Bot not found",chatNotFound:"Chat not found",urlAndSecretRequired:"URL and secret are required",notFound:"Not found",llmProviderNameRequired:"Provider name cannot be empty",llmProviderProtocolInvalid:"Protocol must be openai-chat or openai-responses",llmProviderBaseUrlInvalid:"Base URL must start with http:// or https://",llmProviderApiKeyRequired:"API key cannot be empty",llmProviderNotFound:"LLM provider not found",llmProviderDisabled:"LLM provider {{name}} is disabled",llmNoDefaultProvider:"No LLM provider specified and no default provider configured",llmNoDefaultModel:"No model specified and no default model configured",llmDefaultProviderNotFound:"Default provider does not exist",llmSearchProviderInvalid:"Search provider must be none, tavily or brave",llmFetchModelsFailed:"Failed to fetch model list: {{detail}}",agentSessionNotFound:"Agent session not found",agentSessionBusy:"Agent session is currently running, stop it or wait for completion",agentSessionAwaitingConfirmation:"Agent session has pending confirmations, resolve them first",agentDeviceRequired:"Device is required",agentPaneRequired:"Terminal pane is required",agentWriteModeInvalid:"Write mode must be confirm or auto",agentMaxStepsInvalid:"Max steps per turn must be between 1 and 100",agentProviderWebSearchRequiresResponses:"Provider built-in web search requires the openai-responses protocol",agentHostedToolUnknown:"Unknown hosted tool: {{name}}",agentHostedToolRequiresResponses:"Provider hosted tools require the openai-responses protocol",agentSessionOrphaned:"This agent session is orphaned (its terminal is gone) and is read-only",agentQueuedMessageNotFound:"Queued message not found",agentConfirmationNotFound:"Confirmation not found",agentConfirmationAlreadyDecided:"Confirmation has already been decided",agentMessageTextRequired:"Message text is required",watchRuleNotFound:"Watch rule not found",watchNameRequired:"Rule name is required",watchTriggerTypeInvalid:"Trigger type must be match, unchanged or llm",watchPatternRequired:"match/unchanged rules require a regular expression",watchPatternInvalid:"Invalid regular expression: {{detail}}",watchUnchangedMinutesInvalid:"unchanged rules require unchangedMinutes greater than 0",watchExtractGroupInvalid:"Capture group index must be an integer >= 0",watchConditionPromptRequired:"llm rules require a condition prompt",watchIntervalInvalid:"Sampling interval must be at least {{min}} seconds",watchNoMatchBehaviorInvalid:"No-match behavior must be reset or ignore",watchFireModeInvalid:"Fire mode must be once or repeat",watchCooldownInvalid:"Cooldown seconds must be an integer >= 0",watchAssistDescriptionRequired:"Please describe what to match",watchAssistModelUnavailable:"Model call failed: {{detail}}"},notification:{clickToJump:"Click to jump to corresponding pane",eventType:{terminal_bell:"🔔 Terminal Bell",terminal_notification:"🔔 Terminal Notification",tmux_window_close:"🪟 Window Closed",tmux_pane_close:"📱 Pane Closed",device_tmux_missing:"⚠️ Tmux Missing",device_disconnect:"🔌 Device Disconnected",session_created:"🆕 Session Created",session_closed:"🚪 Session Closed",agent_confirmation_pending:"🤖 Agent Confirmation Pending",agent_turn_finished:"🤖 Agent Turn Finished",agent_error:"🤖 Agent Error",watch_triggered:"👁️ Watch Rule Triggered",watch_model_unavailable:"👁️ Watch Model Unavailable",watch_rule_error:"👁️ Watch Rule Error"},site:"Site",device:"Device",window:"Window",pane:"Pane",time:"Time",directLink:"Direct Link",message:"Message",telegramBell:{title:"🔔 Bell from {{siteName}}: {{terminalTopbarLabel}}",viewLink:"Click to view",terminalTopbarLabel:"Window {{window}} · Pane {{pane}} @ {{device}}"},telegramNotification:{},agent:{confirmationPending:'Agent "{{title}}" requests to run tool {{toolName}}, awaiting confirmation',turnFinished:'Agent "{{title}}" turn finished',error:'Agent "{{title}}" error: {{message}}'},watch:{matchTriggered:'Watch "{{name}}" matched: {{text}}',unchangedTriggered:'Watch "{{name}}" value "{{value}}" has been unchanged for {{minutes}} minutes',llmTriggered:'Watch "{{name}}" condition met: {{reason}}',summaryTriggered:'Watch "{{name}}": {{summary}}',unconfirmedSuffix:" (model unavailable, not LLM-confirmed)",modelUnavailable:'Watch "{{name}}" model call failed: {{message}}',ruleError:'Watch "{{name}}" failed {{count}} times in a row and has been disabled: {{message}}'}},sidebar:{noWindows:"No windows",noDevices:"No devices",addDeviceLink:"Add Device",openSettingsLink:"Open Settings",openSettings:"Open Settings",manageDevices:"Manage Devices",settings:"Settings",currentWindow:"Current Window",currentPane:"Current Pane",newWindow:"Create Window",closeWindow:"Close Window",closePane:"Close Pane",addDevice:"Add Device",tab:{panes:"Panes",agent:"Agent",files:"Files"},orphanedSessions:"Orphaned sessions"},agent:{error:{streamStalled:"The model stopped responding (upstream stream stalled). Please retry."},model:{select:"Select model",placeholder:"Model",noProviders:"No models — configure a provider in Settings"},queue:{title:"Queued ({{count}})",steer:"Steer now",steerHint:"Interrupt the current step and inject the queue now",withdraw:"Withdraw"},orphan:{readonly:"This session is orphaned (its terminal is gone) — read-only",title:"Orphaned",process:"Process",startedAt:"Started"},files:{comingSoon:"Coming Soon"},panel:{title:"Agent",empty:"Select or create a session",inputPlaceholder:"Type a message…",send:"Send",stop:"Stop",retry:"Retry",scrollToBottom:"Scroll to bottom"},session:{none:"No session selected",new:"New session",switch:"Switch session",selectPaneHint:"Select a pane in the Panes tab to start a session",noSessions:"No sessions yet",showAll:"Show all sessions",rename:"Rename session",renameTitle:"Rename session",renamePlaceholder:"Session title",save:"Save",cancel:"Cancel",delete:"Delete session",deleteTitle:"Delete this session?",deleteDesc:'"{{title}}" and all its messages will be permanently deleted.',deleteConfirm:"Delete",createDisabledNoPane:"Open a terminal pane to create a session",privacyNotice:"Sessions send terminal screen content to the configured LLM service."},binding:{invalid:"Pane unavailable",mismatchTitle:"This session is bound to a different pane",goTo:"Go to pane",rebind:"Rebind here"},writeMode:{confirm:"Confirm writes",auto:"Auto execute"},confirm:{title:"Approval required",approve:"Allow",deny:"Deny"},tool:{input:"Input",result:"Result",screen:"Screen capture",send_input:"Send input",read_screen:"Read screen",web_search:"Web search",fetch_url:"Fetch URL",denied:"Denied"},reasoning:{title:"Reasoning"},toast:{errorTitle:'Agent "{{title}}" error',credentialWarningTitle:"Message may contain credentials",credentialWarningDescription:"Detected {{types}}. The content is not modified, but it will be sent to the LLM and stored — risk of leakage."}},window:{noWindows:"No windows",new:"New Window",close:"Close window",closePane:"Close pane",closeConfirmTitle:"Close this window?",closePaneConfirmTitle:"Close this pane?",closeConfirmDesc:'Processes running in "{{name}}" will be terminated. This action cannot be undone.',menu:"Window actions",rename:"Rename window",renamePlaceholder:"Enter a name",renameDesc:"The custom name overrides the title set by the terminal and is kept until the gateway restarts.",renameReset:"Use automatic name"},watch:{title:"Watch rules",dialogDesc:"Monitor this pane's screen and get notified when conditions are met",openMonitor:"Watch this pane",rules:{empty:"No watch rules for this pane yet",addRule:"New rule",edit:"Edit",delete:"Delete",viewState:"Status",lastTriggered:"Last triggered: {{time}}",neverTriggered:"Never triggered",deleteTitle:"Delete this rule?",deleteDesc:'"{{name}}" will be permanently deleted.',deleteConfirm:"Delete"},type:{match:"Match",unchanged:"Stuck",llm:"LLM"},typeDesc:{match:"Trigger when a regex matches the screen",unchanged:"Trigger when an extracted value stays unchanged for N minutes (e.g. stalled download)",llm:"An LLM periodically checks the screen against a natural-language condition"},form:{createTitle:"New watch rule",editTitle:"Edit watch rule",name:"Rule name",namePlaceholder:"e.g. Download stalled",triggerType:"Trigger type",pattern:"Regular expression",patternPlaceholder:"e.g. (\\d+)%",flags:"Flags",flagsPlaceholder:"e.g. i",extractGroup:"Capture group index",extractGroupHint:"0 = whole match; the group value is tracked over time",unchangedMinutes:"Unchanged for (minutes)",noMatchBehavior:"When nothing matches",noMatchReset:"Reset timer (progress line gone = task done)",noMatchIgnore:"Ignore (keep last value)",conditionPrompt:"Condition (natural language)",conditionPromptPlaceholder:"e.g. The build has failed with a compile error",model:"Model",followGlobalDefault:"Follow global default",modelPlaceholder:"Model ID",modelRequiredHint:"This rule calls an LLM. Make sure the selected (or global default) model is available.",confirmWithLlm:"LLM double-check before notifying",confirmWithLlmDesc:"Reduce false positives; fails open if the model is unavailable",summarizeWithLlm:"LLM notification summary",summarizeWithLlmDesc:"Summarize the screen into the notification text",intervalSeconds:"Sampling interval (seconds)",intervalHint:"Minimum {{min}}s",fireMode:"Fire mode",fireOnce:"Once (auto-disable after firing)",fireRepeat:"Repeat",cooldownSeconds:"Cooldown (seconds)",enabled:"Enabled",assistLabel:"Generate regex from a description",assistPlaceholder:"e.g. match the download progress percentage",assistButton:"Generate",assistExplanation:"Explanation",assistPreview:"Matches on current screen",assistPreviewEmpty:"No matches on the current screen sample",create:"Create",save:"Save",providerUnavailable:"Original provider unavailable",providerDisabled:"disabled"},validation:{nameRequired:"Rule name is required",patternRequired:"Regular expression is required",patternInvalid:"Invalid regular expression: {{detail}}",unchangedMinutesInvalid:"Unchanged minutes must be greater than 0",conditionPromptRequired:"Condition prompt is required",intervalMin:"Sampling interval must be at least {{min}} seconds"},state:{title:"Rule status",back:"Back",lastSampledAt:"Last sampled",lastValue:"Last value",lastValueChangedAt:"Value last changed",lastTriggeredAt:"Last triggered",consecutiveErrors:"Consecutive errors",lastError:"Last error",samples:"Recent samples",samplesEmpty:"No samples yet",hit:"hit",none:"—"},toast:{created:"Watch rule created",updated:"Watch rule updated",deleted:"Watch rule deleted",triggeredTitle:"Watch triggered",openTerminal:"Open terminal",modelUnavailableTitle:"Watch model unavailable",modelUnavailableHint:"The rule keeps running with degraded behavior.",ruleErrorTitle:"Watch rule auto-disabled"},notifPermission:{title:"Enable browser notifications?",desc:"Get notified when watch rules trigger, even when this tab is in the background.",enable:"Enable",dismiss:"Not now"}},validation:{deviceNameRequired:"Device name is required",hostRequired:"Host is required for SSH devices"}}},zh_CN:{translation:{common:{loading:"加载中...",save:"保存",saving:"保存中...",cancel:"取消",add:"添加",delete:"删除",edit:"修改",confirm:"确认",close:"关闭",expand:"展开",collapse:"收起",refresh:"刷新",test:"测试",send:"发送",success:"成功",error:"错误",warning:"警告",info:"信息",yes:"是",no:"否",enabled:"已启用",disabled:"已禁用",pending:"待授权",authorized:"已授权",unknown:"未知",empty:"空",none:"无",default:"默认",optional:"可选",required:"必填",pwaInstallTitle:"安装为应用",pwaInstallHintIOSSafari:"iOS Safari 不会自动弹出安装提示。请点击「分享」,再选择「添加到主屏幕」。",pwaInstallHintIOSChrome:"iOS Chrome 不会自动弹出安装提示。请点击「分享」,再选择「添加到主屏幕」"},nav:{manageDevices:"管理设备",settings:"设置",sidebarExpand:"展开侧边栏",sidebarCollapse:"收起侧边栏",openSidebar:"打开侧边栏",closeSidebar:"关闭侧边栏",jumpToLatest:"跳转到最新",switchToEditor:"切换到编辑器输入",switchToDirect:"切换到直接输入",refreshPage:"刷新页面",refreshPageConfirm:"确定要刷新页面吗?未保存的内容将会丢失。"},device:{title:"设备管理",devices:"设备",addDevice:"添加设备",addDeviceDescription:"填写设备信息并选择连接方式",addFirstDevice:"添加第一个设备",editDevice:"修改设备",editDeviceDescription:"更新设备配置",sectionBasic:"基本信息",sectionConnection:"连接信息",sectionAuth:"认证信息",noDevices:"暂无设备",noDevicesDescription:"添加本地或 SSH 设备开始使用",name:"设备名称",namePlaceholder:"例如:我的服务器",type:"类型",typeLocal:"本地设备",typeSSH:"SSH 远程设备",typeSSHBadge:"SSH",host:"主机",hostPlaceholder:"example.com",port:"端口",username:"用户名",usernamePlaceholder:"root",session:"Tmux 会话名称",sessionPlaceholder:"tmex",sessionHint:'留空将使用默认值 "tmex"',authMode:"认证方式",authPassword:"密码",authKey:"私钥",authAgent:"SSH Agent",authConfigRef:"SSH Config",password:"密码",privateKey:"私钥",privateKeyPlaceholder:"-----BEGIN OPENSSH PRIVATE KEY-----",privateKeyPassphrase:"私钥密码(可选)",passphrase:"私钥密码(可选)",connect:"连接",connected:"已连接",disconnect:"断开",disconnected:"已断开",connecting:"连接中...",deleteConfirm:"删除此设备?",deleteDescription:'设备 "{{name}}" 将被永久移除,此操作无法撤销。',deleteSuccess:"设备已删除",createSuccess:"设备已创建",updateSuccess:"设备已更新",deleteFailed:"删除设备失败",createFailed:"创建设备失败",updateFailed:"更新设备失败",loadFailed:"加载设备列表失败",localDevice:"本地设备",subtitle:"{{username}}@{{host}}:{{port}}",modify:"修改设备",delete:"删除"},terminal:{initializing:"初始化终端...",connecting:"连接设备...",initFailed:"终端初始化失败",inputPlaceholder:"在此输入命令...",clear:"清空",deviceError:"设备错误",deviceErrorWithType:"[{{type}}] 设备错误",noDeviceSelected:"未选择设备",windowClosed:"当前窗口已关闭,请在侧边栏重新选择窗口。",paneClosed:"当前 Pane 已关闭,请在侧边栏重新选择 Pane。",bellNotification:"终端 Bell 提醒",bellDescription:"窗口 {{window}} · Pane {{pane}}",bellFallback:"收到 tmux bell",paneTitle:"Pane {{index}}",activePane:"当前 pane",activeWindow:"当前窗口",editorPlaceholder:"在此输入命令...",editorClear:"清空",editorSendWithEnter:"发送附带回车",editorSendLineByLine:"逐行发送",editorSend:"发送",sendShortcut:"发送 {{key}}",inputModeDirect:"直接输入",inputModeEditor:"编辑器",newWindow:"新建窗口",closeWindow:"关闭窗口",closePane:"关闭 pane",copy:"复制",paste:"粘贴",copied:"已复制到剪贴板",copyFailed:"复制失败",pasteFailed:"无法读取剪贴板,请检查浏览器权限",clearSelection:"取消选择"},settings:{title:"系统设置",siteSettings:"站点设置",siteName:"站点名称",siteNamePlaceholder:"tmex",siteUrl:"站点访问 URL",siteUrlPlaceholder:"http://localhost:3000",bellThrottle:"Bell 频控(秒)",notificationThrottle:"通知频控(秒)",enableBrowserBellToast:"开启浏览器 Bell Toast",enableBrowserNotificationToast:"开启浏览器通知 Toast",enableTelegramBellPush:"开启 Telegram Bell 推送",enableTelegramNotificationPush:"开启 Telegram 通知推送",sshReconnectRetries:"SSH 重连次数",sshReconnectDelay:"SSH 重连等待(秒)",language:"语言",languagePlaceholder:"选择语言",language_en_US:"English",language_zh_CN:"简体中文",language_ja_JP:"日本語",theme:"主题",themeLight:"浅色",themeDark:"深色",siteTab:"站点",notificationsTab:"通知",refreshToApply:"刷新后生效",saveSettings:"保存设置",settingsSaved:"站点设置已保存",saveFailed:"保存设置失败",loadFailed:"加载设置失败",restartGateway:"重启 Gateway",restartScheduled:"Gateway 重启请求已发送",restartConfirm:"确定要重启 Gateway 吗?这将中断所有活动连接。",restartFailed:"重启请求失败",sshReconnectMaxRetries:"SSH 重连次数",llm:{title:"LLM 提供商",name:"名称",namePlaceholder:"如 OpenAI",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.openai.com",baseUrlHint:"默认自动补全 /v1;以 / 结尾则按原路径不补 /v1",protocol:"协议",apiKey:"API Key",apiKeyPlaceholder:"输入 API Key",apiKeySetPlaceholder:"已设置,留空不修改",addProvider:"添加提供商",editProvider:"编辑供应商",formHint:"配置供应商连接信息",models:"模型",modelsTitle:"{{name}} 的模型",modelsHint:"管理该供应商可用的模型,启停与手动添加",modelManual:"手动",addModelPlaceholder:"添加模型 ID",empty:"暂无提供商",refreshModels:"刷新模型",modelsCount:"{{total}} 个模型",modelsNotFetched:"尚未获取模型列表",modelsFetchFailed:"模型列表获取失败:{{error}}",deleteProvider:"删除提供商",deleteConfirm:"确定要删除提供商「{{name}}」吗?",defaults:"全局默认",defaultProvider:"默认提供商",defaultProviderNone:"未设置",defaultModel:"默认模型",defaultModelPlaceholder:"输入或选择模型 ID",saveDefaults:"保存默认设置",loadFailed:"加载 LLM 提供商失败",createFailed:"创建提供商失败",updateFailed:"更新提供商失败",deleteFailed:"删除提供商失败",refreshModelsFailed:"刷新模型失败",settingsLoadFailed:"加载 LLM 设置失败",settingsSaveFailed:"保存 LLM 设置失败"},search:{title:"搜索",provider:"搜索提供商",providerNone:"不启用",tavilyApiKey:"Tavily API Key",braveApiKey:"Brave API Key",keyPlaceholder:"输入 API Key",keySetPlaceholder:"已设置,留空不修改",clearKey:"清除",clearKeyConfirm:"确定要清除此 API Key 吗?清除后需要重新填写。",loadFailed:"加载搜索设置失败",saveFailed:"保存搜索设置失败"}},telegram:{title:"Telegram Bot 管理",botName:"Bot 名称",botNamePlaceholder:"如:ops-bot",botToken:"Bot Token",botTokenPlaceholder:"123456:AA...",addBot:"新增 Bot",enableBot:"启用 Bot",allowAuthRequests:"允许申请授权",pendingChats:"待授权",chats:"已授权",authorizedChats:"已授权",noPendingChats:"暂无待授权 chat",noAuthorizedChats:"暂无已授权 chat",approve:"批准",authorize:"授权",reject:"拒绝",revokeAuth:"撤销授权",testMessage:"测试消息",sendTestMessage:"发送测试消息",deleteBot:"删除 Bot",tokenOptional:"Token(留空不改)",tokenPlaceholder:"输入新 token",botCreated:"Bot 已创建",botUpdated:"Bot 已更新",botDeleted:"Bot 已删除",authApproved:"授权已批准",chatRemoved:"chat 已移除",testMessageSent:"测试消息已发送",createFailed:"新增 Bot 失败",updateFailed:"更新 Bot 失败",deleteFailed:"删除 Bot 失败",approveFailed:"批准授权失败",removeFailed:"删除 chat 失败",testMessageFailed:"发送测试消息失败",loadBotsFailed:"加载 Bot 列表失败",loadChatsFailed:"加载 chat 列表失败",noBots:"暂无 Bot,先添加一个。",expand:"展开",collapse:"收起",authCount:"已授权 {{authorized}} / 待授权 {{pending}}(总上限 8)",chatId:"chatId",applyTime:"申请时间",gatewayOnline:"🟢 Gateway online @ {{siteName}}",deviceConnectionError:`🔴 {{siteName}}:设备「{{deviceName}}」({{host}}) 连接异常 [{{category}}]
76
+ {{error}}`,agentCredentialWarning:"⚠️ {{siteName}}:Agent 会话「{{sessionTitle}}」的一条消息疑似包含凭证({{types}})。该内容将发送至 LLM 并存储,存在泄露风险。",authSuccess:"✅ 已授权,可接收通知。",authPending:"⏳ 已收到授权申请,请在 tmex 设置页审批。",authFailed:"❌ 授权申请失败,请联系管理员。",testMessageTemplate:`🧪 测试消息
77
+ 站点:{{siteName}}
78
+ 时间:{{time}}`,approveMessageTemplate:`✅ 已通过 tmex 授权。
79
+ Bot:{{botName}}
80
+ 时间:{{time}}`,botNotFound:"Bot 未启动或不可用",botNotRunning:"Bot 未启动或不可用"},webhook:{title:"Webhooks",url:"Webhook 地址",secret:"密钥",secretPlaceholder:"用于签名(HMAC-SHA256)",enabled:"启用",eventMask:"事件",add:"添加 Webhook",empty:"暂无 Webhook。",createFailed:"创建 Webhook 失败",deleteFailed:"删除 Webhook 失败",loadFailed:"加载 Webhook 失败"},sshError:{sshConfigRefNotSupported:"当前版本暂不支持 SSH Config 引用,请改为填写 host + username,并选择 Agent/私钥/密码认证",configRefNotSupported:"当前版本暂不支持 SSH Config 引用,请改为填写 host + username,并选择 Agent/私钥/密码认证",agentUnavailable:"SSH Agent 不可用:未检测到 SSH_AUTH_SOCK,请检查 agent 环境",agentNoIdentity:"SSH Agent 未加载可用密钥,请先执行 ssh-add",agentNoIdentities:"SSH Agent 未加载可用密钥,请先执行 ssh-add",authFailed:"认证失败:用户名、密码或密钥不正确,请检查设备配置",authFailedGeneric:"认证失败:用户名、密码或密钥不正确,请检查设备配置",networkUnreachable:"网络不可达:请检查路由、防火墙或 VPN 配置",connectionRefused:"连接被拒绝:无法连接到目标主机,请检查主机地址和端口是否正确",timeout:"连接超时:无法连接到设备,请检查网络或防火墙设置",connectionTimeout:"连接超时:无法连接到设备,请检查网络或防火墙设置",hostNotFound:"主机未找到:无法解析主机地址,请检查 DNS 或主机名是否正确",handshakeFailed:"握手失败:无法建立安全连接,可能是密钥交换算法不兼容",tmuxUnavailable:"远端 tmux 不可用或启动失败,请检查远端是否已安装 tmux,且远端 shell PATH 可找到 tmux",connectionClosed:"连接已断开,尝试重连中",unknown:"连接失败:{{message}}",reconnecting:"连接中断,{{delay}} 秒后自动重连({{attempt}}/{{maxRetries}})",reconnectFailed:"自动重连失败,请手动重试",reconnected:"设备已自动重连"},deviceStatus:{reconnecting:"重连中 {{delay}}s",offline:"离线",errorBadge:{authFailed:"认证失败",agentUnavailable:"Agent 不可用",agentNoIdentity:"Agent 无密钥",configRefNotSupported:"不支持 SSH Config",networkUnreachable:"网络不可达",connectionRefused:"连接被拒",timeout:"连接超时",hostNotFound:"主机未找到",handshakeFailed:"握手失败",tmuxUnavailable:"tmux 不可用",connectionClosed:"连接已断开",unknown:"连接异常"}},websocket:{error:"WebSocket 连接错误",checkGateway:"请检查 Gateway 状态",upgradeFailed:"Upgrade failed",invalidMessage:"Invalid message format"},wsError:{checkGateway:"请检查 Gateway 状态"},apiError:{siteNameRequired:"站点名称不能为空",siteUrlInvalid:"站点 URL 必须以 http:// 或 https:// 开头",bellThrottleInvalid:"Bell 频控秒数需在 0-300 之间",sshRetriesInvalid:"SSH 重连次数需在 0-20 之间",sshDelayInvalid:"SSH 重连等待时间需在 1-300 秒之间",languageInvalid:"语言必须是受支持的区域设置之一",botNameRequired:"Bot 名称不能为空",botTokenRequired:"Bot token 不能为空",missingFields:"缺少必填字段",sshRequiresHost:"SSH 设备需要 host 或 sshConfigRef",invalidRequest:"请求无效",deviceNotFound:"Device not found",botNotFound:"Bot 不存在",chatNotFound:"Chat 不存在",urlAndSecretRequired:"URL and secret required",notFound:"Not found",llmProviderNameRequired:"Provider 名称不能为空",llmProviderProtocolInvalid:"协议必须是 openai-chat 或 openai-responses",llmProviderBaseUrlInvalid:"Base URL 必须以 http:// 或 https:// 开头",llmProviderApiKeyRequired:"API key 不能为空",llmProviderNotFound:"LLM provider 不存在",llmProviderDisabled:"LLM provider {{name}} 已被禁用",llmNoDefaultProvider:"未指定 LLM provider 且未配置默认 provider",llmNoDefaultModel:"未指定模型且未配置默认模型",llmDefaultProviderNotFound:"默认 provider 不存在",llmSearchProviderInvalid:"搜索服务必须是 none、tavily 或 brave",llmFetchModelsFailed:"拉取模型列表失败:{{detail}}",agentSessionNotFound:"Agent 会话不存在",agentSessionBusy:"Agent 会话正在运行中,请先停止或等待完成",agentSessionAwaitingConfirmation:"Agent 会话有待处理的确认请求,请先处理",agentDeviceRequired:"必须指定设备",agentPaneRequired:"必须指定终端 pane",agentWriteModeInvalid:"写入模式必须是 confirm 或 auto",agentMaxStepsInvalid:"每回合最大步数必须在 1-100 之间",agentProviderWebSearchRequiresResponses:"Provider 内置搜索仅支持 openai-responses 协议",agentHostedToolUnknown:"未知的 hosted 工具:{{name}}",agentHostedToolRequiresResponses:"Provider hosted 工具仅支持 openai-responses 协议",agentSessionOrphaned:"该 Agent 会话已孤立(绑定终端已不存在),仅可只读查看",agentQueuedMessageNotFound:"排队消息不存在",agentConfirmationNotFound:"确认请求不存在",agentConfirmationAlreadyDecided:"确认请求已被处理",agentMessageTextRequired:"消息内容不能为空",watchRuleNotFound:"Watch 规则不存在",watchNameRequired:"规则名称不能为空",watchTriggerTypeInvalid:"触发类型必须是 match、unchanged 或 llm",watchPatternRequired:"match/unchanged 规则必须提供正则表达式",watchPatternInvalid:"正则表达式无效:{{detail}}",watchUnchangedMinutesInvalid:"unchanged 规则的未变化分钟数必须大于 0",watchExtractGroupInvalid:"捕获组序号必须是不小于 0 的整数",watchConditionPromptRequired:"llm 规则必须提供条件描述",watchIntervalInvalid:"采样间隔不能小于 {{min}} 秒",watchNoMatchBehaviorInvalid:"无命中行为必须是 reset 或 ignore",watchFireModeInvalid:"触发模式必须是 once 或 repeat",watchCooldownInvalid:"冷却秒数必须是不小于 0 的整数",watchAssistDescriptionRequired:"请描述要匹配的内容",watchAssistModelUnavailable:"模型调用失败:{{detail}}"},notification:{clickToJump:"点击跳转到对应 Pane",eventType:{terminal_bell:"🔔 终端 Bell",terminal_notification:"🔔 终端通知",tmux_window_close:"🪟 窗口关闭",tmux_pane_close:"📱 Pane 关闭",device_tmux_missing:"⚠️ Tmux 不可用",device_disconnect:"🔌 设备断开",session_created:"🆕 会话创建",session_closed:"🚪 会话关闭",agent_confirmation_pending:"🤖 Agent 等待确认",agent_turn_finished:"🤖 Agent 回合完成",agent_error:"🤖 Agent 错误",watch_triggered:"👁️ Watch 规则触发",watch_model_unavailable:"👁️ Watch 模型不可用",watch_rule_error:"👁️ Watch 规则错误"},site:"站点",device:"设备",window:"窗口",pane:"Pane",time:"时间",directLink:"直达",message:"信息",telegramBell:{title:"🔔 来自 {{siteName}} 的 Bell:{{terminalTopbarLabel}}",viewLink:"点击查看",terminalTopbarLabel:"窗口 {{window}} · Pane {{pane}} @ {{device}}"},telegramNotification:{},agent:{confirmationPending:"Agent「{{title}}」请求执行工具 {{toolName}},等待确认",turnFinished:"Agent「{{title}}」回合完成",error:"Agent「{{title}}」出错:{{message}}"},watch:{matchTriggered:"监控「{{name}}」命中:{{text}}",unchangedTriggered:"监控「{{name}}」的值「{{value}}」已 {{minutes}} 分钟未变化",llmTriggered:"监控「{{name}}」条件满足:{{reason}}",summaryTriggered:"监控「{{name}}」:{{summary}}",unconfirmedSuffix:"(模型不可用,未经 LLM 二次确认)",modelUnavailable:"监控「{{name}}」模型调用失败:{{message}}",ruleError:"监控「{{name}}」连续失败 {{count}} 次,已自动停用:{{message}}"}},sidebar:{noWindows:"暂无窗口",noDevices:"暂无设备",addDeviceLink:"添加设备",openSettingsLink:"打开设置",openSettings:"打开设置",manageDevices:"管理设备",settings:"设置",currentWindow:"当前窗口",currentPane:"当前 pane",newWindow:"新建窗口",closeWindow:"关闭窗口",closePane:"关闭 pane",addDevice:"添加设备",tab:{panes:"Panes",agent:"Agent",files:"Files"},orphanedSessions:"孤立会话"},agent:{error:{streamStalled:"模型停止响应(上游流无响应),请重试。"},model:{select:"选择模型",placeholder:"模型",noProviders:"暂无模型 — 请先在设置中配置供应商"},queue:{title:"队列({{count}})",steer:"立即注入",steerHint:"中断当前步骤并立即注入队列",withdraw:"撤回"},orphan:{readonly:"该会话已孤立(绑定终端已不存在),仅可只读查看",title:"孤立会话",process:"进程",startedAt:"创建于"},files:{comingSoon:"Coming Soon"},panel:{title:"Agent",empty:"选择或创建一个会话",inputPlaceholder:"输入消息…",send:"发送",stop:"停止",retry:"重试",scrollToBottom:"回到底部"},session:{none:"未选择会话",new:"新建会话",switch:"切换会话",selectPaneHint:"请在 Panes 标签中选择一个 pane 来开启会话",noSessions:"暂无会话",showAll:"显示全部会话",rename:"重命名会话",renameTitle:"重命名会话",renamePlaceholder:"会话标题",save:"保存",cancel:"取消",delete:"删除会话",deleteTitle:"删除此会话?",deleteDesc:"“{{title}}”及其全部消息将被永久删除。",deleteConfirm:"删除",createDisabledNoPane:"请先打开一个终端 pane 再创建会话",privacyNotice:"会话将把终端屏幕内容发送给配置的 LLM 服务。"},binding:{invalid:"已失效",mismatchTitle:"此会话绑定的 pane 与当前终端不一致",goTo:"跳转过去",rebind:"重绑到当前"},writeMode:{confirm:"写入需确认",auto:"自动执行"},confirm:{title:"等待确认",approve:"允许",deny:"拒绝"},tool:{input:"输入",result:"结果",screen:"屏幕快照",send_input:"发送输入",read_screen:"读取屏幕",web_search:"网络搜索",fetch_url:"抓取网页",denied:"已拒绝"},reasoning:{title:"思考过程"},toast:{errorTitle:"Agent“{{title}}”出错",credentialWarningTitle:"消息疑似包含凭证",credentialWarningDescription:"检测到 {{types}}。内容不会被修改,但会发送至 LLM 并存储,存在泄露风险。"}},window:{noWindows:"暂无窗口",new:"新建窗口",close:"关闭窗口",closePane:"关闭面板",closeConfirmTitle:"关闭此窗口?",closePaneConfirmTitle:"关闭此面板?",closeConfirmDesc:'"{{name}}" 中运行的进程将被终止,此操作无法撤销。',menu:"窗口操作",rename:"重命名窗口",renamePlaceholder:"输入名称",renameDesc:"自定义名称会覆盖终端设置的标题,并保留至 gateway 重启。",renameReset:"恢复自动名称"},watch:{title:"监控规则",dialogDesc:"监控该终端屏幕,条件满足时发送通知",openMonitor:"监控此终端",rules:{empty:"该终端还没有监控规则",addRule:"新建规则",edit:"编辑",delete:"删除",viewState:"状态",lastTriggered:"最近触发:{{time}}",neverTriggered:"从未触发",deleteTitle:"删除该规则?",deleteDesc:"“{{name}}”将被永久删除。",deleteConfirm:"删除"},type:{match:"匹配",unchanged:"卡住",llm:"LLM"},typeDesc:{match:"正则命中屏幕内容时触发",unchanged:"提取值连续 N 分钟不变时触发(如下载卡住)",llm:"由 LLM 周期查看屏幕并判断自然语言条件"},form:{createTitle:"新建监控规则",editTitle:"编辑监控规则",name:"规则名称",namePlaceholder:"如:下载卡住提醒",triggerType:"触发类型",pattern:"正则表达式",patternPlaceholder:"如:(\\d+)%",flags:"标志",flagsPlaceholder:"如:i",extractGroup:"捕获组序号",extractGroupHint:"0 = 整个匹配;该组的值将被持续跟踪",unchangedMinutes:"不变持续(分钟)",noMatchBehavior:"无命中时",noMatchReset:"重置计时(进度行消失视为任务结束)",noMatchIgnore:"忽略(保留上次值)",conditionPrompt:"条件(自然语言)",conditionPromptPlaceholder:"如:构建因编译错误而失败",model:"模型",followGlobalDefault:"跟随全局默认",modelPlaceholder:"模型 ID",modelRequiredHint:"该规则会调用 LLM,请确保所选(或全局默认)模型可用。",confirmWithLlm:"通知前 LLM 二次确认",confirmWithLlmDesc:"减少误报;模型不可用时直接通知",summarizeWithLlm:"LLM 生成通知摘要",summarizeWithLlmDesc:"由模型总结屏幕内容作为通知正文",intervalSeconds:"采样间隔(秒)",intervalHint:"最低 {{min}} 秒",fireMode:"触发模式",fireOnce:"单次(触发后自动停用)",fireRepeat:"重复",cooldownSeconds:"冷却时间(秒)",enabled:"启用",assistLabel:"用描述生成正则",assistPlaceholder:"如:匹配下载进度百分比",assistButton:"生成",assistExplanation:"说明",assistPreview:"当前屏幕命中",assistPreviewEmpty:"当前屏幕样本无命中",create:"创建",save:"保存",providerUnavailable:"原提供商已不可用",providerDisabled:"已禁用"},validation:{nameRequired:"规则名称不能为空",patternRequired:"正则表达式不能为空",patternInvalid:"正则表达式无效:{{detail}}",unchangedMinutesInvalid:"不变持续分钟数必须大于 0",conditionPromptRequired:"条件描述不能为空",intervalMin:"采样间隔不能低于 {{min}} 秒"},state:{title:"规则状态",back:"返回",lastSampledAt:"最近采样",lastValue:"最近值",lastValueChangedAt:"值最近变化",lastTriggeredAt:"最近触发",consecutiveErrors:"连续错误次数",lastError:"最近错误",samples:"近期样本",samplesEmpty:"暂无样本",hit:"命中",none:"—"},toast:{created:"监控规则已创建",updated:"监控规则已更新",deleted:"监控规则已删除",triggeredTitle:"监控触发",openTerminal:"打开终端",modelUnavailableTitle:"监控模型不可用",modelUnavailableHint:"规则将以降级方式继续运行。",ruleErrorTitle:"监控规则已自动停用"},notifPermission:{title:"启用浏览器通知?",desc:"即使页面在后台,监控触发时也能收到通知。",enable:"启用",dismiss:"暂不"}},validation:{deviceNameRequired:"设备名称为必填项",hostRequired:"SSH 设备需要填写主机地址"}}},ja_JP:{translation:{common:{loading:"読み込み中...",save:"保存",saving:"保存中...",cancel:"キャンセル",add:"追加",delete:"削除",edit:"編集",confirm:"確認",close:"閉じる",expand:"展開",collapse:"折りたたむ",refresh:"更新",test:"テスト",send:"送信",success:"成功",error:"エラー",warning:"警告",info:"情報",yes:"はい",no:"いいえ",enabled:"有効",disabled:"無効",pending:"保留中",authorized:"承認済み",unknown:"不明",empty:"空",none:"なし",default:"デフォルト",optional:"任意",required:"必須",pwaInstallTitle:"アプリとしてインストール",pwaInstallHintIOSSafari:"iOS Safari では自動的にインストールプロンプトが表示されません。共有ボタンをタップし、「ホーム画面に追加」を選択してください。",pwaInstallHintIOSChrome:"iOS Chrome では自動的にインストールプロンプトが表示されません。共有ボタンをタップし、「ホーム画面に追加」を選択してください。"},nav:{manageDevices:"デバイス管理",settings:"設定",sidebarExpand:"サイドバーを展開",sidebarCollapse:"サイドバーを折りたたむ",openSidebar:"サイドバーを開く",closeSidebar:"サイドバーを閉じる",jumpToLatest:"最新にジャンプ",switchToEditor:"エディタ入力に切り替え",switchToDirect:"直接入力に切り替え",refreshPage:"ページを更新",refreshPageConfirm:"ページを更新してもよろしいですか?保存されていない内容は失われます。"},device:{title:"デバイス管理",devices:"デバイス",addDevice:"デバイスを追加",addDeviceDescription:"デバイス情報を入力し、接続方法を選択してください",addFirstDevice:"最初のデバイスを追加",editDevice:"デバイスを編集",editDeviceDescription:"デバイス設定を更新",sectionBasic:"基本情報",sectionConnection:"接続情報",sectionAuth:"認証情報",noDevices:"デバイスがありません",noDevicesDescription:"ローカルまたは SSH デバイスを追加して開始",name:"デバイス名",namePlaceholder:"例:My Server",type:"タイプ",typeLocal:"ローカルデバイス",typeSSH:"SSH リモートデバイス",typeSSHBadge:"SSH",host:"ホスト",hostPlaceholder:"example.com",port:"ポート",username:"ユーザー名",usernamePlaceholder:"root",session:"Tmux セッション名",sessionPlaceholder:"tmex",sessionHint:"空の場合、デフォルトの「tmex」が使用されます",authMode:"認証モード",authPassword:"パスワード",authKey:"秘密鍵",authAgent:"SSH Agent",authConfigRef:"SSH Config",password:"パスワード",privateKey:"秘密鍵",privateKeyPlaceholder:"-----BEGIN OPENSSH PRIVATE KEY-----",privateKeyPassphrase:"秘密鍵のパスフレーズ(任意)",passphrase:"パスフレーズ",connect:"接続",connected:"接続済み",disconnect:"切断",disconnected:"切断済み",connecting:"接続中...",deleteConfirm:"このデバイスを削除しますか?",deleteDescription:"デバイス「{{name}}」は完全に削除されます。この操作は取り消せません。",deleteSuccess:"デバイスを削除しました",createSuccess:"デバイスを作成しました",updateSuccess:"デバイスを更新しました",deleteFailed:"デバイスの削除に失敗しました",createFailed:"デバイスの作成に失敗しました",updateFailed:"デバイスの更新に失敗しました",loadFailed:"デバイス一覧の読み込みに失敗しました",localDevice:"ローカルデバイス",subtitle:"{{username}}@{{host}}:{{port}}",modify:"デバイスを変更",delete:"削除"},terminal:{initializing:"ターミナルを初期化中...",connecting:"デバイスに接続中...",initFailed:"ターミナルの初期化に失敗しました",inputPlaceholder:"ここにコマンドを入力...",clear:"クリア",deviceError:"デバイスエラー",deviceErrorWithType:"[{{type}}] デバイスエラー",noDeviceSelected:"デバイスが選択されていません",windowClosed:"現在のウィンドウは閉じられました。サイドバーからウィンドウを選択してください。",paneClosed:"現在のペインは閉じられました。サイドバーからペインを選択してください。",bellNotification:"ターミナルベル通知",bellDescription:"ウィンドウ {{window}} · ペイン {{pane}}",bellFallback:"tmux ベルを受信",paneTitle:"ペイン {{index}}",activePane:"現在のペイン",activeWindow:"現在のウィンドウ",editorPlaceholder:"ここにコマンドを入力...",editorClear:"クリア",editorSendWithEnter:"Enter で送信",editorSendLineByLine:"1行ずつ送信",editorSend:"送信",sendShortcut:"{{key}} を送信",inputModeDirect:"直接入力",inputModeEditor:"エディタ",newWindow:"新規ウィンドウ",closeWindow:"ウィンドウを閉じる",closePane:"ペインを閉じる",copy:"コピー",paste:"貼り付け",copied:"クリップボードにコピーしました",copyFailed:"コピーに失敗しました",pasteFailed:"クリップボードを読み取れません。ブラウザの権限を確認してください",clearSelection:"選択を解除"},settings:{title:"システム設定",siteSettings:"サイト設定",siteName:"サイト名",siteNamePlaceholder:"tmex",siteUrl:"サイト URL",siteUrlPlaceholder:"http://localhost:3000",bellThrottle:"ベル制限(秒)",notificationThrottle:"通知制限(秒)",enableBrowserBellToast:"ブラウザベル Toast を有効にする",enableBrowserNotificationToast:"ブラウザ通知 Toast を有効にする",enableTelegramBellPush:"Telegram ベルプッシュを有効にする",enableTelegramNotificationPush:"Telegram 通知プッシュを有効にする",sshReconnectRetries:"SSH 再接続試行回数",sshReconnectDelay:"SSH 再接続待機(秒)",language:"言語",languagePlaceholder:"言語を選択",language_en_US:"English",language_zh_CN:"简体中文",language_ja_JP:"日本語",theme:"テーマ",themeLight:"ライト",themeDark:"ダーク",siteTab:"サイト",notificationsTab:"通知",refreshToApply:"言語変更を適用するには更新してください",saveSettings:"設定を保存",settingsSaved:"設定を保存しました",saveFailed:"設定の保存に失敗しました",loadFailed:"設定の読み込みに失敗しました",restartGateway:"Gateway を再起動",restartScheduled:"Gateway の再起動が予定されました",restartConfirm:"Gateway を再起動してもよろしいですか?すべてのアクティブ接続が中断されます。",restartFailed:"Gateway の再起動に失敗しました",sshReconnectMaxRetries:"SSH 再接続試行回数",llm:{title:"LLM プロバイダー",name:"名前",namePlaceholder:"例: OpenAI",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.openai.com",baseUrlHint:"デフォルトで /v1 を自動補完。/ で終わるとパスをそのまま使用",protocol:"プロトコル",apiKey:"API キー",apiKeyPlaceholder:"API キーを入力",apiKeySetPlaceholder:"設定済み、空欄の場合は変更されません",addProvider:"プロバイダーを追加",editProvider:"プロバイダーを編集",formHint:"プロバイダーの接続を設定",models:"モデル",modelsTitle:"{{name}} のモデル",modelsHint:"このプロバイダーで利用するモデルを管理(有効化と手動追加)",modelManual:"手動",addModelPlaceholder:"モデル ID を追加",empty:"プロバイダーはまだありません",refreshModels:"モデルを更新",modelsCount:"{{total}} 個のモデル",modelsNotFetched:"モデル一覧は未取得です",modelsFetchFailed:"モデル一覧の取得に失敗しました:{{error}}",deleteProvider:"プロバイダーを削除",deleteConfirm:"プロバイダー「{{name}}」を削除しますか?",defaults:"グローバル既定",defaultProvider:"既定プロバイダー",defaultProviderNone:"未設定",defaultModel:"既定モデル",defaultModelPlaceholder:"モデル ID を入力または選択",saveDefaults:"既定を保存",loadFailed:"LLM プロバイダーの読み込みに失敗しました",createFailed:"プロバイダーの作成に失敗しました",updateFailed:"プロバイダーの更新に失敗しました",deleteFailed:"プロバイダーの削除に失敗しました",refreshModelsFailed:"モデルの更新に失敗しました",settingsLoadFailed:"LLM 設定の読み込みに失敗しました",settingsSaveFailed:"LLM 設定の保存に失敗しました"},search:{title:"検索",provider:"検索プロバイダー",providerNone:"無効",tavilyApiKey:"Tavily API キー",braveApiKey:"Brave API キー",keyPlaceholder:"API キーを入力",keySetPlaceholder:"設定済み、空欄の場合は変更されません",clearKey:"クリア",clearKeyConfirm:"この API キーをクリアしますか?再度入力が必要になります。",loadFailed:"検索設定の読み込みに失敗しました",saveFailed:"検索設定の保存に失敗しました"}},telegram:{title:"Telegram Bot 管理",botName:"Bot 名",botNamePlaceholder:"例:ops-bot",botToken:"Bot Token",botTokenPlaceholder:"123456:AA...",addBot:"Bot を追加",enableBot:"Bot を有効にする",allowAuthRequests:"認証リクエストを許可",pendingChats:"承認待ち",chats:"承認済み",authorizedChats:"承認済み",noPendingChats:"承認待ちのチャットはありません",noAuthorizedChats:"承認済みのチャットはありません",approve:"承認",authorize:"認証",reject:"拒否",revokeAuth:"認証を取り消す",testMessage:"テストメッセージ",sendTestMessage:"テストメッセージを送信",deleteBot:"Bot を削除",tokenOptional:"Token(変更しない場合は空)",tokenPlaceholder:"新しい token を入力",botCreated:"Bot を作成しました",botUpdated:"Bot を更新しました",botDeleted:"Bot を削除しました",authApproved:"認証が承認されました",chatRemoved:"チャットを削除しました",testMessageSent:"テストメッセージを送信しました",createFailed:"Bot の作成に失敗しました",updateFailed:"Bot の更新に失敗しました",deleteFailed:"Bot の削除に失敗しました",approveFailed:"認証の承認に失敗しました",removeFailed:"チャットの削除に失敗しました",testMessageFailed:"テストメッセージの送信に失敗しました",loadBotsFailed:"Bot 一覧の読み込みに失敗しました",loadChatsFailed:"チャット一覧の読み込みに失敗しました",noBots:"Bot がありません。まず追加してください。",expand:"展開",collapse:"折りたたむ",authCount:"承認済み {{authorized}} / 承認待ち {{pending}}(最大 8)",chatId:"Chat ID",applyTime:"申請時間",gatewayOnline:"🟢 Gateway online @ {{siteName}}",deviceConnectionError:`🔴 {{siteName}}:デバイス「{{deviceName}}」({{host}}) で接続エラー [{{category}}]
81
+ {{error}}`,agentCredentialWarning:"⚠️ {{siteName}}:Agent セッション「{{sessionTitle}}」のメッセージに認証情報が含まれている可能性があります({{types}})。LLM に送信され保存されるため、漏洩のリスクがあります。",authSuccess:"✅ 承認されました。通知を受信できます。",authPending:"⏳ 認証リクエストを受信しました。tmex 設定ページで承認してください。",authFailed:"❌ 認証リクエストに失敗しました。管理者に連絡してください。",testMessageTemplate:`🧪 テストメッセージ
82
+ サイト:{{siteName}}
83
+ 時間:{{time}}`,approveMessageTemplate:`✅ tmex で承認されました。
84
+ Bot:{{botName}}
85
+ 時間:{{time}}`,botNotFound:"Bot が見つからないか利用できません",botNotRunning:"Bot が起動していないか利用できません"},webhook:{title:"Webhooks",url:"Webhook URL",secret:"シークレット",secretPlaceholder:"署名に使用(HMAC-SHA256)",enabled:"有効",eventMask:"イベント",add:"Webhook を追加",empty:"Webhook がありません。",createFailed:"Webhook の作成に失敗しました",deleteFailed:"Webhook の削除に失敗しました",loadFailed:"Webhook の読み込みに失敗しました"},sshError:{sshConfigRefNotSupported:"このバージョンでは SSH Config 参照はサポートされていません。host + username を使用し、Agent/秘密鍵/パスワード認証を選択してください。",configRefNotSupported:"このバージョンでは SSH Config 参照はサポートされていません。host + username を使用し、Agent/秘密鍵/パスワード認証を選択してください。",agentUnavailable:"SSH Agent が利用できません:SSH_AUTH_SOCK が検出されません。agent 環境を確認してください。",agentNoIdentity:"SSH Agent に利用可能な鍵がありません。ssh-add を実行してください。",agentNoIdentities:"SSH Agent に利用可能な鍵がありません。ssh-add を実行してください。",authFailed:"認証に失敗しました:ユーザー名、パスワード、または鍵が正しくありません。デバイス設定を確認してください。",authFailedGeneric:"認証に失敗しました:ユーザー名、パスワード、または鍵が正しくありません。デバイス設定を確認してください。",networkUnreachable:"ネットワークに到達できません:ルーティング、ファイアウォール、または VPN 設定を確認してください。",connectionRefused:"接続が拒否されました:ターゲットホストに接続できません。ホストアドレスとポートを確認してください。",timeout:"接続タイムアウト:デバイスに接続できません。ネットワークまたはファイアウォール設定を確認してください。",connectionTimeout:"接続タイムアウト:デバイスに接続できません。ネットワークまたはファイアウォール設定を確認してください。",hostNotFound:"ホストが見つかりません:ホスト名を解決できません。DNS またはホスト名設定を確認してください。",handshakeFailed:"ハンドシェイクに失敗しました:安全な接続を確立できません。キー交換アルゴリズムが互換性がない可能性があります。",tmuxUnavailable:"リモート tmux が利用できないか起動に失敗しました。tmux がインストールされ、リモート shell の PATH から参照できることを確認してください。",connectionClosed:"接続が切断されました。再接続を試みています",unknown:"接続に失敗しました:{{message}}",reconnecting:"接続が中断されました。{{delay}} 秒後に再接続します({{attempt}}/{{maxRetries}})",reconnectFailed:"自動再接続に失敗しました。手動で再試行してください",reconnected:"デバイスが自動的に再接続されました"},deviceStatus:{reconnecting:"再接続中 {{delay}}s",offline:"オフライン",errorBadge:{authFailed:"認証失敗",agentUnavailable:"Agent 利用不可",agentNoIdentity:"Agent に鍵なし",configRefNotSupported:"SSH Config 非対応",networkUnreachable:"ネットワーク不可達",connectionRefused:"接続拒否",timeout:"タイムアウト",hostNotFound:"ホスト未検出",handshakeFailed:"ハンドシェイク失敗",tmuxUnavailable:"tmux 利用不可",connectionClosed:"切断",unknown:"接続エラー"}},websocket:{error:"WebSocket 接続エラー",checkGateway:"Gateway 状態を確認してください",upgradeFailed:"アップグレードに失敗しました",invalidMessage:"無効なメッセージ形式"},wsError:{checkGateway:"Gateway 状態を確認してください"},apiError:{siteNameRequired:"サイト名は空にできません",siteUrlInvalid:"サイト URL は http:// または https:// で始まる必要があります",bellThrottleInvalid:"ベル制限秒数は 0-300 の間である必要があります",sshRetriesInvalid:"SSH 再接続試行回数は 0-20 の間である必要があります",sshDelayInvalid:"SSH 再接続待機時間は 1-300 秒の間である必要があります",languageInvalid:"言語はサポートされているロケールのいずれかである必要があります",botNameRequired:"Bot 名は空にできません",botTokenRequired:"Bot token は空にできません",missingFields:"必須フィールドがありません",sshRequiresHost:"SSH デバイスには host または sshConfigRef が必要です",invalidRequest:"無効なリクエスト",deviceNotFound:"デバイスが見つかりません",botNotFound:"Bot が見つかりません",chatNotFound:"チャットが見つかりません",urlAndSecretRequired:"URL とシークレットが必要です",notFound:"見つかりません",llmProviderNameRequired:"プロバイダー名は空にできません",llmProviderProtocolInvalid:"プロトコルは openai-chat または openai-responses である必要があります",llmProviderBaseUrlInvalid:"Base URL は http:// または https:// で始まる必要があります",llmProviderApiKeyRequired:"API key は空にできません",llmProviderNotFound:"LLM プロバイダーが見つかりません",llmProviderDisabled:"LLM プロバイダー {{name}} は無効化されています",llmNoDefaultProvider:"LLM プロバイダーが指定されておらず、デフォルトプロバイダーも設定されていません",llmNoDefaultModel:"モデルが指定されておらず、デフォルトモデルも設定されていません",llmDefaultProviderNotFound:"デフォルトプロバイダーが存在しません",llmSearchProviderInvalid:"検索プロバイダーは none、tavily、brave のいずれかである必要があります",llmFetchModelsFailed:"モデル一覧の取得に失敗しました:{{detail}}",agentSessionNotFound:"Agent セッションが存在しません",agentSessionBusy:"Agent セッションは実行中です。停止するか完了をお待ちください",agentSessionAwaitingConfirmation:"Agent セッションに未処理の確認リクエストがあります。先に処理してください",agentDeviceRequired:"デバイスを指定してください",agentPaneRequired:"ターミナル pane を指定してください",agentWriteModeInvalid:"書き込みモードは confirm または auto である必要があります",agentMaxStepsInvalid:"1 ターンあたりの最大ステップ数は 1〜100 の範囲で指定してください",agentProviderWebSearchRequiresResponses:"プロバイダ内蔵の Web 検索は openai-responses プロトコルのみ対応しています",agentHostedToolUnknown:"不明な hosted ツール: {{name}}",agentHostedToolRequiresResponses:"プロバイダの hosted ツールは openai-responses プロトコルのみ対応しています",agentSessionOrphaned:"この Agent セッションは孤立しており(端末が存在しません)、読み取り専用です",agentQueuedMessageNotFound:"キューのメッセージが存在しません",agentConfirmationNotFound:"確認リクエストが存在しません",agentConfirmationAlreadyDecided:"確認リクエストは既に処理済みです",agentMessageTextRequired:"メッセージ内容を入力してください",watchRuleNotFound:"Watch ルールが存在しません",watchNameRequired:"ルール名を入力してください",watchTriggerTypeInvalid:"トリガー種別は match、unchanged、llm のいずれかです",watchPatternRequired:"match/unchanged ルールには正規表現が必要です",watchPatternInvalid:"正規表現が無効です:{{detail}}",watchUnchangedMinutesInvalid:"unchanged ルールには 0 より大きい未変化分数が必要です",watchExtractGroupInvalid:"キャプチャグループ番号は 0 以上の整数で指定してください",watchConditionPromptRequired:"llm ルールには条件の説明が必要です",watchIntervalInvalid:"サンプリング間隔は {{min}} 秒以上で指定してください",watchNoMatchBehaviorInvalid:"非マッチ時の挙動は reset または ignore です",watchFireModeInvalid:"発火モードは once または repeat です",watchCooldownInvalid:"クールダウン秒数は 0 以上の整数で指定してください",watchAssistDescriptionRequired:"マッチさせたい内容を記述してください",watchAssistModelUnavailable:"モデル呼び出しに失敗しました:{{detail}}"},notification:{clickToJump:"対応するペインにジャンプ",eventType:{terminal_bell:"🔔 ターミナルベル",terminal_notification:"🔔 ターミナル通知",tmux_window_close:"🪟 ウィンドウ閉じる",tmux_pane_close:"📱 ペイン閉じる",device_tmux_missing:"⚠️ Tmux がありません",device_disconnect:"🔌 デバイス切断",session_created:"🆕 セッション作成",session_closed:"🚪 セッション閉じる",agent_confirmation_pending:"🤖 エージェント確認待ち",agent_turn_finished:"🤖 エージェントターン完了",agent_error:"🤖 エージェントエラー",watch_triggered:"👁️ Watch ルール発動",watch_model_unavailable:"👁️ Watch モデル利用不可",watch_rule_error:"👁️ Watch ルールエラー"},site:"サイト",device:"デバイス",window:"ウィンドウ",pane:"ペイン",time:"時間",directLink:"直接リンク",message:"メッセージ",telegramBell:{title:"🔔 {{siteName}} からのベル:{{terminalTopbarLabel}}",viewLink:"表示",terminalTopbarLabel:"ウィンドウ {{window}} · ペイン {{pane}} @ {{device}}"},telegramNotification:{},agent:{confirmationPending:"Agent「{{title}}」がツール {{toolName}} の実行確認を求めています",turnFinished:"Agent「{{title}}」のターンが完了しました",error:"Agent「{{title}}」でエラーが発生しました:{{message}}"},watch:{matchTriggered:"Watch「{{name}}」がマッチしました:{{text}}",unchangedTriggered:"Watch「{{name}}」の値「{{value}}」が {{minutes}} 分間変化していません",llmTriggered:"Watch「{{name}}」の条件を満たしました:{{reason}}",summaryTriggered:"Watch「{{name}}」:{{summary}}",unconfirmedSuffix:"(モデル利用不可のため LLM 未確認)",modelUnavailable:"Watch「{{name}}」のモデル呼び出しに失敗しました:{{message}}",ruleError:"Watch「{{name}}」が {{count}} 回連続で失敗したため自動停止しました:{{message}}"}},sidebar:{noWindows:"ウィンドウがありません",noDevices:"デバイスがありません",addDeviceLink:"デバイスを追加",openSettingsLink:"設定を開く",openSettings:"設定を開く",manageDevices:"デバイス管理",settings:"設定",currentWindow:"現在のウィンドウ",currentPane:"現在のペイン",newWindow:"ウィンドウを作成",closeWindow:"ウィンドウを閉じる",closePane:"ペインを閉じる",addDevice:"デバイスを追加",tab:{panes:"Panes",agent:"Agent",files:"Files"},orphanedSessions:"孤立セッション"},agent:{error:{streamStalled:"モデルが応答を停止しました(上流ストリームが停止)。再試行してください。"},model:{select:"モデルを選択",placeholder:"モデル",noProviders:"モデルがありません — 設定でプロバイダーを構成してください"},queue:{title:"キュー({{count}})",steer:"今すぐ注入",steerHint:"現在のステップを中断してキューを今すぐ注入",withdraw:"取り消し"},orphan:{readonly:"このセッションは孤立しており(端末が存在しません)、読み取り専用です",title:"孤立セッション",process:"プロセス",startedAt:"作成日時"},files:{comingSoon:"Coming Soon"},panel:{title:"Agent",empty:"セッションを選択または作成してください",inputPlaceholder:"メッセージを入力…",send:"送信",stop:"停止",retry:"再試行",scrollToBottom:"最下部へ"},session:{none:"セッション未選択",new:"新規セッション",switch:"セッションを切り替え",selectPaneHint:"Panes タブでペインを選択してセッションを開始してください",noSessions:"セッションがありません",showAll:"すべてのセッションを表示",rename:"セッション名を変更",renameTitle:"セッション名を変更",renamePlaceholder:"セッション名",save:"保存",cancel:"キャンセル",delete:"セッションを削除",deleteTitle:"このセッションを削除しますか?",deleteDesc:"「{{title}}」とそのメッセージはすべて完全に削除されます。",deleteConfirm:"削除",createDisabledNoPane:"ターミナル pane を開いてからセッションを作成してください",privacyNotice:"セッションはターミナル画面の内容を設定済みの LLM サービスへ送信します。"},binding:{invalid:"無効",mismatchTitle:"このセッションは別の pane にバインドされています",goTo:"移動",rebind:"現在の pane に再バインド"},writeMode:{confirm:"書き込み確認",auto:"自動実行"},confirm:{title:"承認待ち",approve:"許可",deny:"拒否"},tool:{input:"入力",result:"結果",screen:"画面キャプチャ",send_input:"入力送信",read_screen:"画面読み取り",web_search:"Web 検索",fetch_url:"URL 取得",denied:"拒否されました"},reasoning:{title:"思考プロセス"},toast:{errorTitle:"Agent「{{title}}」でエラー",credentialWarningTitle:"メッセージに認証情報が含まれる可能性",credentialWarningDescription:"{{types}} を検出しました。内容は変更されませんが、LLM に送信され保存されるため、漏洩のリスクがあります。"}},window:{noWindows:"ウィンドウがありません",new:"新規ウィンドウ",close:"ウィンドウを閉じる",closePane:"ペインを閉じる",closeConfirmTitle:"このウィンドウを閉じますか?",closePaneConfirmTitle:"このペインを閉じますか?",closeConfirmDesc:'"{{name}}" で実行中のプロセスは終了されます。この操作は取り消せません。',menu:"ウィンドウ操作",rename:"ウィンドウ名を変更",renamePlaceholder:"名前を入力",renameDesc:"カスタム名はターミナルが設定したタイトルを上書きし、ゲートウェイが再起動するまで保持されます。",renameReset:"自動名に戻す"},watch:{title:"監視ルール",dialogDesc:"このペインの画面を監視し、条件を満たしたら通知します",openMonitor:"このターミナルを監視",rules:{empty:"このペインにはまだ監視ルールがありません",addRule:"新規ルール",edit:"編集",delete:"削除",viewState:"状態",lastTriggered:"最終トリガー:{{time}}",neverTriggered:"未トリガー",deleteTitle:"このルールを削除しますか?",deleteDesc:"「{{name}}」は完全に削除されます。",deleteConfirm:"削除"},type:{match:"マッチ",unchanged:"停滞",llm:"LLM"},typeDesc:{match:"正規表現が画面にマッチしたらトリガー",unchanged:"抽出した値が N 分間変化しない場合にトリガー(例:ダウンロード停滞)",llm:"LLM が定期的に画面を確認し自然言語の条件を判定"},form:{createTitle:"監視ルールを作成",editTitle:"監視ルールを編集",name:"ルール名",namePlaceholder:"例:ダウンロード停滞アラート",triggerType:"トリガー種別",pattern:"正規表現",patternPlaceholder:"例:(\\d+)%",flags:"フラグ",flagsPlaceholder:"例:i",extractGroup:"キャプチャグループ番号",extractGroupHint:"0 = マッチ全体。このグループの値を追跡します",unchangedMinutes:"変化なし継続(分)",noMatchBehavior:"マッチしない場合",noMatchReset:"タイマーをリセット(進捗行の消失 = タスク完了)",noMatchIgnore:"無視(前回値を保持)",conditionPrompt:"条件(自然言語)",conditionPromptPlaceholder:"例:コンパイルエラーでビルドが失敗した",model:"モデル",followGlobalDefault:"グローバル既定に従う",modelPlaceholder:"モデル ID",modelRequiredHint:"このルールは LLM を呼び出します。選択した(またはグローバル既定の)モデルが利用可能か確認してください。",confirmWithLlm:"通知前に LLM で再確認",confirmWithLlmDesc:"誤検知を低減。モデル利用不可時はそのまま通知",summarizeWithLlm:"LLM による通知要約",summarizeWithLlmDesc:"画面内容をモデルが要約して通知本文にします",intervalSeconds:"サンプリング間隔(秒)",intervalHint:"最小 {{min}} 秒",fireMode:"発火モード",fireOnce:"一回(発火後に自動停止)",fireRepeat:"繰り返し",cooldownSeconds:"クールダウン(秒)",enabled:"有効",assistLabel:"説明から正規表現を生成",assistPlaceholder:"例:ダウンロード進捗のパーセンテージにマッチ",assistButton:"生成",assistExplanation:"説明",assistPreview:"現在の画面でのマッチ",assistPreviewEmpty:"現在の画面サンプルにマッチなし",create:"作成",save:"保存",providerUnavailable:"元のプロバイダーは利用できません",providerDisabled:"無効"},validation:{nameRequired:"ルール名は必須です",patternRequired:"正規表現は必須です",patternInvalid:"正規表現が無効です:{{detail}}",unchangedMinutesInvalid:"変化なし継続分は 0 より大きい必要があります",conditionPromptRequired:"条件の説明は必須です",intervalMin:"サンプリング間隔は {{min}} 秒以上にしてください"},state:{title:"ルール状態",back:"戻る",lastSampledAt:"最終サンプリング",lastValue:"最新値",lastValueChangedAt:"値の最終変化",lastTriggeredAt:"最終トリガー",consecutiveErrors:"連続エラー回数",lastError:"最新エラー",samples:"直近サンプル",samplesEmpty:"サンプルなし",hit:"ヒット",none:"—"},toast:{created:"監視ルールを作成しました",updated:"監視ルールを更新しました",deleted:"監視ルールを削除しました",triggeredTitle:"監視トリガー",openTerminal:"ターミナルを開く",modelUnavailableTitle:"監視モデル利用不可",modelUnavailableHint:"ルールは縮退動作で継続します。",ruleErrorTitle:"監視ルールを自動停止しました"},notifPermission:{title:"ブラウザ通知を有効にしますか?",desc:"タブがバックグラウンドでも監視トリガー時に通知を受け取れます。",enable:"有効にする",dismiss:"今はしない"}},validation:{deviceNameRequired:"デバイス名は必須です",hostRequired:"SSH デバイスにはホストアドレスが必要です"}}}},Jv="en_US",IX={locales:[{code:"en_US",name:"English",nativeName:"English",flag:"🇺🇸",isDefault:!0},{code:"zh_CN",name:"简体中文",nativeName:"简体中文",flag:"🇨🇳",isDefault:!1},{code:"ja_JP",name:"日本語",nativeName:"日本語",flag:"🇯🇵",isDefault:!1}]};function zk(e){return e.replace("_","-")}var yy={},cs={},ds={},hT;function Rj(){if(hT)return ds;hT=1,Object.defineProperty(ds,"__esModule",{value:!0}),ds.BinaryReader=ds.BinaryWriter=void 0;class e{constructor(r=1024){tt(this,"buffer");tt(this,"view");tt(this,"offset",0);this.buffer=new Uint8Array(r),this.view=new DataView(this.buffer.buffer)}ensureCapacity(r){const a=this.offset+r;if(a<=this.buffer.length)return;let s=this.buffer.length;for(;s<a;)s*=2;const l=new Uint8Array(s);l.set(this.buffer),this.buffer=l,this.view=new DataView(this.buffer.buffer)}writeUint8(r){this.ensureCapacity(1),this.view.setUint8(this.offset,r),this.offset+=1}writeUint16(r){this.ensureCapacity(2),this.view.setUint16(this.offset,r,!0),this.offset+=2}writeUint32(r){this.ensureCapacity(4),this.view.setUint32(this.offset,r,!0),this.offset+=4}writeUint64(r){this.ensureCapacity(8),this.view.setBigUint64(this.offset,r,!0),this.offset+=8}writeUint128(r){this.ensureCapacity(16);const a=r&BigInt("0xFFFFFFFFFFFFFFFF"),s=r>>BigInt(64);this.writeUint64(a),this.writeUint64(s)}writeInt8(r){this.ensureCapacity(1),this.view.setInt8(this.offset,r),this.offset+=1}writeInt16(r){this.ensureCapacity(2),this.view.setInt16(this.offset,r,!0),this.offset+=2}writeInt32(r){this.ensureCapacity(4),this.view.setInt32(this.offset,r,!0),this.offset+=4}writeInt64(r){this.ensureCapacity(8),this.view.setBigInt64(this.offset,r,!0),this.offset+=8}writeInt128(r){this.ensureCapacity(16);const a=r&BigInt("0xFFFFFFFFFFFFFFFF"),s=r>>BigInt(64);this.writeInt64(a),this.writeInt64(s)}writeFloat32(r){this.ensureCapacity(4),this.view.setFloat32(this.offset,r,!0),this.offset+=4}writeFloat64(r){this.ensureCapacity(8),this.view.setFloat64(this.offset,r,!0),this.offset+=8}writeBool(r){this.writeUint8(r?1:0)}writeString(r){const a=new TextEncoder().encode(r);this.writeUint32(a.length),this.ensureCapacity(a.length),this.buffer.set(a,this.offset),this.offset+=a.length}getBuffer(){return this.buffer.slice(0,this.offset)}}ds.BinaryWriter=e;class t{constructor(r){tt(this,"buffer");tt(this,"view");tt(this,"offset",0);this.buffer=r,this.view=new DataView(r.buffer,r.byteOffset,r.byteLength)}readUint8(){const r=this.view.getUint8(this.offset);return this.offset+=1,r}readUint16(){const r=this.view.getUint16(this.offset,!0);return this.offset+=2,r}readUint32(){const r=this.view.getUint32(this.offset,!0);return this.offset+=4,r}readUint64(){const r=this.view.getBigUint64(this.offset,!0);return this.offset+=8,r}readUint128(){const r=this.readUint64();return this.readUint64()<<BigInt(64)|r}readInt8(){const r=this.view.getInt8(this.offset);return this.offset+=1,r}readInt16(){const r=this.view.getInt16(this.offset,!0);return this.offset+=2,r}readInt32(){const r=this.view.getInt32(this.offset,!0);return this.offset+=4,r}readInt64(){const r=this.view.getBigInt64(this.offset,!0);return this.offset+=8,r}readInt128(){const r=this.readUint64();return this.readInt64()<<BigInt(64)|r}readFloat32(){const r=this.view.getFloat32(this.offset,!0);return this.offset+=4,r}readFloat64(){const r=this.view.getFloat64(this.offset,!0);return this.offset+=8,r}readBool(){return!!this.readUint8()}readString(){const r=this.readUint32(),a=this.buffer.slice(this.offset,this.offset+r);return this.offset+=r,new TextDecoder().decode(a)}getOffset(){return this.offset}}return ds.BinaryReader=t,ds}var by={},pT;function kj(){return pT||(pT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registry=e.TypeRegistry=void 0;class t{constructor(){tt(this,"handlers",new Map)}register(r,a){this.handlers.set(r,a)}getHandler(r){const a=this.handlers.get(r);if(!a)throw new Error(`No handler registered for type: ${r}`);return a}}e.TypeRegistry=t,e.registry=new t,e.registry.register("u8",{write:(n,r)=>{if(r<0||r>255||!Number.isInteger(r))throw new Error("Value out of range for u8");n.writeUint8(r)},read:n=>n.readUint8()}),e.registry.register("u16",{write:(n,r)=>{if(r<0||r>65535||!Number.isInteger(r))throw new Error("Value out of range for u16");n.writeUint16(r)},read:n=>n.readUint16()}),e.registry.register("u32",{write:(n,r)=>{if(r<0||r>4294967295||!Number.isInteger(r))throw new Error("Value out of range for u32");n.writeUint32(r)},read:n=>n.readUint32()}),e.registry.register("u64",{write:(n,r)=>{if(r<0n||r>18446744073709551615n)throw new Error("Value out of range for u64");n.writeUint64(r)},read:n=>n.readUint64()}),e.registry.register("u128",{write:(n,r)=>{if(r<0n||r>340282366920938463463374607431768211455n)throw new Error("Value out of range for u128");n.writeUint128(r)},read:n=>n.readUint128()}),e.registry.register("i8",{write:(n,r)=>{if(r<-128||r>127||!Number.isInteger(r))throw new Error("Value out of range for i8");n.writeInt8(r)},read:n=>n.readInt8()}),e.registry.register("i16",{write:(n,r)=>{if(r<-32768||r>32767||!Number.isInteger(r))throw new Error("Value out of range for i16");n.writeInt16(r)},read:n=>n.readInt16()}),e.registry.register("i32",{write:(n,r)=>{if(r<-2147483648||r>2147483647||!Number.isInteger(r))throw new Error("Value out of range for i32");n.writeInt32(r)},read:n=>n.readInt32()}),e.registry.register("i64",{write:(n,r)=>{if(r<-9223372036854775808n||r>9223372036854775807n)throw new Error("Value out of range for i64");n.writeInt64(r)},read:n=>n.readInt64()}),e.registry.register("i128",{write:(n,r)=>{if(r<-170141183460469231731687303715884105728n||r>170141183460469231731687303715884105727n)throw new Error("Value out of range for i128");n.writeInt128(r)},read:n=>n.readInt128()}),e.registry.register("f32",{write:(n,r)=>n.writeFloat32(r),read:n=>n.readFloat32()}),e.registry.register("f64",{write:(n,r)=>{if(Number.isNaN(r))throw new Error("For portability reasons we do not allow serializing NaN values.");n.writeFloat64(r)},read:n=>n.readFloat64()}),e.registry.register("bool",{write:(n,r)=>n.writeBool(r),read:n=>n.readBool()}),e.registry.register("string",{write:(n,r)=>n.writeString(r),read:n=>n.readString()}),e.registry.register("unit",{write:()=>{},read:()=>({})}),e.registry.register("struct",{write:(n,r,a)=>{if(a)for(const[s,l]of Object.entries(a))e.registry.getHandler(l.type).write(n,r[s],l.options)},read:(n,r)=>{if(!r)return{};const a={};for(const[s,l]of Object.entries(r)){const c=e.registry.getHandler(l.type);a[s]=c.read(n,l.options)}return a}}),e.registry.register("vec",{write:(n,r,a)=>{if(!a)return;const{elementType:s,elementOptions:l}=a,c=(ArrayBuffer.isView(r),r.length);n.writeUint32(c);const f=e.registry.getHandler(s);if(ArrayBuffer.isView(r))for(let d=0;d<c;d++)f.write(n,r[d],l);else for(const d of r)f.write(n,d,l)},read:(n,r)=>{if(!r)return[];const{elementType:a,elementOptions:s}=r,l=n.readUint32(),c=e.registry.getHandler(a),f=Array.from({length:l},()=>c.read(n,s));switch(a){case"u8":return new Uint8Array(f);case"u16":return new Uint16Array(f);case"u32":return new Uint32Array(f);case"i8":return new Int8Array(f);case"i16":return new Int16Array(f);case"i32":return new Int32Array(f);case"i64":return new BigInt64Array(f);case"f32":return new Float32Array(f);case"f64":return new Float64Array(f);default:return f}}}),e.registry.register("set",{write:(n,r,a)=>{if(!a)return;const{elementType:s,elementOptions:l}=a,c=Array.from(r).sort();n.writeUint32(c.length);const f=e.registry.getHandler(s);for(const d of c)f.write(n,d,l)},read:(n,r)=>{if(!r)return new Set;const{elementType:a,elementOptions:s}=r,l=n.readUint32(),c=e.registry.getHandler(a),f=Array.from({length:l},()=>c.read(n,s));return new Set(f)}}),e.registry.register("map",{write:(n,r,a)=>{if(!a)return;const{keyType:s,keyOptions:l,valueType:c,valueOptions:f}=a,d=Array.from(r.entries()).sort();n.writeUint32(d.length);const m=e.registry.getHandler(s),p=e.registry.getHandler(c);for(const[y,g]of d)m.write(n,y,l),p.write(n,g,f)},read:(n,r)=>{if(!r)return new Map;const{keyType:a,keyOptions:s,valueType:l,valueOptions:c}=r,f=n.readUint32(),d=e.registry.getHandler(a),m=e.registry.getHandler(l),p=Array.from({length:f},()=>{const y=d.read(n,s),g=m.read(n,c);return[y,g]});return new Map(p)}}),e.registry.register("option",{write:(n,r,a)=>{if(!a)return;const{valueType:s,valueOptions:l}=a,c=r!==null;n.writeUint8(c?1:0),c&&e.registry.getHandler(s).write(n,r,l)},read:(n,r)=>{if(!r)return null;const{valueType:a,valueOptions:s}=r;return n.readUint8()===1?e.registry.getHandler(a).read(n,s):null}}),e.registry.register("enum",{write:(n,r,a)=>{if(!a)return;const s=Object.keys(r)[0],l=r[s],c=a.variants.find(f=>f.name===s);if(!c)throw new Error(`Unknown enum variant: ${s}`);n.writeUint8(c.index),c.type!=="unit"&&e.registry.getHandler(c.type).write(n,l,c.options)},read:(n,r)=>{if(!r)return{};const a=n.readUint8(),s=r.variants.find(f=>f.index===a);if(!s)throw new Error(`Unknown enum variant index: ${a}`);if(s.type==="unit")return{[s.name]:{}};const c=e.registry.getHandler(s.type).read(n,s.options);return{[s.name]:c}}}),e.registry.register("tuple",{write:(n,r,a)=>{if(a){if(r.length!==a.length)throw new Error(`Tuple length mismatch: expected ${a.length}, got ${r.length}`);for(let s=0;s<a.length;s++){const l=a[s];if(!l)throw new Error(`Missing type information for tuple element at index ${s}`);e.registry.getHandler(l.type).write(n,r[s],l.options)}}},read:(n,r)=>{if(!r)return[];const a=[];for(const s of r){const l=e.registry.getHandler(s.type);a.push(l.read(n,s.options))}return a}}),e.registry.register("array",{write:(n,r,a)=>{if(!a)return;const{elementType:s,elementOptions:l,length:c}=a;if(r.length!==c)throw new Error(`Array length mismatch: expected ${c}, got ${r.length}`);const f=e.registry.getHandler(s);for(const d of r)f.write(n,d,l)},read:(n,r)=>{if(!r)return[];const{elementType:a,elementOptions:s,length:l}=r,c=e.registry.getHandler(a);return Array.from({length:l},()=>c.read(n,s))}}),e.registry.register("bytes",{write:(n,r,a)=>{const s=r.length;if((a==null?void 0:a.length)!=null){if(s!==a.length)throw new Error(`Bytes length mismatch: expected ${a.length}, got ${s}`);for(let l=0;l<s;l++)n.writeUint8(r[l])}else{n.writeUint32(s);for(let l=0;l<s;l++)n.writeUint8(r[l])}},read:(n,r)=>{const a=(r==null?void 0:r.length)!=null?r.length:n.readUint32(),s=new Uint8Array(a);for(let l=0;l<a;l++)s[l]=n.readUint8();return s}}),e.registry.register("nativeEnum",{write:(n,r,a)=>{if(!a)return;const{valueToIndexMap:s}=a,l=r,c=s.get(l);if(c===void 0)throw new Error(`Invalid enum value: ${String(r)}`);n.writeUint8(c)},read:(n,r)=>{if(!r)return null;const{indexToValueMap:a}=r,s=n.readUint8(),l=a.get(s);if(l===void 0)throw new Error(`Invalid enum index: ${s}`);return l}})})(by)),by}var mT;function Mj(){if(mT)return cs;mT=1,Object.defineProperty(cs,"__esModule",{value:!0}),cs.b=cs.Schema=void 0;const e=Rj(),t=kj();class n{constructor(a,s,l){tt(this,"type");tt(this,"options");tt(this,"registry");this.type=a,this.options=s,this.registry=l}serialize(a){const s=new e.BinaryWriter;return this.registry.getHandler(this.type).write(s,a,this.options),s.getBuffer()}deserialize(a){const s=new e.BinaryReader(a);return this.registry.getHandler(this.type).read(s,this.options)}}return cs.Schema=n,cs.b={u8:()=>new n("u8",null,t.registry),u16:()=>new n("u16",null,t.registry),u32:()=>new n("u32",null,t.registry),u64:()=>new n("u64",null,t.registry),u128:()=>new n("u128",null,t.registry),i8:()=>new n("i8",null,t.registry),i16:()=>new n("i16",null,t.registry),i32:()=>new n("i32",null,t.registry),i64:()=>new n("i64",null,t.registry),i128:()=>new n("i128",null,t.registry),f32:()=>new n("f32",null,t.registry),f64:()=>new n("f64",null,t.registry),bool:()=>new n("bool",null,t.registry),string:()=>new n("string",null,t.registry),unit:()=>new n("unit",null,t.registry),vec:r=>new n("vec",{elementType:r.type,elementOptions:r.options},t.registry),hashSet:r=>new n("set",{elementType:r.type,elementOptions:r.options},t.registry),hashMap:(r,a)=>new n("map",{keyType:r.type,keyOptions:r.options,valueType:a.type,valueOptions:a.options},t.registry),option:r=>new n("option",{valueType:r.type,valueOptions:r.options},t.registry),array:(r,a)=>new n("array",{elementType:r.type,elementOptions:r.options,length:a},t.registry),bytes:r=>new n("bytes",r!=null?{length:r}:{},t.registry),enum:r=>{const a=Object.entries(r).map(([s,l],c)=>({index:c,name:s,type:l.type,options:l.options}));return new n("enum",{variants:a},t.registry)},struct:r=>{const a=Object.fromEntries(Object.entries(r).map(([s,l])=>[s,{type:l.type,options:l.options}]));return new n("struct",a,t.registry)},tuple:(...r)=>{const a=r.map(s=>({type:s.type,options:s.options}));return new n("tuple",a,t.registry)},nativeEnum:r=>{const a=Object.entries(r).filter(([m])=>typeof m=="string"&&Number.isNaN(Number(m))),s=a.map(([m,p])=>p),l=s.some(m=>typeof m=="string"),c=s.some(m=>typeof m=="number");if(l&&c)throw new Error("Mixed string/numeric enums are not supported");const f=new Map,d=new Map;if(a.forEach(([m,p],y)=>{f.set(p,y),d.set(y,p)}),a.length>255)throw new Error("Borsh only supports enums with up to 255 variants");return new n("nativeEnum",{enumObj:r,valueToIndexMap:f,indexToValueMap:d},t.registry)}},cs}var gT;function Oj(){return gT||(gT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Schema=e.b=void 0;var t=Mj();Object.defineProperty(e,"b",{enumerable:!0,get:function(){return t.b}}),Object.defineProperty(e,"Schema",{enumerable:!0,get:function(){return t.Schema}})})(yy)),yy}var le=Oj();const Aj=1,Nj=2,Dj=3,Ij=4,Pj=5,Lj=257,_j=258,jj=259,zj=260,Fj=261,Bj=513,Hj=514,Uj=515,Vj=516,qj=517,$j=518,Yj=519,Wj=520,Kj=522,Gj=769,Xj=770,Qj=771,Zj=772,Jj=773,ez=774,tz=1025,nz=1026,rz=1281,iz=1537,az=1538,oz=1539,sz=1793,lz=1,uz=2,cz=3,dz=4,fz=5,hz=6,pz=7,mz=8,gz=9,yz=10,bz=11,vz=12,xz=13,wz=1,Sz=2,Ez=3,Tz=1001,qi=1002,Cz=1003,Fk=1004,xh=1005,Rz=1101,kz=1102,Mz=1201,Oz=1202,Az=1301,Nz=1302,Dz=1401,Iz={[Tz]:"Unsupported protocol version",[qi]:"Invalid frame format",[Cz]:"Unknown message kind",[Fk]:"Failed to decode payload",[xh]:"Frame exceeds maximum size",[Rz]:"Device not found",[kz]:"Failed to connect device",[Mz]:"Tmux target not found",[Oz]:"Tmux not ready",[Az]:"Select conflict",[Nz]:"Select token mismatch",[Dz]:"Internal server error"};function Pz(e){return Iz[e]??`Unknown error code: ${e}`}class Gr extends Error{constructor(t,n=!1,r){super(r??Pz(t)),this.code=t,this.retryable=n,this.name="WsBorshError"}}const Bk=le.b.struct({magic:le.b.bytes(2),version:le.b.u16(),kind:le.b.u16(),flags:le.b.u16(),seq:le.b.u32(),payload:le.b.bytes()}),Lz=le.b.option(le.b.u32()),ru=le.b.option(le.b.u16()),Tr=le.b.option(le.b.string()),_z=le.b.struct({clientImpl:le.b.string(),clientVersion:le.b.string(),maxFrameBytes:le.b.u32(),supportsCompression:le.b.bool(),supportsDiffSnapshot:le.b.bool()}),jz=le.b.struct({serverImpl:le.b.string(),serverVersion:le.b.string(),selectedVersion:le.b.u16(),maxFrameBytes:le.b.u32(),heartbeatIntervalMs:le.b.u32(),capabilities:le.b.vec(le.b.string())}),zz=le.b.struct({nonce:le.b.u32(),timeMs:le.b.u64()});le.b.struct({refSeq:Lz,code:le.b.u16(),message:le.b.string(),retryable:le.b.bool()});const Fz=le.b.struct({deviceId:le.b.string()}),Bz=le.b.struct({deviceId:le.b.string()}),Hz=le.b.struct({deviceId:le.b.string()}),Uz=le.b.struct({deviceId:le.b.string()}),Vz=le.b.struct({deviceId:le.b.string(),eventType:le.b.u8(),errorType:Tr,message:Tr,rawMessage:Tr}),qz=le.b.struct({deviceId:le.b.string(),windowId:Tr,paneId:Tr,selectToken:le.b.bytes(16),wantHistory:le.b.bool(),cols:ru,rows:ru}),$z=le.b.struct({deviceId:le.b.string(),windowId:le.b.string()}),Yz=le.b.struct({deviceId:le.b.string(),name:Tr}),Wz=le.b.struct({deviceId:le.b.string(),windowId:le.b.string()}),Kz=le.b.struct({deviceId:le.b.string(),paneId:le.b.string()}),Gz=le.b.struct({deviceId:le.b.string(),windowId:le.b.string(),name:le.b.string()}),Xz=le.b.struct({deviceId:le.b.string(),style:le.b.string()}),Qz=le.b.struct({deviceId:le.b.string(),eventType:le.b.u8(),eventData:le.b.bytes()}),Zz=le.b.struct({deviceId:le.b.string(),paneId:le.b.string(),encoding:le.b.u8(),data:le.b.bytes(),isComposing:le.b.bool()}),Jz=le.b.struct({deviceId:le.b.string(),paneId:le.b.string(),encoding:le.b.u8(),data:le.b.bytes(),isComposing:le.b.bool()}),Hk=le.b.struct({deviceId:le.b.string(),paneId:le.b.string(),cols:le.b.u16(),rows:le.b.u16()}),e3=Hk,t3=le.b.struct({deviceId:le.b.string(),paneId:le.b.string(),encoding:le.b.u8(),data:le.b.bytes()}),n3=le.b.struct({deviceId:le.b.string(),paneId:le.b.string(),selectToken:le.b.bytes(16),encoding:le.b.u8(),alternateScreen:le.b.bool(),data:le.b.bytes()}),r3=le.b.struct({deviceId:le.b.string(),windowId:le.b.string(),paneId:le.b.string(),selectToken:le.b.bytes(16)}),i3=le.b.struct({deviceId:le.b.string(),paneId:le.b.string(),selectToken:le.b.bytes(16)}),Uk=le.b.struct({chunkStreamId:le.b.u32(),originalKind:le.b.u16(),originalSeq:le.b.u32(),totalChunks:le.b.u16(),chunkIndex:le.b.u16(),data:le.b.bytes()}),a3=le.b.struct({id:le.b.string(),windowId:le.b.string(),index:le.b.u16(),title:Tr,active:le.b.bool(),width:le.b.u16(),height:le.b.u16()}),o3=le.b.struct({id:le.b.string(),name:le.b.string(),customName:Tr,index:le.b.u16(),active:le.b.bool(),panes:le.b.vec(a3)}),s3=le.b.struct({id:le.b.string(),name:le.b.string(),windows:le.b.vec(o3)}),l3=le.b.struct({deviceId:le.b.string(),session:le.b.option(s3)});le.b.struct({deviceId:le.b.string(),baseRevision:le.b.u32(),revision:le.b.u32(),diffFormat:le.b.u8(),diffBytes:le.b.bytes()});const u3=le.b.struct({sessionId:le.b.string()}),c3=le.b.struct({sessionId:le.b.string()}),d3=le.b.struct({sessionId:le.b.string(),seq:le.b.u32(),eventType:le.b.u8(),payload:le.b.bytes()}),f3=le.b.struct({ruleId:le.b.string(),deviceId:le.b.string(),paneId:le.b.string(),eventType:le.b.u8(),payload:le.b.bytes()}),h3=le.b.struct({windowId:le.b.string()}),p3=le.b.struct({windowId:le.b.string()}),m3=le.b.struct({windowId:le.b.string(),name:le.b.string()}),g3=le.b.struct({windowId:le.b.string()}),y3=le.b.struct({paneId:le.b.string(),windowId:le.b.string()}),b3=le.b.struct({paneId:le.b.string()}),v3=le.b.struct({windowId:le.b.string(),paneId:le.b.string()}),x3=le.b.struct({windowId:le.b.string(),layout:le.b.string()}),w3=le.b.struct({windowId:Tr,paneId:Tr,windowIndex:ru,paneIndex:ru,paneUrl:Tr}),S3=le.b.struct({source:le.b.u8(),title:Tr,body:le.b.string(),windowId:Tr,paneId:Tr,windowIndex:ru,paneIndex:ru,paneUrl:Tr}),td=new Uint8Array([84,88]),E3=1;function wh(e,t,n,r=0,a=E3){const s={magic:td,version:a,kind:e,flags:r,seq:n,payload:t};return Bk.serialize(s)}function cr(e,t){return e.serialize(t)}function T3(e){if(e.length<12)throw new Gr(qi,!1,"Envelope too small");if(e[0]!==td[0]||e[1]!==td[1])throw new Gr(qi,!1,"Invalid magic bytes");try{return Bk.deserialize(e)}catch(t){throw new Gr(qi,!1,t instanceof Error?t.message:"Failed to decode envelope")}}function Ra(e,t){try{return e.deserialize(t)}catch(n){throw new Gr(Fk,!1,n instanceof Error?n.message:"Failed to decode payload")}}function C3(e,t){const n=Uk.serialize(e);return wh(1281,n,t)}function R3(e){return Uk.deserialize(e)}function k3(e){return e.length>=2&&e[0]===td[0]&&e[1]===td[1]}const M3=5e3,yT=100,Db=1e3;class O3{constructor(){tt(this,"streams",new Map);tt(this,"lastCleanup",Date.now())}addChunk(t){if(this.cleanup(),t.totalChunks>Db)throw new Gr(qi,!1,`Too many chunks: ${t.totalChunks} > ${Db}`);if(t.chunkIndex>=t.totalChunks)throw new Gr(qi,!1,`Chunk index out of bounds: ${t.chunkIndex} >= ${t.totalChunks}`);let n=this.streams.get(t.chunkStreamId);if(!n){if(this.streams.size>=yT&&(this.cleanup(!0),this.streams.size>=yT))throw new Gr(qi,!1,"Too many concurrent chunk streams");n={chunks:new Map,totalChunks:t.totalChunks,createdAt:Date.now(),originalKind:t.originalKind,originalSeq:t.originalSeq},this.streams.set(t.chunkStreamId,n)}if(n.totalChunks!==t.totalChunks)throw this.streams.delete(t.chunkStreamId),new Gr(qi,!1,"Chunk total count mismatch");if(n.chunks.has(t.chunkIndex))throw new Gr(qi,!1,`Duplicate chunk index: ${t.chunkIndex}`);return n.chunks.set(t.chunkIndex,t),n.chunks.size===n.totalChunks?this.reassemble(t.chunkStreamId,n):null}reassemble(t,n){const r=[];let a=0;for(let c=0;c<n.totalChunks;c++){const f=n.chunks.get(c);if(!f)throw this.streams.delete(t),new Gr(qi,!1,`Missing chunk index: ${c}`);r.push(f.data),a+=f.data.length}const s=new Uint8Array(a);let l=0;for(const c of r)s.set(c,l),l+=c.length;return this.streams.delete(t),{kind:n.originalKind,seq:n.originalSeq,payload:s}}cleanup(t=!1){const n=Date.now();if(!t&&n-this.lastCleanup<5e3)return;this.lastCleanup=n;const r=n-M3;for(const[a,s]of this.streams)s.createdAt<r&&this.streams.delete(a)}getActiveStreamCount(){return this.streams.size}clear(){this.streams.clear()}}function A3(e,t,n,r){const{maxFrameBytes:a,chunkStreamId:s}=r,l=16,c=18,f=a-l;if(f<=0)throw new Gr(xh,!1,`maxFrameBytes too small: ${a}`);if(e.length<=f)return{chunks:[],totalChunks:0};const d=a-l-c;if(d<=0)throw new Gr(xh,!1,`maxFrameBytes too small for chunking: ${a}`);const m=Math.ceil(e.length/d);if(m>Db)throw new Gr(xh,!1,`Too many chunks: ${m}`);const p=[];for(let y=0;y<m;y++){const g=y*d,x=Math.min(g+d,e.length);p.push({chunkStreamId:s,originalKind:t,originalSeq:n,totalChunks:m,chunkIndex:y,data:e.slice(g,x)})}return{chunks:p,totalChunks:m}}let vy=1;function N3(){const e=vy;return vy=vy%4294967295+1,e}const D3={1:"osc9",2:"osc777",3:"osc1337",4:"osc99"};function I3(e){const t=Vz.deserialize(e),n={1:"tmux-missing",2:"disconnected",3:"error",4:"reconnected"};return{deviceId:t.deviceId,type:n[t.eventType]??"error",errorType:t.errorType??void 0,message:t.message??void 0,rawMessage:t.rawMessage??void 0}}function P3(e){const t=Qz.deserialize(e),r={1:"window-add",2:"window-close",3:"window-renamed",4:"window-active",5:"pane-add",6:"pane-close",7:"pane-active",8:"layout-change",9:"bell",10:"output",11:"notification"}[t.eventType];if(!r)throw new Error(`Unknown tmux event type: ${t.eventType}`);return{deviceId:t.deviceId,type:r,data:L3(r,t.eventData)}}function L3(e,t){if(t.length===0)return{};try{switch(e){case"window-add":return h3.deserialize(t);case"window-close":return p3.deserialize(t);case"window-renamed":return m3.deserialize(t);case"window-active":return g3.deserialize(t);case"pane-add":return y3.deserialize(t);case"pane-close":return b3.deserialize(t);case"pane-active":return v3.deserialize(t);case"layout-change":return x3.deserialize(t);case"bell":{const n=w3.deserialize(t);return{windowId:n.windowId??void 0,paneId:n.paneId??void 0,windowIndex:n.windowIndex??void 0,paneIndex:n.paneIndex??void 0,paneUrl:n.paneUrl??void 0}}case"notification":{const n=S3.deserialize(t);return{source:D3[n.source]??"osc9",title:n.title??void 0,body:n.body,windowId:n.windowId??void 0,paneId:n.paneId??void 0,windowIndex:n.windowIndex??void 0,paneIndex:n.paneIndex??void 0,paneUrl:n.paneUrl??void 0}}default:return{}}}catch{return{}}}function _3(e){const t=l3.deserialize(e);return{deviceId:t.deviceId,session:t.session?j3(t.session):null}}function j3(e){return{id:e.id,name:e.name,windows:e.windows.map(z3)}}function z3(e){return{id:e.id,name:e.name,customName:e.customName??void 0,index:e.index,active:e.active,panes:e.panes.map(F3)}}function F3(e){return{id:e.id,windowId:e.windowId,index:e.index,title:e.title??void 0,active:e.active,width:e.width,height:e.height}}function B3(){const e=navigator.language;return e.startsWith("zh")?"zh_CN":e.startsWith("ja")?"ja_JP":Jv}wn.use(bj).init({resources:Cj,lng:B3(),fallbackLng:Jv,interpolation:{escapeValue:!1},returnNull:!1});const H3={background:"#e1e1e1",foreground:"#616161",cursor:"#616161",selectionBackground:"rgba(97, 97, 97, 0.25)",black:"#171717",red:"#bf2172",green:"#009799",yellow:"#9a7200",blue:"#007299",magenta:"#9b1d72",cyan:"#007173",white:"#d9d9d9",brightBlack:"#4e4e4e",brightRed:"#e12672",brightGreen:"#00bddf",brightYellow:"#ffdd00",brightBlue:"#7299bc",brightMagenta:"#e17899",brightCyan:"#6fbcbd",brightWhite:"#f1f1f1"},U3={background:"#262626",foreground:"#d0d0d0",cursor:"#c5c5c5",selectionBackground:"rgba(197, 197, 197, 0.25)",black:"#000000",red:"#ba3c3c",green:"#5d876d",yellow:"#d5a54e",blue:"#887c8d",magenta:"#cd6d6d",cyan:"#618484",white:"#cfcdc3",brightBlack:"#000000",brightRed:"#ea7171",brightGreen:"#7aab7a",brightYellow:"#d1d194",brightBlue:"#afa3b5",brightMagenta:"#e29f9f",brightCyan:"#a0aea3",brightWhite:"#d0d0d0"};function V3(e){const t=e==="light"?H3:U3;return`fg=${t.foreground},bg=${t.background}`}const PX='"JetBrains Mono", "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Noto Sans Mono CJK SC", "Source Han Mono SC", "Sarasa Mono SC", "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", monospace',q3=`${typeof window<"u"&&window.location.protocol==="https:"?"wss:":"ws:"}//${typeof window<"u"?window.location.host:""}/ws`,$3={clientImpl:"tmex-fe",clientVersion:"0.1.0",maxFrameBytes:1048576,reconnectDelayMs:1e3,maxReconnectAttempts:5,heartbeatIntervalMs:15e3};class Y3{constructor(t={}){tt(this,"ws",null);tt(this,"options");tt(this,"state","IDLE");tt(this,"seq",0);tt(this,"chunkReassembler",new O3);tt(this,"reconnectAttempts",0);tt(this,"reconnectTimer",null);tt(this,"heartbeatTimer",null);tt(this,"messageHandlers",new Set);tt(this,"stateChangeHandlers",new Set);tt(this,"errorHandlers",new Set);tt(this,"pendingMessages",[]);tt(this,"maxPendingMessages",100);this.options={...$3,...t}}setState(t){if(this.state!==t){console.log(`[borsh-client] State: ${this.state} -> ${t}`),this.state=t;for(const n of this.stateChangeHandlers)try{n(t)}catch(r){console.error("[borsh-client] State change handler error:",r)}t==="READY"&&this.flushPendingMessages()}}getState(){return this.state}isReady(){return this.state==="READY"}onMessage(t){return this.messageHandlers.add(t),()=>this.messageHandlers.delete(t)}onStateChange(t){return this.stateChangeHandlers.add(t),()=>this.stateChangeHandlers.delete(t)}onError(t){return this.errorHandlers.add(t),()=>this.errorHandlers.delete(t)}connect(){var t,n;if(!(((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN||((n=this.ws)==null?void 0:n.readyState)===WebSocket.CONNECTING)){this.setState("WS_CONNECTING");try{this.ws=new WebSocket(q3),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{this.sendHello()},this.ws.onmessage=r=>{this.handleMessage(r.data)},this.ws.onclose=()=>{this.handleClose()},this.ws.onerror=()=>{this.handleError(new Error("WebSocket error"))}}catch(r){this.handleError(r instanceof Error?r:new Error(String(r)))}}}disconnect(){this.setState("CLOSED"),this.clearTimers(),this.ws&&(this.ws.close(),this.ws=null)}handleMessage(t){if(typeof t=="string")return;const n=new Uint8Array(t);if(!k3(n)){console.warn("[borsh-client] Received message without magic, ignoring");return}try{const r=T3(n);if(r.kind===rz){const a=R3(r.payload),s=this.chunkReassembler.addChunk(a);s&&this.dispatchMessage({kind:s.kind,seq:s.seq,payload:s.payload});return}if(r.kind===Nj){this.handleHelloS2C(r.payload);return}if(r.kind===Ij)return;this.dispatchMessage({kind:r.kind,seq:r.seq,payload:r.payload})}catch(r){console.error("[borsh-client] Failed to decode message:",r)}}dispatchMessage(t){for(const n of this.messageHandlers)try{n(t)}catch(r){console.error("[borsh-client] Message handler error:",r)}}handleHelloS2C(t){try{const n=Ra(jz,t);console.log("[borsh-client] HELLO_S2C received:",n),this.setState("READY"),this.startHeartbeat(),this.reconnectAttempts=0}catch(n){console.error("[borsh-client] Failed to decode HELLO_S2C:",n),this.handleError(new Error("HELLO negotiation failed"))}}handleClose(){this.stopHeartbeat(),this.state!=="CLOSED"&&(this.reconnectAttempts<this.options.maxReconnectAttempts?this.scheduleReconnect():(this.setState("CLOSED"),this.handleError(new Error("Max reconnection attempts reached"))))}handleError(t){console.error("[borsh-client] Error:",t);for(const n of this.errorHandlers)try{n(t)}catch(r){console.error("[borsh-client] Error handler error:",r)}}sendHello(){const t={clientImpl:this.options.clientImpl,clientVersion:this.options.clientVersion,maxFrameBytes:this.options.maxFrameBytes,supportsCompression:!1,supportsDiffSnapshot:!1},n=cr(_z,t),r=this.nextSeq(),a=wh(Aj,n,r);this.sendRaw(a),this.setState("HELLO_NEGOTIATING")}send(t,n){if(!this.isReady())return this.pendingMessages.length<this.maxPendingMessages&&this.pendingMessages.push({kind:t,payload:n}),!1;const r=this.nextSeq(),a=A3(n,t,r,{maxFrameBytes:this.options.maxFrameBytes,chunkStreamId:N3()});if(a.totalChunks===0){const s=wh(t,n,r);this.sendRaw(s)}else for(const s of a.chunks){const l=C3(s,this.nextSeq());this.sendRaw(l)}return!0}sendRaw(t){var n;((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN&&this.ws.send(t)}flushPendingMessages(){for(;this.pendingMessages.length>0;){const t=this.pendingMessages.shift();t&&this.send(t.kind,t.payload)}}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.sendPing()},this.options.heartbeatIntervalMs)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}sendPing(){if(!this.isReady())return;const t={nonce:Math.floor(Math.random()*4294967295),timeMs:BigInt(Date.now())},n=cr(zz,t),r=this.nextSeq(),a=wh(Dj,n,r);this.sendRaw(a)}scheduleReconnect(){if(this.reconnectTimer)return;this.reconnectAttempts++,this.setState("RECONNECT_BACKOFF");const t=Math.min(this.options.reconnectDelayMs*2**(this.reconnectAttempts-1),3e4);console.log(`[borsh-client] Reconnecting in ${t}ms (attempt ${this.reconnectAttempts})`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}clearTimers(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.stopHeartbeat()}nextSeq(){return this.seq=(this.seq+1)%4294967295,this.seq}}let xy=null;function Hn(){return xy||(xy=new Y3),xy}class W3{constructor(t={}){tt(this,"transactions",new Map);tt(this,"outputGates",new Map);tt(this,"deferredResets",new Set);tt(this,"deferredHistories",new Map);tt(this,"deferredFlushes",new Map);tt(this,"deferredOutputs",new Map);tt(this,"callbacks");tt(this,"ackTimeoutMs",1500);tt(this,"liveResumeTimeoutMs",2e3);tt(this,"timers",new Map);this.callbacks=t}setCallbacks(t){this.callbacks=t;for(const n of this.transactions.keys())this.replayDeferred(n);for(const n of this.deferredResets)this.replayDeferred(n);for(const n of this.deferredHistories.keys())this.replayDeferred(n);for(const n of this.deferredFlushes.keys())this.replayDeferred(n);for(const n of this.deferredOutputs.keys())this.replayDeferred(n)}getTransaction(t){return this.transactions.get(t)}getState(t){var n;return((n=this.transactions.get(t))==null?void 0:n.state)??"STABLE"}isStable(t){return this.getState(t)==="STABLE"}isBuffering(t){var n;return((n=this.outputGates.get(t))==null?void 0:n.state)==="BUFFERING"}dispatch(t){switch(t.type){case"SELECT_START":this.handleSelectStart(t);break;case"SWITCH_ACK":this.handleSwitchAck(t);break;case"HISTORY":this.handleHistory(t);break;case"LIVE_RESUME":this.handleLiveResume(t);break;case"OUTPUT":this.handleOutput(t);break;case"SELECT_FAILED":this.handleSelectFailed(t);break}}handleSelectStart(t){const{deviceId:n,windowId:r,paneId:a,selectToken:s,wantHistory:l}=t;this.cancelTransaction(n),this.clearDeferred(n);const c={state:"SELECTING",deviceId:n,windowId:r,paneId:a,selectToken:new Uint8Array(s),wantHistory:l,startedAt:Date.now()};this.transactions.set(n,c),this.startOutputBuffering(n),this.setTimer(n,()=>{this.handleTimeout(n,"ack")},this.ackTimeoutMs)}handleSwitchAck(t){const{deviceId:n,selectToken:r}=t,a=this.transactions.get(n);!a||!this.validateToken(a.selectToken,r)||a.state==="SELECTING"&&(this.clearTimer(n),a.state="ACKED",this.callbacks.onResetTerminal?this.callbacks.onResetTerminal(n):this.deferredResets.add(n),this.setTimer(n,()=>{this.handleTimeout(n,"live")},this.liveResumeTimeoutMs))}handleHistory(t){const{deviceId:n,selectToken:r,data:a}=t,s=this.transactions.get(n);!s||!this.validateToken(s.selectToken,r)||s.state==="ACKED"&&(s.state="HISTORY_APPLIED",this.callbacks.onApplyHistory?this.callbacks.onApplyHistory(n,a,t.alternateScreen):this.deferredHistories.set(n,{data:a,alternateScreen:t.alternateScreen}),this.setTimer(n,()=>{this.handleTimeout(n,"live")},this.liveResumeTimeoutMs))}handleLiveResume(t){const{deviceId:n,selectToken:r}=t,a=this.transactions.get(n);if(!a||!this.validateToken(a.selectToken,r)||a.state!=="ACKED"&&a.state!=="HISTORY_APPLIED")return;this.clearTimer(n),a.state="LIVE";const s=this.stopOutputBuffering(n);this.completeTransaction(n),this.callbacks.onFlushBuffer?this.callbacks.onFlushBuffer(n,s):s.length>0&&this.deferredFlushes.set(n,s),this.replayDeferred(n)}handleOutput(t){const{deviceId:n,paneId:r,data:a}=t,s=this.transactions.get(n);if(s&&s.paneId!==r)return;if(this.isBuffering(n)){this.bufferOutput(n,a);return}if(this.callbacks.onOutput){this.callbacks.onOutput(n,r,a);return}const l=this.deferredOutputs.get(n)??[];l.push({paneId:r,data:new Uint8Array(a)}),this.deferredOutputs.set(n,l)}handleSelectFailed(t){const{deviceId:n}=t;this.failTransaction(n)}handleTimeout(t,n){console.warn(`[select-sm] Timeout at ${n} for ${t}`),this.failTransaction(t)}completeTransaction(t){const n=this.transactions.get(t);n&&(n.state="STABLE",this.transactions.delete(t))}failTransaction(t){var r,a;const n=this.transactions.get(t);n&&(n.state="SELECT_FAILED",this.stopOutputBuffering(t),(a=(r=this.callbacks).onSelectFailed)==null||a.call(r,t),this.transactions.delete(t),this.clearTimer(t),this.clearDeferred(t))}cancelTransaction(t){this.transactions.get(t)&&(this.stopOutputBuffering(t),this.transactions.delete(t),this.clearTimer(t),this.clearDeferred(t))}startOutputBuffering(t){this.outputGates.set(t,{state:"BUFFERING",buffer:[]})}stopOutputBuffering(t){const n=this.outputGates.get(t);if(!n)return[];const r=[...n.buffer];return this.outputGates.delete(t),r}bufferOutput(t,n){const r=this.outputGates.get(t);r&&(r.buffer.length>=1e3&&r.buffer.shift(),r.buffer.push(new Uint8Array(n)))}validateToken(t,n){if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==n[r])return!1;return!0}replayDeferred(t){var s,l;this.deferredResets.has(t)&&(this.deferredResets.delete(t),(l=(s=this.callbacks).onResetTerminal)==null||l.call(s,t));const n=this.deferredHistories.get(t);n!==void 0&&this.callbacks.onApplyHistory&&(this.callbacks.onApplyHistory(t,n.data,n.alternateScreen),this.deferredHistories.delete(t));const r=this.deferredFlushes.get(t);r&&this.callbacks.onFlushBuffer&&(this.callbacks.onFlushBuffer(t,r),this.deferredFlushes.delete(t));const a=this.deferredOutputs.get(t);if(a&&this.callbacks.onOutput){for(const c of a)this.callbacks.onOutput(t,c.paneId,c.data);this.deferredOutputs.delete(t)}}clearDeferred(t){this.deferredResets.delete(t),this.deferredHistories.delete(t),this.deferredFlushes.delete(t),this.deferredOutputs.delete(t)}setTimer(t,n,r){this.clearTimer(t);const a=setTimeout(n,r);this.timers.set(t,a)}clearTimer(t){const n=this.timers.get(t);n&&(clearTimeout(n),this.timers.delete(t))}cleanup(t){this.cancelTransaction(t),this.outputGates.delete(t),this.clearDeferred(t)}cleanupAll(){for(const t of this.transactions.keys())this.cleanup(t);this.transactions.clear(),this.outputGates.clear(),this.deferredResets.clear(),this.deferredHistories.clear(),this.deferredFlushes.clear(),this.deferredOutputs.clear();for(const t of this.timers.values())clearTimeout(t);this.timers.clear()}}let vc=null;function nd(e){return vc?(e&&vc.setCallbacks(e),vc):(vc=new W3(e),vc)}function K3(){return crypto.getRandomValues(new Uint8Array(16))}function Vk(e){const t=cr(Fz,{deviceId:e});return{kind:Lj,payload:t}}function G3(e){const t=cr(Hz,{deviceId:e});return{kind:jj,payload:t}}function X3(e){const t=cr(qz,{deviceId:e.deviceId,windowId:e.windowId??null,paneId:e.paneId??null,selectToken:e.selectToken,wantHistory:e.wantHistory,cols:e.cols??null,rows:e.rows??null});return{kind:Bj,payload:t}}function Q3(e,t){const n=cr($z,{deviceId:e,windowId:t});return{kind:Hj,payload:n}}function Z3(e,t){const n=cr(Yz,{deviceId:e,name:t??null});return{kind:Uj,payload:n}}function J3(e,t){const n=cr(Wz,{deviceId:e,windowId:t});return{kind:Vj,payload:n}}function e4(e,t){const n=cr(Kz,{deviceId:e,paneId:t});return{kind:qj,payload:n}}function t4(e,t,n){const r=cr(Gz,{deviceId:e,windowId:t,name:n});return{kind:$j,payload:r}}function n4(e,t){const n=cr(Xz,{deviceId:e,style:t});return{kind:Kj,payload:n}}function r4(e,t,n,r=!1){const a=new TextEncoder,s=cr(Zz,{deviceId:e,paneId:t,encoding:2,data:a.encode(n),isComposing:r});return{kind:Gj,payload:s}}function i4(e,t,n){const r=new TextEncoder,a=cr(Jz,{deviceId:e,paneId:t,encoding:2,data:r.encode(n),isComposing:!1});return{kind:Xj,payload:a}}function a4(e,t,n,r){const a=cr(Hk,{deviceId:e,paneId:t,cols:n,rows:r});return{kind:Qj,payload:a}}function o4(e,t,n,r){const a=cr(e3,{deviceId:e,paneId:t,cols:n,rows:r});return{kind:Zj,payload:a}}function s4(e){const t=cr(u3,{sessionId:e});return{kind:iz,payload:t}}function l4(e){const t=cr(c3,{sessionId:e});return{kind:az,payload:t}}const bT=e=>{let t;const n=new Set,r=(d,m)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const y=t;t=m??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(g=>g(t,y))}},a=()=>t,c={setState:r,getState:a,getInitialState:()=>f,subscribe:d=>(n.add(d),()=>n.delete(d))},f=t=e(r,a,c);return c},u4=(e=>e?bT(e):bT),c4=e=>e;function d4(e,t=c4){const n=Ue.useSyncExternalStore(e.subscribe,Ue.useCallback(()=>t(e.getState()),[e,t]),Ue.useCallback(()=>t(e.getInitialState()),[e,t]));return Ue.useDebugValue(n),n}const vT=e=>{const t=u4(e),n=r=>d4(t,r);return Object.assign(n,t),n},fp=(e=>e?vT(e):vT),wy={siteName:"tmex",siteUrl:typeof window<"u"?window.location.origin:"http://localhost:9663",bellThrottleSeconds:6,notificationThrottleSeconds:3,enableBrowserBellToast:!0,enableBrowserNotificationToast:!0,enableTelegramBellPush:!0,enableTelegramNotificationPush:!0,sshReconnectMaxRetries:2,sshReconnectDelaySeconds:10,language:Jv,updatedAt:new Date(0).toISOString()};async function xT(){const e=await fetch("/api/settings/site");if(!e.ok)throw new Error("Failed to load site settings");return(await e.json()).settings}const Ps=fp((e,t)=>({settings:null,loading:!1,fetchSettings:async()=>{const n=t().settings;if(n)return n;e({loading:!0});try{const r=await xT();return e({settings:r,loading:!1}),wn.changeLanguage(r.language),r}catch(r){return console.error("[site] failed to fetch settings:",r),e({settings:wy,loading:!1}),wn.changeLanguage(wy.language),wy}},refreshSettings:async()=>{e({loading:!0});try{const n=await xT();return e({settings:n,loading:!1}),wn.changeLanguage(n.language),n}catch(n){throw console.error("[site] failed to refresh settings:",n),e({loading:!1}),n}}}));function f4(e){const t=typeof e.windowIndex=="number"?`Window ${e.windowIndex}`:typeof e.windowId=="string"&&e.windowId?`Window ${e.windowId}`:"",n=typeof e.paneIndex=="number"?`Pane ${e.paneIndex}`:typeof e.paneId=="string"&&e.paneId?`Pane ${e.paneId}`:"";return[t,n].filter(Boolean).join(" · ")}function h4(e){const t=typeof e.title=="string"&&e.title?e.title:"Terminal Notification",n=f4(e),r=typeof e.body=="string"&&e.body?e.body:typeof e.source=="string"&&e.source?`From ${e.source}`:"Terminal notification";return{title:t,description:n?`${n}
86
+ ${r}`:r}}function p4(e,t){let n;try{n=e()}catch{return}return{getItem:a=>{var s;const l=f=>f===null?null:JSON.parse(f,void 0),c=(s=n.getItem(a))!=null?s:null;return c instanceof Promise?c.then(l):l(c)},setItem:(a,s)=>n.setItem(a,JSON.stringify(s,void 0)),removeItem:a=>n.removeItem(a)}}const Ib=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Ib(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Ib(r)(n)}}}},m4=(e,t)=>(n,r,a)=>{let s={storage:p4(()=>window.localStorage),partialize:T=>T,version:0,merge:(T,S)=>({...S,...T}),...t},l=!1,c=0;const f=new Set,d=new Set;let m=s.storage;if(!m)return e((...T)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...T)},r,a);const p=()=>{const T=s.partialize({...r()});return m.setItem(s.name,{state:T,version:s.version})},y=a.setState;a.setState=(T,S)=>(y(T,S),p());const g=e((...T)=>(n(...T),p()),r,a);a.getInitialState=()=>g;let x;const C=()=>{var T,S;if(!m)return;const R=++c;l=!1,f.forEach(M=>{var D;return M((D=r())!=null?D:g)});const k=((S=s.onRehydrateStorage)==null?void 0:S.call(s,(T=r())!=null?T:g))||void 0;return Ib(m.getItem.bind(m))(s.name).then(M=>{if(M)if(typeof M.version=="number"&&M.version!==s.version){if(s.migrate){const D=s.migrate(M.state,M.version);return D instanceof Promise?D.then(O=>[!0,O]):[!0,D]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,M.state];return[!1,void 0]}).then(M=>{var D;if(R!==c)return;const[O,N]=M;if(x=s.merge(N,(D=r())!=null?D:g),n(x,!0),O)return p()}).then(()=>{R===c&&(k==null||k(x,void 0),x=r(),l=!0,d.forEach(M=>M(x)))}).catch(M=>{R===c&&(k==null||k(void 0,M))})};return a.persist={setOptions:T=>{s={...s,...T},T.storage&&(m=T.storage)},clearStorage:()=>{m==null||m.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>C(),hasHydrated:()=>l,onHydrate:T=>(f.add(T),()=>{f.delete(T)}),onFinishHydration:T=>(d.add(T),()=>{d.delete(T)})},s.skipHydration||C(),x||g},qk=m4,Ia=fp()(qk(e=>({sidebarCollapsed:!1,sidebarTab:"panes",inputMode:"direct",editorSendWithEnter:!0,theme:"dark",editorHistory:[],editorDrafts:{},setSidebarCollapsed:t=>e({sidebarCollapsed:t}),setSidebarTab:t=>e({sidebarTab:t}),setInputMode:t=>e({inputMode:t}),setEditorSendWithEnter:t=>e({editorSendWithEnter:t}),setTheme:t=>e({theme:t}),addEditorHistory:t=>e(n=>({editorHistory:[t,...n.editorHistory.slice(0,49)]})),setEditorDraft:(t,n)=>e(r=>({editorDrafts:{...r.editorDrafts,[t]:n}})),removeEditorDraft:t=>e(n=>{if(!(t in n.editorDrafts))return n;const r={...n.editorDrafts};return delete r[t],{editorDrafts:r}})}),{name:"tmex-ui",partialize:e=>({sidebarCollapsed:e.sidebarCollapsed,sidebarTab:e.sidebarTab,inputMode:e.inputMode,editorSendWithEnter:e.editorSendWithEnter,theme:e.theme,editorHistory:e.editorHistory,editorDrafts:e.editorDrafts})})),g4=500,wT=new Map,Sy=new Map;function $k(e){const t=Date.now(),n=wT.get(e);return n!==void 0&&t-n<g4?!0:(wT.set(e,t),!1)}let ST=!1;function Ey(e){const t=V3(Ia.getState().theme),n=n4(e,t);Hn().send(n.kind,n.payload)}function Ty(e,t){if(typeof e!="number"||typeof t!="number")return null;const n=Math.max(2,Math.floor(e)),r=Math.max(2,Math.floor(t));return{cols:n,rows:r}}function y4(e,t){if(ST)return;ST=!0;const n=Hn(),r=s=>{const l=t().selectedPanes[s];!l||nd().getTransaction(s)||t().selectPane(s,l.windowId,l.paneId)};n.onStateChange(s=>{e({socketReady:s==="READY"})}),n.onMessage(s=>{const l=nd();switch(s.kind){case _j:{const c=Ra(Bz,s.payload);e(f=>({deviceConnected:{...f.deviceConnected,[c.deviceId]:!0},deviceErrors:{...f.deviceErrors,[c.deviceId]:void 0},deviceReconnecting:{...f.deviceReconnecting,[c.deviceId]:void 0}})),Ey(c.deviceId),r(c.deviceId);return}case zj:{const c=Ra(Uz,s.payload);l.cleanup(c.deviceId),e(f=>({deviceConnected:{...f.deviceConnected,[c.deviceId]:!1}}));return}case Fj:{const c=I3(s.payload);b4(e,c),c.type==="reconnected"&&(Ey(c.deviceId),r(c.deviceId));return}case Wj:{const c=_3(s.payload);e(f=>({snapshots:{...f.snapshots,[c.deviceId]:c}}));return}case Yj:{const c=P3(s.payload);v4(e,c);return}case tz:{const c=Ra(r3,s.payload);l.dispatch({type:"SWITCH_ACK",deviceId:c.deviceId,selectToken:c.selectToken});return}case ez:{const c=Ra(n3,s.payload),f=new TextDecoder().decode(c.data);l.dispatch({type:"HISTORY",deviceId:c.deviceId,selectToken:c.selectToken,data:f,alternateScreen:c.alternateScreen});return}case nz:{const c=Ra(i3,s.payload);l.dispatch({type:"LIVE_RESUME",deviceId:c.deviceId,selectToken:c.selectToken});return}case Jj:{const c=Ra(t3,s.payload);l.dispatch({type:"OUTPUT",deviceId:c.deviceId,paneId:c.paneId,data:c.data});return}case Pj:return}}),n.onError(s=>{console.error("[tmux] borsh ws error:",s),e({socketReady:!1}),gn.error("WebSocket Connection Error",{description:"Please check Gateway status"})}),n.onStateChange(s=>{if(s!=="READY")return;const l=t().connectedDevices;for(const c of l){if($k(c))continue;const f=Vk(c);n.send(f.kind,f.payload)}});let a=Ia.getState().theme;Ia.subscribe(s=>{if(s.theme===a)return;a=s.theme;const l=t();for(const c of l.connectedDevices)l.deviceConnected[c]&&Ey(c)})}function b4(e,t){if(t.type==="error"){const n=t.message??"Device Error",r=t.errorType??"unknown";if(r==="reconnecting"){e(a=>({deviceReconnecting:{...a.deviceReconnecting,[t.deviceId]:{message:n,at:Date.now()}}}));return}e(a=>{const s=a.deviceErrors[t.deviceId];return(!s||s.type!==r)&&gn.error(n),{deviceErrors:{...a.deviceErrors,[t.deviceId]:{message:n,type:r,rawMessage:t.rawMessage,at:Date.now()}},deviceReconnecting:{...a.deviceReconnecting,[t.deviceId]:void 0}}});return}if(t.type==="disconnected"){nd().cleanup(t.deviceId),e(n=>({deviceConnected:{...n.deviceConnected,[t.deviceId]:!1}}));return}t.type==="reconnected"&&e(n=>({deviceConnected:{...n.deviceConnected,[t.deviceId]:!0},deviceErrors:{...n.deviceErrors,[t.deviceId]:void 0},deviceReconnecting:{...n.deviceReconnecting,[t.deviceId]:void 0}}))}function v4(e,t){if(t.type==="bell"){console.log("[tmex] bell",t.data);const n=Ps.getState().settings;if((n==null?void 0:n.enableBrowserBellToast)===!1)return;const r=t.data??{},a="Terminal Bell",s=[typeof r.windowIndex=="number"?`Window ${r.windowIndex}`:void 0,typeof r.paneIndex=="number"?`Pane ${r.paneIndex}`:void 0].filter(Boolean).join(" · "),l=typeof r.paneUrl=="string"?r.paneUrl:void 0;gn(a,{description:s||"Received tmux bell",action:l?{label:"Open",onClick:()=>{window.location.href=l}}:void 0})}if(t.type==="notification"){console.log("[tmex] notification",t.data);const n=Ps.getState().settings;if((n==null?void 0:n.enableBrowserNotificationToast)===!1)return;const r=t.data??{},{title:a,description:s}=h4(r),l=typeof r.paneUrl=="string"?r.paneUrl:void 0;gn(a,{description:s,action:l?{label:"Open",onClick:()=>{window.location.href=l}}:void 0})}if(t.type==="pane-active"){const n=t.data;n!=null&&n.windowId&&(n!=null&&n.paneId)&&e(r=>({activePaneFromEvent:{...r.activePaneFromEvent,[t.deviceId]:{windowId:n.windowId,paneId:n.paneId}}}))}}const Qn=fp((e,t)=>({socketReady:!1,snapshots:{},connectedDevices:new Set,deviceConnected:{},deviceErrors:{},deviceReconnecting:{},selectedPanes:{},activePaneFromEvent:{},pendingCreateWindowAt:{},ensureSocketConnected(){y4(e,t),Hn().connect()},connectDevice(n){if(!n||(e(a=>{const s=new Set(a.connectedDevices);return s.add(n),{connectedDevices:s}}),t().ensureSocketConnected(),$k(n)))return;const r=Vk(n);Hn().send(r.kind,r.payload)},disconnectDevice(n){if(!n)return;e(a=>{const s=new Set(a.connectedDevices);return s.delete(n),{connectedDevices:s}}),nd().cleanup(n);const r=G3(n);Hn().send(r.kind,r.payload)},clearDeviceError(n){e(r=>({deviceErrors:{...r.deviceErrors,[n]:void 0},deviceReconnecting:{...r.deviceReconnecting,[n]:void 0}}))},hydrateDeviceErrors(n){e(r=>{const a={...r.deviceErrors};for(const s of n)a[s.deviceId]||!s.lastError||!s.lastErrorType||(a[s.deviceId]={message:s.lastError,type:s.lastErrorType,at:0});return{deviceErrors:a}})},selectPane(n,r,a,s){if(!n||!r||!a)return;e(m=>({selectedPanes:{...m.selectedPanes,[n]:{windowId:r,paneId:a}}}));const l=K3(),c=!0;nd().dispatch({type:"SELECT_START",deviceId:n,windowId:r,paneId:a,selectToken:l,wantHistory:c});const f=Ty(s==null?void 0:s.cols,s==null?void 0:s.rows)??Sy.get(n)??null,d=X3({deviceId:n,windowId:r,paneId:a,selectToken:l,wantHistory:c,cols:f==null?void 0:f.cols,rows:f==null?void 0:f.rows});Hn().send(d.kind,d.payload)},selectWindow(n,r){if(!n||!r)return;const a=Q3(n,r);Hn().send(a.kind,a.payload)},sendInput(n,r,a,s=!1){if(!n||!r)return;const l=r4(n,r,a,s);Hn().send(l.kind,l.payload)},resizePane(n,r,a,s){if(!n||!r)return;const l=Ty(a,s);l&&Sy.set(n,{...l,at:Date.now()});const c=a4(n,r,a,s);Hn().send(c.kind,c.payload)},syncPaneSize(n,r,a,s){if(!n||!r)return;const l=Ty(a,s);l&&Sy.set(n,{...l,at:Date.now()});const c=o4(n,r,a,s);Hn().send(c.kind,c.payload)},paste(n,r,a){if(!n||!r)return;const s=i4(n,r,a);Hn().send(s.kind,s.payload)},createWindow(n,r){if(!n)return;const a=Z3(n,r);Hn().send(a.kind,a.payload),e(s=>({pendingCreateWindowAt:{...s.pendingCreateWindowAt,[n]:Date.now()}}))},clearPendingCreateWindow(n){n&&e(r=>{if(r.pendingCreateWindowAt[n]===void 0)return r;const a={...r.pendingCreateWindowAt};return delete a[n],{pendingCreateWindowAt:a}})},closeWindow(n,r){if(!n||!r)return;const a=J3(n,r);Hn().send(a.kind,a.payload)},closePane(n,r){if(!n||!r)return;const a=e4(n,r);Hn().send(a.kind,a.payload)},renameWindow(n,r,a){if(!n||!r)return;const s=t4(n,r,a);Hn().send(s.kind,s.payload)}})),ET="tmex:connectedDevices",Yk=w.createContext(null);function x4(){const e=w.useContext(Yk);if(!e)throw new Error("useGlobalDevice must be used within GlobalDeviceProvider");return e}function w4({children:e}){const t=Zi(),[n,r]=w.useState(()=>{try{const p=localStorage.getItem(ET);if(p){const y=JSON.parse(p);return new Set(y)}}catch{}return new Set}),a=Qn(p=>p.connectDevice),s=Qn(p=>p.disconnectDevice),l=Qn(p=>p.connectedDevices);w.useEffect(()=>{try{localStorage.setItem(ET,JSON.stringify([...n]))}catch{}},[n]),w.useEffect(()=>{const p=t.pathname.match(/^\/devices\/([^/]+)/),y=p==null?void 0:p[1];y&&!l.has(y)&&a(y)},[t.pathname,l,a]);const c=w.useCallback(p=>{r(y=>{const g=new Set(y);return g.add(p),g}),l.has(p)||a(p)},[l,a]),f=w.useCallback(p=>{r(y=>{const g=new Set(y);return g.delete(p),g}),l.has(p)&&s(p)},[l,s]),d=w.useCallback((p,y)=>{y?f(p):c(p)},[c,f]),m=w.useMemo(()=>({persistedDevices:n,connectDevice:c,disconnectDevice:f,toggleDevice:d}),[n,c,f,d]);return E.jsx(Yk.Provider,{value:m,children:e})}/**
87
+ * @license lucide-react v0.564.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
90
+ * See the LICENSE file in the root directory of this source tree.
91
+ */const Wk=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
92
+ * @license lucide-react v0.564.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */const S4=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
97
+ * @license lucide-react v0.564.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */const E4=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
102
+ * @license lucide-react v0.564.0 - ISC
103
+ *
104
+ * This source code is licensed under the ISC license.
105
+ * See the LICENSE file in the root directory of this source tree.
106
+ */const TT=e=>{const t=E4(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
107
+ * @license lucide-react v0.564.0 - ISC
108
+ *
109
+ * This source code is licensed under the ISC license.
110
+ * See the LICENSE file in the root directory of this source tree.
111
+ */var T4={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"};/**
112
+ * @license lucide-react v0.564.0 - ISC
113
+ *
114
+ * This source code is licensed under the ISC license.
115
+ * See the LICENSE file in the root directory of this source tree.
116
+ */const C4=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
117
+ * @license lucide-react v0.564.0 - ISC
118
+ *
119
+ * This source code is licensed under the ISC license.
120
+ * See the LICENSE file in the root directory of this source tree.
121
+ */const R4=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:s,iconNode:l,...c},f)=>w.createElement("svg",{ref:f,...T4,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Wk("lucide",a),...!s&&!C4(c)&&{"aria-hidden":"true"},...c},[...l.map(([d,m])=>w.createElement(d,m)),...Array.isArray(s)?s:[s]]));/**
122
+ * @license lucide-react v0.564.0 - ISC
123
+ *
124
+ * This source code is licensed under the ISC license.
125
+ * See the LICENSE file in the root directory of this source tree.
126
+ */const Dt=(e,t)=>{const n=w.forwardRef(({className:r,...a},s)=>w.createElement(R4,{ref:s,iconNode:t,className:Wk(`lucide-${S4(TT(e))}`,`lucide-${e}`,r),...a}));return n.displayName=TT(e),n};/**
127
+ * @license lucide-react v0.564.0 - ISC
128
+ *
129
+ * This source code is licensed under the ISC license.
130
+ * See the LICENSE file in the root directory of this source tree.
131
+ */const k4=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],M4=Dt("activity",k4);/**
132
+ * @license lucide-react v0.564.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */const O4=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],A4=Dt("arrow-down",O4);/**
137
+ * @license lucide-react v0.564.0 - ISC
138
+ *
139
+ * This source code is licensed under the ISC license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */const N4=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],D4=Dt("arrow-left",N4);/**
142
+ * @license lucide-react v0.564.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */const I4=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],P4=Dt("bell",I4);/**
147
+ * @license lucide-react v0.564.0 - ISC
148
+ *
149
+ * This source code is licensed under the ISC license.
150
+ * See the LICENSE file in the root directory of this source tree.
151
+ */const L4=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],ex=Dt("bot",L4);/**
152
+ * @license lucide-react v0.564.0 - ISC
153
+ *
154
+ * This source code is licensed under the ISC license.
155
+ * See the LICENSE file in the root directory of this source tree.
156
+ */const _4=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],j4=Dt("brain",_4);/**
157
+ * @license lucide-react v0.564.0 - ISC
158
+ *
159
+ * This source code is licensed under the ISC license.
160
+ * See the LICENSE file in the root directory of this source tree.
161
+ */const z4=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],zh=Dt("check",z4);/**
162
+ * @license lucide-react v0.564.0 - ISC
163
+ *
164
+ * This source code is licensed under the ISC license.
165
+ * See the LICENSE file in the root directory of this source tree.
166
+ */const F4=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Kk=Dt("chevron-down",F4);/**
167
+ * @license lucide-react v0.564.0 - ISC
168
+ *
169
+ * This source code is licensed under the ISC license.
170
+ * See the LICENSE file in the root directory of this source tree.
171
+ */const B4=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],hp=Dt("chevron-right",B4);/**
172
+ * @license lucide-react v0.564.0 - ISC
173
+ *
174
+ * This source code is licensed under the ISC license.
175
+ * See the LICENSE file in the root directory of this source tree.
176
+ */const H4=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],U4=Dt("chevron-up",H4);/**
177
+ * @license lucide-react v0.564.0 - ISC
178
+ *
179
+ * This source code is licensed under the ISC license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */const V4=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Fc=Dt("circle-alert",V4);/**
182
+ * @license lucide-react v0.564.0 - ISC
183
+ *
184
+ * This source code is licensed under the ISC license.
185
+ * See the LICENSE file in the root directory of this source tree.
186
+ */const q4=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],CT=Dt("ellipsis-vertical",q4);/**
187
+ * @license lucide-react v0.564.0 - ISC
188
+ *
189
+ * This source code is licensed under the ISC license.
190
+ * See the LICENSE file in the root directory of this source tree.
191
+ */const $4=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Y4=Dt("ellipsis",$4);/**
192
+ * @license lucide-react v0.564.0 - ISC
193
+ *
194
+ * This source code is licensed under the ISC license.
195
+ * See the LICENSE file in the root directory of this source tree.
196
+ */const W4=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M2 10h20",key:"1ir3d8"}]],K4=Dt("folder-closed",W4);/**
197
+ * @license lucide-react v0.564.0 - ISC
198
+ *
199
+ * This source code is licensed under the ISC license.
200
+ * See the LICENSE file in the root directory of this source tree.
201
+ */const G4=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],X4=Dt("folder",G4);/**
202
+ * @license lucide-react v0.564.0 - ISC
203
+ *
204
+ * This source code is licensed under the ISC license.
205
+ * See the LICENSE file in the root directory of this source tree.
206
+ */const Q4=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Gk=Dt("globe",Q4);/**
207
+ * @license lucide-react v0.564.0 - ISC
208
+ *
209
+ * This source code is licensed under the ISC license.
210
+ * See the LICENSE file in the root directory of this source tree.
211
+ */const Z4=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],J4=Dt("history",Z4);/**
212
+ * @license lucide-react v0.564.0 - ISC
213
+ *
214
+ * This source code is licensed under the ISC license.
215
+ * See the LICENSE file in the root directory of this source tree.
216
+ */const e5=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],t5=Dt("keyboard",e5);/**
217
+ * @license lucide-react v0.564.0 - ISC
218
+ *
219
+ * This source code is licensed under the ISC license.
220
+ * See the LICENSE file in the root directory of this source tree.
221
+ */const n5=[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]],r5=Dt("list-tree",n5);/**
222
+ * @license lucide-react v0.564.0 - ISC
223
+ *
224
+ * This source code is licensed under the ISC license.
225
+ * See the LICENSE file in the root directory of this source tree.
226
+ */const i5=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],iu=Dt("loader-circle",i5);/**
227
+ * @license lucide-react v0.564.0 - ISC
228
+ *
229
+ * This source code is licensed under the ISC license.
230
+ * See the LICENSE file in the root directory of this source tree.
231
+ */const a5=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],tx=Dt("monitor",a5);/**
232
+ * @license lucide-react v0.564.0 - ISC
233
+ *
234
+ * This source code is licensed under the ISC license.
235
+ * See the LICENSE file in the root directory of this source tree.
236
+ */const o5=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],s5=Dt("moon",o5);/**
237
+ * @license lucide-react v0.564.0 - ISC
238
+ *
239
+ * This source code is licensed under the ISC license.
240
+ * See the LICENSE file in the root directory of this source tree.
241
+ */const l5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],u5=Dt("panel-left",l5);/**
242
+ * @license lucide-react v0.564.0 - ISC
243
+ *
244
+ * This source code is licensed under the ISC license.
245
+ * See the LICENSE file in the root directory of this source tree.
246
+ */const c5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],d5=Dt("panels-top-left",c5);/**
247
+ * @license lucide-react v0.564.0 - ISC
248
+ *
249
+ * This source code is licensed under the ISC license.
250
+ * See the LICENSE file in the root directory of this source tree.
251
+ */const f5=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],pp=Dt("pencil",f5);/**
252
+ * @license lucide-react v0.564.0 - ISC
253
+ *
254
+ * This source code is licensed under the ISC license.
255
+ * See the LICENSE file in the root directory of this source tree.
256
+ */const h5=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],mp=Dt("plus",h5);/**
257
+ * @license lucide-react v0.564.0 - ISC
258
+ *
259
+ * This source code is licensed under the ISC license.
260
+ * See the LICENSE file in the root directory of this source tree.
261
+ */const p5=[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],m5=Dt("power-off",p5);/**
262
+ * @license lucide-react v0.564.0 - ISC
263
+ *
264
+ * This source code is licensed under the ISC license.
265
+ * See the LICENSE file in the root directory of this source tree.
266
+ */const g5=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],y5=Dt("power",g5);/**
267
+ * @license lucide-react v0.564.0 - ISC
268
+ *
269
+ * This source code is licensed under the ISC license.
270
+ * See the LICENSE file in the root directory of this source tree.
271
+ */const b5=[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]],v5=Dt("radar",b5);/**
272
+ * @license lucide-react v0.564.0 - ISC
273
+ *
274
+ * This source code is licensed under the ISC license.
275
+ * See the LICENSE file in the root directory of this source tree.
276
+ */const x5=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],w5=Dt("refresh-ccw",x5);/**
277
+ * @license lucide-react v0.564.0 - ISC
278
+ *
279
+ * This source code is licensed under the ISC license.
280
+ * See the LICENSE file in the root directory of this source tree.
281
+ */const S5=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],E5=Dt("search",S5);/**
282
+ * @license lucide-react v0.564.0 - ISC
283
+ *
284
+ * This source code is licensed under the ISC license.
285
+ * See the LICENSE file in the root directory of this source tree.
286
+ */const T5=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],RT=Dt("send",T5);/**
287
+ * @license lucide-react v0.564.0 - ISC
288
+ *
289
+ * This source code is licensed under the ISC license.
290
+ * See the LICENSE file in the root directory of this source tree.
291
+ */const C5=[["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"}]],R5=Dt("settings",C5);/**
292
+ * @license lucide-react v0.564.0 - ISC
293
+ *
294
+ * This source code is licensed under the ISC license.
295
+ * See the LICENSE file in the root directory of this source tree.
296
+ */const k5=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],M5=Dt("sparkles",k5);/**
297
+ * @license lucide-react v0.564.0 - ISC
298
+ *
299
+ * This source code is licensed under the ISC license.
300
+ * See the LICENSE file in the root directory of this source tree.
301
+ */const O5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],A5=Dt("square",O5);/**
302
+ * @license lucide-react v0.564.0 - ISC
303
+ *
304
+ * This source code is licensed under the ISC license.
305
+ * See the LICENSE file in the root directory of this source tree.
306
+ */const N5=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],D5=Dt("sun",N5);/**
307
+ * @license lucide-react v0.564.0 - ISC
308
+ *
309
+ * This source code is licensed under the ISC license.
310
+ * See the LICENSE file in the root directory of this source tree.
311
+ */const I5=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],P5=Dt("terminal",I5);/**
312
+ * @license lucide-react v0.564.0 - ISC
313
+ *
314
+ * This source code is licensed under the ISC license.
315
+ * See the LICENSE file in the root directory of this source tree.
316
+ */const L5=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Xk=Dt("trash-2",L5);/**
317
+ * @license lucide-react v0.564.0 - ISC
318
+ *
319
+ * This source code is licensed under the ISC license.
320
+ * See the LICENSE file in the root directory of this source tree.
321
+ */const _5=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],j5=Dt("wrench",_5);/**
322
+ * @license lucide-react v0.564.0 - ISC
323
+ *
324
+ * This source code is licensed under the ISC license.
325
+ * See the LICENSE file in the root directory of this source tree.
326
+ */const z5=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Pa=Dt("x",z5);/**
327
+ * @license lucide-react v0.564.0 - ISC
328
+ *
329
+ * This source code is licensed under the ISC license.
330
+ * See the LICENSE file in the root directory of this source tree.
331
+ */const F5=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Qk=Dt("zap",F5);function gp(){return typeof window<"u"}function zo(e){return nx(e)?(e.nodeName||"").toLowerCase():"#document"}function jn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ji(e){var t;return(t=(nx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function nx(e){return gp()?e instanceof Node||e instanceof jn(e).Node:!1}function sn(e){return gp()?e instanceof Element||e instanceof jn(e).Element:!1}function Cn(e){return gp()?e instanceof HTMLElement||e instanceof jn(e).HTMLElement:!1}function Pb(e){return!gp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof jn(e).ShadowRoot}const B5=new Set(["inline","contents"]);function Fo(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Jr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!B5.has(a)}const H5=new Set(["table","td","th"]);function U5(e){return H5.has(zo(e))}const V5=[":popover-open",":modal"];function yp(e){return V5.some(t=>{try{return e.matches(t)}catch{return!1}})}const q5=["transform","translate","scale","rotate","perspective"],$5=["transform","translate","scale","rotate","perspective","filter"],Y5=["paint","layout","strict","content"];function rx(e){const t=bp(),n=sn(e)?Jr(e):e;return q5.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||$5.some(r=>(n.willChange||"").includes(r))||Y5.some(r=>(n.contain||"").includes(r))}function W5(e){let t=Xi(e);for(;Cn(t)&&!Wi(t);){if(rx(t))return t;if(yp(t))return null;t=Xi(t)}return null}function bp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const K5=new Set(["html","body","#document"]);function Wi(e){return K5.has(zo(e))}function Jr(e){return jn(e).getComputedStyle(e)}function vp(e){return sn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xi(e){if(zo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Pb(e)&&e.host||Ji(e);return Pb(t)?t.host:t}function Zk(e){const t=Xi(e);return Wi(t)?e.ownerDocument?e.ownerDocument.body:e.body:Cn(t)&&Fo(t)?t:Zk(t)}function Ao(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=Zk(e),s=a===((r=e.ownerDocument)==null?void 0:r.body),l=jn(a);if(s){const c=Lb(l);return t.concat(l,l.visualViewport||[],Fo(a)?a:[],c&&n?Ao(c):[])}return t.concat(a,Ao(a,[],n))}function Lb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const kT={};function Jn(e,t){const n=w.useRef(kT);return n.current===kT&&(n.current=e(t)),n}const Cy=jv[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],G5=Cy&&Cy!==w.useLayoutEffect?Cy:e=>e();function Ve(e){const t=Jn(X5).current;return t.next=e,G5(t.effect),t.trampoline}function X5(){const e={next:void 0,callback:Q5,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function Q5(){}const Z5={...jv},J5=()=>{},He=typeof document<"u"?w.useLayoutEffect:J5;function _b(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const Bc={};function bi(e,t,n,r,a){let s={...jb(e,Bc)};return t&&(s=Ic(s,t)),n&&(s=Ic(s,n)),r&&(s=Ic(s,r)),a&&(s=Ic(s,a)),s}function eF(e){if(e.length===0)return Bc;if(e.length===1)return jb(e[0],Bc);let t={...jb(e[0],Bc)};for(let n=1;n<e.length;n+=1)t=Ic(t,e[n]);return t}function Ic(e,t){return Jk(t)?t(e):tF(e,t)}function tF(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=_b(e.style,r);break}case"className":{e[n]=eM(e.className,r);break}default:nF(n,r)?e[n]=rF(e[n],r):e[n]=r}}return e}function nF(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),a=e.charCodeAt(2);return n===111&&r===110&&a>=65&&a<=90&&(typeof t=="function"||typeof t>"u")}function Jk(e){return typeof e=="function"}function jb(e,t){return Jk(e)?e(t):e??Bc}function rF(e,t){return t?e?n=>{if(iF(n)){const a=n;zb(a);const s=t(a);return a.baseUIHandlerPrevented||e==null||e(a),s}const r=t(n);return e==null||e(n),r}:t:e}function zb(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function eM(e,t){return t?e?t+" "+e:t:e}function iF(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Sn(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(r=>n.searchParams.append("args[]",r)),`Base UI error #${e}; visit ${n} for the full message.`}const tM=w.createContext(void 0);function ix(e=!1){const t=w.useContext(tM);if(t===void 0&&!e)throw new Error(Sn(16));return t}function aF(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:a=0,isNativeButton:s}=e,l=r&&t!==!1,c=r&&t===!1;return{props:w.useMemo(()=>{const d={onKeyDown(m){n&&t&&m.key!=="Tab"&&m.preventDefault()}};return r||(d.tabIndex=a,!s&&n&&(d.tabIndex=t?a:-1)),(s&&(t||l)||!s&&n)&&(d["aria-disabled"]=n),s&&(!t||c)&&(d.disabled=n),d},[r,n,t,l,c,s,a])}}function _a(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:a=!0}=e,s=w.useRef(null),l=ix(!0)!==void 0,c=Ve(()=>{const y=s.current;return!!((y==null?void 0:y.tagName)==="A"&&(y!=null&&y.href))}),{props:f}=aF({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:a}),d=w.useCallback(()=>{const y=s.current;oF(y)&&l&&t&&f.disabled===void 0&&y.disabled&&(y.disabled=!1)},[t,f.disabled,l]);He(d,[d]);const m=w.useCallback((y={})=>{const{onClick:g,onMouseDown:x,onKeyUp:C,onKeyDown:T,onPointerDown:S,...R}=y;return bi({type:a?"button":void 0,onClick(M){if(t){M.preventDefault();return}g==null||g(M)},onMouseDown(M){t||x==null||x(M)},onKeyDown(M){if(t||(zb(M),T==null||T(M)),M.baseUIHandlerPrevented)return;const D=M.target===M.currentTarget&&!a&&!c()&&!t,O=M.key==="Enter",N=M.key===" ";D&&((N||O)&&M.preventDefault(),O&&(g==null||g(M)))},onKeyUp(M){t||(zb(M),C==null||C(M)),!M.baseUIHandlerPrevented&&M.target===M.currentTarget&&!a&&!t&&M.key===" "&&(g==null||g(M))},onPointerDown(M){if(t){M.preventDefault();return}S==null||S(M)}},a?void 0:{role:"button"},f,R)},[t,f,a,c]),p=Ve(y=>{s.current=y,d()});return{getButtonProps:m,buttonRef:p}}function oF(e){return Cn(e)&&e.tagName==="BUTTON"}function Ni(e,t,n,r){const a=Jn(nM).current;return lF(a,e,t,n,r)&&rM(a,[e,t,n,r]),a.callback}function sF(e){const t=Jn(nM).current;return uF(t,e)&&rM(t,e),t.callback}function nM(){return{callback:null,cleanup:null,refs:[]}}function lF(e,t,n,r,a){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==a}function uF(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function rM(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 r=Array(t.length).fill(null);for(let a=0;a<t.length;a+=1){const s=t[a];if(s!=null)switch(typeof s){case"function":{const l=s(n);typeof l=="function"&&(r[a]=l);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let a=0;a<t.length;a+=1){const s=t[a];if(s!=null)switch(typeof s){case"function":{const l=r[a];typeof l=="function"?l():s(null);break}case"object":{s.current=null;break}}}}}}}const cF=parseInt(w.version,10);function ax(e){return cF>=e}function MT(e){if(!w.isValidElement(e))return null;const t=e,n=t.props;return(ax(19)?n==null?void 0:n.ref:t.ref)??null}function dF(e,t){const n={};for(const r in e){const a=e[r];if(t!=null&&t.hasOwnProperty(r)){const s=t[r](a);s!=null&&Object.assign(n,s);continue}a===!0?n[`data-${r.toLowerCase()}`]="":a&&(n[`data-${r.toLowerCase()}`]=a.toString())}return n}function fF(e,t){return typeof e=="function"?e(t):e}function hF(e,t){return typeof e=="function"?e(t):e}function _r(){}const Lo=Object.freeze([]),On=Object.freeze({}),pF=500,mF=500,gF={style:{transition:"none"}},yF="data-base-ui-click-trigger",iM={fallbackAxisSide:"none"},aM={fallbackAxisSide:"end"},bF={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Ct(e,t,n={}){const r=t.render,a=vF(t,n);if(n.enabled===!1)return null;const s=n.state??On;return wF(e,r,a,s)}function vF(e,t={}){const{className:n,style:r,render:a}=e,{state:s=On,ref:l,props:c,stateAttributesMapping:f,enabled:d=!0}=t,m=d?fF(n,s):void 0,p=d?hF(r,s):void 0,y=d?dF(s,f):On,g=d?_b(y,Array.isArray(c)?eF(c):c)??On:On;return typeof document<"u"&&(d?Array.isArray(l)?g.ref=sF([g.ref,MT(a),...l]):g.ref=Ni(g.ref,MT(a),l):Ni(null,null)),d?(m!==void 0&&(g.className=eM(g.className,m)),p!==void 0&&(g.style=_b(g.style,p)),g):On}const xF=Symbol.for("react.lazy");function wF(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const a=bi(n,t.props);a.ref=n.ref;let s=t;return(s==null?void 0:s.$$typeof)===xF&&(s=w.Children.toArray(t)[0]),w.cloneElement(s,a)}if(e&&typeof e=="string")return SF(e,n);throw new Error(Sn(8))}function SF(e,t){return e==="button"?w.createElement("button",{type:"button",...t,key:t.key}):e==="img"?w.createElement("img",{alt:"",...t,key:t.key}):w.createElement(e,t)}const EF=w.forwardRef(function(t,n){const{render:r,className:a,disabled:s=!1,focusableWhenDisabled:l=!1,nativeButton:c=!0,...f}=t,{getButtonProps:d,buttonRef:m}=_a({disabled:s,focusableWhenDisabled:l,native:c});return Ct("button",t,{state:{disabled:s},ref:[n,m],props:[f,d]})});function oM(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=oM(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function sM(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=oM(e))&&(r&&(r+=" "),r+=t);return r}const OT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,AT=sM,xp=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return AT(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:s}=t,l=Object.keys(a).map(d=>{const m=n==null?void 0:n[d],p=s==null?void 0:s[d];if(m===null)return null;const y=OT(m)||OT(p);return a[d][y]}),c=n&&Object.entries(n).reduce((d,m)=>{let[p,y]=m;return y===void 0||(d[p]=y),d},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,m)=>{let{class:p,className:y,...g}=m;return Object.entries(g).every(x=>{let[C,T]=x;return Array.isArray(T)?T.includes({...s,...c}[C]):{...s,...c}[C]===T})?[...d,p,y]:d},[]);return AT(e,l,f,n==null?void 0:n.class,n==null?void 0:n.className)},TF=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},CF=(e,t)=>({classGroupId:e,validator:t}),lM=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Fh="-",NT=[],RF="arbitrary..",kF=e=>{const t=OF(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return MF(l);const c=l.split(Fh),f=c[0]===""&&c.length>1?1:0;return uM(c,f,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const f=r[l],d=n[l];return f?d?TF(d,f):f:d||NT}return n[l]||NT}}},uM=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],s=n.nextPart.get(a);if(s){const d=uM(e,t+1,s);if(d)return d}const l=n.validators;if(l===null)return;const c=t===0?e.join(Fh):e.slice(t).join(Fh),f=l.length;for(let d=0;d<f;d++){const m=l[d];if(m.validator(c))return m.classGroupId}},MF=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?RF+r:void 0})(),OF=e=>{const{theme:t,classGroups:n}=e;return AF(n,t)},AF=(e,t)=>{const n=lM();for(const r in e){const a=e[r];ox(a,n,r,t)}return n},ox=(e,t,n,r)=>{const a=e.length;for(let s=0;s<a;s++){const l=e[s];NF(l,t,n,r)}},NF=(e,t,n,r)=>{if(typeof e=="string"){DF(e,t,n);return}if(typeof e=="function"){IF(e,t,n,r);return}PF(e,t,n,r)},DF=(e,t,n)=>{const r=e===""?t:cM(t,e);r.classGroupId=n},IF=(e,t,n,r)=>{if(LF(e)){ox(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(CF(n,e))},PF=(e,t,n,r)=>{const a=Object.entries(e),s=a.length;for(let l=0;l<s;l++){const[c,f]=a[l];ox(f,cM(t,c),n,r)}},cM=(e,t)=>{let n=e;const r=t.split(Fh),a=r.length;for(let s=0;s<a;s++){const l=r[s];let c=n.nextPart.get(l);c||(c=lM(),n.nextPart.set(l,c)),n=c}return n},LF=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,_F=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const a=(s,l)=>{n[s]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let l=n[s];if(l!==void 0)return l;if((l=r[s])!==void 0)return a(s,l),l},set(s,l){s in n?n[s]=l:a(s,l)}}},Fb="!",DT=":",jF=[],IT=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),zF=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const s=[];let l=0,c=0,f=0,d;const m=a.length;for(let C=0;C<m;C++){const T=a[C];if(l===0&&c===0){if(T===DT){s.push(a.slice(f,C)),f=C+1;continue}if(T==="/"){d=C;continue}}T==="["?l++:T==="]"?l--:T==="("?c++:T===")"&&c--}const p=s.length===0?a:a.slice(f);let y=p,g=!1;p.endsWith(Fb)?(y=p.slice(0,-1),g=!0):p.startsWith(Fb)&&(y=p.slice(1),g=!0);const x=d&&d>f?d-f:void 0;return IT(s,g,y,x)};if(t){const a=t+DT,s=r;r=l=>l.startsWith(a)?s(l.slice(a.length)):IT(jF,!1,l,void 0,!0)}if(n){const a=r;r=s=>n({className:s,parseClassName:a})}return r},FF=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let a=[];for(let s=0;s<n.length;s++){const l=n[s],c=l[0]==="[",f=t.has(l);c||f?(a.length>0&&(a.sort(),r.push(...a),a=[]),r.push(l)):a.push(l)}return a.length>0&&(a.sort(),r.push(...a)),r}},BF=e=>({cache:_F(e.cacheSize),parseClassName:zF(e),sortModifiers:FF(e),...kF(e)}),HF=/\s+/,UF=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:s}=t,l=[],c=e.trim().split(HF);let f="";for(let d=c.length-1;d>=0;d-=1){const m=c[d],{isExternal:p,modifiers:y,hasImportantModifier:g,baseClassName:x,maybePostfixModifierPosition:C}=n(m);if(p){f=m+(f.length>0?" "+f:f);continue}let T=!!C,S=r(T?x.substring(0,C):x);if(!S){if(!T){f=m+(f.length>0?" "+f:f);continue}if(S=r(x),!S){f=m+(f.length>0?" "+f:f);continue}T=!1}const R=y.length===0?"":y.length===1?y[0]:s(y).join(":"),k=g?R+Fb:R,M=k+S;if(l.indexOf(M)>-1)continue;l.push(M);const D=a(S,T);for(let O=0;O<D.length;++O){const N=D[O];l.push(k+N)}f=m+(f.length>0?" "+f:f)}return f},VF=(...e)=>{let t=0,n,r,a="";for(;t<e.length;)(n=e[t++])&&(r=dM(n))&&(a&&(a+=" "),a+=r);return a},dM=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=dM(e[r]))&&(n&&(n+=" "),n+=t);return n},qF=(e,...t)=>{let n,r,a,s;const l=f=>{const d=t.reduce((m,p)=>p(m),e());return n=BF(d),r=n.cache.get,a=n.cache.set,s=c,c(f)},c=f=>{const d=r(f);if(d)return d;const m=UF(f,n);return a(f,m),m};return s=l,(...f)=>s(VF(...f))},$F=[],Xn=e=>{const t=n=>n[e]||$F;return t.isThemeGetter=!0,t},fM=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,hM=/^\((?:(\w[\w-]*):)?(.+)\)$/i,YF=/^\d+\/\d+$/,WF=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,KF=/\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$/,GF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,XF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,QF=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rl=e=>YF.test(e),Pt=e=>!!e&&!Number.isNaN(Number(e)),co=e=>!!e&&Number.isInteger(Number(e)),Ry=e=>e.endsWith("%")&&Pt(e.slice(0,-1)),wa=e=>WF.test(e),ZF=()=>!0,JF=e=>KF.test(e)&&!GF.test(e),pM=()=>!1,eB=e=>XF.test(e),tB=e=>QF.test(e),nB=e=>!nt(e)&&!rt(e),rB=e=>mu(e,yM,pM),nt=e=>fM.test(e),fs=e=>mu(e,bM,JF),ky=e=>mu(e,lB,Pt),PT=e=>mu(e,mM,pM),iB=e=>mu(e,gM,tB),Gf=e=>mu(e,vM,eB),rt=e=>hM.test(e),xc=e=>gu(e,bM),aB=e=>gu(e,uB),LT=e=>gu(e,mM),oB=e=>gu(e,yM),sB=e=>gu(e,gM),Xf=e=>gu(e,vM,!0),mu=(e,t,n)=>{const r=fM.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},gu=(e,t,n=!1)=>{const r=hM.exec(e);return r?r[1]?t(r[1]):n:!1},mM=e=>e==="position"||e==="percentage",gM=e=>e==="image"||e==="url",yM=e=>e==="length"||e==="size"||e==="bg-size",bM=e=>e==="length",lB=e=>e==="number",uB=e=>e==="family-name",vM=e=>e==="shadow",cB=()=>{const e=Xn("color"),t=Xn("font"),n=Xn("text"),r=Xn("font-weight"),a=Xn("tracking"),s=Xn("leading"),l=Xn("breakpoint"),c=Xn("container"),f=Xn("spacing"),d=Xn("radius"),m=Xn("shadow"),p=Xn("inset-shadow"),y=Xn("text-shadow"),g=Xn("drop-shadow"),x=Xn("blur"),C=Xn("perspective"),T=Xn("aspect"),S=Xn("ease"),R=Xn("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...M(),rt,nt],O=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],_=()=>[rt,nt,f],$=()=>[Rl,"full","auto",..._()],F=()=>[co,"none","subgrid",rt,nt],W=()=>["auto",{span:["full",co,rt,nt]},co,rt,nt],L=()=>[co,"auto",rt,nt],V=()=>["auto","min","max","fr",rt,nt],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],j=()=>["auto",..._()],z=()=>[Rl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",..._()],H=()=>[e,rt,nt],K=()=>[...M(),LT,PT,{position:[rt,nt]}],P=()=>["no-repeat",{repeat:["","x","y","space","round"]}],B=()=>["auto","cover","contain",oB,rB,{size:[rt,nt]}],G=()=>[Ry,xc,fs],I=()=>["","none","full",d,rt,nt],Q=()=>["",Pt,xc,fs],Z=()=>["solid","dashed","dotted","double"],ie=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ce=()=>[Pt,Ry,LT,PT],ge=()=>["","none",x,rt,nt],Ee=()=>["none",Pt,rt,nt],_e=()=>["none",Pt,rt,nt],Ie=()=>[Pt,rt,nt],re=()=>[Rl,"full",..._()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[wa],breakpoint:[wa],color:[ZF],container:[wa],"drop-shadow":[wa],ease:["in","out","in-out"],font:[nB],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[wa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[wa],shadow:[wa],spacing:["px",Pt],text:[wa],"text-shadow":[wa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Rl,nt,rt,T]}],container:["container"],columns:[{columns:[Pt,nt,rt,c]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"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:D()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{start:$()}],end:[{end:$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[co,"auto",rt,nt]}],basis:[{basis:[Rl,"full","auto",c,..._()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Pt,Rl,"auto","initial","none",nt]}],grow:[{grow:["",Pt,rt,nt]}],shrink:[{shrink:["",Pt,rt,nt]}],order:[{order:[co,"first","last","none",rt,nt]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:W()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:W()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:_()}],"gap-x":[{"gap-x":_()}],"gap-y":[{"gap-y":_()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:_()}],px:[{px:_()}],py:[{py:_()}],ps:[{ps:_()}],pe:[{pe:_()}],pt:[{pt:_()}],pr:[{pr:_()}],pb:[{pb:_()}],pl:[{pl:_()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":_()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":_()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],w:[{w:[c,"screen",...z()]}],"min-w":[{"min-w":[c,"screen","none",...z()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",n,xc,fs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,rt,ky]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ry,nt]}],"font-family":[{font:[aB,nt,t]}],"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:[a,rt,nt]}],"line-clamp":[{"line-clamp":[Pt,"none",rt,ky]}],leading:[{leading:[s,..._()]}],"list-image":[{"list-image":["none",rt,nt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",rt,nt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[Pt,"from-font","auto",rt,fs]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[Pt,"auto",rt,nt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",rt,nt]}],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",rt,nt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:K()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:B()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},co,rt,nt],radial:["",rt,nt],conic:[co,rt,nt]},sB,iB]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:Q()}],"border-w-x":[{"border-x":Q()}],"border-w-y":[{"border-y":Q()}],"border-w-s":[{"border-s":Q()}],"border-w-e":[{"border-e":Q()}],"border-w-t":[{"border-t":Q()}],"border-w-r":[{"border-r":Q()}],"border-w-b":[{"border-b":Q()}],"border-w-l":[{"border-l":Q()}],"divide-x":[{"divide-x":Q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Z(),"hidden","none"]}],"divide-style":[{divide:[...Z(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Pt,rt,nt]}],"outline-w":[{outline:["",Pt,xc,fs]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",m,Xf,Gf]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",p,Xf,Gf]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[Pt,fs]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":Q()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",y,Xf,Gf]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[Pt,rt,nt]}],"mix-blend":[{"mix-blend":[...ie(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ie()}],"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":[Pt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ce()}],"mask-image-linear-to-pos":[{"mask-linear-to":ce()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":ce()}],"mask-image-t-to-pos":[{"mask-t-to":ce()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":ce()}],"mask-image-r-to-pos":[{"mask-r-to":ce()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":ce()}],"mask-image-b-to-pos":[{"mask-b-to":ce()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":ce()}],"mask-image-l-to-pos":[{"mask-l-to":ce()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":ce()}],"mask-image-x-to-pos":[{"mask-x-to":ce()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":ce()}],"mask-image-y-to-pos":[{"mask-y-to":ce()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[rt,nt]}],"mask-image-radial-from-pos":[{"mask-radial-from":ce()}],"mask-image-radial-to-pos":[{"mask-radial-to":ce()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"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":M()}],"mask-image-conic-pos":[{"mask-conic":[Pt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ce()}],"mask-image-conic-to-pos":[{"mask-conic-to":ce()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:K()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:B()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",rt,nt]}],filter:[{filter:["","none",rt,nt]}],blur:[{blur:ge()}],brightness:[{brightness:[Pt,rt,nt]}],contrast:[{contrast:[Pt,rt,nt]}],"drop-shadow":[{"drop-shadow":["","none",g,Xf,Gf]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",Pt,rt,nt]}],"hue-rotate":[{"hue-rotate":[Pt,rt,nt]}],invert:[{invert:["",Pt,rt,nt]}],saturate:[{saturate:[Pt,rt,nt]}],sepia:[{sepia:["",Pt,rt,nt]}],"backdrop-filter":[{"backdrop-filter":["","none",rt,nt]}],"backdrop-blur":[{"backdrop-blur":ge()}],"backdrop-brightness":[{"backdrop-brightness":[Pt,rt,nt]}],"backdrop-contrast":[{"backdrop-contrast":[Pt,rt,nt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Pt,rt,nt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Pt,rt,nt]}],"backdrop-invert":[{"backdrop-invert":["",Pt,rt,nt]}],"backdrop-opacity":[{"backdrop-opacity":[Pt,rt,nt]}],"backdrop-saturate":[{"backdrop-saturate":[Pt,rt,nt]}],"backdrop-sepia":[{"backdrop-sepia":["",Pt,rt,nt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":_()}],"border-spacing-x":[{"border-spacing-x":_()}],"border-spacing-y":[{"border-spacing-y":_()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",rt,nt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Pt,"initial",rt,nt]}],ease:[{ease:["linear","initial",S,rt,nt]}],delay:[{delay:[Pt,rt,nt]}],animate:[{animate:["none",R,rt,nt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,rt,nt]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:Ee()}],"rotate-x":[{"rotate-x":Ee()}],"rotate-y":[{"rotate-y":Ee()}],"rotate-z":[{"rotate-z":Ee()}],scale:[{scale:_e()}],"scale-x":[{"scale-x":_e()}],"scale-y":[{"scale-y":_e()}],"scale-z":[{"scale-z":_e()}],"scale-3d":["scale-3d"],skew:[{skew:Ie()}],"skew-x":[{"skew-x":Ie()}],"skew-y":[{"skew-y":Ie()}],transform:[{transform:[rt,nt,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:re()}],"translate-x":[{"translate-x":re()}],"translate-y":[{"translate-y":re()}],"translate-z":[{"translate-z":re()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"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",rt,nt]}],"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":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"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",rt,nt]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[Pt,xc,fs,ky]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],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-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},dB=qF(cB);function Le(...e){return dB(sM(e))}const fB=xp("focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",destructive:"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function _t({className:e,variant:t="default",size:n="default",...r}){return E.jsx(EF,{"data-slot":"button",className:Le(fB({variant:t,size:n,className:e})),...r})}function au({controlled:e,default:t,name:n,state:r="value"}){const{current:a}=w.useRef(e!==void 0),[s,l]=w.useState(t),c=a?e:s,f=w.useCallback(d=>{a||l(d)},[]);return[c,f]}const xM={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},wp={...xM,position:"fixed",top:0,left:0},wM={...xM,position:"absolute"};let _T=0;function hB(e,t="mui"){const[n,r]=w.useState(e),a=e||n;return w.useEffect(()=>{n==null&&(_T+=1,r(`${t}-${_T}`))},[n,t]),a}const jT=Z5.useId;function Vs(e,t){if(jT!==void 0){const n=jT();return e??(t?`${t}-${n}`:n)}return hB(e,t)}function Pi(e){return Vs(e,"base-ui")}const SM=w.createContext(void 0);function pB(){const e=w.useContext(SM);if(e===void 0)throw new Error(Sn(63));return e}let zT=(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 mB={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},sx={valid(e){return e===null?null:e?{[zT.valid]:""}:{[zT.invalid]:""}}};let FT=(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 EM={...sx,checked(e){return e?{[FT.checked]:""}:{[FT.unchecked]:""}}};function gB(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const yB=w.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:_r,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function lx(){return w.useContext(yB)}const bB=w.createContext({invalid:void 0,name:void 0,validityData:{state:mB,errors:[],error:"",value:"",initialValue:null},setValidityData:_r,disabled:void 0,touched:!1,setTouched:_r,dirty:!1,setDirty:_r,filled:!1,setFilled:_r,focused:!1,setFocused:_r,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=On)=>e,getInputValidationProps:(e=On)=>e,inputRef:{current:null},commit:async()=>{}}});function yu(e=!0){const t=w.useContext(bB);if(t.setValidityData===_r&&!e)throw new Error(Sn(28));return t}function ux(e){const{enabled:t=!0,value:n,id:r,name:a,controlRef:s,commit:l}=e,{formRef:c}=lx(),{invalid:f,markedDirtyRef:d,validityData:m,setValidityData:p}=yu(),y=Ve(e.getValue);He(()=>{if(!t)return;let g=n;g===void 0&&(g=y()),m.initialValue===null&&g!==null&&p(x=>({...x,initialValue:g}))},[t,p,n,m.initialValue,y]),He(()=>{!t||!r||c.current.fields.set(r,{getValue:y,name:a,controlRef:s,validityData:gB(m,f),validate(g=!0){let x=n;x===void 0&&(x=y()),d.current=!0,g?yi.flushSync(()=>l(x)):l(x)}})},[l,s,t,c,y,r,f,d,a,m,n]),He(()=>{const g=c.current.fields;return()=>{r&&g.delete(r)}},[c,r])}const vB=w.createContext({controlId:void 0,registerControlId:_r,labelId:void 0,setLabelId:_r,messageIds:[],setMessageIds:_r,getDescriptionProps:e=>e});function Sp(){return w.useContext(vB)}function Ep(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:a,registerControlId:s}=Sp(),l=Pi(t),c=n?a:void 0,f=Jn(()=>Symbol("labelable-control")),d=w.useRef(!1),m=w.useRef(t!=null),p=Ve(()=>{!d.current||s===_r||(d.current=!1,s(f.current,void 0))});return He(()=>{if(s===_r)return;let y;if(n){const g=r==null?void 0:r.current;sn(g)&&g.closest("label")!=null?y=t??null:y=c??l}else if(t!=null)m.current=!0,y=t;else if(m.current)y=l;else{p();return}if(y===void 0){p();return}d.current=!0,s(f.current,y)},[t,r,c,s,n,l,f,p]),w.useEffect(()=>p,[p]),a??l}const Di="none",Ls="trigger-press",wr="trigger-hover",_l="trigger-focus",Tp="outside-press",Hc="item-press",xB="close-press",_s="focus-out",Cp="escape-key",Sh="list-navigation",TM="cancel-open",Eh="sibling-open",wB="disabled",cx="imperative-action",SB="window-resize";function pt(e,t,n,r){let a=!1,s=!1;const l=r??On;return{reason:e,event:t??new Event("base-ui"),cancel(){a=!0},allowPropagation(){s=!0},get isCanceled(){return a},get isPropagationAllowed(){return s},trigger:n,...l}}function CM(e,t){const n=w.useRef(e),r=Ve(t);He(()=>{n.current!==e&&r(n.current)},[e,r]),He(()=>{n.current=e},[e])}const EB=w.forwardRef(function(t,n){const{checked:r,className:a,defaultChecked:s,id:l,inputRef:c,name:f,nativeButton:d=!1,onCheckedChange:m,readOnly:p=!1,required:y=!1,disabled:g=!1,render:x,uncheckedValue:C,value:T,...S}=t,{clearErrors:R}=lx(),{state:k,setTouched:M,setDirty:D,validityData:O,setFilled:N,setFocused:_,shouldValidateOnChange:$,validationMode:F,disabled:W,name:L,validation:V}=yu(),{labelId:q}=Sp(),Y=W||g,j=L??f,z=Ve(m),H=w.useRef(null),K=Ni(H,c,V.inputRef),P=w.useRef(null),B=Pi(),G=Ep({id:l,implicit:!1,controlRef:P}),I=d?void 0:G,[Q,Z]=au({controlled:r,default:!!s,name:"Switch",state:"checked"});ux({id:B,commit:V.commit,value:Q,controlRef:P,name:j,getValue:()=>Q}),He(()=>{H.current&&N(H.current.checked)},[H,N]),CM(Q,()=>{R(j),D(Q!==O.initialValue),N(Q),$()?V.commit(Q):V.commit(Q,!0)});const{getButtonProps:ie,buttonRef:ce}=_a({disabled:Y,native:d}),ge={id:d?G:B,role:"switch","aria-checked":Q,"aria-readonly":p||void 0,"aria-required":y||void 0,"aria-labelledby":q,onFocus(){Y||_(!0)},onBlur(){const re=H.current;!re||Y||(M(!0),_(!1),F==="onBlur"&&V.commit(re.checked))},onClick(re){var he;p||Y||(re.preventDefault(),(he=H.current)==null||he.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:re.shiftKey,ctrlKey:re.ctrlKey,altKey:re.altKey,metaKey:re.metaKey})))}},Ee=w.useMemo(()=>bi({checked:Q,disabled:Y,id:I,name:j,required:y,style:j?wM:wp,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:K,onChange(re){if(re.nativeEvent.defaultPrevented)return;const he=re.target.checked,be=pt(Di,re.nativeEvent);z==null||z(he,be),!be.isCanceled&&Z(he)},onFocus(){var re;(re=P.current)==null||re.focus()}},V.getInputValidationProps,T!==void 0?{value:T}:On),[Q,Y,K,I,j,z,y,Z,V,T]),_e=w.useMemo(()=>({...k,checked:Q,disabled:Y,readOnly:p,required:y}),[k,Q,Y,p,y]),Ie=Ct("span",t,{state:_e,ref:[n,P,ce],props:[ge,V.getValidationProps,S,ie],stateAttributesMapping:EM});return E.jsxs(SM.Provider,{value:_e,children:[Ie,!Q&&j&&C!==void 0&&E.jsx("input",{type:"hidden",name:j,value:C}),E.jsx("input",{...Ee})]})}),TB=w.forwardRef(function(t,n){const{render:r,className:a,...s}=t,{state:l}=yu(),c=pB(),f={...l,...c};return Ct("span",t,{state:f,ref:n,stateAttributesMapping:EM,props:s})});function Bh({className:e,size:t="default",...n}){return E.jsx(EB,{"data-slot":"switch","data-size":t,className:Le("data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-3 aria-invalid:ring-3 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...n,children:E.jsx(TB,{"data-slot":"switch-thumb",className:"bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground rounded-full group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 pointer-events-none block ring-0 transition-transform"})})}function dx({className:e,...t}){return E.jsx("textarea",{"data-slot":"textarea",className:Le("border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 rounded-lg border bg-transparent px-2.5 py-2 text-base transition-colors focus-visible:ring-2 aria-invalid:ring-2 md:text-sm placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})}function Pc(){return{texts:[],reasonings:[],toolCalls:[],staleBarrier:!1}}function jl(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function RM(e){if(jl(e)&&typeof e.type=="string")switch(e.type){case"text":case"json":if("value"in e)return{value:e.value,isError:!1,denied:!1};break;case"error-text":case"error-json":if("value"in e)return{value:e.value,isError:!0,denied:!1};break;case"execution-denied":return{value:typeof e.reason=="string"?e.reason:void 0,isError:!1,denied:!0}}return{value:e,isError:!1,denied:!1}}function kM(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>jl(t)&&typeof t.text=="string"?t.text:"").filter(Boolean).join(`
332
+ `):""}function CB(e){const t=[],n=new Map;for(const r of e){const a=jl(r.content)?r.content:null;if(!a)continue;const s=a.content;switch(r.role){case"user":{const l=kM(s);l&&t.push({kind:"user",key:`m${r.seq}`,text:l});break}case"assistant":{if(typeof s=="string"){s&&t.push({kind:"assistant-text",key:`m${r.seq}`,text:s,streaming:!1});break}if(!Array.isArray(s))break;s.forEach((l,c)=>{if(!jl(l))return;const f=`m${r.seq}p${c}`;if(l.type==="text"&&typeof l.text=="string"&&l.text){t.push({kind:"assistant-text",key:f,text:l.text,streaming:!1});return}if(l.type==="reasoning"&&typeof l.text=="string"&&l.text){t.push({kind:"reasoning",key:f,text:l.text,streaming:!1});return}if(l.type==="tool-call"&&typeof l.toolCallId=="string"){const d={toolCallId:l.toolCallId,toolName:typeof l.toolName=="string"?l.toolName:"unknown",input:l.input,isError:!1,denied:!1,resolved:!1};n.set(d.toolCallId,d),t.push({kind:"tool-call",key:f,call:d})}});break}case"tool":{if(!Array.isArray(s))break;for(const l of s){if(!jl(l)||l.type!=="tool-result")continue;const c=typeof l.toolCallId=="string"?l.toolCallId:"",f=n.get(c),{value:d,isError:m,denied:p}=RM(l.output);f&&(f.output=d,f.isError=m,f.denied=p,f.resolved=!0)}break}}}return{blocks:t,toolBlocksById:n}}function RB(e,t){const{blocks:n,toolBlocksById:r}=CB(e??[]);if(!t)return n;for(const a of t.toolCalls){const s=r.get(a.toolCallId);if(s){!s.resolved&&a.resolved&&(s.output=a.output,s.isError=a.isError,s.denied=a.denied,s.resolved=!0);continue}n.push({kind:"tool-call",key:`live-tool-${a.toolCallId}`,call:a})}for(const a of t.reasonings)a.text&&n.push({kind:"reasoning",key:`live-reasoning-${a.messageId}`,text:a.text,streaming:!0});for(const a of t.texts)a.text&&n.push({kind:"assistant-text",key:`live-text-${a.messageId}`,text:a.text,streaming:!0});return n}function Bb(e){return!e||e.length===0?-1:e[e.length-1].seq}function kB(e){if(!e)return null;for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role!=="user")continue;const r=jl(n.content)?n.content:null,a=r?kM(r.content):"";if(a)return a}return null}async function br(e,t){try{return(await e.json()).error??t}catch{return t}}function wc(e){return Object.values(e).filter(t=>!!t).sort((t,n)=>t.updatedAt<n.updatedAt?1:-1).map(t=>t.id)}function BT(e,t){if(!e||e.length===0)return[...t].sort((r,a)=>r.seq-a.seq);const n=new Map;for(const r of e)n.set(r.seq,r);for(const r of t)n.set(r.seq,r);return[...n.values()].sort((r,a)=>r.seq-a.seq)}let HT=!1;const po=new Set,MB=40,Ms=new Map;let Sc=null;const OB=120,Uc=new Map,My=new Set,Hb=new Set;function AB(e){const t=Uc.get(e);t&&(clearTimeout(t),Uc.delete(e)),Ms.delete(e),Hb.delete(e)}function Ub(e){const t=s4(e);Hn().send(t.kind,t.payload)}function UT(e){const t=l4(e);Hn().send(t.kind,t.payload)}function VT(e,t,n,r){let a=Ms.get(e);a||(a={texts:new Map,reasonings:new Map},Ms.set(e,a));const s=a[t];s.set(n,(s.get(n)??"")+r)}function NB(e){const t=()=>{if(Sc&&(clearTimeout(Sc),Sc=null),Ms.size===0)return;const r=new Map(Ms);Ms.clear(),e(a=>{const s={...a.inProgress};for(const[l,c]of r){const f=s[l]??Pc(),d={...f,texts:[...f.texts],reasonings:[...f.reasonings]};for(const m of["texts","reasonings"])for(const[p,y]of c[m]){const g=d[m],x=g.findIndex(C=>C.messageId===p);x>=0?g[x]={...g[x],text:g[x].text+y}:g.push({messageId:p,text:y,stale:!1})}s[l]=d}return{inProgress:s}})};return{flush:t,schedule:()=>{Sc||(Sc=setTimeout(t,MB))}}}function DB(e,t){if(HT)return;HT=!0;const n=Hn(),r=NB(e),a=T=>{Uc.get(T)||Uc.set(T,setTimeout(()=>{Uc.delete(T),t().loadHistory(T)},OB))},s=(T,S)=>{Ms.delete(T),e(k=>{const M=k.sessions[T],D=Pc();return S.inProgressText&&D.texts.push({messageId:"__sync__",text:S.inProgressText,stale:!1}),S.inProgressReasoning&&D.reasonings.push({messageId:"__sync_reasoning__",text:S.inProgressReasoning,stale:!1}),{sessions:M?{...k.sessions,[T]:{...M,status:S.status,lastError:S.lastError}}:k.sessions,inProgress:{...k.inProgress,[T]:D},pendingConfirmations:{...k.pendingConfirmations,[T]:S.pendingConfirmations.map(O=>({id:O.confirmationId,toolCallId:O.toolCallId,toolName:O.toolName,input:O.input,createdAt:O.createdAt}))},queued:{...k.queued,[T]:S.queuedMessages.map(O=>({id:O.id,sessionId:T,seq:O.seq,text:O.text,createdAt:O.createdAt}))}}});const R=t();(S.lastMessageSeq>Bb(R.messages[T])||!R.historyLoaded[T])&&R.loadHistory(T)},l=(T,S)=>{const R=!!t().sessions[T];if(e(k=>{const M=k.sessions[T];return M?{sessions:{...k.sessions,[T]:{...M,status:S.status,lastError:S.lastError!==void 0?S.lastError:M.lastError}}}:k}),!R){t().loadSessions();return}t().refreshSession(T)},c=(T,S)=>{r.flush(),e(R=>{const k=R.inProgress[T]??Pc(),M=[...k.toolCalls],D=M.findIndex(N=>N.toolCallId===S.toolCallId),O={toolCallId:S.toolCallId,toolName:S.toolName,input:S.input,isError:!1,denied:!1,resolved:!1,stale:!1};return D>=0?M[D]={...M[D],...O}:M.push(O),{inProgress:{...R.inProgress,[T]:{...k,toolCalls:M}}}})},f=(T,S)=>{r.flush();const{value:R,isError:k,denied:M}=RM(S.output);e(D=>{const O=D.inProgress[T]??Pc(),N=[...O.toolCalls],_=N.findIndex($=>$.toolCallId===S.toolCallId);return _>=0?N[_]={...N[_],output:R,isError:!!S.isError||k,denied:M,resolved:!0}:N.push({toolCallId:S.toolCallId,toolName:S.toolName,input:void 0,output:R,isError:!!S.isError||k,denied:M,resolved:!0,stale:O.staleBarrier}),{inProgress:{...D.inProgress,[T]:{...O,toolCalls:N}}}})},d=(T,S)=>{e(R=>{const k=R.pendingConfirmations[T]??[];return k.some(M=>M.id===S.confirmationId)?R:{pendingConfirmations:{...R.pendingConfirmations,[T]:[...k,{id:S.confirmationId,toolCallId:S.toolCallId,toolName:S.toolName,input:S.input,createdAt:new Date().toISOString()}]}}})},m=(T,S)=>{e(R=>{const k=R.pendingConfirmations[T];return!k||!k.some(M=>M.id===S.confirmationId)?R:{pendingConfirmations:{...R.pendingConfirmations,[T]:k.filter(M=>M.id!==S.confirmationId)}}})},p=(T,S)=>{r.flush(),(S.role==="assistant"||S.role==="tool")&&e(R=>{const k=R.inProgress[T];return k?{inProgress:{...R.inProgress,[T]:{texts:k.texts.map(M=>({...M,stale:!0})),reasonings:k.reasonings.map(M=>({...M,stale:!0})),toolCalls:k.toolCalls.map(M=>M.resolved?{...M,stale:!0}:M),staleBarrier:!0}}}:R}),a(T)},y=(T,S)=>{r.flush(),e(R=>{const k=R.sessions[T];return{sessions:k?{...R.sessions,[T]:{...k,status:S.sessionStatus}}:R.sessions,inProgress:{...R.inProgress,[T]:Pc()}}}),S.lastMessageSeq>Bb(t().messages[T])&&a(T)},g=(T,S)=>{const R=t().sessions[T];gn.error(wn.t("agent.toast.errorTitle",{title:(R==null?void 0:R.title)??"Agent"}),{description:S.message})},x=(T,S)=>{gn.warning(wn.t("agent.toast.credentialWarningTitle"),{description:wn.t("agent.toast.credentialWarningDescription",{types:S.types.join(", ")}),duration:1e4})},C=(T,S)=>{e(R=>({queued:{...R.queued,[T]:S.queued.map(k=>({id:k.id,sessionId:T,seq:k.seq,text:k.text,createdAt:k.createdAt}))}}))};n.onMessage(T=>{if(T.kind!==oz)return;let S;try{S=Ra(d3,T.payload)}catch(M){console.error("[agent] failed to decode AGENT_EVENT:",M);return}let R;try{R=JSON.parse(new TextDecoder().decode(S.payload))}catch(M){console.error("[agent] failed to parse AGENT_EVENT payload:",M);return}const k=S.sessionId;switch(S.eventType){case lz:s(k,R);return;case uz:l(k,R);return;case cz:{const M=R;VT(k,"texts",M.messageId,M.delta),r.schedule();return}case dz:{const M=R;VT(k,"reasonings",M.messageId,M.delta),r.schedule();return}case fz:c(k,R);return;case hz:f(k,R);return;case pz:d(k,R);return;case mz:m(k,R);return;case gz:p(k,R);return;case yz:g(k,R);return;case bz:y(k,R);return;case vz:x(k,R);return;case xz:C(k,R);return;default:return}}),n.onStateChange(T=>{if(T!=="READY")return;for(const R of po)Ub(R);const S=t().activeSessionId;S&&t().loadHistory(S)})}const on=fp()(qk((e,t)=>({sessions:{},sessionOrder:[],sessionsLoaded:!1,activeSessionId:null,messages:{},historyLoaded:{},inProgress:{},pendingConfirmations:{},queued:{},sending:{},draft:null,defaultWriteMode:"confirm",ensureInitialized(){DB(e,t),Hn().connect();const n=t().activeSessionId;n&&!po.has(n)&&(po.add(n),Ub(n))},async loadSessions(){try{const n=await fetch("/api/agent/sessions");if(!n.ok)throw new Error(await br(n,"Failed to load agent sessions"));const r=await n.json();e(()=>{const s={};for(const l of r.sessions)s[l.id]=l;return{sessions:s,sessionOrder:wc(s),sessionsLoaded:!0}});const a=t();a.activeSessionId&&!a.sessions[a.activeSessionId]&&a.setActiveSession(null)}catch(n){console.error("[agent] loadSessions failed:",n)}},async refreshSession(n){try{const r=await fetch(`/api/agent/sessions/${n}`);if(r.status===404){await t().loadSessions();return}if(!r.ok)throw new Error(await br(r,"Failed to load agent session"));const a=await r.json();e(s=>{const l={...s.sessions,[n]:a.session};return{sessions:l,sessionOrder:wc(l)}})}catch(r){console.error("[agent] refreshSession failed:",r)}},setActiveSession(n){const r=t().activeSessionId;r!==n&&(r&&po.has(r)&&(po.delete(r),UT(r)),e({activeSessionId:n,draft:null}),n&&(po.add(n),Ub(n),t().historyLoaded[n]||t().loadHistory(n)))},async createSession(n,r,a){try{const s=await fetch("/api/agent/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceId:n,paneId:r,...(a==null?void 0:a.providerId)!==void 0?{providerId:a.providerId}:{},...(a==null?void 0:a.modelId)!==void 0&&a.modelId!==null?{modelId:a.modelId}:{},...(a==null?void 0:a.providerHostedTools)!==void 0?{providerHostedTools:a.providerHostedTools}:{},...(a==null?void 0:a.originPaneTitle)!==void 0?{originPaneTitle:a.originPaneTitle}:{},writeMode:(a==null?void 0:a.writeMode)??t().defaultWriteMode})});if(!s.ok)throw new Error(await br(s,"Failed to create agent session"));const c=(await s.json()).session;return e(f=>{const d={...f.sessions,[c.id]:c};return{sessions:d,sessionOrder:wc(d),messages:{...f.messages,[c.id]:[]},historyLoaded:{...f.historyLoaded,[c.id]:!0}}}),t().setActiveSession(c.id),c}catch(s){return gn.error(s instanceof Error?s.message:String(s)),null}},async renameSession(n,r){try{const a=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:r})});if(!a.ok)throw new Error(await br(a,"Failed to rename agent session"));const s=await a.json();return e(l=>{const c={...l.sessions,[n]:s.session};return{sessions:c,sessionOrder:wc(c)}}),!0}catch(a){return gn.error(a instanceof Error?a.message:String(a)),!1}},async deleteSession(n){try{const r=await fetch(`/api/agent/sessions/${n}`,{method:"DELETE"});if(!r.ok)throw new Error(await br(r,"Failed to delete agent session"));return t().activeSessionId===n&&t().setActiveSession(null),AB(n),e(a=>{const s={...a.sessions};delete s[n];const l={...a.messages};delete l[n];const c={...a.historyLoaded};delete c[n];const f={...a.inProgress};delete f[n];const d={...a.pendingConfirmations};delete d[n];const m={...a.queued};return delete m[n],{sessions:s,sessionOrder:wc(s),messages:l,historyLoaded:c,inProgress:f,pendingConfirmations:d,queued:m}}),!0}catch(r){return gn.error(r instanceof Error?r.message:String(r)),!1}},async setWriteMode(n,r){try{const a=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({writeMode:r})});if(!a.ok)throw new Error(await br(a,"Failed to update write mode"));const s=await a.json();e(l=>({sessions:{...l.sessions,[n]:s.session}}))}catch(a){gn.error(a instanceof Error?a.message:String(a))}},setDefaultWriteMode(n){e({defaultWriteMode:n})},async setSessionModel(n,r,a){try{const s=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerId:r,modelId:a})});if(!s.ok)throw new Error(await br(s,"Failed to update model"));const l=await s.json();e(c=>({sessions:{...c.sessions,[n]:l.session}}))}catch(s){gn.error(s instanceof Error?s.message:String(s))}},async rebindPane(n,r){try{const a=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({paneId:r})});if(!a.ok)throw new Error(await br(a,"Failed to rebind pane"));const s=await a.json();e(l=>({sessions:{...l.sessions,[n]:s.session}}))}catch(a){gn.error(a instanceof Error?a.message:String(a))}},async loadHistory(n){if(My.has(n)){Hb.add(n);return}My.add(n);try{const r=t(),a=r.historyLoaded[n]?Bb(r.messages[n]):-1,s=a>=0?`?afterSeq=${a}`:"",l=await fetch(`/api/agent/sessions/${n}/messages${s}`);if(!l.ok)throw new Error(await br(l,"Failed to load agent messages"));const c=await l.json();e(f=>{const d=BT(a>=0?f.messages[n]:void 0,c.messages),m=f.inProgress[n],p=m&&{texts:m.texts.filter(y=>!y.stale),reasonings:m.reasonings.filter(y=>!y.stale),toolCalls:m.toolCalls.filter(y=>!y.stale),staleBarrier:!1};return{messages:{...f.messages,[n]:d},historyLoaded:{...f.historyLoaded,[n]:!0},inProgress:p?{...f.inProgress,[n]:p}:f.inProgress}})}catch(r){console.error("[agent] loadHistory failed:",r)}finally{My.delete(n),Hb.delete(n)&&t().loadHistory(n)}},async sendMessage(n,r){e(a=>({sending:{...a.sending,[n]:!0}}));try{const a=await fetch(`/api/agent/sessions/${n}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:r})});if(!a.ok)throw new Error(await br(a,"Failed to send message"));const s=await a.json();if(s.message){const l=s.message;e(c=>{const f=c.sessions[n];return{messages:{...c.messages,[n]:BT(c.messages[n],[l])},sessions:f?{...c.sessions,[n]:{...f,status:"running",lastError:null}}:c.sessions}})}return!0}catch(a){return gn.error(a instanceof Error?a.message:String(a)),!1}finally{e(a=>({sending:{...a.sending,[n]:!1}}))}},async enqueueMessage(n,r,a=!1){try{const s=await fetch(`/api/agent/sessions/${n}/queue`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:r,steer:a})});if(!s.ok)throw new Error(await br(s,"Failed to queue message"))}catch(s){gn.error(s instanceof Error?s.message:String(s))}},async editQueuedMessage(n,r,a){try{const s=await fetch(`/api/agent/queue/${r}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:a})});if(!s.ok)throw new Error(await br(s,"Failed to edit queued message"))}catch(s){gn.error(s instanceof Error?s.message:String(s))}},async withdrawQueuedMessage(n,r){try{const a=await fetch(`/api/agent/queue/${r}`,{method:"DELETE"});if(!a.ok)throw new Error(await br(a,"Failed to withdraw queued message"))}catch(a){gn.error(a instanceof Error?a.message:String(a))}},startDraft(n,r,a){const s=t().activeSessionId;s&&po.has(s)&&(po.delete(s),UT(s)),e({activeSessionId:null,draft:{deviceId:n,paneId:r,providerId:null,modelId:null,paneTitle:a}})},updateDraft(n){e(r=>r.draft?{draft:{...r.draft,...n}}:r)},clearDraft(){e({draft:null})},async materializeDraft(){const n=t().draft;return n?await t().createSession(n.deviceId,n.paneId,{providerId:n.providerId,modelId:n.modelId,originPaneTitle:n.paneTitle}):null},async stopSession(n){try{const r=await fetch(`/api/agent/sessions/${n}/stop`,{method:"POST"});if(!r.ok)throw new Error(await br(r,"Failed to stop agent session"));const a=await r.json();if(a.session){const s=a.session;e(l=>({sessions:{...l.sessions,[n]:s}}))}}catch(r){gn.error(r instanceof Error?r.message:String(r))}},async decideConfirmation(n,r,a,s){const l=()=>{e(c=>{const f=c.pendingConfirmations[n];return f?{pendingConfirmations:{...c.pendingConfirmations,[n]:f.filter(d=>d.id!==r)}}:c})};try{const c=await fetch(`/api/agent/confirmations/${r}/decide`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s===void 0?{approved:a}:{approved:a,reason:s})});if(c.status===409){l();try{const f=await fetch(`/api/agent/sessions/${n}/confirmations`);if(f.ok){const d=await f.json();e(m=>({pendingConfirmations:{...m.pendingConfirmations,[n]:d.confirmations.map(p=>({id:p.id,toolCallId:p.toolCallId,toolName:p.toolName,input:p.input,createdAt:p.createdAt}))}}))}}catch{}return}if(!c.ok)throw new Error(await br(c,"Failed to decide confirmation"));l()}catch(c){gn.error(c instanceof Error?c.message:String(c))}}}),{name:"tmex-agent",partialize:e=>({activeSessionId:e.activeSessionId,defaultWriteMode:e.defaultWriteMode})}));function IB(){const e=Ps.getState().settings;return(e==null?void 0:e.siteName)||"tmex"}function qT(e){const t=e==null?void 0:e.trim();return t&&t.length>0?t:"?"}function PB({paneIdx:e,windowIdx:t,paneTitle:n,windowName:r,windowCustomName:a,deviceName:s}){const l=t??"?",c=e??"?",f=qT(a??n??r),d=qT(s);return`${l}/${c}: ${f}@${d}`}function fx(e){var c,f;const t=(c=e.customName)==null?void 0:c.trim(),n=e.panes.find(d=>d.active)??e.panes[0],r=e.name.trim(),a=(f=n==null?void 0:n.title)==null?void 0:f.trim(),s=t||a||r;return{title:s,processName:!!r&&r!==s?r:void 0}}function LB(e){const{title:t,processName:n}=fx(e);return n?`${n}: ${t}`:t}function LX(e){const t=IB();return e!=null&&e.trim()?`[${t}]${e}`:t}function _B(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const jB=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zB=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,FB={};function $T(e,t){return(FB.jsx?zB:jB).test(e)}const BB=/[ \t\n\f\r]/g;function HB(e){return typeof e=="object"?e.type==="text"?YT(e.value):!1:YT(e)}function YT(e){return e.replace(BB,"")===""}class bd{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}bd.prototype.normal={};bd.prototype.property={};bd.prototype.space=void 0;function MM(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new bd(n,r,t)}function Vb(e){return e.toLowerCase()}class zr{constructor(t,n){this.attribute=n,this.property=t}}zr.prototype.attribute="";zr.prototype.booleanish=!1;zr.prototype.boolean=!1;zr.prototype.commaOrSpaceSeparated=!1;zr.prototype.commaSeparated=!1;zr.prototype.defined=!1;zr.prototype.mustUseProperty=!1;zr.prototype.number=!1;zr.prototype.overloadedBoolean=!1;zr.prototype.property="";zr.prototype.spaceSeparated=!1;zr.prototype.space=void 0;let UB=0;const St=qs(),Wn=qs(),qb=qs(),ze=qs(),bn=qs(),Os=qs(),Wr=qs();function qs(){return 2**++UB}const $b=Object.freeze(Object.defineProperty({__proto__:null,boolean:St,booleanish:Wn,commaOrSpaceSeparated:Wr,commaSeparated:Os,number:ze,overloadedBoolean:qb,spaceSeparated:bn},Symbol.toStringTag,{value:"Module"})),Oy=Object.keys($b);class hx extends zr{constructor(t,n,r,a){let s=-1;if(super(t,n),WT(this,"space",a),typeof r=="number")for(;++s<Oy.length;){const l=Oy[s];WT(this,Oy[s],(r&$b[l])===$b[l])}}}hx.prototype.defined=!0;function WT(e,t,n){n&&(e[t]=n)}function bu(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const s=new hx(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Vb(r)]=r,n[Vb(s.attribute)]=r}return new bd(t,n,e.space)}const OM=bu({properties:{ariaActiveDescendant:null,ariaAtomic:Wn,ariaAutoComplete:null,ariaBusy:Wn,ariaChecked:Wn,ariaColCount:ze,ariaColIndex:ze,ariaColSpan:ze,ariaControls:bn,ariaCurrent:null,ariaDescribedBy:bn,ariaDetails:null,ariaDisabled:Wn,ariaDropEffect:bn,ariaErrorMessage:null,ariaExpanded:Wn,ariaFlowTo:bn,ariaGrabbed:Wn,ariaHasPopup:null,ariaHidden:Wn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:bn,ariaLevel:ze,ariaLive:null,ariaModal:Wn,ariaMultiLine:Wn,ariaMultiSelectable:Wn,ariaOrientation:null,ariaOwns:bn,ariaPlaceholder:null,ariaPosInSet:ze,ariaPressed:Wn,ariaReadOnly:Wn,ariaRelevant:null,ariaRequired:Wn,ariaRoleDescription:bn,ariaRowCount:ze,ariaRowIndex:ze,ariaRowSpan:ze,ariaSelected:Wn,ariaSetSize:ze,ariaSort:null,ariaValueMax:ze,ariaValueMin:ze,ariaValueNow:ze,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function AM(e,t){return t in e?e[t]:t}function NM(e,t){return AM(e,t.toLowerCase())}const VB=bu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Os,acceptCharset:bn,accessKey:bn,action:null,allow:null,allowFullScreen:St,allowPaymentRequest:St,allowUserMedia:St,alpha:St,alt:null,as:null,async:St,autoCapitalize:null,autoComplete:bn,autoFocus:St,autoPlay:St,blocking:bn,capture:null,charSet:null,checked:St,cite:null,className:bn,closedBy:null,colorSpace:null,cols:ze,colSpan:ze,command:null,commandFor:null,content:null,contentEditable:Wn,controls:St,controlsList:bn,coords:ze|Os,crossOrigin:null,data:null,dateTime:null,decoding:null,default:St,defer:St,dir:null,dirName:null,disabled:St,download:qb,draggable:Wn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:St,formTarget:null,headers:bn,height:ze,hidden:qb,high:ze,href:null,hrefLang:null,htmlFor:bn,httpEquiv:bn,id:null,imageSizes:null,imageSrcSet:null,inert:St,inputMode:null,integrity:null,is:null,isMap:St,itemId:null,itemProp:bn,itemRef:bn,itemScope:St,itemType:bn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:St,low:ze,manifest:null,max:null,maxLength:ze,media:null,method:null,min:null,minLength:ze,multiple:St,muted:St,name:null,nonce:null,noModule:St,noValidate:St,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:St,optimum:ze,pattern:null,ping:bn,placeholder:null,playsInline:St,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:St,referrerPolicy:null,rel:bn,required:St,reversed:St,rows:ze,rowSpan:ze,sandbox:bn,scope:null,scoped:St,seamless:St,selected:St,shadowRootClonable:St,shadowRootCustomElementRegistry:St,shadowRootDelegatesFocus:St,shadowRootMode:null,shadowRootSerializable:St,shape:null,size:ze,sizes:null,slot:null,span:ze,spellCheck:Wn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ze,step:null,style:null,tabIndex:ze,target:null,title:null,translate:null,type:null,typeMustMatch:St,useMap:null,value:Wn,width:ze,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:bn,axis:null,background:null,bgColor:null,border:ze,borderColor:null,bottomMargin:ze,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:St,declare:St,event:null,face:null,frame:null,frameBorder:null,hSpace:ze,leftMargin:ze,link:null,longDesc:null,lowSrc:null,marginHeight:ze,marginWidth:ze,noResize:St,noHref:St,noShade:St,noWrap:St,object:null,profile:null,prompt:null,rev:null,rightMargin:ze,rules:null,scheme:null,scrolling:Wn,standby:null,summary:null,text:null,topMargin:ze,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ze,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:St,disablePictureInPicture:St,disableRemotePlayback:St,exportParts:Os,part:bn,prefix:null,property:null,results:ze,security:null,unselectable:null},space:"html",transform:NM}),qB=bu({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Wr,accentHeight:ze,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ze,amplitude:ze,arabicForm:null,ascent:ze,attributeName:null,attributeType:null,azimuth:ze,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ze,by:null,calcMode:null,capHeight:ze,className:bn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ze,diffuseConstant:ze,direction:null,display:null,dur:null,divisor:ze,dominantBaseline:null,download:St,dx:null,dy:null,edgeMode:null,editable:null,elevation:ze,enableBackground:null,end:null,event:null,exponent:ze,externalResourcesRequired:null,fill:null,fillOpacity:ze,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Os,g2:Os,glyphName:Os,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ze,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ze,horizOriginX:ze,horizOriginY:ze,id:null,ideographic:ze,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ze,k:ze,k1:ze,k2:ze,k3:ze,k4:ze,kernelMatrix:Wr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ze,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ze,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ze,overlineThickness:ze,paintOrder:null,panose1:null,path:null,pathLength:ze,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:bn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ze,pointsAtY:ze,pointsAtZ:ze,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Wr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Wr,rev:Wr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Wr,requiredFeatures:Wr,requiredFonts:Wr,requiredFormats:Wr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ze,specularExponent:ze,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ze,strikethroughThickness:ze,string:null,stroke:null,strokeDashArray:Wr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ze,strokeOpacity:ze,strokeWidth:null,style:null,surfaceScale:ze,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Wr,tabIndex:ze,tableValues:null,target:null,targetX:ze,targetY:ze,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Wr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ze,underlineThickness:ze,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ze,values:null,vAlphabetic:ze,vMathematical:ze,vectorEffect:null,vHanging:ze,vIdeographic:ze,version:null,vertAdvY:ze,vertOriginX:ze,vertOriginY:ze,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ze,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:AM}),DM=bu({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),IM=bu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:NM}),PM=bu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),$B={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},YB=/[A-Z]/g,KT=/-[a-z]/g,WB=/^data[-\w.:]+$/i;function KB(e,t){const n=Vb(t);let r=t,a=zr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&WB.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(KT,XB);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!KT.test(s)){let l=s.replace(YB,GB);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}a=hx}return new a(r,t)}function GB(e){return"-"+e.toLowerCase()}function XB(e){return e.charAt(1).toUpperCase()}const QB=MM([OM,VB,DM,IM,PM],"html"),px=MM([OM,qB,DM,IM,PM],"svg");function ZB(e){return e.join(" ").trim()}var kl={},Ay,GT;function JB(){if(GT)return Ay;GT=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,f=`
333
+ `,d="/",m="*",p="",y="comment",g="declaration";function x(T,S){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];S=S||{};var R=1,k=1;function M(q){var Y=q.match(t);Y&&(R+=Y.length);var j=q.lastIndexOf(f);k=~j?q.length-j:k+q.length}function D(){var q={line:R,column:k};return function(Y){return Y.position=new O(q),$(),Y}}function O(q){this.start=q,this.end={line:R,column:k},this.source=S.source}O.prototype.content=T;function N(q){var Y=new Error(S.source+":"+R+":"+k+": "+q);if(Y.reason=q,Y.filename=S.source,Y.line=R,Y.column=k,Y.source=T,!S.silent)throw Y}function _(q){var Y=q.exec(T);if(Y){var j=Y[0];return M(j),T=T.slice(j.length),Y}}function $(){_(n)}function F(q){var Y;for(q=q||[];Y=W();)Y!==!1&&q.push(Y);return q}function W(){var q=D();if(!(d!=T.charAt(0)||m!=T.charAt(1))){for(var Y=2;p!=T.charAt(Y)&&(m!=T.charAt(Y)||d!=T.charAt(Y+1));)++Y;if(Y+=2,p===T.charAt(Y-1))return N("End of comment missing");var j=T.slice(2,Y-2);return k+=2,M(j),T=T.slice(Y),k+=2,q({type:y,comment:j})}}function L(){var q=D(),Y=_(r);if(Y){if(W(),!_(a))return N("property missing ':'");var j=_(s),z=q({type:g,property:C(Y[0].replace(e,p)),value:j?C(j[0].replace(e,p)):p});return _(l),z}}function V(){var q=[];F(q);for(var Y;Y=L();)Y!==!1&&(q.push(Y),F(q));return q}return $(),V()}function C(T){return T?T.replace(c,p):p}return Ay=x,Ay}var XT;function eH(){if(XT)return kl;XT=1;var e=kl&&kl.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(kl,"__esModule",{value:!0}),kl.default=n;const t=e(JB());function n(r,a){let s=null;if(!r||typeof r!="string")return s;const l=(0,t.default)(r),c=typeof a=="function";return l.forEach(f=>{if(f.type!=="declaration")return;const{property:d,value:m}=f;c?a(d,m,f):m&&(s=s||{},s[d]=m)}),s}return kl}var Ec={},QT;function tH(){if(QT)return Ec;QT=1,Object.defineProperty(Ec,"__esModule",{value:!0}),Ec.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,s=function(d){return!d||n.test(d)||e.test(d)},l=function(d,m){return m.toUpperCase()},c=function(d,m){return"".concat(m,"-")},f=function(d,m){return m===void 0&&(m={}),s(d)?d:(d=d.toLowerCase(),m.reactCompat?d=d.replace(a,c):d=d.replace(r,c),d.replace(t,l))};return Ec.camelCase=f,Ec}var Tc,ZT;function nH(){if(ZT)return Tc;ZT=1;var e=Tc&&Tc.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(eH()),n=tH();function r(a,s){var l={};return!a||typeof a!="string"||(0,t.default)(a,function(c,f){c&&f&&(l[(0,n.camelCase)(c,s)]=f)}),l}return r.default=r,Tc=r,Tc}var rH=nH();const iH=sp(rH),LM=_M("end"),mx=_M("start");function _M(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function aH(e){const t=mx(e),n=LM(e);if(t&&n)return{start:t,end:n}}function Vc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?JT(e.position):"start"in e||"end"in e?JT(e):"line"in e||"column"in e?Yb(e):""}function Yb(e){return eC(e&&e.line)+":"+eC(e&&e.column)}function JT(e){return Yb(e&&e.start)+"-"+Yb(e&&e.end)}function eC(e){return e&&typeof e=="number"?e:1}class gr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",s={},l=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?a=t:!s.cause&&t&&(l=!0,a=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?s.ruleId=r:(s.source=r.slice(0,f),s.ruleId=r.slice(f+1))}if(!s.place&&s.ancestors&&s.ancestors){const f=s.ancestors[s.ancestors.length-1];f&&(s.place=f.position)}const c=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=c?c.line:void 0,this.name=Vc(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=l&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}gr.prototype.file="";gr.prototype.name="";gr.prototype.reason="";gr.prototype.message="";gr.prototype.stack="";gr.prototype.column=void 0;gr.prototype.line=void 0;gr.prototype.ancestors=void 0;gr.prototype.cause=void 0;gr.prototype.fatal=void 0;gr.prototype.place=void 0;gr.prototype.ruleId=void 0;gr.prototype.source=void 0;const gx={}.hasOwnProperty,oH=new Map,sH=/[A-Z]/g,lH=new Set(["table","tbody","thead","tfoot","tr"]),uH=new Set(["td","th"]),jM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function cH(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=bH(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=yH(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?px:QB,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=zM(a,e,void 0);return s&&typeof s!="string"?s:a.create(e,a.Fragment,{children:s||void 0},void 0)}function zM(e,t,n){if(t.type==="element")return dH(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return fH(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return pH(e,t,n);if(t.type==="mdxjsEsm")return hH(e,t);if(t.type==="root")return mH(e,t,n);if(t.type==="text")return gH(e,t)}function dH(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=px,e.schema=a),e.ancestors.push(t);const s=BM(e,t.tagName,!1),l=vH(e,t);let c=bx(e,t);return lH.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!HB(f):!0})),FM(e,l,s,t),yx(l,c),e.ancestors.pop(),e.schema=r,e.create(t,s,l,n)}function fH(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}rd(e,t.position)}function hH(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);rd(e,t.position)}function pH(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=px,e.schema=a),e.ancestors.push(t);const s=t.name===null?e.Fragment:BM(e,t.name,!0),l=xH(e,t),c=bx(e,t);return FM(e,l,s,t),yx(l,c),e.ancestors.pop(),e.schema=r,e.create(t,s,l,n)}function mH(e,t,n){const r={};return yx(r,bx(e,t)),e.create(t,e.Fragment,r,n)}function gH(e,t){return t.value}function FM(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function yx(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function yH(e,t,n){return r;function r(a,s,l,c){const d=Array.isArray(l.children)?n:t;return c?d(s,l,c):d(s,l)}}function bH(e,t){return n;function n(r,a,s,l){const c=Array.isArray(s.children),f=mx(r);return t(a,s,l,c,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function vH(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&gx.call(t.properties,a)){const s=wH(e,a,t.properties[a]);if(s){const[l,c]=s;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&uH.has(t.tagName)?r=c:n[l]=c}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function xH(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const l=s.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else rd(e,t.position);else{const a=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,s=e.evaluater.evaluateExpression(c.expression)}else rd(e,t.position);else s=r.value===null?!0:r.value;n[a]=s}return n}function bx(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:oH;for(;++r<t.children.length;){const s=t.children[r];let l;if(e.passKeys){const f=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(f){const d=a.get(f)||0;l=f+"-"+d,a.set(f,d+1)}}const c=zM(e,s,l);c!==void 0&&n.push(c)}return n}function wH(e,t,n){const r=KB(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?_B(n):ZB(n)),r.property==="style"){let a=typeof n=="object"?n:SH(e,String(n));return e.stylePropertyNameCase==="css"&&(a=EH(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?$B[r.property]||r.property:r.attribute,n]}}function SH(e,t){try{return iH(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new gr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=jM+"#cannot-parse-style-attribute",a}}function BM(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let s=-1,l;for(;++s<a.length;){const c=$T(a[s])?{type:"Identifier",name:a[s]}:{type:"Literal",value:a[s]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(s&&c.type==="Literal"),optional:!1}:c}r=l}else r=$T(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return gx.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);rd(e)}function rd(e,t){const n=new gr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=jM+"#cannot-handle-mdx-estrees-without-createevaluater",n}function EH(e){const t={};let n;for(n in e)gx.call(e,n)&&(t[TH(n)]=e[n]);return t}function TH(e){let t=e.replace(sH,CH);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function CH(e){return"-"+e.toLowerCase()}const Ny={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},RH={};function vx(e,t){const n=RH,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return HM(e,r,a)}function HM(e,t,n){if(kH(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return tC(e.children,t,n)}return Array.isArray(e)?tC(e,t,n):""}function tC(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=HM(e[a],t,n);return r.join("")}function kH(e){return!!(e&&typeof e=="object")}const nC=document.createElement("i");function xx(e){const t="&"+e+";";nC.innerHTML=t;const n=nC.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Zr(e,t,n,r){const a=e.length;let s=0,l;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);s<r.length;)l=r.slice(s,s+1e4),l.unshift(t,0),e.splice(...l),s+=1e4,t+=1e4}function hi(e,t){return e.length>0?(Zr(e,e.length,0,t),e):t}const rC={}.hasOwnProperty;function UM(e){const t={};let n=-1;for(;++n<e.length;)MH(t,e[n]);return t}function MH(e,t){let n;for(n in t){const a=(rC.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let l;if(s)for(l in s){rC.call(a,l)||(a[l]=[]);const c=s[l];OH(a[l],Array.isArray(c)?c:c?[c]:[])}}}function OH(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Zr(e,0,0,r)}function VM(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Ai(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Er=Bo(/[A-Za-z]/),mr=Bo(/[\dA-Za-z]/),AH=Bo(/[#-'*+\--9=?A-Z^-~]/);function Hh(e){return e!==null&&(e<32||e===127)}const Wb=Bo(/\d/),NH=Bo(/[\dA-Fa-f]/),DH=Bo(/[!-/:-@[-`{-~]/);function ht(e){return e!==null&&e<-2}function vn(e){return e!==null&&(e<0||e===32)}function $t(e){return e===-2||e===-1||e===32}const Rp=Bo(new RegExp("\\p{P}|\\p{S}","u")),js=Bo(/\s/);function Bo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function vu(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const s=e.charCodeAt(n);let l="";if(s===37&&mr(e.charCodeAt(n+1))&&mr(e.charCodeAt(n+2)))a=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(l=String.fromCharCode(s));else if(s>55295&&s<57344){const c=e.charCodeAt(n+1);s<56320&&c>56319&&c<57344?(l=String.fromCharCode(s,c),a=1):l="�"}else l=String.fromCharCode(s);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+a+1,l=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function en(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let s=0;return l;function l(f){return $t(f)?(e.enter(n),c(f)):t(f)}function c(f){return $t(f)&&s++<a?(e.consume(f),c):(e.exit(n),t(f))}}const IH={tokenize:PH};function PH(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),en(e,t,"linePrefix")}function a(c){return e.enter("paragraph"),s(c)}function s(c){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return ht(c)?(e.consume(c),e.exit("chunkText"),s):(e.consume(c),l)}}const LH={tokenize:_H},iC={tokenize:jH};function _H(e){const t=this,n=[];let r=0,a,s,l;return c;function c(k){if(r<n.length){const M=n[r];return t.containerState=M[1],e.attempt(M[0].continuation,f,d)(k)}return d(k)}function f(k){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&R();const M=t.events.length;let D=M,O;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){O=t.events[D][1].end;break}S(r);let N=M;for(;N<t.events.length;)t.events[N][1].end={...O},N++;return Zr(t.events,D+1,0,t.events.slice(M)),t.events.length=N,d(k)}return c(k)}function d(k){if(r===n.length){if(!a)return y(k);if(a.currentConstruct&&a.currentConstruct.concrete)return x(k);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(iC,m,p)(k)}function m(k){return a&&R(),S(r),y(k)}function p(k){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,x(k)}function y(k){return t.containerState={},e.attempt(iC,g,x)(k)}function g(k){return r++,n.push([t.currentConstruct,t.containerState]),y(k)}function x(k){if(k===null){a&&R(),S(0),e.consume(k);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:s}),C(k)}function C(k){if(k===null){T(e.exit("chunkFlow"),!0),S(0),e.consume(k);return}return ht(k)?(e.consume(k),T(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(k),C)}function T(k,M){const D=t.sliceStream(k);if(M&&D.push(null),k.previous=s,s&&(s.next=k),s=k,a.defineSkip(k.start),a.write(D),t.parser.lazy[k.start.line]){let O=a.events.length;for(;O--;)if(a.events[O][1].start.offset<l&&(!a.events[O][1].end||a.events[O][1].end.offset>l))return;const N=t.events.length;let _=N,$,F;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){if($){F=t.events[_][1].end;break}$=!0}for(S(r),O=N;O<t.events.length;)t.events[O][1].end={...F},O++;Zr(t.events,_+1,0,t.events.slice(N)),t.events.length=O}}function S(k){let M=n.length;for(;M-- >k;){const D=n[M];t.containerState=D[1],D[0].exit.call(t,e)}n.length=k}function R(){a.write([null]),s=void 0,a=void 0,t.containerState._closeFlow=void 0}}function jH(e,t,n){return en(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ou(e){if(e===null||vn(e)||js(e))return 1;if(Rp(e))return 2}function kp(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const s=e[a].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const Kb={name:"attention",resolveAll:zH,tokenize:FH};function zH(e,t){let n=-1,r,a,s,l,c,f,d,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},y={...e[n][1].start};aC(p,-f),aC(y,f),l={type:f>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},c={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},s={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:f>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[r][1].end={...l.start},e[n][1].start={...c.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=hi(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=hi(d,[["enter",a,t],["enter",l,t],["exit",l,t],["enter",s,t]]),d=hi(d,kp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=hi(d,[["exit",s,t],["enter",c,t],["exit",c,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,d=hi(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,Zr(e,r-1,n-r+3,d),n=r+d.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function FH(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=ou(r);let s;return l;function l(f){return s=f,e.enter("attentionSequence"),c(f)}function c(f){if(f===s)return e.consume(f),c;const d=e.exit("attentionSequence"),m=ou(f),p=!m||m===2&&a||n.includes(f),y=!a||a===2&&m||n.includes(r);return d._open=!!(s===42?p:p&&(a||!y)),d._close=!!(s===42?y:y&&(m||!p)),t(f)}}function aC(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const BH={name:"autolink",tokenize:HH};function HH(e,t,n){let r=0;return a;function a(g){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(g){return Er(g)?(e.consume(g),l):g===64?n(g):d(g)}function l(g){return g===43||g===45||g===46||mr(g)?(r=1,c(g)):d(g)}function c(g){return g===58?(e.consume(g),r=0,f):(g===43||g===45||g===46||mr(g))&&r++<32?(e.consume(g),c):(r=0,d(g))}function f(g){return g===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):g===null||g===32||g===60||Hh(g)?n(g):(e.consume(g),f)}function d(g){return g===64?(e.consume(g),m):AH(g)?(e.consume(g),d):n(g)}function m(g){return mr(g)?p(g):n(g)}function p(g){return g===46?(e.consume(g),r=0,m):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):y(g)}function y(g){if((g===45||mr(g))&&r++<63){const x=g===45?y:p;return e.consume(g),x}return n(g)}}const vd={partial:!0,tokenize:UH};function UH(e,t,n){return r;function r(s){return $t(s)?en(e,a,"linePrefix")(s):a(s)}function a(s){return s===null||ht(s)?t(s):n(s)}}const qM={continuation:{tokenize:qH},exit:$H,name:"blockQuote",tokenize:VH};function VH(e,t,n){const r=this;return a;function a(l){if(l===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),s}return n(l)}function s(l){return $t(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function qH(e,t,n){const r=this;return a;function a(l){return $t(l)?en(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):s(l)}function s(l){return e.attempt(qM,t,n)(l)}}function $H(e){e.exit("blockQuote")}const $M={name:"characterEscape",tokenize:YH};function YH(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),a}function a(s){return DH(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const YM={name:"characterReference",tokenize:WH};function WH(e,t,n){const r=this;let a=0,s,l;return c;function c(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),f}function f(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),s=31,l=mr,m(p))}function d(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,l=NH,m):(e.enter("characterReferenceValue"),s=7,l=Wb,m(p))}function m(p){if(p===59&&a){const y=e.exit("characterReferenceValue");return l===mr&&!xx(r.sliceSerialize(y))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(p)&&a++<s?(e.consume(p),m):n(p)}}const oC={partial:!0,tokenize:GH},sC={concrete:!0,name:"codeFenced",tokenize:KH};function KH(e,t,n){const r=this,a={partial:!0,tokenize:D};let s=0,l=0,c;return f;function f(O){return d(O)}function d(O){const N=r.events[r.events.length-1];return s=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[1],!0).length:0,c=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(O)}function m(O){return O===c?(l++,e.consume(O),m):l<3?n(O):(e.exit("codeFencedFenceSequence"),$t(O)?en(e,p,"whitespace")(O):p(O))}function p(O){return O===null||ht(O)?(e.exit("codeFencedFence"),r.interrupt?t(O):e.check(oC,C,M)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(O))}function y(O){return O===null||ht(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(O)):$t(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),en(e,g,"whitespace")(O)):O===96&&O===c?n(O):(e.consume(O),y)}function g(O){return O===null||ht(O)?p(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(O))}function x(O){return O===null||ht(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(O)):O===96&&O===c?n(O):(e.consume(O),x)}function C(O){return e.attempt(a,M,T)(O)}function T(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),S}function S(O){return s>0&&$t(O)?en(e,R,"linePrefix",s+1)(O):R(O)}function R(O){return O===null||ht(O)?e.check(oC,C,M)(O):(e.enter("codeFlowValue"),k(O))}function k(O){return O===null||ht(O)?(e.exit("codeFlowValue"),R(O)):(e.consume(O),k)}function M(O){return e.exit("codeFenced"),t(O)}function D(O,N,_){let $=0;return F;function F(Y){return O.enter("lineEnding"),O.consume(Y),O.exit("lineEnding"),W}function W(Y){return O.enter("codeFencedFence"),$t(Y)?en(O,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):L(Y)}function L(Y){return Y===c?(O.enter("codeFencedFenceSequence"),V(Y)):_(Y)}function V(Y){return Y===c?($++,O.consume(Y),V):$>=l?(O.exit("codeFencedFenceSequence"),$t(Y)?en(O,q,"whitespace")(Y):q(Y)):_(Y)}function q(Y){return Y===null||ht(Y)?(O.exit("codeFencedFence"),N(Y)):_(Y)}}}function GH(e,t,n){const r=this;return a;function a(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s)}function s(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Dy={name:"codeIndented",tokenize:QH},XH={partial:!0,tokenize:ZH};function QH(e,t,n){const r=this;return a;function a(d){return e.enter("codeIndented"),en(e,s,"linePrefix",5)(d)}function s(d){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(d):n(d)}function l(d){return d===null?f(d):ht(d)?e.attempt(XH,l,f)(d):(e.enter("codeFlowValue"),c(d))}function c(d){return d===null||ht(d)?(e.exit("codeFlowValue"),l(d)):(e.consume(d),c)}function f(d){return e.exit("codeIndented"),t(d)}}function ZH(e,t,n){const r=this;return a;function a(l){return r.parser.lazy[r.now().line]?n(l):ht(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):en(e,s,"linePrefix",5)(l)}function s(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):ht(l)?a(l):n(l)}}const JH={name:"codeText",previous:tU,resolve:eU,tokenize:nU};function eU(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function tU(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function nU(e,t,n){let r=0,a,s;return l;function l(p){return e.enter("codeText"),e.enter("codeTextSequence"),c(p)}function c(p){return p===96?(e.consume(p),r++,c):(e.exit("codeTextSequence"),f(p))}function f(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),f):p===96?(s=e.enter("codeTextSequence"),a=0,m(p)):ht(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("codeTextData"),d(p))}function d(p){return p===null||p===32||p===96||ht(p)?(e.exit("codeTextData"),f(p)):(e.consume(p),d)}function m(p){return p===96?(e.consume(p),a++,m):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(s.type="codeTextData",d(p))}}class rU{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&Cc(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Cc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Cc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Cc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Cc(this.left,n.reverse())}}}function Cc(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function WM(e){const t={};let n=-1,r,a,s,l,c,f,d;const m=new rU(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(f=r[1]._tokenizer.events,s=0,s<f.length&&f[s][1].type==="lineEndingBlank"&&(s+=2),s<f.length&&f[s][1].type==="content"))for(;++s<f.length&&f[s][1].type!=="content";)f[s][1].type==="chunkText"&&(f[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,iU(m,n)),n=t[n],d=!0);else if(r[1]._container){for(s=n,a=void 0;s--;)if(l=m.get(s),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(a&&(m.get(a)[1].type="lineEndingBlank"),l[1].type="lineEnding",a=s);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;a&&(r[1].end={...m.get(a)[1].start},c=m.slice(a,n),c.unshift(r),m.splice(a,n-a+1,c))}}return Zr(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!d}function iU(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const s=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,f=[],d={};let m,p,y=-1,g=n,x=0,C=0;const T=[C];for(;g;){for(;e.get(++a)[1]!==g;);s.push(a),g._tokenizer||(m=r.sliceStream(g),g.next||m.push(null),p&&l.defineSkip(g.start),g._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),g._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),p=g,g=g.next}for(g=n;++y<c.length;)c[y][0]==="exit"&&c[y-1][0]==="enter"&&c[y][1].type===c[y-1][1].type&&c[y][1].start.line!==c[y][1].end.line&&(C=y+1,T.push(C),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(l.events=[],g?(g._tokenizer=void 0,g.previous=void 0):T.pop(),y=T.length;y--;){const S=c.slice(T[y],T[y+1]),R=s.pop();f.push([R,R+S.length-1]),e.splice(R,2,S)}for(f.reverse(),y=-1;++y<f.length;)d[x+f[y][0]]=x+f[y][1],x+=f[y][1]-f[y][0]-1;return d}const aU={resolve:sU,tokenize:lU},oU={partial:!0,tokenize:uU};function sU(e){return WM(e),e}function lU(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(c)}function a(c){return c===null?s(c):ht(c)?e.check(oU,l,s)(c):(e.consume(c),a)}function s(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function uU(e,t,n){const r=this;return a;function a(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),en(e,s,"linePrefix")}function s(l){if(l===null||ht(l))return n(l);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function KM(e,t,n,r,a,s,l,c,f){const d=f||Number.POSITIVE_INFINITY;let m=0;return p;function p(S){return S===60?(e.enter(r),e.enter(a),e.enter(s),e.consume(S),e.exit(s),y):S===null||S===32||S===41||Hh(S)?n(S):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),C(S))}function y(S){return S===62?(e.enter(s),e.consume(S),e.exit(s),e.exit(a),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===62?(e.exit("chunkString"),e.exit(c),y(S)):S===null||S===60||ht(S)?n(S):(e.consume(S),S===92?x:g)}function x(S){return S===60||S===62||S===92?(e.consume(S),g):g(S)}function C(S){return!m&&(S===null||S===41||vn(S))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),t(S)):m<d&&S===40?(e.consume(S),m++,C):S===41?(e.consume(S),m--,C):S===null||S===32||S===40||Hh(S)?n(S):(e.consume(S),S===92?T:C)}function T(S){return S===40||S===41||S===92?(e.consume(S),C):C(S)}}function GM(e,t,n,r,a,s){const l=this;let c=0,f;return d;function d(g){return e.enter(r),e.enter(a),e.consume(g),e.exit(a),e.enter(s),m}function m(g){return c>999||g===null||g===91||g===93&&!f||g===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(g):g===93?(e.exit(s),e.enter(a),e.consume(g),e.exit(a),e.exit(r),t):ht(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===null||g===91||g===93||ht(g)||c++>999?(e.exit("chunkString"),m(g)):(e.consume(g),f||(f=!$t(g)),g===92?y:p)}function y(g){return g===91||g===92||g===93?(e.consume(g),c++,p):p(g)}}function XM(e,t,n,r,a,s){let l;return c;function c(y){return y===34||y===39||y===40?(e.enter(r),e.enter(a),e.consume(y),e.exit(a),l=y===40?41:y,f):n(y)}function f(y){return y===l?(e.enter(a),e.consume(y),e.exit(a),e.exit(r),t):(e.enter(s),d(y))}function d(y){return y===l?(e.exit(s),f(l)):y===null?n(y):ht(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),en(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===l||y===null||ht(y)?(e.exit("chunkString"),d(y)):(e.consume(y),y===92?p:m)}function p(y){return y===l||y===92?(e.consume(y),m):m(y)}}function qc(e,t){let n;return r;function r(a){return ht(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):$t(a)?en(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const cU={name:"definition",tokenize:fU},dU={partial:!0,tokenize:hU};function fU(e,t,n){const r=this;let a;return s;function s(g){return e.enter("definition"),l(g)}function l(g){return GM.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function c(g){return a=Ai(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),f):n(g)}function f(g){return vn(g)?qc(e,d)(g):d(g)}function d(g){return KM(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function m(g){return e.attempt(dU,p,p)(g)}function p(g){return $t(g)?en(e,y,"whitespace")(g):y(g)}function y(g){return g===null||ht(g)?(e.exit("definition"),r.parser.defined.push(a),t(g)):n(g)}}function hU(e,t,n){return r;function r(c){return vn(c)?qc(e,a)(c):n(c)}function a(c){return XM(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function s(c){return $t(c)?en(e,l,"whitespace")(c):l(c)}function l(c){return c===null||ht(c)?t(c):n(c)}}const pU={name:"hardBreakEscape",tokenize:mU};function mU(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),a}function a(s){return ht(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const gU={name:"headingAtx",resolve:yU,tokenize:bU};function yU(e,t){let n=e.length-2,r=3,a,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Zr(e,r,n-r+1,[["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t]])),e}function bU(e,t,n){let r=0;return a;function a(m){return e.enter("atxHeading"),s(m)}function s(m){return e.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&r++<6?(e.consume(m),l):m===null||vn(m)?(e.exit("atxHeadingSequence"),c(m)):n(m)}function c(m){return m===35?(e.enter("atxHeadingSequence"),f(m)):m===null||ht(m)?(e.exit("atxHeading"),t(m)):$t(m)?en(e,c,"whitespace")(m):(e.enter("atxHeadingText"),d(m))}function f(m){return m===35?(e.consume(m),f):(e.exit("atxHeadingSequence"),c(m))}function d(m){return m===null||m===35||vn(m)?(e.exit("atxHeadingText"),c(m)):(e.consume(m),d)}}const vU=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],lC=["pre","script","style","textarea"],xU={concrete:!0,name:"htmlFlow",resolveTo:EU,tokenize:TU},wU={partial:!0,tokenize:RU},SU={partial:!0,tokenize:CU};function EU(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function TU(e,t,n){const r=this;let a,s,l,c,f;return d;function d(I){return m(I)}function m(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),p}function p(I){return I===33?(e.consume(I),y):I===47?(e.consume(I),s=!0,C):I===63?(e.consume(I),a=3,r.interrupt?t:P):Er(I)?(e.consume(I),l=String.fromCharCode(I),T):n(I)}function y(I){return I===45?(e.consume(I),a=2,g):I===91?(e.consume(I),a=5,c=0,x):Er(I)?(e.consume(I),a=4,r.interrupt?t:P):n(I)}function g(I){return I===45?(e.consume(I),r.interrupt?t:P):n(I)}function x(I){const Q="CDATA[";return I===Q.charCodeAt(c++)?(e.consume(I),c===Q.length?r.interrupt?t:L:x):n(I)}function C(I){return Er(I)?(e.consume(I),l=String.fromCharCode(I),T):n(I)}function T(I){if(I===null||I===47||I===62||vn(I)){const Q=I===47,Z=l.toLowerCase();return!Q&&!s&&lC.includes(Z)?(a=1,r.interrupt?t(I):L(I)):vU.includes(l.toLowerCase())?(a=6,Q?(e.consume(I),S):r.interrupt?t(I):L(I)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(I):s?R(I):k(I))}return I===45||mr(I)?(e.consume(I),l+=String.fromCharCode(I),T):n(I)}function S(I){return I===62?(e.consume(I),r.interrupt?t:L):n(I)}function R(I){return $t(I)?(e.consume(I),R):F(I)}function k(I){return I===47?(e.consume(I),F):I===58||I===95||Er(I)?(e.consume(I),M):$t(I)?(e.consume(I),k):F(I)}function M(I){return I===45||I===46||I===58||I===95||mr(I)?(e.consume(I),M):D(I)}function D(I){return I===61?(e.consume(I),O):$t(I)?(e.consume(I),D):k(I)}function O(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),f=I,N):$t(I)?(e.consume(I),O):_(I)}function N(I){return I===f?(e.consume(I),f=null,$):I===null||ht(I)?n(I):(e.consume(I),N)}function _(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||vn(I)?D(I):(e.consume(I),_)}function $(I){return I===47||I===62||$t(I)?k(I):n(I)}function F(I){return I===62?(e.consume(I),W):n(I)}function W(I){return I===null||ht(I)?L(I):$t(I)?(e.consume(I),W):n(I)}function L(I){return I===45&&a===2?(e.consume(I),j):I===60&&a===1?(e.consume(I),z):I===62&&a===4?(e.consume(I),B):I===63&&a===3?(e.consume(I),P):I===93&&a===5?(e.consume(I),K):ht(I)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(wU,G,V)(I)):I===null||ht(I)?(e.exit("htmlFlowData"),V(I)):(e.consume(I),L)}function V(I){return e.check(SU,q,G)(I)}function q(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),Y}function Y(I){return I===null||ht(I)?V(I):(e.enter("htmlFlowData"),L(I))}function j(I){return I===45?(e.consume(I),P):L(I)}function z(I){return I===47?(e.consume(I),l="",H):L(I)}function H(I){if(I===62){const Q=l.toLowerCase();return lC.includes(Q)?(e.consume(I),B):L(I)}return Er(I)&&l.length<8?(e.consume(I),l+=String.fromCharCode(I),H):L(I)}function K(I){return I===93?(e.consume(I),P):L(I)}function P(I){return I===62?(e.consume(I),B):I===45&&a===2?(e.consume(I),P):L(I)}function B(I){return I===null||ht(I)?(e.exit("htmlFlowData"),G(I)):(e.consume(I),B)}function G(I){return e.exit("htmlFlow"),t(I)}}function CU(e,t,n){const r=this;return a;function a(l){return ht(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):n(l)}function s(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function RU(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(vd,t,n)}}const kU={name:"htmlText",tokenize:MU};function MU(e,t,n){const r=this;let a,s,l;return c;function c(P){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(P),f}function f(P){return P===33?(e.consume(P),d):P===47?(e.consume(P),D):P===63?(e.consume(P),k):Er(P)?(e.consume(P),_):n(P)}function d(P){return P===45?(e.consume(P),m):P===91?(e.consume(P),s=0,x):Er(P)?(e.consume(P),R):n(P)}function m(P){return P===45?(e.consume(P),g):n(P)}function p(P){return P===null?n(P):P===45?(e.consume(P),y):ht(P)?(l=p,z(P)):(e.consume(P),p)}function y(P){return P===45?(e.consume(P),g):p(P)}function g(P){return P===62?j(P):P===45?y(P):p(P)}function x(P){const B="CDATA[";return P===B.charCodeAt(s++)?(e.consume(P),s===B.length?C:x):n(P)}function C(P){return P===null?n(P):P===93?(e.consume(P),T):ht(P)?(l=C,z(P)):(e.consume(P),C)}function T(P){return P===93?(e.consume(P),S):C(P)}function S(P){return P===62?j(P):P===93?(e.consume(P),S):C(P)}function R(P){return P===null||P===62?j(P):ht(P)?(l=R,z(P)):(e.consume(P),R)}function k(P){return P===null?n(P):P===63?(e.consume(P),M):ht(P)?(l=k,z(P)):(e.consume(P),k)}function M(P){return P===62?j(P):k(P)}function D(P){return Er(P)?(e.consume(P),O):n(P)}function O(P){return P===45||mr(P)?(e.consume(P),O):N(P)}function N(P){return ht(P)?(l=N,z(P)):$t(P)?(e.consume(P),N):j(P)}function _(P){return P===45||mr(P)?(e.consume(P),_):P===47||P===62||vn(P)?$(P):n(P)}function $(P){return P===47?(e.consume(P),j):P===58||P===95||Er(P)?(e.consume(P),F):ht(P)?(l=$,z(P)):$t(P)?(e.consume(P),$):j(P)}function F(P){return P===45||P===46||P===58||P===95||mr(P)?(e.consume(P),F):W(P)}function W(P){return P===61?(e.consume(P),L):ht(P)?(l=W,z(P)):$t(P)?(e.consume(P),W):$(P)}function L(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),a=P,V):ht(P)?(l=L,z(P)):$t(P)?(e.consume(P),L):(e.consume(P),q)}function V(P){return P===a?(e.consume(P),a=void 0,Y):P===null?n(P):ht(P)?(l=V,z(P)):(e.consume(P),V)}function q(P){return P===null||P===34||P===39||P===60||P===61||P===96?n(P):P===47||P===62||vn(P)?$(P):(e.consume(P),q)}function Y(P){return P===47||P===62||vn(P)?$(P):n(P)}function j(P){return P===62?(e.consume(P),e.exit("htmlTextData"),e.exit("htmlText"),t):n(P)}function z(P){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),H}function H(P){return $t(P)?en(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):K(P)}function K(P){return e.enter("htmlTextData"),l(P)}}const wx={name:"labelEnd",resolveAll:DU,resolveTo:IU,tokenize:PU},OU={tokenize:LU},AU={tokenize:_U},NU={tokenize:jU};function DU(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&Zr(e,0,e.length,n),e}function IU(e,t){let n=e.length,r=0,a,s,l,c;for(;n--;)if(a=e[n][1],s){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(s=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(l=n);const f={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[s][1].start},end:{...e[l][1].end}},m={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",f,t],["enter",d,t]],c=hi(c,e.slice(s+1,s+r+3)),c=hi(c,[["enter",m,t]]),c=hi(c,kp(t.parser.constructs.insideSpan.null,e.slice(s+r+4,l-3),t)),c=hi(c,[["exit",m,t],e[l-2],e[l-1],["exit",d,t]]),c=hi(c,e.slice(l+1)),c=hi(c,[["exit",f,t]]),Zr(e,s,e.length,c),e}function PU(e,t,n){const r=this;let a=r.events.length,s,l;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){s=r.events[a][1];break}return c;function c(y){return s?s._inactive?p(y):(l=r.parser.defined.includes(Ai(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),f):n(y)}function f(y){return y===40?e.attempt(OU,m,l?m:p)(y):y===91?e.attempt(AU,m,l?d:p)(y):l?m(y):p(y)}function d(y){return e.attempt(NU,m,p)(y)}function m(y){return t(y)}function p(y){return s._balanced=!0,n(y)}}function LU(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),a}function a(p){return vn(p)?qc(e,s)(p):s(p)}function s(p){return p===41?m(p):KM(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return vn(p)?qc(e,f)(p):m(p)}function c(p){return n(p)}function f(p){return p===34||p===39||p===40?XM(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):m(p)}function d(p){return vn(p)?qc(e,m)(p):m(p)}function m(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function _U(e,t,n){const r=this;return a;function a(c){return GM.call(r,e,s,l,"reference","referenceMarker","referenceString")(c)}function s(c){return r.parser.defined.includes(Ai(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function jU(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),a}function a(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const zU={name:"labelStartImage",resolveAll:wx.resolveAll,tokenize:FU};function FU(e,t,n){const r=this;return a;function a(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),s}function s(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const BU={name:"labelStartLink",resolveAll:wx.resolveAll,tokenize:HU};function HU(e,t,n){const r=this;return a;function a(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),s}function s(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const Iy={name:"lineEnding",tokenize:UU};function UU(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),en(e,t,"linePrefix")}}const Th={name:"thematicBreak",tokenize:VU};function VU(e,t,n){let r=0,a;return s;function s(d){return e.enter("thematicBreak"),l(d)}function l(d){return a=d,c(d)}function c(d){return d===a?(e.enter("thematicBreakSequence"),f(d)):r>=3&&(d===null||ht(d))?(e.exit("thematicBreak"),t(d)):n(d)}function f(d){return d===a?(e.consume(d),r++,f):(e.exit("thematicBreakSequence"),$t(d)?en(e,c,"whitespace")(d):c(d))}}const Dr={continuation:{tokenize:WU},exit:GU,name:"list",tokenize:YU},qU={partial:!0,tokenize:XU},$U={partial:!0,tokenize:KU};function YU(e,t,n){const r=this,a=r.events[r.events.length-1];let s=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,l=0;return c;function c(g){const x=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:Wb(g)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(Th,n,d)(g):d(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(g)}return n(g)}function f(g){return Wb(g)&&++l<10?(e.consume(g),f):(!r.interrupt||l<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),d(g)):n(g)}function d(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(vd,r.interrupt?n:m,e.attempt(qU,y,p))}function m(g){return r.containerState.initialBlankLine=!0,s++,y(g)}function p(g){return $t(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),y):n(g)}function y(g){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function WU(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(vd,a,s);function a(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,en(e,t,"listItemIndent",r.containerState.size+1)(c)}function s(c){return r.containerState.furtherBlankLines||!$t(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt($U,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,en(e,e.attempt(Dr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function KU(e,t,n){const r=this;return en(e,a,"listItemIndent",r.containerState.size+1);function a(s){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(s):n(s)}}function GU(e){e.exit(this.containerState.type)}function XU(e,t,n){const r=this;return en(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(s){const l=r.events[r.events.length-1];return!$t(s)&&l&&l[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const uC={name:"setextUnderline",resolveTo:QU,tokenize:ZU};function QU(e,t){let n=e.length,r,a,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",s?(e.splice(a,0,["enter",l,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function ZU(e,t,n){const r=this;let a;return s;function s(d){let m=r.events.length,p;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){p=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),a=d,l(d)):n(d)}function l(d){return e.enter("setextHeadingLineSequence"),c(d)}function c(d){return d===a?(e.consume(d),c):(e.exit("setextHeadingLineSequence"),$t(d)?en(e,f,"lineSuffix")(d):f(d))}function f(d){return d===null||ht(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const JU={tokenize:e6};function e6(e){const t=this,n=e.attempt(vd,r,e.attempt(this.parser.constructs.flowInitial,a,en(e,e.attempt(this.parser.constructs.flow,a,e.attempt(aU,a)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const t6={resolveAll:ZM()},n6=QM("string"),r6=QM("text");function QM(e){return{resolveAll:ZM(e==="text"?i6:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],s=n.attempt(a,l,c);return l;function l(m){return d(m)?s(m):c(m)}function c(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),f}function f(m){return d(m)?(n.exit("data"),s(m)):(n.consume(m),f)}function d(m){if(m===null)return!0;const p=a[m];let y=-1;if(p)for(;++y<p.length;){const g=p[y];if(!g.previous||g.previous.call(r,r.previous))return!0}return!1}}}function ZM(e){return t;function t(n,r){let a=-1,s;for(;++a<=n.length;)s===void 0?n[a]&&n[a][1].type==="data"&&(s=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==s+2&&(n[s][1].end=n[a-1][1].end,n.splice(s+2,a-s-2),a=s+2),s=void 0);return e?e(n,r):n}}function i6(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let s=a.length,l=-1,c=0,f;for(;s--;){const d=a[s];if(typeof d=="string"){for(l=d.length;d.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(d===-2)f=!0,c++;else if(d!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const d={type:n===e.length||f||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?l:r.start._bufferIndex+l,_index:r.start._index+s,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const a6={42:Dr,43:Dr,45:Dr,48:Dr,49:Dr,50:Dr,51:Dr,52:Dr,53:Dr,54:Dr,55:Dr,56:Dr,57:Dr,62:qM},o6={91:cU},s6={[-2]:Dy,[-1]:Dy,32:Dy},l6={35:gU,42:Th,45:[uC,Th],60:xU,61:uC,95:Th,96:sC,126:sC},u6={38:YM,92:$M},c6={[-5]:Iy,[-4]:Iy,[-3]:Iy,33:zU,38:YM,42:Kb,60:[BH,kU],91:BU,92:[pU,$M],93:wx,95:Kb,96:JH},d6={null:[Kb,t6]},f6={null:[42,95]},h6={null:[]},p6=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:f6,contentInitial:o6,disable:h6,document:a6,flow:l6,flowInitial:s6,insideSpan:d6,string:u6,text:c6},Symbol.toStringTag,{value:"Module"}));function m6(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},s=[];let l=[],c=[];const f={attempt:N(D),check:N(O),consume:R,enter:k,exit:M,interrupt:N(O,{interrupt:!0})},d={code:null,containerState:{},defineSkip:C,events:[],now:x,parser:e,previous:null,sliceSerialize:y,sliceStream:g,write:p};let m=t.tokenize.call(d,f);return t.resolveAll&&s.push(t),d;function p(W){return l=hi(l,W),T(),l[l.length-1]!==null?[]:(_(t,0),d.events=kp(s,d.events,d),d.events)}function y(W,L){return y6(g(W),L)}function g(W){return g6(l,W)}function x(){const{_bufferIndex:W,_index:L,line:V,column:q,offset:Y}=r;return{_bufferIndex:W,_index:L,line:V,column:q,offset:Y}}function C(W){a[W.line]=W.column,F()}function T(){let W;for(;r._index<l.length;){const L=l[r._index];if(typeof L=="string")for(W=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===W&&r._bufferIndex<L.length;)S(L.charCodeAt(r._bufferIndex));else S(L)}}function S(W){m=m(W)}function R(W){ht(W)?(r.line++,r.column=1,r.offset+=W===-3?2:1,F()):W!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=W}function k(W,L){const V=L||{};return V.type=W,V.start=x(),d.events.push(["enter",V,d]),c.push(V),V}function M(W){const L=c.pop();return L.end=x(),d.events.push(["exit",L,d]),L}function D(W,L){_(W,L.from)}function O(W,L){L.restore()}function N(W,L){return V;function V(q,Y,j){let z,H,K,P;return Array.isArray(q)?G(q):"tokenize"in q?G([q]):B(q);function B(ie){return ce;function ce(ge){const Ee=ge!==null&&ie[ge],_e=ge!==null&&ie.null,Ie=[...Array.isArray(Ee)?Ee:Ee?[Ee]:[],...Array.isArray(_e)?_e:_e?[_e]:[]];return G(Ie)(ge)}}function G(ie){return z=ie,H=0,ie.length===0?j:I(ie[H])}function I(ie){return ce;function ce(ge){return P=$(),K=ie,ie.partial||(d.currentConstruct=ie),ie.name&&d.parser.constructs.disable.null.includes(ie.name)?Z():ie.tokenize.call(L?Object.assign(Object.create(d),L):d,f,Q,Z)(ge)}}function Q(ie){return W(K,P),Y}function Z(ie){return P.restore(),++H<z.length?I(z[H]):j}}}function _(W,L){W.resolveAll&&!s.includes(W)&&s.push(W),W.resolve&&Zr(d.events,L,d.events.length-L,W.resolve(d.events.slice(L),d)),W.resolveTo&&(d.events=W.resolveTo(d.events,d))}function $(){const W=x(),L=d.previous,V=d.currentConstruct,q=d.events.length,Y=Array.from(c);return{from:q,restore:j};function j(){r=W,d.previous=L,d.currentConstruct=V,d.events.length=q,c=Y,F()}}function F(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function g6(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,s=t.end._bufferIndex;let l;if(n===a)l=[e[n].slice(r,s)];else{if(l=e.slice(n,a),r>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}s>0&&l.push(e[a].slice(0,s))}return l}function y6(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const s=e[n];let l;if(typeof s=="string")l=s;else switch(s){case-5:{l="\r";break}case-4:{l=`
334
+ `;break}case-3:{l=`\r
335
+ `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&a)continue;l=" ";break}default:l=String.fromCharCode(s)}a=s===-2,r.push(l)}return r.join("")}function b6(e){const r={constructs:UM([p6,...(e||{}).extensions||[]]),content:a(IH),defined:[],document:a(LH),flow:a(JU),lazy:{},string:a(n6),text:a(r6)};return r;function a(s){return l;function l(c){return m6(r,s,c)}}}function v6(e){for(;!WM(e););return e}const cC=/[\0\t\n\r]/g;function x6(){let e=1,t="",n=!0,r;return a;function a(s,l,c){const f=[];let d,m,p,y,g;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(l||void 0).decode(s)),p=0,t="",n&&(s.charCodeAt(0)===65279&&p++,n=void 0);p<s.length;){if(cC.lastIndex=p,d=cC.exec(s),y=d&&d.index!==void 0?d.index:s.length,g=s.charCodeAt(y),!d){t=s.slice(p);break}if(g===10&&p===y&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),p<y&&(f.push(s.slice(p,y)),e+=y-p),g){case 0:{f.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,f.push(-2);e++<m;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:r=!0,e=1}p=y+1}return c&&(r&&f.push(-5),t&&f.push(t),f.push(null)),f}}const w6=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function S6(e){return e.replace(w6,E6)}function E6(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),s=a===120||a===88;return VM(n.slice(s?2:1),s?16:10)}return xx(n)||e}const JM={}.hasOwnProperty;function T6(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),C6(n)(v6(b6(n).document().write(x6()(e,t,!0))))}function C6(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(J),autolinkProtocol:$,autolinkEmail:$,atxHeading:s(Pe),blockQuote:s(_e),characterEscape:$,characterReference:$,codeFenced:s(Ie),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s(Ie,l),codeText:s(re,l),codeTextData:$,data:$,codeFlowValue:$,definition:s(he),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s(be),hardBreakEscape:s(Ae),hardBreakTrailing:s(Ae),htmlFlow:s(Se,l),htmlFlowData:$,htmlText:s(Se,l),htmlTextData:$,image:s(Ce),label:l,link:s(J),listItem:s(xe),listItemValue:y,listOrdered:s(Re,p),listUnordered:s(Re),paragraph:s(Be),reference:I,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s(Pe),strong:s($e),thematicBreak:s(De)},exit:{atxHeading:f(),atxHeadingSequence:D,autolink:f(),autolinkEmail:Ee,autolinkProtocol:ge,blockQuote:f(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:Z,characterReferenceMarkerNumeric:Z,characterReferenceValue:ie,characterReference:ce,codeFenced:f(T),codeFencedFence:C,codeFencedFenceInfo:g,codeFencedFenceMeta:x,codeFlowValue:F,codeIndented:f(S),codeText:f(Y),codeTextData:F,data:F,definition:f(),definitionDestinationString:M,definitionLabelString:R,definitionTitleString:k,emphasis:f(),hardBreakEscape:f(L),hardBreakTrailing:f(L),htmlFlow:f(V),htmlFlowData:F,htmlText:f(q),htmlTextData:F,image:f(z),label:K,labelText:H,lineEnding:W,link:f(j),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:Q,resourceDestinationString:P,resourceTitleString:B,resource:G,setextHeading:f(_),setextHeadingLineSequence:N,setextHeadingText:O,strong:f(),thematicBreak:f()}};eO(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(se){let ye={type:"root",children:[]};const we={stack:[ye],tokenStack:[],config:t,enter:c,exit:d,buffer:l,resume:m,data:n},Me=[];let Fe=-1;for(;++Fe<se.length;)if(se[Fe][1].type==="listOrdered"||se[Fe][1].type==="listUnordered")if(se[Fe][0]==="enter")Me.push(Fe);else{const ct=Me.pop();Fe=a(se,ct,Fe)}for(Fe=-1;++Fe<se.length;){const ct=t[se[Fe][0]];JM.call(ct,se[Fe][1].type)&&ct[se[Fe][1].type].call(Object.assign({sliceSerialize:se[Fe][2].sliceSerialize},we),se[Fe][1])}if(we.tokenStack.length>0){const ct=we.tokenStack[we.tokenStack.length-1];(ct[1]||dC).call(we,void 0,ct[0])}for(ye.position={start:fo(se.length>0?se[0][1].start:{line:1,column:1,offset:0}),end:fo(se.length>0?se[se.length-2][1].end:{line:1,column:1,offset:0})},Fe=-1;++Fe<t.transforms.length;)ye=t.transforms[Fe](ye)||ye;return ye}function a(se,ye,we){let Me=ye-1,Fe=-1,ct=!1,bt,Ot,We,ot;for(;++Me<=we;){const st=se[Me];switch(st[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{st[0]==="enter"?Fe++:Fe--,ot=void 0;break}case"lineEndingBlank":{st[0]==="enter"&&(bt&&!ot&&!Fe&&!We&&(We=Me),ot=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ot=void 0}if(!Fe&&st[0]==="enter"&&st[1].type==="listItemPrefix"||Fe===-1&&st[0]==="exit"&&(st[1].type==="listUnordered"||st[1].type==="listOrdered")){if(bt){let jt=Me;for(Ot=void 0;jt--;){const zt=se[jt];if(zt[1].type==="lineEnding"||zt[1].type==="lineEndingBlank"){if(zt[0]==="exit")continue;Ot&&(se[Ot][1].type="lineEndingBlank",ct=!0),zt[1].type="lineEnding",Ot=jt}else if(!(zt[1].type==="linePrefix"||zt[1].type==="blockQuotePrefix"||zt[1].type==="blockQuotePrefixWhitespace"||zt[1].type==="blockQuoteMarker"||zt[1].type==="listItemIndent"))break}We&&(!Ot||We<Ot)&&(bt._spread=!0),bt.end=Object.assign({},Ot?se[Ot][1].start:st[1].end),se.splice(Ot||Me,0,["exit",bt,st[2]]),Me++,we++}if(st[1].type==="listItemPrefix"){const jt={type:"listItem",_spread:!1,start:Object.assign({},st[1].start),end:void 0};bt=jt,se.splice(Me,0,["enter",jt,st[2]]),Me++,we++,We=void 0,ot=!0}}}return se[ye][1]._spread=ct,we}function s(se,ye){return we;function we(Me){c.call(this,se(Me),Me),ye&&ye.call(this,Me)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(se,ye,we){this.stack[this.stack.length-1].children.push(se),this.stack.push(se),this.tokenStack.push([ye,we||void 0]),se.position={start:fo(ye.start),end:void 0}}function f(se){return ye;function ye(we){se&&se.call(this,we),d.call(this,we)}}function d(se,ye){const we=this.stack.pop(),Me=this.tokenStack.pop();if(Me)Me[0].type!==se.type&&(ye?ye.call(this,se,Me[0]):(Me[1]||dC).call(this,se,Me[0]));else throw new Error("Cannot close `"+se.type+"` ("+Vc({start:se.start,end:se.end})+"): it’s not open");we.position.end=fo(se.end)}function m(){return vx(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function y(se){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(se),10),this.data.expectingFirstListItemValue=void 0}}function g(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=se}function x(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=se}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.value=se.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.value=se.replace(/(\r?\n|\r)$/g,"")}function R(se){const ye=this.resume(),we=this.stack[this.stack.length-1];we.label=ye,we.identifier=Ai(this.sliceSerialize(se)).toLowerCase()}function k(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.title=se}function M(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.url=se}function D(se){const ye=this.stack[this.stack.length-1];if(!ye.depth){const we=this.sliceSerialize(se).length;ye.depth=we}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function N(se){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(se).codePointAt(0)===61?1:2}function _(){this.data.setextHeadingSlurpLineEnding=void 0}function $(se){const we=this.stack[this.stack.length-1].children;let Me=we[we.length-1];(!Me||Me.type!=="text")&&(Me=te(),Me.position={start:fo(se.start),end:void 0},we.push(Me)),this.stack.push(Me)}function F(se){const ye=this.stack.pop();ye.value+=this.sliceSerialize(se),ye.position.end=fo(se.end)}function W(se){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const we=ye.children[ye.children.length-1];we.position.end=fo(se.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ye.type)&&($.call(this,se),F.call(this,se))}function L(){this.data.atHardBreak=!0}function V(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.value=se}function q(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.value=se}function Y(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.value=se}function j(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=ye,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function z(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=ye,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function H(se){const ye=this.sliceSerialize(se),we=this.stack[this.stack.length-2];we.label=S6(ye),we.identifier=Ai(ye).toLowerCase()}function K(){const se=this.stack[this.stack.length-1],ye=this.resume(),we=this.stack[this.stack.length-1];if(this.data.inReference=!0,we.type==="link"){const Me=se.children;we.children=Me}else we.alt=ye}function P(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.url=se}function B(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.title=se}function G(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function Q(se){const ye=this.resume(),we=this.stack[this.stack.length-1];we.label=ye,we.identifier=Ai(this.sliceSerialize(se)).toLowerCase(),this.data.referenceType="full"}function Z(se){this.data.characterReferenceType=se.type}function ie(se){const ye=this.sliceSerialize(se),we=this.data.characterReferenceType;let Me;we?(Me=VM(ye,we==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Me=xx(ye);const Fe=this.stack[this.stack.length-1];Fe.value+=Me}function ce(se){const ye=this.stack.pop();ye.position.end=fo(se.end)}function ge(se){F.call(this,se);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(se)}function Ee(se){F.call(this,se);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(se)}function _e(){return{type:"blockquote",children:[]}}function Ie(){return{type:"code",lang:null,meta:null,value:""}}function re(){return{type:"inlineCode",value:""}}function he(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function be(){return{type:"emphasis",children:[]}}function Pe(){return{type:"heading",depth:0,children:[]}}function Ae(){return{type:"break"}}function Se(){return{type:"html",value:""}}function Ce(){return{type:"image",title:null,url:"",alt:null}}function J(){return{type:"link",title:null,url:"",children:[]}}function Re(se){return{type:"list",ordered:se.type==="listOrdered",start:null,spread:se._spread,children:[]}}function xe(se){return{type:"listItem",spread:se._spread,checked:null,children:[]}}function Be(){return{type:"paragraph",children:[]}}function $e(){return{type:"strong",children:[]}}function te(){return{type:"text",value:""}}function De(){return{type:"thematicBreak"}}}function fo(e){return{line:e.line,column:e.column,offset:e.offset}}function eO(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?eO(e,r):R6(e,r)}}function R6(e,t){let n;for(n in t)if(JM.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function dC(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Vc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Vc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Vc({start:t.start,end:t.end})+") is still open")}function k6(e){const t=this;t.parser=n;function n(r){return T6(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function M6(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function O6(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
336
+ `}]}function A6(e,t){const n=t.value?t.value+`
337
+ `:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function N6(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function D6(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function I6(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=vu(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let l,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=s+1,c+=1,e.footnoteCounts.set(r,c);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,f);const d={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,d),e.applyData(t,d)}function P6(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function L6(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function tO(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const a=e.all(t),s=a[0];s&&s.type==="text"?s.value="["+s.value:a.unshift({type:"text",value:"["});const l=a[a.length-1];return l&&l.type==="text"?l.value+=r:a.push({type:"text",value:r}),a}function _6(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return tO(e,t);const a={src:vu(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const s={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,s),e.applyData(t,s)}function j6(e,t){const n={src:vu(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function z6(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function F6(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return tO(e,t);const a={href:vu(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const s={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function B6(e,t){const n={href:vu(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function H6(e,t,n){const r=e.all(t),a=n?U6(n):nO(t),s={},l=[];if(typeof t.checked=="boolean"){const m=r[0];let p;m&&m.type==="element"&&m.tagName==="p"?p=m:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const m=r[c];(a||c!==0||m.type!=="element"||m.tagName!=="p")&&l.push({type:"text",value:`
338
+ `}),m.type==="element"&&m.tagName==="p"&&!a?l.push(...m.children):l.push(m)}const f=r[r.length-1];f&&(a||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
339
+ `});const d={type:"element",tagName:"li",properties:s,children:l};return e.patch(t,d),e.applyData(t,d)}function U6(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=nO(n[r])}return t}function nO(e){const t=e.spread;return t??e.children.length>1}function V6(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const l=r[a];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function q6(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $6(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Y6(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function W6(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),a.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=mx(t.children[1]),f=LM(t.children[t.children.length-1]);c&&f&&(l.position={start:c,end:f}),a.push(l)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,s),e.applyData(t,s)}function K6(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,c=l?l.length:t.children.length;let f=-1;const d=[];for(;++f<c;){const p=t.children[f],y={},g=l?l[f]:void 0;g&&(y.align=g);let x={type:"element",tagName:s,properties:y,children:[]};p&&(x.children=e.all(p),e.patch(p,x),x=e.applyData(p,x)),d.push(x)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,m),e.applyData(t,m)}function G6(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const fC=9,hC=32;function X6(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const s=[];for(;r;)s.push(pC(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return s.push(pC(t.slice(a),a>0,!1)),s.join("")}function pC(e,t,n){let r=0,a=e.length;if(t){let s=e.codePointAt(r);for(;s===fC||s===hC;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(a-1);for(;s===fC||s===hC;)a--,s=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function Q6(e,t){const n={type:"text",value:X6(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Z6(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const J6={blockquote:M6,break:O6,code:A6,delete:N6,emphasis:D6,footnoteReference:I6,heading:P6,html:L6,imageReference:_6,image:j6,inlineCode:z6,linkReference:F6,link:B6,listItem:H6,list:V6,paragraph:q6,root:$6,strong:Y6,table:W6,tableCell:G6,tableRow:K6,text:Q6,thematicBreak:Z6,toml:Qf,yaml:Qf,definition:Qf,footnoteDefinition:Qf};function Qf(){}const rO=-1,Mp=0,$c=1,Uh=2,Sx=3,Ex=4,Tx=5,Cx=6,iO=7,aO=8,e8=typeof self=="object"?self:globalThis,mC=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new e8[e](t)},t8=(e,t)=>{const n=(a,s)=>(e.set(s,a),a),r=a=>{if(e.has(a))return e.get(a);const[s,l]=t[a];switch(s){case Mp:case rO:return n(l,a);case $c:{const c=n([],a);for(const f of l)c.push(r(f));return c}case Uh:{const c=n({},a);for(const[f,d]of l)c[r(f)]=r(d);return c}case Sx:return n(new Date(l),a);case Ex:{const{source:c,flags:f}=l;return n(new RegExp(c,f),a)}case Tx:{const c=n(new Map,a);for(const[f,d]of l)c.set(r(f),r(d));return c}case Cx:{const c=n(new Set,a);for(const f of l)c.add(r(f));return c}case iO:{const{name:c,message:f}=l;return n(mC(c,f),a)}case aO:return n(BigInt(l),a);case"BigInt":return n(Object(BigInt(l)),a);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(mC(s,l),a)};return r},gC=e=>t8(new Map,e)(0),Ml="",{toString:n8}={},{keys:r8}=Object,Rc=e=>{const t=typeof e;if(t!=="object"||!e)return[Mp,t];const n=n8.call(e).slice(8,-1);switch(n){case"Array":return[$c,Ml];case"Object":return[Uh,Ml];case"Date":return[Sx,Ml];case"RegExp":return[Ex,Ml];case"Map":return[Tx,Ml];case"Set":return[Cx,Ml];case"DataView":return[$c,n]}return n.includes("Array")?[$c,n]:n.includes("Error")?[iO,n]:[Uh,n]},Zf=([e,t])=>e===Mp&&(t==="function"||t==="symbol"),i8=(e,t,n,r)=>{const a=(l,c)=>{const f=r.push(l)-1;return n.set(c,f),f},s=l=>{if(n.has(l))return n.get(l);let[c,f]=Rc(l);switch(c){case Mp:{let m=l;switch(f){case"bigint":c=aO,m=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);m=null;break;case"undefined":return a([rO],l)}return a([c,m],l)}case $c:{if(f){let y=l;return f==="DataView"?y=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(y=new Uint8Array(l)),a([f,[...y]],l)}const m=[],p=a([c,m],l);for(const y of l)m.push(s(y));return p}case Uh:{if(f)switch(f){case"BigInt":return a([f,l.toString()],l);case"Boolean":case"Number":case"String":return a([f,l.valueOf()],l)}if(t&&"toJSON"in l)return s(l.toJSON());const m=[],p=a([c,m],l);for(const y of r8(l))(e||!Zf(Rc(l[y])))&&m.push([s(y),s(l[y])]);return p}case Sx:return a([c,l.toISOString()],l);case Ex:{const{source:m,flags:p}=l;return a([c,{source:m,flags:p}],l)}case Tx:{const m=[],p=a([c,m],l);for(const[y,g]of l)(e||!(Zf(Rc(y))||Zf(Rc(g))))&&m.push([s(y),s(g)]);return p}case Cx:{const m=[],p=a([c,m],l);for(const y of l)(e||!Zf(Rc(y)))&&m.push(s(y));return p}}const{message:d}=l;return a([c,{name:f,message:d}],l)};return s},yC=(e,{json:t,lossy:n}={})=>{const r=[];return i8(!(t||n),!!t,new Map,r)(e),r},Vh=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?gC(yC(e,t)):structuredClone(e):(e,t)=>gC(yC(e,t));function a8(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function o8(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function s8(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||a8,r=e.options.footnoteBackLabel||o8,a=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let f=-1;for(;++f<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[f]);if(!d)continue;const m=e.all(d),p=String(d.identifier).toUpperCase(),y=vu(p.toLowerCase());let g=0;const x=[],C=e.footnoteCounts.get(p);for(;C!==void 0&&++g<=C;){x.length>0&&x.push({type:"text",value:" "});let R=typeof n=="string"?n:n(f,g);typeof R=="string"&&(R={type:"text",value:R}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,g),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const T=m[m.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const R=T.children[T.children.length-1];R&&R.type==="text"?R.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(...x)}else m.push(...x);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(m,!0)};e.patch(d,S),c.push(S)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Vh(l),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
340
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
341
+ `}]}}const Op=(function(e){if(e==null)return d8;if(typeof e=="function")return Ap(e);if(typeof e=="object")return Array.isArray(e)?l8(e):u8(e);if(typeof e=="string")return c8(e);throw new Error("Expected function, string, or object as test")});function l8(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Op(e[n]);return Ap(r);function r(...a){let s=-1;for(;++s<t.length;)if(t[s].apply(this,a))return!0;return!1}}function u8(e){const t=e;return Ap(n);function n(r){const a=r;let s;for(s in e)if(a[s]!==t[s])return!1;return!0}}function c8(e){return Ap(t);function t(n){return n&&n.type===e}}function Ap(e){return t;function t(n,r,a){return!!(f8(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function d8(){return!0}function f8(e){return e!==null&&typeof e=="object"&&"type"in e}const oO=[],h8=!0,Gb=!1,p8="skip";function sO(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const s=Op(a),l=r?-1:1;c(e,void 0,[])();function c(f,d,m){const p=f&&typeof f=="object"?f:{};if(typeof p.type=="string"){const g=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(f.type+(g?"<"+g+">":""))+")"})}return y;function y(){let g=oO,x,C,T;if((!t||s(f,d,m[m.length-1]||void 0))&&(g=m8(n(f,m)),g[0]===Gb))return g;if("children"in f&&f.children){const S=f;if(S.children&&g[0]!==p8)for(C=(r?S.children.length:-1)+l,T=m.concat(S);C>-1&&C<S.children.length;){const R=S.children[C];if(x=c(R,C,T)(),x[0]===Gb)return x;C=typeof x[1]=="number"?x[1]:C+l}}return g}}}function m8(e){return Array.isArray(e)?e:typeof e=="number"?[h8,e]:e==null?oO:[e]}function Rx(e,t,n,r){let a,s,l;typeof t=="function"&&typeof n!="function"?(s=void 0,l=t,a=n):(s=t,l=n,a=r),sO(e,s,c,a);function c(f,d){const m=d[d.length-1],p=m?m.children.indexOf(f):void 0;return l(f,p,m)}}const Xb={}.hasOwnProperty,g8={};function y8(e,t){const n=t||g8,r=new Map,a=new Map,s=new Map,l={...J6,...n.handlers},c={all:d,applyData:v8,definitionById:r,footnoteById:a,footnoteCounts:s,footnoteOrder:[],handlers:l,one:f,options:n,patch:b8,wrap:w8};return Rx(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const p=m.type==="definition"?r:a,y=String(m.identifier).toUpperCase();p.has(y)||p.set(y,m)}}),c;function f(m,p){const y=m.type,g=c.handlers[y];if(Xb.call(c.handlers,y)&&g)return g(c,m,p);if(c.options.passThrough&&c.options.passThrough.includes(y)){if("children"in m){const{children:C,...T}=m,S=Vh(T);return S.children=c.all(m),S}return Vh(m)}return(c.options.unknownHandler||x8)(c,m,p)}function d(m){const p=[];if("children"in m){const y=m.children;let g=-1;for(;++g<y.length;){const x=c.one(y[g],m);if(x){if(g&&y[g-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=bC(x.value)),!Array.isArray(x)&&x.type==="element")){const C=x.children[0];C&&C.type==="text"&&(C.value=bC(C.value))}Array.isArray(x)?p.push(...x):p.push(x)}}}return p}}function b8(e,t){e.position&&(t.position=aH(e))}function v8(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&s&&Object.assign(n.properties,Vh(s)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function x8(e,t){const n=t.data||{},r="value"in t&&!(Xb.call(n,"hProperties")||Xb.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function w8(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
342
+ `});++r<e.length;)r&&n.push({type:"text",value:`
343
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
344
+ `}),n}function bC(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function vC(e,t){const n=y8(e,t),r=n.one(e,void 0),a=s8(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&s.children.push({type:"text",value:`
345
+ `},a),s}function S8(e,t){return e&&"run"in e?async function(n,r){const a=vC(n,{file:r,...t});await e.run(a,r)}:function(n,r){return vC(n,{file:r,...e||t})}}function xC(e){if(e)throw e}var Py,wC;function E8(){if(wC)return Py;wC=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},s=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var m=e.call(d,"constructor"),p=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!m&&!p)return!1;var y;for(y in d);return typeof y>"u"||e.call(d,y)},l=function(d,m){n&&m.name==="__proto__"?n(d,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):d[m.name]=m.newValue},c=function(d,m){if(m==="__proto__")if(e.call(d,m)){if(r)return r(d,m).value}else return;return d[m]};return Py=function f(){var d,m,p,y,g,x,C=arguments[0],T=1,S=arguments.length,R=!1;for(typeof C=="boolean"&&(R=C,C=arguments[1]||{},T=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});T<S;++T)if(d=arguments[T],d!=null)for(m in d)p=c(C,m),y=c(d,m),C!==y&&(R&&y&&(s(y)||(g=a(y)))?(g?(g=!1,x=p&&a(p)?p:[]):x=p&&s(p)?p:{},l(C,{name:m,newValue:f(R,x,y)})):typeof y<"u"&&l(C,{name:m,newValue:y}));return C},Py}var T8=E8();const Ly=sp(T8);function Qb(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function C8(){const e=[],t={run:n,use:r};return t;function n(...a){let s=-1;const l=a.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...a);function c(f,...d){const m=e[++s];let p=-1;if(f){l(f);return}for(;++p<a.length;)(d[p]===null||d[p]===void 0)&&(d[p]=a[p]);a=d,m?R8(m,c)(...d):l(null,...d)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function R8(e,t){let n;return r;function r(...l){const c=e.length>l.length;let f;c&&l.push(a);try{f=e.apply(this,l)}catch(d){const m=d;if(c&&n)throw m;return a(m)}c||(f&&f.then&&typeof f.then=="function"?f.then(s,a):f instanceof Error?a(f):s(f))}function a(l,...c){n||(n=!0,t(l,...c))}function s(l){a(null,l)}}const Bi={basename:k8,dirname:M8,extname:O8,join:A8,sep:"/"};function k8(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');xd(e);let n=0,r=-1,a=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(s){n=a+1;break}}else r<0&&(s=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,c=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(s){n=a+1;break}}else l<0&&(s=!0,l=a+1),c>-1&&(e.codePointAt(a)===t.codePointAt(c--)?c<0&&(r=a):(c=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function M8(e){if(xd(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function O8(e){xd(e);let t=e.length,n=-1,r=0,a=-1,s=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?a<0?a=t:s!==1&&(s=1):a>-1&&(s=-1)}return a<0||n<0||s===0||s===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function A8(...e){let t=-1,n;for(;++t<e.length;)xd(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":N8(n)}function N8(e){xd(e);const t=e.codePointAt(0)===47;let n=D8(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function D8(e,t){let n="",r=0,a=-1,s=0,l=-1,c,f;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(a===l-1||s===1))if(a!==l-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),a=l,s=0;continue}}else if(n.length>0){n="",r=0,a=l,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,l):n=e.slice(a+1,l),r=l-a-1;a=l,s=0}else c===46&&s>-1?s++:s=-1}return n}function xd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const I8={cwd:P8};function P8(){return"/"}function Zb(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function L8(e){if(typeof e=="string")e=new URL(e);else if(!Zb(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return _8(e)}function _8(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const _y=["history","path","basename","stem","extname","dirname"];class lO{constructor(t){let n;t?Zb(t)?n={path:t}:typeof t=="string"||j8(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":I8.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<_y.length;){const s=_y[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let a;for(a in n)_y.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?Bi.basename(this.path):void 0}set basename(t){zy(t,"basename"),jy(t,"basename"),this.path=Bi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Bi.dirname(this.path):void 0}set dirname(t){SC(this.basename,"dirname"),this.path=Bi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Bi.extname(this.path):void 0}set extname(t){if(jy(t,"extname"),SC(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Bi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Zb(t)&&(t=L8(t)),zy(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Bi.basename(this.path,this.extname):void 0}set stem(t){zy(t,"stem"),jy(t,"stem"),this.path=Bi.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new gr(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function jy(e,t){if(e&&e.includes(Bi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Bi.sep+"`")}function zy(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function SC(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function j8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const z8=(function(e){const r=this.constructor.prototype,a=r[e],s=function(){return a.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),F8={}.hasOwnProperty;class kx extends z8{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=C8()}copy(){const t=new kx;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Ly(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Hy("data",this.frozen),this.namespace[t]=n,this):F8.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Hy("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Jf(t),r=this.parser||this.Parser;return Fy("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Fy("process",this.parser||this.Parser),By("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(s,l){const c=Jf(t),f=r.parse(c);r.run(f,c,function(m,p,y){if(m||!p||!y)return d(m);const g=p,x=r.stringify(g,y);U8(x)?y.value=x:y.result=x,d(m,y)});function d(m,p){m||!p?l(m):s?s(p):n(void 0,p)}}}processSync(t){let n=!1,r;return this.freeze(),Fy("processSync",this.parser||this.Parser),By("processSync",this.compiler||this.Compiler),this.process(t,a),TC("processSync","process",n),r;function a(s,l){n=!0,xC(s),r=l}}run(t,n,r){EC(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(l,c){const f=Jf(n);a.run(t,f,d);function d(m,p,y){const g=p||t;m?c(m):l?l(g):r(void 0,g,y)}}}runSync(t,n){let r=!1,a;return this.run(t,n,s),TC("runSync","run",r),a;function s(l,c){xC(l),a=c,r=!0}}stringify(t,n){this.freeze();const r=Jf(n),a=this.compiler||this.Compiler;return By("stringify",a),EC(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(Hy("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(d){if(typeof d=="function")f(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[m,...p]=d;f(m,p)}else l(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function l(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(d.plugins),d.settings&&(a.settings=Ly(!0,a.settings,d.settings))}function c(d){let m=-1;if(d!=null)if(Array.isArray(d))for(;++m<d.length;){const p=d[m];s(p)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function f(d,m){let p=-1,y=-1;for(;++p<r.length;)if(r[p][0]===d){y=p;break}if(y===-1)r.push([d,...m]);else if(m.length>0){let[g,...x]=m;const C=r[y][1];Qb(C)&&Qb(g)&&(g=Ly(!0,C,g)),r[y]=[d,g,...x]}}}}const B8=new kx().freeze();function Fy(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function By(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Hy(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function EC(e){if(!Qb(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function TC(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Jf(e){return H8(e)?e:new lO(e)}function H8(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function U8(e){return typeof e=="string"||V8(e)}function V8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const q8="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",CC=[],RC={allowDangerousHtml:!0},$8=/^(https?|ircs?|mailto|xmpp)$/i,Y8=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function W8(e){const t=K8(e),n=G8(e);return X8(t.runSync(t.parse(n),n),e)}function K8(e){const t=e.rehypePlugins||CC,n=e.remarkPlugins||CC,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...RC}:RC;return B8().use(k6).use(n).use(S8,r).use(t)}function G8(e){const t=e.children||"",n=new lO;return typeof t=="string"&&(n.value=t),n}function X8(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,s=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,f=t.urlTransform||Q8;for(const m of Y8)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+q8+m.id,void 0);return Rx(e,d),cH(e,{Fragment:E.Fragment,components:a,ignoreInvalidStyle:!0,jsx:E.jsx,jsxs:E.jsxs,passKeys:!0,passNode:!0});function d(m,p,y){if(m.type==="raw"&&y&&typeof p=="number")return l?y.children.splice(p,1):y.children[p]={type:"text",value:m.value},p;if(m.type==="element"){let g;for(g in Ny)if(Object.hasOwn(Ny,g)&&Object.hasOwn(m.properties,g)){const x=m.properties[g],C=Ny[g];(C===null||C.includes(m.tagName))&&(m.properties[g]=f(String(x||""),g,m))}}if(m.type==="element"){let g=n?!n.includes(m.tagName):s?s.includes(m.tagName):!1;if(!g&&r&&typeof p=="number"&&(g=!r(m,p,y)),g&&y&&typeof p=="number")return c&&m.children?y.children.splice(p,1,...m.children):y.children.splice(p,1),p}}}function Q8(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||$8.test(e.slice(0,t))?e:""}function kC(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function Z8(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function J8(e,t,n){const a=Op((n||{}).ignore||[]),s=e9(t);let l=-1;for(;++l<s.length;)sO(e,"text",c);function c(d,m){let p=-1,y;for(;++p<m.length;){const g=m[p],x=y?y.children:void 0;if(a(g,x?x.indexOf(g):void 0,y))return;y=g}if(y)return f(d,m)}function f(d,m){const p=m[m.length-1],y=s[l][0],g=s[l][1];let x=0;const T=p.children.indexOf(d);let S=!1,R=[];y.lastIndex=0;let k=y.exec(d.value);for(;k;){const M=k.index,D={index:k.index,input:k.input,stack:[...m,d]};let O=g(...k,D);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1?y.lastIndex=M+1:(x!==M&&R.push({type:"text",value:d.value.slice(x,M)}),Array.isArray(O)?R.push(...O):O&&R.push(O),x=M+k[0].length,S=!0),!y.global)break;k=y.exec(d.value)}return S?(x<d.value.length&&R.push({type:"text",value:d.value.slice(x)}),p.children.splice(T,1,...R)):R=[d],T+R.length}}function e9(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const a=n[r];t.push([t9(a[0]),n9(a[1])])}return t}function t9(e){return typeof e=="string"?new RegExp(Z8(e),"g"):e}function n9(e){return typeof e=="function"?e:function(){return e}}const Uy="phrasing",Vy=["autolink","link","image","label"];function r9(){return{transforms:[c9],enter:{literalAutolink:a9,literalAutolinkEmail:qy,literalAutolinkHttp:qy,literalAutolinkWww:qy},exit:{literalAutolink:u9,literalAutolinkEmail:l9,literalAutolinkHttp:o9,literalAutolinkWww:s9}}}function i9(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Uy,notInConstruct:Vy},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Uy,notInConstruct:Vy},{character:":",before:"[ps]",after:"\\/",inConstruct:Uy,notInConstruct:Vy}]}}function a9(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function qy(e){this.config.enter.autolinkProtocol.call(this,e)}function o9(e){this.config.exit.autolinkProtocol.call(this,e)}function s9(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function l9(e){this.config.exit.autolinkEmail.call(this,e)}function u9(e){this.exit(e)}function c9(e){J8(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,d9],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),f9]],{ignore:["link","linkReference"]})}function d9(e,t,n,r,a){let s="";if(!uO(a)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!h9(n)))return!1;const l=p9(n+r);if(!l[0])return!1;const c={type:"link",title:null,url:s+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function f9(e,t,n,r){return!uO(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function h9(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function p9(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=kC(e,"(");let s=kC(e,")");for(;r!==-1&&a>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function uO(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||js(n)||Rp(n))&&(!t||n!==47)}cO.peek=E9;function m9(){this.buffer()}function g9(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function y9(){this.buffer()}function b9(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function v9(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ai(this.sliceSerialize(e)).toLowerCase(),n.label=t}function x9(e){this.exit(e)}function w9(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ai(this.sliceSerialize(e)).toLowerCase(),n.label=t}function S9(e){this.exit(e)}function E9(){return"["}function cO(e,t,n,r){const a=n.createTracker(r);let s=a.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return s+=a.move(n.safe(n.associationId(e),{after:"]",before:s})),c(),l(),s+=a.move("]"),s}function T9(){return{enter:{gfmFootnoteCallString:m9,gfmFootnoteCall:g9,gfmFootnoteDefinitionLabelString:y9,gfmFootnoteDefinition:b9},exit:{gfmFootnoteCallString:v9,gfmFootnoteCall:x9,gfmFootnoteDefinitionLabelString:w9,gfmFootnoteDefinition:S9}}}function C9(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:cO},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,s,l){const c=s.createTracker(l);let f=c.move("[^");const d=s.enter("footnoteDefinition"),m=s.enter("label");return f+=c.move(s.safe(s.associationId(r),{before:f,after:"]"})),m(),f+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),f+=c.move((t?`
346
+ `:" ")+s.indentLines(s.containerFlow(r,c.current()),t?dO:R9))),d(),f}}function R9(e,t,n){return t===0?e:dO(e,t,n)}function dO(e,t,n){return(n?"":" ")+e}const k9=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];fO.peek=D9;function M9(){return{canContainEols:["delete"],enter:{strikethrough:A9},exit:{strikethrough:N9}}}function O9(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:k9}],handlers:{delete:fO}}}function A9(e){this.enter({type:"delete",children:[]},e)}function N9(e){this.exit(e)}function fO(e,t,n,r){const a=n.createTracker(r),s=n.enter("strikethrough");let l=a.move("~~");return l+=n.containerPhrasing(e,{...a.current(),before:l,after:"~"}),l+=a.move("~~"),s(),l}function D9(){return"~"}function I9(e){return e.length}function P9(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||I9,s=[],l=[],c=[],f=[];let d=0,m=-1;for(;++m<e.length;){const C=[],T=[];let S=-1;for(e[m].length>d&&(d=e[m].length);++S<e[m].length;){const R=L9(e[m][S]);if(n.alignDelimiters!==!1){const k=a(R);T[S]=k,(f[S]===void 0||k>f[S])&&(f[S]=k)}C.push(R)}l[m]=C,c[m]=T}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<d;)s[p]=MC(r[p]);else{const C=MC(r);for(;++p<d;)s[p]=C}p=-1;const y=[],g=[];for(;++p<d;){const C=s[p];let T="",S="";C===99?(T=":",S=":"):C===108?T=":":C===114&&(S=":");let R=n.alignDelimiters===!1?1:Math.max(1,f[p]-T.length-S.length);const k=T+"-".repeat(R)+S;n.alignDelimiters!==!1&&(R=T.length+R+S.length,R>f[p]&&(f[p]=R),g[p]=R),y[p]=k}l.splice(1,0,y),c.splice(1,0,g),m=-1;const x=[];for(;++m<l.length;){const C=l[m],T=c[m];p=-1;const S=[];for(;++p<d;){const R=C[p]||"";let k="",M="";if(n.alignDelimiters!==!1){const D=f[p]-(T[p]||0),O=s[p];O===114?k=" ".repeat(D):O===99?D%2?(k=" ".repeat(D/2+.5),M=" ".repeat(D/2-.5)):(k=" ".repeat(D/2),M=k):M=" ".repeat(D)}n.delimiterStart!==!1&&!p&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&R==="")&&(n.delimiterStart!==!1||p)&&S.push(" "),n.alignDelimiters!==!1&&S.push(k),S.push(R),n.alignDelimiters!==!1&&S.push(M),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||p!==d-1)&&S.push("|")}x.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return x.join(`
347
+ `)}function L9(e){return e==null?"":String(e)}function MC(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function _9(e,t,n,r){const a=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const l=n.indentLines(n.containerFlow(e,s.current()),j9);return a(),l}function j9(e,t,n){return">"+(n?"":" ")+e}function z9(e,t){return OC(e,t.inConstruct,!0)&&!OC(e,t.notInConstruct,!1)}function OC(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function AC(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
348
+ `&&z9(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\
349
+ `}function F9(e,t){const n=String(e);let r=n.indexOf(t),a=r,s=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===a?++s>l&&(l=s):s=1,a=r+t.length,r=n.indexOf(t,a);return l}function B9(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function H9(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function U9(e,t,n,r){const a=H9(n),s=e.value||"",l=a==="`"?"GraveAccent":"Tilde";if(B9(e,n)){const p=n.enter("codeIndented"),y=n.indentLines(s,V9);return p(),y}const c=n.createTracker(r),f=a.repeat(Math.max(F9(s,a)+1,3)),d=n.enter("codeFenced");let m=c.move(f);if(e.lang){const p=n.enter(`codeFencedLang${l}`);m+=c.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...c.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${l}`);m+=c.move(" "),m+=c.move(n.safe(e.meta,{before:m,after:`
350
+ `,encode:["`"],...c.current()})),p()}return m+=c.move(`
351
+ `),s&&(m+=c.move(s+`
352
+ `)),m+=c.move(f),d(),m}function V9(e,t,n){return(n?"":" ")+e}function Mx(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function q9(e,t,n,r){const a=Mx(n),s=a==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const f=n.createTracker(r);let d=f.move("[");return d+=f.move(n.safe(n.associationId(e),{before:d,after:"]",...f.current()})),d+=f.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(c=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":`
353
+ `,...f.current()}))),c(),e.title&&(c=n.enter(`title${s}`),d+=f.move(" "+a),d+=f.move(n.safe(e.title,{before:d,after:a,...f.current()})),d+=f.move(a),c()),l(),d}function $9(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function id(e){return"&#x"+e.toString(16).toUpperCase()+";"}function qh(e,t,n){const r=ou(e),a=ou(t);return r===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}hO.peek=Y9;function hO(e,t,n,r){const a=$9(n),s=n.enter("emphasis"),l=n.createTracker(r),c=l.move(a);let f=l.move(n.containerPhrasing(e,{after:a,before:c,...l.current()}));const d=f.charCodeAt(0),m=qh(r.before.charCodeAt(r.before.length-1),d,a);m.inside&&(f=id(d)+f.slice(1));const p=f.charCodeAt(f.length-1),y=qh(r.after.charCodeAt(0),p,a);y.inside&&(f=f.slice(0,-1)+id(p));const g=l.move(a);return s(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},c+f+g}function Y9(e,t,n){return n.options.emphasis||"*"}function W9(e,t){let n=!1;return Rx(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Gb}),!!((!e.depth||e.depth<3)&&vx(e)&&(t.options.setext||n))}function K9(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(W9(e,n)){const m=n.enter("headingSetext"),p=n.enter("phrasing"),y=n.containerPhrasing(e,{...s.current(),before:`
354
+ `,after:`
355
+ `});return p(),m(),y+`
356
+ `+(a===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
357
+ `))+1))}const l="#".repeat(a),c=n.enter("headingAtx"),f=n.enter("phrasing");s.move(l+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
358
+ `,...s.current()});return/^[\t ]/.test(d)&&(d=id(d.charCodeAt(0))+d.slice(1)),d=d?l+" "+d:l,n.options.closeAtx&&(d+=" "+l),f(),c(),d}pO.peek=G9;function pO(e){return e.value||""}function G9(){return"<"}mO.peek=X9;function mO(e,t,n,r){const a=Mx(n),s=a==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const f=n.createTracker(r);let d=f.move("![");return d+=f.move(n.safe(e.alt,{before:d,after:"]",...f.current()})),d+=f.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(c=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":")",...f.current()}))),c(),e.title&&(c=n.enter(`title${s}`),d+=f.move(" "+a),d+=f.move(n.safe(e.title,{before:d,after:a,...f.current()})),d+=f.move(a),c()),d+=f.move(")"),l(),d}function X9(){return"!"}gO.peek=Q9;function gO(e,t,n,r){const a=e.referenceType,s=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(r);let f=c.move("![");const d=n.safe(e.alt,{before:f,after:"]",...c.current()});f+=c.move(d+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=m,s(),a==="full"||!d||d!==p?f+=c.move(p+"]"):a==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function Q9(){return"!"}yO.peek=Z9;function yO(e,t,n){let r=e.value||"",a="`",s=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const l=n.unsafe[s],c=n.compilePattern(l);let f;if(l.atBreak)for(;f=c.exec(r);){let d=f.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(f.index+1)}}return a+r+a}function Z9(){return"`"}function bO(e,t){const n=vx(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}vO.peek=J9;function vO(e,t,n,r){const a=Mx(n),s=a==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let c,f;if(bO(e,n)){const m=n.stack;n.stack=[],c=n.enter("autolink");let p=l.move("<");return p+=l.move(n.containerPhrasing(e,{before:p,after:">",...l.current()})),p+=l.move(">"),c(),n.stack=m,p}c=n.enter("link"),f=n.enter("label");let d=l.move("[");return d+=l.move(n.containerPhrasing(e,{before:d,after:"](",...l.current()})),d+=l.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),d+=l.move("<"),d+=l.move(n.safe(e.url,{before:d,after:">",...l.current()})),d+=l.move(">")):(f=n.enter("destinationRaw"),d+=l.move(n.safe(e.url,{before:d,after:e.title?" ":")",...l.current()}))),f(),e.title&&(f=n.enter(`title${s}`),d+=l.move(" "+a),d+=l.move(n.safe(e.title,{before:d,after:a,...l.current()})),d+=l.move(a),f()),d+=l.move(")"),c(),d}function J9(e,t,n){return bO(e,n)?"<":"["}xO.peek=eV;function xO(e,t,n,r){const a=e.referenceType,s=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(r);let f=c.move("[");const d=n.containerPhrasing(e,{before:f,after:"]",...c.current()});f+=c.move(d+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=m,s(),a==="full"||!d||d!==p?f+=c.move(p+"]"):a==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function eV(){return"["}function Ox(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function tV(e){const t=Ox(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function nV(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function wO(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function rV(e,t,n,r){const a=n.enter("list"),s=n.bulletCurrent;let l=e.ordered?nV(n):Ox(n);const c=e.ordered?l==="."?")":".":tV(n);let f=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),wO(n)===l&&m){let p=-1;for(;++p<e.children.length;){const y=e.children[p];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(l=c),n.bulletCurrent=l;const d=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=s,a(),d}function iV(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function aV(e,t,n,r){const a=iV(n);let s=n.bulletCurrent||Ox(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let l=s.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(r);c.move(s+" ".repeat(l-s.length)),c.shift(l);const f=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,c.current()),m);return f(),d;function m(p,y,g){return y?(g?"":" ".repeat(l))+p:(g?s:s+" ".repeat(l-s.length))+p}}function oV(e,t,n,r){const a=n.enter("paragraph"),s=n.enter("phrasing"),l=n.containerPhrasing(e,r);return s(),a(),l}const sV=Op(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function lV(e,t,n,r){return(e.children.some(function(l){return sV(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function uV(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}SO.peek=cV;function SO(e,t,n,r){const a=uV(n),s=n.enter("strong"),l=n.createTracker(r),c=l.move(a+a);let f=l.move(n.containerPhrasing(e,{after:a,before:c,...l.current()}));const d=f.charCodeAt(0),m=qh(r.before.charCodeAt(r.before.length-1),d,a);m.inside&&(f=id(d)+f.slice(1));const p=f.charCodeAt(f.length-1),y=qh(r.after.charCodeAt(0),p,a);y.inside&&(f=f.slice(0,-1)+id(p));const g=l.move(a+a);return s(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},c+f+g}function cV(e,t,n){return n.options.strong||"*"}function dV(e,t,n,r){return n.safe(e.value,r)}function fV(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function hV(e,t,n){const r=(wO(n)+(n.options.ruleSpaces?" ":"")).repeat(fV(n));return n.options.ruleSpaces?r.slice(0,-1):r}const EO={blockquote:_9,break:AC,code:U9,definition:q9,emphasis:hO,hardBreak:AC,heading:K9,html:pO,image:mO,imageReference:gO,inlineCode:yO,link:vO,linkReference:xO,list:rV,listItem:aV,paragraph:oV,root:lV,strong:SO,text:dV,thematicBreak:hV};function pV(){return{enter:{table:mV,tableData:NC,tableHeader:NC,tableRow:yV},exit:{codeText:bV,table:gV,tableData:$y,tableHeader:$y,tableRow:$y}}}function mV(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function gV(e){this.exit(e),this.data.inTable=void 0}function yV(e){this.enter({type:"tableRow",children:[]},e)}function $y(e){this.exit(e)}function NC(e){this.enter({type:"tableCell",children:[]},e)}function bV(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,vV));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function vV(e,t){return t==="|"?t:e}function xV(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
359
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:l,tableCell:f,tableRow:c}};function l(g,x,C,T){return d(m(g,C,T),g.align)}function c(g,x,C,T){const S=p(g,C,T),R=d([S]);return R.slice(0,R.indexOf(`
360
+ `))}function f(g,x,C,T){const S=C.enter("tableCell"),R=C.enter("phrasing"),k=C.containerPhrasing(g,{...T,before:s,after:s});return R(),S(),k}function d(g,x){return P9(g,{align:x,alignDelimiters:r,padding:n,stringLength:a})}function m(g,x,C){const T=g.children;let S=-1;const R=[],k=x.enter("table");for(;++S<T.length;)R[S]=p(T[S],x,C);return k(),R}function p(g,x,C){const T=g.children;let S=-1;const R=[],k=x.enter("tableRow");for(;++S<T.length;)R[S]=f(T[S],g,x,C);return k(),R}function y(g,x,C){let T=EO.inlineCode(g,x,C);return C.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function wV(){return{exit:{taskListCheckValueChecked:DC,taskListCheckValueUnchecked:DC,paragraph:EV}}}function SV(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:TV}}}function DC(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function EV(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const a=t.children;let s=-1,l;for(;++s<a.length;){const c=a[s];if(c.type==="paragraph"){l=c;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function TV(e,t,n,r){const a=e.children[0],s=typeof e.checked=="boolean"&&a&&a.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);s&&c.move(l);let f=EO.listItem(e,t,n,{...r,...c.current()});return s&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),f;function d(m){return m+l}}function CV(){return[r9(),T9(),M9(),pV(),wV()]}function RV(e){return{extensions:[i9(),C9(e),O9(),xV(e),SV()]}}const kV={tokenize:IV,partial:!0},TO={tokenize:PV,partial:!0},CO={tokenize:LV,partial:!0},RO={tokenize:_V,partial:!0},MV={tokenize:jV,partial:!0},kO={name:"wwwAutolink",tokenize:NV,previous:OO},MO={name:"protocolAutolink",tokenize:DV,previous:AO},ja={name:"emailAutolink",tokenize:AV,previous:NO},ea={};function OV(){return{text:ea}}let hs=48;for(;hs<123;)ea[hs]=ja,hs++,hs===58?hs=65:hs===91&&(hs=97);ea[43]=ja;ea[45]=ja;ea[46]=ja;ea[95]=ja;ea[72]=[ja,MO];ea[104]=[ja,MO];ea[87]=[ja,kO];ea[119]=[ja,kO];function AV(e,t,n){const r=this;let a,s;return l;function l(p){return!Jb(p)||!NO.call(r,r.previous)||Ax(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(p))}function c(p){return Jb(p)?(e.consume(p),c):p===64?(e.consume(p),f):n(p)}function f(p){return p===46?e.check(MV,m,d)(p):p===45||p===95||mr(p)?(s=!0,e.consume(p),f):m(p)}function d(p){return e.consume(p),a=!0,f}function m(p){return s&&a&&Er(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function NV(e,t,n){const r=this;return a;function a(l){return l!==87&&l!==119||!OO.call(r,r.previous)||Ax(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(kV,e.attempt(TO,e.attempt(CO,s),n),n)(l))}function s(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function DV(e,t,n){const r=this;let a="",s=!1;return l;function l(p){return(p===72||p===104)&&AO.call(r,r.previous)&&!Ax(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(p),e.consume(p),c):n(p)}function c(p){if(Er(p)&&a.length<5)return a+=String.fromCodePoint(p),e.consume(p),c;if(p===58){const y=a.toLowerCase();if(y==="http"||y==="https")return e.consume(p),f}return n(p)}function f(p){return p===47?(e.consume(p),s?d:(s=!0,f)):n(p)}function d(p){return p===null||Hh(p)||vn(p)||js(p)||Rp(p)?n(p):e.attempt(TO,e.attempt(CO,m),n)(p)}function m(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function IV(e,t,n){let r=0;return a;function a(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),a):l===46&&r===3?(e.consume(l),s):n(l)}function s(l){return l===null?n(l):t(l)}}function PV(e,t,n){let r,a,s;return l;function l(d){return d===46||d===95?e.check(RO,f,c)(d):d===null||vn(d)||js(d)||d!==45&&Rp(d)?f(d):(s=!0,e.consume(d),l)}function c(d){return d===95?r=!0:(a=r,r=void 0),e.consume(d),l}function f(d){return a||r||!s?n(d):t(d)}}function LV(e,t){let n=0,r=0;return a;function a(l){return l===40?(n++,e.consume(l),a):l===41&&r<n?s(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(RO,t,s)(l):l===null||vn(l)||js(l)?t(l):(e.consume(l),a)}function s(l){return l===41&&r++,e.consume(l),a}}function _V(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),s):c===93?(e.consume(c),a):c===60||c===null||vn(c)||js(c)?t(c):n(c)}function a(c){return c===null||c===40||c===91||vn(c)||js(c)?t(c):r(c)}function s(c){return Er(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),r):Er(c)?(e.consume(c),l):n(c)}}function jV(e,t,n){return r;function r(s){return e.consume(s),a}function a(s){return mr(s)?n(s):t(s)}}function OO(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||vn(e)}function AO(e){return!Er(e)}function NO(e){return!(e===47||Jb(e))}function Jb(e){return e===43||e===45||e===46||e===95||mr(e)}function Ax(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const zV={tokenize:YV,partial:!0};function FV(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:VV,continuation:{tokenize:qV},exit:$V}},text:{91:{name:"gfmFootnoteCall",tokenize:UV},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:BV,resolveTo:HV}}}}function BV(e,t,n){const r=this;let a=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;a--;){const f=r.events[a][1];if(f.type==="labelImage"){l=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return c;function c(f){if(!l||!l._balanced)return n(f);const d=Ai(r.sliceSerialize({start:l.end,end:r.now()}));return d.codePointAt(0)!==94||!s.includes(d.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function HV(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",s,t],["enter",l,t],["exit",l,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function UV(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,l;return c;function c(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),f}function f(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(p){if(s>999||p===93&&!l||p===null||p===91||vn(p))return n(p);if(p===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return a.includes(Ai(r.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return vn(p)||(l=!0),s++,e.consume(p),p===92?m:d}function m(p){return p===91||p===92||p===93?(e.consume(p),s++,d):d(p)}}function VV(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,l=0,c;return f;function f(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(x)}function m(x){if(l>999||x===93&&!c||x===null||x===91||vn(x))return n(x);if(x===93){e.exit("chunkString");const C=e.exit("gfmFootnoteDefinitionLabelString");return s=Ai(r.sliceSerialize(C)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return vn(x)||(c=!0),l++,e.consume(x),x===92?p:m}function p(x){return x===91||x===92||x===93?(e.consume(x),l++,m):m(x)}function y(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),a.includes(s)||a.push(s),en(e,g,"gfmFootnoteDefinitionWhitespace")):n(x)}function g(x){return t(x)}}function qV(e,t,n){return e.check(vd,t,e.attempt(zV,t,n))}function $V(e){e.exit("gfmFootnoteDefinition")}function YV(e,t,n){const r=this;return en(e,a,"gfmFootnoteDefinitionIndent",5);function a(s){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(s):n(s)}}function WV(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(l,c){let f=-1;for(;++f<l.length;)if(l[f][0]==="enter"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._close){let d=f;for(;d--;)if(l[d][0]==="exit"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._open&&l[f][1].end.offset-l[f][1].start.offset===l[d][1].end.offset-l[d][1].start.offset){l[f][1].type="strikethroughSequence",l[d][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},l[d][1].start),end:Object.assign({},l[f][1].end)},p={type:"strikethroughText",start:Object.assign({},l[d][1].end),end:Object.assign({},l[f][1].start)},y=[["enter",m,c],["enter",l[d][1],c],["exit",l[d][1],c],["enter",p,c]],g=c.parser.constructs.insideSpan.null;g&&Zr(y,y.length,0,kp(g,l.slice(d+1,f),c)),Zr(y,y.length,0,[["exit",p,c],["enter",l[f][1],c],["exit",l[f][1],c],["exit",m,c]]),Zr(l,d-1,f-d+3,y),f=d+y.length-2;break}}for(f=-1;++f<l.length;)l[f][1].type==="strikethroughSequenceTemporary"&&(l[f][1].type="data");return l}function s(l,c,f){const d=this.previous,m=this.events;let p=0;return y;function y(x){return d===126&&m[m.length-1][1].type!=="characterEscape"?f(x):(l.enter("strikethroughSequenceTemporary"),g(x))}function g(x){const C=ou(d);if(x===126)return p>1?f(x):(l.consume(x),p++,g);if(p<2&&!n)return f(x);const T=l.exit("strikethroughSequenceTemporary"),S=ou(x);return T._open=!S||S===2&&!!C,T._close=!C||C===2&&!!S,c(x)}}}class KV{constructor(){this.map=[]}add(t,n,r){GV(this,t,n,r)}consume(t){if(this.map.sort(function(s,l){return s[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let a=r.pop();for(;a;){for(const s of a)t.push(s);a=r.pop()}this.map.length=0}}function GV(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}}function XV(e,t){let n=!1;const r=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function QV(){return{flow:{null:{name:"table",tokenize:ZV,resolveAll:JV}}}}function ZV(e,t,n){const r=this;let a=0,s=0,l;return c;function c(F){let W=r.events.length-1;for(;W>-1;){const q=r.events[W][1].type;if(q==="lineEnding"||q==="linePrefix")W--;else break}const L=W>-1?r.events[W][1].type:null,V=L==="tableHead"||L==="tableRow"?O:f;return V===O&&r.parser.lazy[r.now().line]?n(F):V(F)}function f(F){return e.enter("tableHead"),e.enter("tableRow"),d(F)}function d(F){return F===124||(l=!0,s+=1),m(F)}function m(F){return F===null?n(F):ht(F)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),g):n(F):$t(F)?en(e,m,"whitespace")(F):(s+=1,l&&(l=!1,a+=1),F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),l=!0,m):(e.enter("data"),p(F)))}function p(F){return F===null||F===124||vn(F)?(e.exit("data"),m(F)):(e.consume(F),F===92?y:p)}function y(F){return F===92||F===124?(e.consume(F),p):p(F)}function g(F){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(F):(e.enter("tableDelimiterRow"),l=!1,$t(F)?en(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):x(F))}function x(F){return F===45||F===58?T(F):F===124?(l=!0,e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),C):D(F)}function C(F){return $t(F)?en(e,T,"whitespace")(F):T(F)}function T(F){return F===58?(s+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),S):F===45?(s+=1,S(F)):F===null||ht(F)?M(F):D(F)}function S(F){return F===45?(e.enter("tableDelimiterFiller"),R(F)):D(F)}function R(F){return F===45?(e.consume(F),R):F===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(F))}function k(F){return $t(F)?en(e,M,"whitespace")(F):M(F)}function M(F){return F===124?x(F):F===null||ht(F)?!l||a!==s?D(F):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(F)):D(F)}function D(F){return n(F)}function O(F){return e.enter("tableRow"),N(F)}function N(F){return F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),N):F===null||ht(F)?(e.exit("tableRow"),t(F)):$t(F)?en(e,N,"whitespace")(F):(e.enter("data"),_(F))}function _(F){return F===null||F===124||vn(F)?(e.exit("data"),N(F)):(e.consume(F),F===92?$:_)}function $(F){return F===92||F===124?(e.consume(F),_):_(F)}}function JV(e,t){let n=-1,r=!0,a=0,s=[0,0,0,0],l=[0,0,0,0],c=!1,f=0,d,m,p;const y=new KV;for(;++n<e.length;){const g=e[n],x=g[1];g[0]==="enter"?x.type==="tableHead"?(c=!1,f!==0&&(IC(y,t,f,d,m),m=void 0,f=0),d={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},y.add(n,0,[["enter",d,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,p=void 0,s=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,m={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},y.add(n,0,[["enter",m,t]])),a=x.type==="tableDelimiterRow"?2:m?3:1):a&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(s[1]!==0&&(l[0]=l[1],p=eh(y,t,s,a,void 0,p),s=[0,0,0,0]),l[2]=n)):x.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(l[0]=l[1],p=eh(y,t,s,a,void 0,p)),s=l,l=[s[1],n,0,0])):x.type==="tableHead"?(c=!0,f=n):x.type==="tableRow"||x.type==="tableDelimiterRow"?(f=n,s[1]!==0?(l[0]=l[1],p=eh(y,t,s,a,n,p)):l[1]!==0&&(p=eh(y,t,l,a,n,p)),a=0):a&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&IC(y,t,f,d,m),y.consume(t.events),n=-1;++n<t.events.length;){const g=t.events[n];g[0]==="enter"&&g[1].type==="table"&&(g[1]._align=XV(t.events,n))}return e}function eh(e,t,n,r,a,s){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(s.end=Object.assign({},Nl(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const f=Nl(t.events,n[1]);if(s={type:l,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const d=Nl(t.events,n[2]),m=Nl(t.events,n[3]),p={type:c,start:Object.assign({},d),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",p,t]]),r!==2){const y=t.events[n[2]],g=t.events[n[3]];if(y[1].end=Object.assign({},g[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const x=n[2]+1,C=n[3]-n[2]-1;e.add(x,C,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return a!==void 0&&(s.end=Object.assign({},Nl(t.events,a)),e.add(a,0,[["exit",s,t]]),s=void 0),s}function IC(e,t,n,r,a){const s=[],l=Nl(t.events,n);a&&(a.end=Object.assign({},l),s.push(["exit",a,t])),r.end=Object.assign({},l),s.push(["exit",r,t]),e.add(n+1,0,s)}function Nl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const eq={name:"tasklistCheck",tokenize:nq};function tq(){return{text:{91:eq}}}function nq(e,t,n){const r=this;return a;function a(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),s)}function s(f){return vn(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),l):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),l):n(f)}function l(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(f)}function c(f){return ht(f)?t(f):$t(f)?e.check({tokenize:rq},t,n)(f):n(f)}}function rq(e,t,n){return en(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function iq(e){return UM([OV(),FV(),WV(e),QV(),tq()])}const aq={};function oq(e){const t=this,n=e||aq,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(iq(n)),s.push(CV()),l.push(RV(n))}function sq(e){const t=e.split(`
361
+ `),n=[];let r=[],a=!1;const s=()=>{const l=r.join(`
362
+ `);l.trim()&&n.push(l),r=[]};for(const l of t){if(/^\s*(```|~~~)/.test(l)){a=!a,r.push(l);continue}if(!a&&l.trim()===""){s();continue}r.push(l)}return s(),n}const lq={a:({node:e,...t})=>E.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2 break-all"}),pre:({node:e,...t})=>E.jsx("pre",{...t,className:"bg-muted overflow-x-auto rounded-md p-2 font-mono text-xs leading-relaxed"}),code:({node:e,className:t,...n})=>E.jsx("code",{...n,className:Le("bg-muted rounded px-1 font-mono text-xs",t)}),ul:({node:e,...t})=>E.jsx("ul",{...t,className:"list-disc pl-5"}),ol:({node:e,...t})=>E.jsx("ol",{...t,className:"list-decimal pl-5"}),blockquote:({node:e,...t})=>E.jsx("blockquote",{...t,className:"border-border text-muted-foreground border-l-2 pl-2"}),h1:({node:e,...t})=>E.jsx("h1",{...t,className:"text-base font-semibold"}),h2:({node:e,...t})=>E.jsx("h2",{...t,className:"text-sm font-semibold"}),h3:({node:e,...t})=>E.jsx("h3",{...t,className:"text-sm font-semibold"}),table:({node:e,...t})=>E.jsx("div",{className:"overflow-x-auto",children:E.jsx("table",{...t,className:"border-border w-full border-collapse border text-xs"})}),th:({node:e,...t})=>E.jsx("th",{...t,className:"border-border bg-muted border px-2 py-1 text-left"}),td:({node:e,...t})=>E.jsx("td",{...t,className:"border-border border px-2 py-1"})},uq=w.memo(function({content:t}){return E.jsx(W8,{remarkPlugins:[oq],components:lq,children:t})});function cq({text:e,streaming:t=!1,className:n}){const r=w.useMemo(()=>sq(e),[e]);return E.jsxs("div",{className:Le("flex min-w-0 flex-col gap-2 text-sm leading-relaxed",n),children:[r.map((a,s)=>E.jsx(uq,{content:a},s)),t&&E.jsx("span",{"data-testid":"agent-streaming-cursor",className:"bg-foreground inline-block h-4 w-2 animate-pulse self-start"})]})}function dq({text:e,streaming:t=!1,className:n}){return E.jsx("div",{"data-testid":"agent-assistant-message",className:Le("min-w-0 max-w-full self-start",n),children:E.jsx(cq,{text:e,streaming:t})})}const fq=[];function Np(e){w.useEffect(e,fq)}const th=null;class hq{constructor(){tt(this,"callbacks",[]);tt(this,"callbacksCount",0);tt(this,"nextId",1);tt(this,"startId",1);tt(this,"isScheduled",!1);tt(this,"tick",t=>{var a;this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let s=0;s<n.length;s+=1)(a=n[s])==null||a.call(n,t)})}request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(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 nh=new hq;class Ln{constructor(){tt(this,"currentId",th);tt(this,"cancel",()=>{this.currentId!==th&&(nh.cancel(this.currentId),this.currentId=th)});tt(this,"disposeEffect",()=>this.cancel)}static create(){return new Ln}static request(t){return nh.request(t)}static cancel(t){return nh.cancel(t)}request(t){this.cancel(),this.currentId=nh.request(()=>{this.currentId=th,t()})}}function wd(){const e=Jn(Ln.create).current;return Np(e.disposeEffect),e}function Ta(e){return e==null?e:"current"in e?e.current:e}let zs=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const pq={[zs.startingStyle]:""},mq={[zs.endingStyle]:""},Ho={transitionStatus(e){return e==="starting"?pq:e==="ending"?mq:null}};function DO(e,t=!1,n=!0){const r=wd();return Ve((a,s=null)=>{r.cancel();function l(){yi.flushSync(a)}const c=Ta(e);if(c==null)return;const f=c;if(typeof f.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)a();else{let d=function(){const p=zs.startingStyle;if(!f.hasAttribute(p)){r.request(m);return}const y=new MutationObserver(()=>{f.hasAttribute(p)||(y.disconnect(),m())});y.observe(f,{attributes:!0,attributeFilter:[p]}),s==null||s.addEventListener("abort",()=>y.disconnect(),{once:!0})},m=function(){Promise.all(f.getAnimations().map(p=>p.finished)).then(()=>{s!=null&&s.aborted||l()}).catch(()=>{const p=f.getAnimations();if(n){if(s!=null&&s.aborted)return;l()}else p.length>0&&p.some(y=>y.pending||y.playState!=="finished")&&m()})};if(t){d();return}r.request(m)}})}function Sd(e,t=!1,n=!1){const[r,a]=w.useState(e&&t?"idle":void 0),[s,l]=w.useState(e);return e&&!s&&(l(!0),a("starting")),!e&&s&&r!=="ending"&&!n&&a("ending"),!e&&!s&&r==="ending"&&a(void 0),He(()=>{if(!e&&s&&r!=="ending"&&n){const c=Ln.request(()=>{a("ending")});return()=>{Ln.cancel(c)}}},[e,s,r,n]),He(()=>{if(!e||t)return;const c=Ln.request(()=>{a(void 0)});return()=>{Ln.cancel(c)}},[t,e]),He(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&a("starting");const c=Ln.request(()=>{a("idle")});return()=>{Ln.cancel(c)}},[t,e,s,a,r]),w.useMemo(()=>({mounted:s,setMounted:l,transitionStatus:r}),[s,r])}function gq(e){const{open:t,defaultOpen:n,onOpenChange:r,disabled:a}=e,s=t!==void 0,[l,c]=au({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:f,setMounted:d,transitionStatus:m}=Sd(l,!0,!0),[p,y]=w.useState(l),[{height:g,width:x},C]=w.useState({height:void 0,width:void 0}),T=Pi(),[S,R]=w.useState(),k=S??T,[M,D]=w.useState(!1),[O,N]=w.useState(!1),_=w.useRef(null),$=w.useRef(null),F=w.useRef(null),W=w.useRef(null),L=DO(W,!1),V=Ve(q=>{const Y=!l,j=pt(Ls,q.nativeEvent);if(r(Y,j),j.isCanceled)return;const z=W.current;$.current==="css-animation"&&z!=null&&z.style.removeProperty("animation-name"),!M&&!O&&($.current!=null&&$.current!=="css-animation"&&!f&&Y&&d(!0),$.current==="css-animation"&&(!p&&Y&&y(!0),!f&&Y&&d(!0))),c(Y),$.current==="none"&&f&&!Y&&d(!1)});return He(()=>{s&&$.current==="none"&&!O&&!l&&d(!1)},[s,O,l,t,d]),w.useMemo(()=>({abortControllerRef:_,animationTypeRef:$,disabled:a,handleTrigger:V,height:g,mounted:f,open:l,panelId:k,panelRef:W,runOnceAnimationsFinish:L,setDimensions:C,setHiddenUntilFound:D,setKeepMounted:N,setMounted:d,setOpen:c,setPanelIdState:R,setVisible:y,transitionDimensionRef:F,transitionStatus:m,visible:p,width:x}),[_,$,a,V,g,f,l,k,W,L,C,D,N,d,c,y,F,m,p,x])}const IO=w.createContext(void 0);function PO(){const e=w.useContext(IO);if(e===void 0)throw new Error(Sn(15));return e}let Yc=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=zs.startingStyle]="startingStyle",e[e.endingStyle=zs.endingStyle]="endingStyle",e})({}),yq=(function(e){return e.panelOpen="data-panel-open",e})({});const bq={[Yc.open]:""},vq={[Yc.closed]:""},xq={open(e){return e?{[yq.panelOpen]:""}:null}},wq={open(e){return e?bq:vq}},LO={...wq,...Ho},Sq=w.forwardRef(function(t,n){const{render:r,className:a,defaultOpen:s=!1,disabled:l=!1,onOpenChange:c,open:f,...d}=t,m=Ve(c),p=gq({open:f,defaultOpen:s,onOpenChange:m,disabled:l}),y=w.useMemo(()=>({open:p.open,disabled:p.disabled,transitionStatus:p.transitionStatus}),[p.open,p.disabled,p.transitionStatus]),g=w.useMemo(()=>({...p,onOpenChange:m,state:y}),[p,m,y]),x=Ct("div",t,{state:y,ref:n,props:d,stateAttributesMapping:LO});return E.jsx(IO.Provider,{value:g,children:x})}),Eq={...xq,...Ho},Tq=w.forwardRef(function(t,n){const{panelId:r,open:a,handleTrigger:s,state:l,disabled:c}=PO(),{className:f,disabled:d=c,id:m,render:p,nativeButton:y=!0,...g}=t,{getButtonProps:x,buttonRef:C}=_a({disabled:d,focusableWhenDisabled:!0,native:y}),T=w.useMemo(()=>({"aria-controls":a?r:void 0,"aria-expanded":a,onClick:s}),[r,a,s]);return Ct("button",t,{state:l,ref:[n,C],props:[T,g,x],stateAttributesMapping:Eq})});let Cq=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e})({});function Rq(e){const{abortControllerRef:t,animationTypeRef:n,externalRef:r,height:a,hiddenUntilFound:s,keepMounted:l,id:c,mounted:f,onOpenChange:d,open:m,panelRef:p,runOnceAnimationsFinish:y,setDimensions:g,setMounted:x,setOpen:C,setVisible:T,transitionDimensionRef:S,visible:R,width:k}=e,M=w.useRef(!1),D=w.useRef(null),O=w.useRef(m),N=w.useRef(m),_=wd(),$=w.useMemo(()=>n.current==="css-animation"?!R:!m&&!f,[m,f,R,n]),F=Ve(L=>{if(!L)return;if(n.current==null||S.current==null){const Y=getComputedStyle(L),j=Y.animationName!=="none"&&Y.animationName!=="",z=Y.transitionDuration!=="0s"&&Y.transitionDuration!=="";j&&z||(Y.animationName==="none"&&Y.transitionDuration!=="0s"?n.current="css-transition":Y.animationName!=="none"&&Y.transitionDuration==="0s"?n.current="css-animation":n.current="none"),L.getAttribute(Cq.orientation)==="horizontal"||Y.transitionProperty.indexOf("width")>-1?S.current="width":S.current="height"}if(n.current!=="css-transition")return;(a===void 0||k===void 0)&&(g({height:L.scrollHeight,width:L.scrollWidth}),N.current&&L.style.setProperty("transition-duration","0s"));let V=-1,q=-1;return V=Ln.request(()=>{N.current=!1,q=Ln.request(()=>{setTimeout(()=>{L.style.removeProperty("transition-duration")})})}),()=>{Ln.cancel(V),Ln.cancel(q)}}),W=Ni(r,p,F);return He(()=>{if(n.current!=="css-transition")return;const L=p.current;if(!L)return;let V=-1;if(t.current!=null&&(t.current.abort(),t.current=null),m){const q={"justify-content":L.style.justifyContent,"align-items":L.style.alignItems,"align-content":L.style.alignContent,"justify-items":L.style.justifyItems};Object.keys(q).forEach(Y=>{L.style.setProperty(Y,"initial","important")}),!N.current&&!l&&L.setAttribute(Yc.startingStyle,""),g({height:L.scrollHeight,width:L.scrollWidth}),V=Ln.request(()=>{Object.entries(q).forEach(([Y,j])=>{j===""?L.style.removeProperty(Y):L.style.setProperty(Y,j)})})}else{if(L.scrollHeight===0&&L.scrollWidth===0)return;g({height:L.scrollHeight,width:L.scrollWidth});const q=new AbortController;t.current=q;const Y=q.signal;let j=null;const z=Yc.endingStyle;return j=new MutationObserver(H=>{H.some(P=>P.type==="attributes"&&P.attributeName===z)&&(j==null||j.disconnect(),j=null,y(()=>{g({height:0,width:0}),L.style.removeProperty("content-visibility"),x(!1),t.current===q&&(t.current=null)},Y))}),j.observe(L,{attributes:!0,attributeFilter:[z]}),()=>{j==null||j.disconnect(),_.cancel(),t.current===q&&(q.abort(),t.current=null)}}return()=>{Ln.cancel(V)}},[t,n,_,s,l,f,m,p,y,g,x]),He(()=>{if(n.current!=="css-animation")return;const L=p.current;L&&(D.current=L.style.animationName||D.current,L.style.setProperty("animation-name","none"),g({height:L.scrollHeight,width:L.scrollWidth}),!O.current&&!M.current&&L.style.removeProperty("animation-name"),m?(t.current!=null&&(t.current.abort(),t.current=null),x(!0),T(!0)):(t.current=new AbortController,y(()=>{x(!1),T(!1),t.current=null},t.current.signal)))},[t,n,m,p,y,g,x,T,R]),Np(()=>{const L=Ln.request(()=>{O.current=!1});return()=>Ln.cancel(L)}),He(()=>{if(!s)return;const L=p.current;if(!L)return;let V=-1,q=-1;return m&&M.current&&(L.style.transitionDuration="0s",g({height:L.scrollHeight,width:L.scrollWidth}),V=Ln.request(()=>{M.current=!1,q=Ln.request(()=>{setTimeout(()=>{L.style.removeProperty("transition-duration")})})})),()=>{Ln.cancel(V),Ln.cancel(q)}},[s,m,p,g]),He(()=>{const L=p.current;L&&s&&$&&(L.setAttribute("hidden","until-found"),n.current==="css-transition"&&L.setAttribute(Yc.startingStyle,""))},[s,$,n,p]),w.useEffect(function(){const V=p.current;if(!V)return;function q(Y){M.current=!0,C(!0),d(!0,pt(Di,Y))}return V.addEventListener("beforematch",q),()=>{V.removeEventListener("beforematch",q)}},[d,p,C]),w.useMemo(()=>({props:{hidden:$,id:c,ref:W}}),[$,c,W])}let PC=(function(e){return e.collapsiblePanelHeight="--collapsible-panel-height",e.collapsiblePanelWidth="--collapsible-panel-width",e})({});function za(e){const{enabled:t=!0,open:n,ref:r,onComplete:a}=e,s=Ve(a),l=DO(r,n,!1);w.useEffect(()=>{if(!t)return;const c=new AbortController;return l(s,c.signal),()=>{c.abort()}},[t,n,s,l])}const kq=w.forwardRef(function(t,n){const{className:r,hiddenUntilFound:a,keepMounted:s,render:l,id:c,...f}=t,{abortControllerRef:d,animationTypeRef:m,height:p,mounted:y,onOpenChange:g,open:x,panelId:C,panelRef:T,runOnceAnimationsFinish:S,setDimensions:R,setHiddenUntilFound:k,setKeepMounted:M,setMounted:D,setPanelIdState:O,setOpen:N,setVisible:_,state:$,transitionDimensionRef:F,visible:W,width:L,transitionStatus:V}=PO(),q=a??!1,Y=s??!1;He(()=>{if(c)return O(c),()=>{O(void 0)}},[c,O]),He(()=>{k(q)},[k,q]),He(()=>{M(Y)},[M,Y]);const{props:j}=Rq({abortControllerRef:d,animationTypeRef:m,externalRef:n,height:p,hiddenUntilFound:q,id:C,keepMounted:Y,mounted:y,onOpenChange:g,open:x,panelRef:T,runOnceAnimationsFinish:S,setDimensions:R,setMounted:D,setOpen:N,setVisible:_,transitionDimensionRef:F,visible:W,width:L});za({open:x&&V==="idle",ref:T,onComplete(){x&&R({height:void 0,width:void 0})}});const z=w.useMemo(()=>({...$,transitionStatus:V}),[$,V]),H=Ct("div",t,{state:z,ref:[n,T],props:[j,{style:{[PC.collapsiblePanelHeight]:p===void 0?"auto":`${p}px`,[PC.collapsiblePanelWidth]:L===void 0?"auto":`${L}px`}},f],stateAttributesMapping:LO});return Y||q||!Y&&y?H:null});function Dp({...e}){return E.jsx(Sq,{"data-slot":"collapsible",...e})}function Ip({...e}){return E.jsx(Tq,{"data-slot":"collapsible-trigger",...e})}function Pp({...e}){return E.jsx(kq,{"data-slot":"collapsible-content",...e})}function Mq({text:e,streaming:t=!1,className:n}){const{t:r}=xn();return E.jsxs(Dp,{"data-testid":"agent-reasoning-block",className:Le("min-w-0 max-w-full self-start",n),children:[E.jsxs(Ip,{className:"text-muted-foreground hover:text-foreground group flex items-center gap-1 text-xs",children:[E.jsx(hp,{className:"size-3 transition-transform group-data-[panel-open]:rotate-90"}),E.jsx(j4,{className:"size-3"}),E.jsx("span",{children:r("agent.reasoning.title")}),t&&E.jsx(iu,{className:"size-3 animate-spin"})]}),E.jsx(Pp,{children:E.jsx("div",{className:"text-muted-foreground border-border mt-1 border-l-2 pl-2 text-xs whitespace-pre-wrap break-words",children:e})})]})}function Lp(e){return Ct(e.defaultTagName??"div",e,e)}const Oq=xp("h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive overflow-hidden group/badge",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function Fs({className:e,variant:t="default",render:n,...r}){return Lp({defaultTagName:"span",props:bi({className:Le(Oq({className:e,variant:t}))},r),render:n,state:{slot:"badge",variant:t}})}function _o(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ev(e){if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Aq(e){return _o(e.output)&&typeof e.output.error=="string"?e.output.error:e.isError?ev(e.output):null}function Nq(e){switch(e){case"send_input":return E.jsx(t5,{className:"size-3.5"});case"read_screen":return E.jsx(tx,{className:"size-3.5"});case"web_search":return E.jsx(E5,{className:"size-3.5"});case"fetch_url":return E.jsx(Gk,{className:"size-3.5"});default:return E.jsx(j5,{className:"size-3.5"})}}function su({label:e,text:t}){return E.jsxs(Dp,{children:[E.jsxs(Ip,{className:"text-muted-foreground hover:text-foreground group flex items-center gap-1 text-xs",children:[E.jsx(hp,{className:"size-3 transition-transform group-data-[panel-open]:rotate-90"}),E.jsx("span",{children:e})]}),E.jsx(Pp,{children:E.jsx("pre",{className:"bg-muted mt-1 max-h-64 overflow-auto rounded-md p-2 font-mono text-xs whitespace-pre-wrap break-all",children:t})})]})}function Dq(e){if(typeof e!="string")return null;try{const t=JSON.parse(e);return Array.isArray(t)?t.filter(_o).map(n=>({title:typeof n.title=="string"?n.title:"",url:typeof n.url=="string"?n.url:"",snippet:typeof n.snippet=="string"?n.snippet:""})).filter(n=>n.url):null}catch{return null}}function Iq({call:e}){const{t}=xn(),n=_o(e.input)?e.input:{},r=typeof n.text=="string"?n.text:"",a=Array.isArray(n.keys)?n.keys.filter(c=>typeof c=="string"):[],s=_o(e.output)?e.output:{},l=typeof s.screenTail=="string"?s.screenTail:"";return E.jsxs("div",{className:"flex flex-col gap-1.5",children:[r&&E.jsx("pre",{className:"bg-muted max-h-40 overflow-auto rounded-md p-2 font-mono text-xs whitespace-pre-wrap break-all",children:r}),a.length>0&&E.jsx("div",{className:"flex flex-wrap items-center gap-1",children:a.map((c,f)=>E.jsx(Fs,{variant:"outline",className:"font-mono",children:c},`${f}-${c}`))}),l&&E.jsx(su,{label:t("agent.tool.result"),text:l})]})}function Pq({call:e}){const{t}=xn(),n=_o(e.output)?e.output:{},r=typeof n.screen=="string"?n.screen:"";return r?E.jsx(su,{label:t("agent.tool.screen"),text:r}):null}function Lq({call:e}){const{t}=xn(),n=_o(e.input)?e.input:{},r=typeof n.query=="string"?n.query:"",a=e.resolved&&!e.isError&&!e.denied?Dq(e.output):null;return E.jsxs("div",{className:"flex flex-col gap-1.5",children:[r&&E.jsxs("p",{className:"text-muted-foreground text-xs break-words",children:["“",r,"”"]}),a&&a.length>0&&E.jsx("ul",{className:"flex flex-col gap-1",children:a.map(s=>E.jsxs("li",{className:"min-w-0 text-xs",children:[E.jsx("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary block truncate underline underline-offset-2",title:s.title||s.url,children:s.title||s.url}),s.snippet&&E.jsx("p",{className:"text-muted-foreground line-clamp-2 break-words",children:s.snippet})]},s.url))}),e.resolved&&!e.isError&&!e.denied&&!a&&typeof e.output=="string"&&E.jsx(su,{label:t("agent.tool.result"),text:e.output})]})}function _q({call:e}){const{t}=xn(),n=_o(e.input)?e.input:{},r=typeof n.url=="string"?n.url:"",a=typeof e.output=="string"?e.output:"";return E.jsxs("div",{className:"flex flex-col gap-1.5",children:[r&&E.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"text-primary block truncate text-xs underline underline-offset-2",title:r,children:r}),e.resolved&&!e.isError&&!e.denied&&a&&E.jsx(su,{label:t("agent.tool.result"),text:a})]})}const jq=/^[A-Za-z0-9+/]{256,}={0,2}$/,zq=/^https?:\/\/\S+\.(png|jpe?g|webp|gif)(\?\S*)?$/i;function Fq(e){return typeof e!="string"||e.length===0?null:e.startsWith("data:image/")||zq.test(e)?e:jq.test(e.replace(/\s/g,""))?`data:image/png;base64,${e.replace(/\s/g,"")}`:null}function Bq(e){if(!e.resolved||e.isError||e.denied)return[];const t=[],n=(r,a)=>{if(t.length>=8||a>3)return;const s=Fq(r);if(s){t.push(s);return}if(Array.isArray(r)){for(const l of r)n(l,a+1);return}if(_o(r))for(const l of["result","image","images","url","b64_json","data"])l in r&&n(r[l],a+1)};return n(e.output,0),[...new Set(t)]}function Hq({images:e}){return e.length===0?null:E.jsx("div",{className:"flex flex-wrap gap-2",children:e.map((t,n)=>E.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"block",children:E.jsx("img",{src:t,alt:"generated",className:"max-h-64 max-w-full rounded-md border border-border object-contain",loading:"lazy"})},n))})}function Uq({call:e,hideOutput:t}){const{t:n}=xn();return E.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.input!==void 0&&E.jsx(su,{label:n("agent.tool.input"),text:ev(e.input)}),!t&&e.resolved&&!e.isError&&!e.denied&&e.output!==void 0&&E.jsx(su,{label:n("agent.tool.result"),text:ev(e.output)})]})}function Vq({call:e,confirmationId:t,onDecide:n,className:r}){const{t:a}=xn(),s=!!t&&!e.resolved,l=e.resolved&&e.denied,c=e.resolved&&!l?Aq(e):null,f=!e.resolved&&!s,d=l&&typeof e.output=="string"?e.output:"",m=`agent.tool.${e.toolName}`,p=["send_input","read_screen","web_search","fetch_url"].includes(e.toolName)?a(m):e.toolName,y=Bq(e);return E.jsxs("div",{"data-testid":`agent-tool-card-${e.toolCallId}`,"data-tool-name":e.toolName,"data-tool-denied":l||void 0,className:Le("border-border bg-card flex max-w-full min-w-0 flex-col gap-1.5 self-start rounded-lg border p-2",c!==null&&"border-destructive/50",l&&"opacity-80",r),children:[E.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium",children:[Nq(e.toolName),E.jsx("span",{className:"min-w-0 truncate",children:p}),f&&E.jsx(iu,{className:"text-muted-foreground size-3 animate-spin"}),e.resolved&&!l&&c===null&&E.jsx(zh,{className:"size-3 text-emerald-500"}),c!==null&&E.jsx(Fc,{className:"text-destructive size-3"}),l&&E.jsxs("span",{className:"text-destructive flex items-center gap-0.5",children:[E.jsx(Pa,{className:"size-3"}),a("agent.tool.denied")]})]}),e.toolName==="send_input"&&E.jsx(Iq,{call:e}),e.toolName==="read_screen"&&E.jsx(Pq,{call:e}),e.toolName==="web_search"&&E.jsx(Lq,{call:e}),e.toolName==="fetch_url"&&E.jsx(_q,{call:e}),!["send_input","read_screen","web_search","fetch_url"].includes(e.toolName)&&E.jsx(Uq,{call:e,hideOutput:y.length>0}),E.jsx(Hq,{images:y}),c!==null&&E.jsx("p",{className:"text-destructive text-xs break-words whitespace-pre-wrap",children:c}),d&&E.jsx("p",{className:"text-muted-foreground text-xs break-words whitespace-pre-wrap",children:d}),s&&t&&E.jsxs("div",{"data-testid":`agent-tool-approval-${e.toolCallId}`,className:"flex items-center gap-2 pt-1",children:[E.jsx("span",{className:"text-muted-foreground min-w-0 flex-1 text-xs",children:a("agent.confirm.title")}),E.jsxs(_t,{"data-testid":"agent-confirm-approve",size:"xs",variant:"secondary",onClick:()=>n==null?void 0:n(t,!0),children:[E.jsx(zh,{}),a("agent.confirm.approve")]}),E.jsxs(_t,{"data-testid":"agent-confirm-deny",size:"xs",variant:"destructive",onClick:()=>n==null?void 0:n(t,!1),children:[E.jsx(Pa,{}),a("agent.confirm.deny")]})]})]})}function qq({text:e,className:t}){return E.jsx("div",{"data-testid":"agent-user-message",className:Le("bg-primary text-primary-foreground max-w-[85%] self-end rounded-2xl px-3 py-2 text-sm whitespace-pre-wrap break-words",t),children:e})}const $q=48;function Yq(){return E.jsxs("div",{"data-testid":"agent-running-indicator",className:"flex items-center gap-1 self-start px-1",children:[E.jsx("span",{className:"bg-muted-foreground size-1.5 animate-pulse rounded-full"}),E.jsx("span",{className:"bg-muted-foreground size-1.5 animate-pulse rounded-full [animation-delay:150ms]"}),E.jsx("span",{className:"bg-muted-foreground size-1.5 animate-pulse rounded-full [animation-delay:300ms]"})]})}function Wq({blocks:e,running:t,emptyText:n,confirmationByToolCallId:r,onDecide:a,className:s}){const{t:l}=xn(),c=w.useRef(null),f=w.useRef(!0),[d,m]=w.useState(!1),p=()=>{const g=c.current;g&&(g.scrollTop=g.scrollHeight,f.current=!0,m(!1))};w.useEffect(()=>{if(f.current){const g=c.current;g&&(g.scrollTop=g.scrollHeight)}else m(!0)},[e,t]);const y=()=>{const g=c.current;if(!g)return;const C=g.scrollHeight-g.scrollTop-g.clientHeight<$q;f.current=C,m(!C)};return e.length===0&&!t?E.jsx("div",{"data-testid":"agent-chat-thread",className:Le("flex min-h-0 flex-1 items-center justify-center p-4",s),children:E.jsx("p",{className:"text-muted-foreground text-sm",children:n})}):E.jsxs("div",{className:Le("relative min-h-0 flex-1",s),children:[E.jsx("div",{ref:c,"data-testid":"agent-chat-thread",className:"h-full overflow-y-auto p-3",onScroll:y,children:E.jsxs("div",{className:"flex flex-col gap-3",children:[e.map(g=>{switch(g.kind){case"user":return E.jsx(qq,{text:g.text},g.key);case"assistant-text":return E.jsx(dq,{text:g.text,streaming:g.streaming},g.key);case"reasoning":return E.jsx(Mq,{text:g.text,streaming:g.streaming},g.key);case"tool-call":return E.jsx(Vq,{call:g.call,confirmationId:r.get(g.call.toolCallId),onDecide:a},g.key);default:return null}}),t&&E.jsx(Yq,{})]})}),d&&E.jsx(_t,{"data-testid":"agent-scroll-to-bottom",size:"icon-sm",variant:"secondary",className:"absolute right-3 bottom-3 z-10 rounded-full shadow-md",onClick:p,"aria-label":l("agent.panel.scrollToBottom"),children:E.jsx(A4,{})})]})}function _p(e){const t=w.useRef(!0);t.current&&(t.current=!1,e())}function rr(e){const t=Jn(Kq,e).current;return t.next=e,He(t.effect),t}function Kq(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var $h=Symbol("NOT_FOUND");function Gq(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Xq(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Qq(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var LC=e=>Array.isArray(e)?e:[e];function Zq(e){const t=Array.isArray(e[0])?e[0]:e;return Qq(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Jq(e,t){const n=[],{length:r}=e;for(let a=0;a<r;a++)n.push(e[a].apply(null,t));return n}function e7(e){let t;return{get(n){return t&&e(t.key,n)?t.value:$h},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function t7(e,t){let n=[];function r(c){const f=n.findIndex(d=>t(c,d.key));if(f>-1){const d=n[f];return f>0&&(n.splice(f,1),n.unshift(d)),d.value}return $h}function a(c,f){r(c)===$h&&(n.unshift({key:c,value:f}),n.length>e&&n.pop())}function s(){return n}function l(){n=[]}return{get:r,put:a,getEntries:s,clear:l}}var n7=(e,t)=>e===t;function r7(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:a}=n;for(let s=0;s<a;s++)if(!e(n[s],r[s]))return!1;return!0}}function i7(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=n7,maxSize:a=1,resultEqualityCheck:s}=n,l=r7(r);let c=0;const f=a<=1?e7(l):t7(a,l);function d(){let m=f.get(arguments);if(m===$h){if(m=e.apply(null,arguments),c++,s){const y=f.getEntries().find(g=>s(g.value,m));y&&(m=y.value,c!==0&&c--)}f.put(arguments,m)}return m}return d.clearCache=()=>{f.clear(),d.resetResultsCount()},d.resultsCount=()=>c,d.resetResultsCount=()=>{c=0},d}var a7=class{constructor(e){this.value=e}deref(){return this.value}},o7=typeof WeakRef<"u"?WeakRef:a7,s7=0,_C=1;function rh(){return{s:s7,v:void 0,o:null,p:null}}function _O(e,t={}){let n=rh();const{resultEqualityCheck:r}=t;let a,s=0;function l(){var p;let c=n;const{length:f}=arguments;for(let y=0,g=f;y<g;y++){const x=arguments[y];if(typeof x=="function"||typeof x=="object"&&x!==null){let C=c.o;C===null&&(c.o=C=new WeakMap);const T=C.get(x);T===void 0?(c=rh(),C.set(x,c)):c=T}else{let C=c.p;C===null&&(c.p=C=new Map);const T=C.get(x);T===void 0?(c=rh(),C.set(x,c)):c=T}}const d=c;let m;if(c.s===_C)m=c.v;else if(m=e.apply(null,arguments),s++,r){const y=((p=a==null?void 0:a.deref)==null?void 0:p.call(a))??a;y!=null&&r(y,m)&&(m=y,s!==0&&s--),a=typeof m=="object"&&m!==null||typeof m=="function"?new o7(m):m}return d.s=_C,d.v=m,m}return l.clearCache=()=>{n=rh(),l.resetResultsCount()},l.resultsCount=()=>s,l.resetResultsCount=()=>{s=0},l}function jO(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...a)=>{let s=0,l=0,c,f={},d=a.pop();typeof d=="object"&&(f=d,d=a.pop()),Gq(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const m={...n,...f},{memoize:p,memoizeOptions:y=[],argsMemoize:g=_O,argsMemoizeOptions:x=[]}=m,C=LC(y),T=LC(x),S=Zq(a),R=p(function(){return s++,d.apply(null,arguments)},...C),k=g(function(){l++;const D=Jq(S,arguments);return c=R.apply(null,D),c},...T);return Object.assign(k,{resultFunc:d,memoizedResultFunc:R,dependencies:S,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>c,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:p,argsMemoize:g})};return Object.assign(r,{withTypes:()=>r}),r}var l7=jO(_O),u7=Object.assign((e,t=l7)=>{Xq(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),r=n.map(s=>e[s]);return t(r,(...s)=>s.reduce((l,c,f)=>(l[n[f]]=c,l),{}))},{withTypes:()=>u7});jO({memoize:i7,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Ye=(e,t,n,r,a,s,...l)=>{if(l.length>0)throw new Error(Sn(1));let c;if(e)c=e;else throw new Error("Missing arguments");return c};var Yy={exports:{}},Wy={};/**
363
+ * @license React
364
+ * use-sync-external-store-shim/with-selector.production.js
365
+ *
366
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
367
+ *
368
+ * This source code is licensed under the MIT license found in the
369
+ * LICENSE file in the root directory of this source tree.
370
+ */var jC;function c7(){if(jC)return Wy;jC=1;var e=hd(),t=jk();function n(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,s=e.useRef,l=e.useEffect,c=e.useMemo,f=e.useDebugValue;return Wy.useSyncExternalStoreWithSelector=function(d,m,p,y,g){var x=s(null);if(x.current===null){var C={hasValue:!1,value:null};x.current=C}else C=x.current;x=c(function(){function S(O){if(!R){if(R=!0,k=O,O=y(O),g!==void 0&&C.hasValue){var N=C.value;if(g(N,O))return M=N}return M=O}if(N=M,r(k,O))return N;var _=y(O);return g!==void 0&&g(N,_)?(k=O,N):(k=O,M=_)}var R=!1,k,M,D=p===void 0?null:p;return[function(){return S(m())},D===null?void 0:function(){return S(D())}]},[m,p,y,g]);var T=a(d,x[0],x[1]);return l(function(){C.hasValue=!0,C.value=T},[T]),f(T),T},Wy}var zC;function d7(){return zC||(zC=1,Yy.exports=c7()),Yy.exports}var f7=d7();const tv=[];let nv;function h7(){return nv}function p7(e){tv.push(e)}function Nx(e){const t=(n,r)=>{const a=Jn(m7).current;let s;try{nv=a;for(const l of tv)l.before(a);s=e(n,r);for(const l of tv)l.after(a);a.didInitialize=!0}finally{nv=void 0}return s};return t.displayName=e.displayName||e.name,t}function zO(e){return w.forwardRef(Nx(e))}function m7(){return{didInitialize:!1}}const g7=ax(19),y7=g7?v7:x7;function xt(e,t,n,r,a){return y7(e,t,n,r,a)}function b7(e,t,n,r,a){const s=w.useCallback(()=>t(e.getSnapshot(),n,r,a),[e,t,n,r,a]);return Zv.useSyncExternalStore(e.subscribe,s,s)}p7({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],a=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,a))&&(t=!0,r.value=a,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const a of e.syncHooks)n.add(a.store);const r=[];for(const a of n)r.push(a.subscribe(t));return()=>{for(const a of r)a()}}),Zv.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function v7(e,t,n,r,a){const s=h7();if(!s)return b7(e,t,n,r,a);const l=s.syncIndex;s.syncIndex+=1;let c;return s.didInitialize?(c=s.syncHooks[l],(c.store!==e||c.selector!==t||!Object.is(c.a1,n)||!Object.is(c.a2,r)||!Object.is(c.a3,a))&&(c.store!==e&&(s.didChangeStore=!0),c.store=e,c.selector=t,c.a1=n,c.a2=r,c.a3=a,c.didChange=!0)):(c={store:e,selector:t,a1:n,a2:r,a3:a,value:t(e.getSnapshot(),n,r,a),didChange:!1},s.syncHooks.push(c)),c.value}function x7(e,t,n,r,a){return f7.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,r,a))}class FO{constructor(t){tt(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));tt(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(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,r,a){return xt(this,t,n,r,a)}}class jp extends FO{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){w.useDebugValue(t),He(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const r=this;He(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);He(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){w.useDebugValue(t);const r=n!==void 0;He(()=>{r&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,r])}select(t,n,r,a){const s=this.selectors[t];return s(this.state,n,r,a)}useState(t,n,r,a){return w.useDebugValue(t),xt(this,this.selectors[t],n,r,a)}useContextCallback(t,n){w.useDebugValue(t);const r=Ve(n??_r);this.context[t]=r}useStateSetter(t){const n=w.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let a=r(this.state);return n(a,a,this),this.subscribe(s=>{const l=r(s);if(!Object.is(a,l)){const c=a;a=l,n(l,c,this)}})}}const kc=0;class Qi{constructor(){tt(this,"currentId",kc);tt(this,"clear",()=>{this.currentId!==kc&&(clearTimeout(this.currentId),this.currentId=kc)});tt(this,"disposeEffect",()=>this.clear)}static create(){return new Qi}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=kc,n()},t)}isStarted(){return this.currentId!==kc}}function _n(){const e=Jn(Qi.create).current;return Np(e.disposeEffect),e}function Kt(e){return(e==null?void 0:e.ownerDocument)||document}const xu=typeof navigator<"u",Ky=S7(),BO=T7(),HO=E7(),zp=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),UO=Ky.platform==="MacIntel"&&Ky.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Ky.platform),VO=xu&&/apple/i.test(navigator.vendor),rv=xu&&/android/i.test(BO)||/android/i.test(HO),w7=xu&&BO.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,qO=HO.includes("jsdom/");function S7(){if(!xu)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e!=null&&e.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function E7(){if(!xu)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function T7(){if(!xu)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}const iv="data-base-ui-focusable",$O="active",YO="selected",WO="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",No="ArrowLeft",Do="ArrowRight",Dx="ArrowUp",Ed="ArrowDown";function Xr(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function Et(e,t){var r;if(!e||!t)return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e.contains(t))return!0;if(n&&Pb(n)){let a=t;for(;a;){if(e===a)return!0;a=a.parentNode||a.host}}return!1}function Yh(e,t){if(!sn(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(Et(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function Sr(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ri(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 C7(e){return e.matches("html,body")}function Fp(e){return Cn(e)&&e.matches(WO)}function av(e){return e?e.getAttribute("role")==="combobox"&&Fp(e):!1}function R7(e){if(!e||qO)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function ad(e){return e?e.hasAttribute(iv)?e:e.querySelector(`[${iv}]`)||e:null}function As(e,t,n=!0){return e.filter(a=>{var s;return a.parentId===t&&(!n||((s=a.context)==null?void 0:s.open))}).flatMap(a=>[a,...As(e,a.id,n)])}function FC(e,t){var a;let n=[],r=(a=e.find(s=>s.id===t))==null?void 0:a.parentId;for(;r;){const s=e.find(l=>l.id===r);r=s==null?void 0:s.parentId,s&&(n=n.concat(s))}return n}function pr(e){e.preventDefault(),e.stopPropagation()}function k7(e){return"nativeEvent"in e}function KO(e){return e.pointerType===""&&e.isTrusted?!0:rv&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function GO(e){return qO?!1:!rv&&e.width===0&&e.height===0||rv&&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 Bs(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function XO(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const M7=["top","right","bottom","left"],lu=Math.min,Qr=Math.max,Wh=Math.round,Pl=Math.floor,Ki=e=>({x:e,y:e}),O7={left:"right",right:"left",bottom:"top",top:"bottom"},A7={start:"end",end:"start"};function ov(e,t,n){return Qr(e,lu(t,n))}function La(e,t){return typeof e=="function"?e(t):e}function jr(e){return e.split("-")[0]}function Uo(e){return e.split("-")[1]}function Ix(e){return e==="x"?"y":"x"}function Px(e){return e==="y"?"height":"width"}const N7=new Set(["top","bottom"]);function pi(e){return N7.has(jr(e))?"y":"x"}function Lx(e){return Ix(pi(e))}function D7(e,t,n){n===void 0&&(n=!1);const r=Uo(e),a=Lx(e),s=Px(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(l=Kh(l)),[l,Kh(l)]}function I7(e){const t=Kh(e);return[sv(e),t,sv(t)]}function sv(e){return e.replace(/start|end/g,t=>A7[t])}const BC=["left","right"],HC=["right","left"],P7=["top","bottom"],L7=["bottom","top"];function _7(e,t,n){switch(e){case"top":case"bottom":return n?t?HC:BC:t?BC:HC;case"left":case"right":return t?P7:L7;default:return[]}}function j7(e,t,n,r){const a=Uo(e);let s=_7(jr(e),n==="start",r);return a&&(s=s.map(l=>l+"-"+a),t&&(s=s.concat(s.map(sv)))),s}function Kh(e){return e.replace(/left|right|bottom|top/g,t=>O7[t])}function z7(e){return{top:0,right:0,bottom:0,left:0,...e}}function QO(e){return typeof e!="number"?z7(e):{top:e,right:e,bottom:e,left:e}}function Gh(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function ih(e,t,n){return Math.floor(e/t)!==n}function zl(e,t){return t<0||t>=e.current.length}function Ch(e,t){return ur(e,{disabledIndices:t})}function lv(e,t){return ur(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ur(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:a=1}={}){let s=t;do s+=n?-a:a;while(s>=0&&s<=e.current.length-1&&Io(e,s,r));return s}function ZO(e,{event:t,orientation:n,loopFocus:r,rtl:a,cols:s,disabledIndices:l,minIndex:c,maxIndex:f,prevIndex:d,stopEvent:m=!1}){let p=d;const y=[],g={};let x=!1;{let S=null,R=-1;e.current.forEach((k,M)=>{if(k==null)return;const D=k.closest('[role="row"]');D&&(x=!0),(D!==S||R===-1)&&(S=D,R+=1,y[R]=[]),y[R].push(M),g[M]=R})}const C=x&&y.length>0&&y.some(S=>S.length!==s);function T(S){if(!C||d===-1)return;const R=g[d];if(R==null)return;const k=y[R].indexOf(d);let M=S==="up"?R-1:R+1;r&&(M<0?M=y.length-1:M>=y.length&&(M=0));const D=new Set;for(;M>=0&&M<y.length&&!D.has(M);){D.add(M);const O=y[M];if(O.length===0){M=S==="up"?M-1:M+1;continue}const N=Math.min(k,O.length-1);for(let _=N;_>=0;_-=1){const $=O[_];if(!Io(e,$,l))return $}M=S==="up"?M-1:M+1,r&&(M<0?M=y.length-1:M>=y.length&&(M=0))}}if(t.key===Dx){const S=T("up");if(S!==void 0)m&&pr(t),p=S;else{if(m&&pr(t),d===-1)p=f;else if(p=ur(e,{startingIndex:p,amount:s,decrement:!0,disabledIndices:l}),r&&(d-s<c||p<0)){const R=d%s,k=f%s,M=f-(k-R);k===R?p=f:p=k>R?M:M-s}zl(e,p)&&(p=d)}}if(t.key===Ed){const S=T("down");S!==void 0?(m&&pr(t),p=S):(m&&pr(t),d===-1?p=c:(p=ur(e,{startingIndex:d,amount:s,disabledIndices:l}),r&&d+s>f&&(p=ur(e,{startingIndex:d%s-s,amount:s,disabledIndices:l}))),zl(e,p)&&(p=d))}if(n==="both"){const S=Pl(d/s);t.key===(a?No:Do)&&(m&&pr(t),d%s!==s-1?(p=ur(e,{startingIndex:d,disabledIndices:l}),r&&ih(p,s,S)&&(p=ur(e,{startingIndex:d-d%s-1,disabledIndices:l}))):r&&(p=ur(e,{startingIndex:d-d%s-1,disabledIndices:l})),ih(p,s,S)&&(p=d)),t.key===(a?Do:No)&&(m&&pr(t),d%s!==0?(p=ur(e,{startingIndex:d,decrement:!0,disabledIndices:l}),r&&ih(p,s,S)&&(p=ur(e,{startingIndex:d+(s-d%s),decrement:!0,disabledIndices:l}))):r&&(p=ur(e,{startingIndex:d+(s-d%s),decrement:!0,disabledIndices:l})),ih(p,s,S)&&(p=d));const R=Pl(f/s)===S;zl(e,p)&&(r&&R?p=t.key===(a?Do:No)?f:ur(e,{startingIndex:d-d%s-1,disabledIndices:l}):p=d)}return p}function JO(e,t,n){const r=[];let a=0;return e.forEach(({width:s,height:l},c)=>{let f=!1;for(n&&(a=0);!f;){const d=[];for(let m=0;m<s;m+=1)for(let p=0;p<l;p+=1)d.push(a+m+p*t);a%t+s<=t&&d.every(m=>r[m]==null)?(d.forEach(m=>{r[m]=c}),f=!0):a+=1}}),[...r]}function eA(e,t,n,r,a){if(e===-1)return-1;const s=n.indexOf(e),l=t[e];switch(a){case"tl":return s;case"tr":return l?s+l.width-1:s;case"bl":return l?s+(l.height-1)*r:s;case"br":return n.lastIndexOf(e);default:return-1}}function tA(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function Io(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const r=e.current[t];return r?r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true":!1}/*!
371
+ * tabbable 6.4.0
372
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
373
+ */var F7=["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] *)"],Xh=F7.join(","),nA=typeof Element>"u",uu=nA?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Qh=!nA&&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==null?void 0:e.ownerDocument},Zh=function(t,n){var r;n===void 0&&(n=!0);var a=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=a===""||a==="true",l=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Zh(t.parentNode));return l},B7=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},rA=function(t,n,r){if(Zh(t))return[];var a=Array.prototype.slice.apply(t.querySelectorAll(Xh));return n&&uu.call(t,Xh)&&a.unshift(t),a=a.filter(r),a},Jh=function(t,n,r){for(var a=[],s=Array.from(t);s.length;){var l=s.shift();if(!Zh(l,!1))if(l.tagName==="SLOT"){var c=l.assignedElements(),f=c.length?c:l.children,d=Jh(f,!0,r);r.flatten?a.push.apply(a,d):a.push({scopeParent:l,candidates:d})}else{var m=uu.call(l,Xh);m&&r.filter(l)&&(n||!t.includes(l))&&a.push(l);var p=l.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(l),y=!Zh(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(p&&y){var g=Jh(p===!0?l.children:p.children,!0,r);r.flatten?a.push.apply(a,g):a.push({scopeParent:l,candidates:g})}else s.unshift.apply(s,l.children)}}return a},iA=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},aA=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||B7(t))&&!iA(t)?0:t.tabIndex},H7=function(t,n){var r=aA(t);return r<0&&n&&!iA(t)?0:r},U7=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},oA=function(t){return t.tagName==="INPUT"},V7=function(t){return oA(t)&&t.type==="hidden"},q7=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},$7=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Y7=function(t){if(!t.name)return!0;var n=t.form||Qh(t),r=function(c){return n.querySelectorAll('input[type="radio"][name="'+c+'"]')},a;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")a=r(window.CSS.escape(t.name));else try{a=r(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 s=$7(a,t.form);return!s||s===t},W7=function(t){return oA(t)&&t.type==="radio"},K7=function(t){return W7(t)&&!Y7(t)},G7=function(t){var n,r=t&&Qh(t),a=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var l,c,f;for(s=!!((l=a)!==null&&l!==void 0&&(c=l.ownerDocument)!==null&&c!==void 0&&c.contains(a)||t!=null&&(f=t.ownerDocument)!==null&&f!==void 0&&f.contains(t));!s&&a;){var d,m,p;r=Qh(a),a=(d=r)===null||d===void 0?void 0:d.host,s=!!((m=a)!==null&&m!==void 0&&(p=m.ownerDocument)!==null&&p!==void 0&&p.contains(a))}}return s},UC=function(t){var n=t.getBoundingClientRect(),r=n.width,a=n.height;return r===0&&a===0},X7=function(t,n){var r=n.displayCheck,a=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var l=uu.call(t,"details>summary:first-of-type"),c=l?t.parentElement:t;if(uu.call(c,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof a=="function"){for(var f=t;t;){var d=t.parentElement,m=Qh(t);if(d&&!d.shadowRoot&&a(d)===!0)return UC(t);t.assignedSlot?t=t.assignedSlot:!d&&m!==t.ownerDocument?t=m.host:t=d}t=f}if(G7(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return UC(t);return!1},Q7=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var a=n.children.item(r);if(a.tagName==="LEGEND")return uu.call(n,"fieldset[disabled] *")?!0:!a.contains(t)}return!0}n=n.parentElement}return!1},uv=function(t,n){return!(n.disabled||V7(n)||X7(n,t)||q7(n)||Q7(n))},cv=function(t,n){return!(K7(n)||aA(n)<0||!uv(t,n))},Z7=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},sA=function(t){var n=[],r=[];return t.forEach(function(a,s){var l=!!a.scopeParent,c=l?a.scopeParent:a,f=H7(c,l),d=l?sA(a.candidates):c;f===0?l?n.push.apply(n,d):n.push(c):r.push({documentOrder:s,tabIndex:f,item:a,isScope:l,content:d})}),r.sort(U7).reduce(function(a,s){return s.isScope?a.push.apply(a,s.content):a.push(s.content),a},[]).concat(n)},Td=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Jh([t],n.includeContainer,{filter:cv.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Z7}):r=rA(t,n.includeContainer,cv.bind(null,n)),sA(r)},J7=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Jh([t],n.includeContainer,{filter:uv.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=rA(t,n.includeContainer,uv.bind(null,n)),r},lA=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return uu.call(t,Xh)===!1?!1:cv(n,t)};const wu=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function uA(e,t){const n=Td(e,wu()),r=n.length;if(r===0)return;const a=Xr(Kt(e)),s=n.indexOf(a),l=s===-1?t===1?0:r-1:s+t;return n[l]}function _x(e){return uA(Kt(e).body,1)||e}function cA(e){return uA(Kt(e).body,-1)||e}function dA(e,t){if(!e)return null;const n=Td(Kt(e).body,wu()),r=n.length;if(r===0)return null;const a=n.indexOf(e);if(a===-1)return null;const s=(a+t+r)%r;return n[s]}function e$(e){return dA(e,1)}function t$(e){return dA(e,-1)}function Fl(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Et(n,r)}function n$(e){Td(e,wu()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function VC(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function fA(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(a=>a(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}class jx{constructor(){tt(this,"nodesRef",{current:[]});tt(this,"events",fA())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const hA=w.createContext(null),pA=w.createContext(null),Fa=()=>{var e;return((e=w.useContext(hA))==null?void 0:e.id)||null},Vo=e=>{const t=w.useContext(pA);return e??t};function mA(e){const t=Vs(),n=Vo(e),r=Fa();return He(()=>{if(!t)return;const a={id:t,parentId:r};return n==null||n.addNode(a),()=>{n==null||n.removeNode(a)}},[n,t,r]),t}function r$(e){const{children:t,id:n}=e,r=Fa();return E.jsx(hA.Provider,{value:w.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function i$(e){const{children:t,externalTree:n}=e,r=Jn(()=>n??new jx).current;return E.jsx(pA.Provider,{value:r,children:t})}function cu(e){return`data-base-ui-${e}`}function Rh(e,t,n){if(n&&!Bs(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r==null?void 0:r[t]}return e==null?void 0:e[t]}const a$=w.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Qi,currentIdRef:{current:null},currentContextRef:{current:null}});function o$(e,t={open:!1}){const n="rootStore"in e?e.rootStore:e,r=n.useState("floatingId"),{open:a}=t,s=w.useContext(a$),{currentIdRef:l,delayRef:c,timeoutMs:f,initialDelayRef:d,currentContextRef:m,hasProvider:p,timeout:y}=s,[g,x]=w.useState(!1);return He(()=>{function C(){var T;x(!1),(T=m.current)==null||T.setIsInstantPhase(!1),l.current=null,m.current=null,c.current=d.current}if(l.current&&!a&&l.current===r){if(x(!1),f){const T=r;return y.start(f,()=>{n.select("open")||l.current&&l.current!==T||C()}),()=>{y.clear()}}C()}},[a,r,l,c,f,d,m,y,n]),He(()=>{if(!a)return;const C=m.current,T=l.current;y.clear(),m.current={onOpenChange:n.setOpen,setIsInstantPhase:x},l.current=r,c.current={open:0,close:Rh(d.current,"close")},T!==null&&T!==r?(x(!0),C==null||C.setIsInstantPhase(!0),C==null||C.onOpenChange(!1,pt(Di))):(x(!1),C==null||C.setIsInstantPhase(!1))},[a,r,n,l,c,f,d,m,y]),He(()=>()=>{m.current=null},[m]),w.useMemo(()=>({hasProvider:p,delayRef:c,isInstantPhase:g}),[p,c,g])}const du=w.forwardRef(function(t,n){const[r,a]=w.useState();He(()=>{VO&&a("button")},[]);const s={tabIndex:0,role:r};return E.jsx("span",{...t,ref:n,style:wp,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})});let qC=0;function Wc(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:a=!1}=t;r&&cancelAnimationFrame(qC);const s=()=>e==null?void 0:e.focus({preventScroll:n});a?s():qC=requestAnimationFrame(s)}const Bl={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function $C(e){return e==="inert"?Bl.inert:e==="aria-hidden"?Bl["aria-hidden"]:Bl.none}let ah=new WeakSet,oh={},Gy=0;const gA=e=>e&&(e.host||gA(e.parentNode)),s$=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=gA(n);return e.contains(r)?r:null}).filter(n=>n!=null);function l$(e,t,n,r){const a="data-base-ui-inert",s=r?"inert":n?"aria-hidden":null,l=s$(t,e),c=new Set,f=new Set(l),d=[];oh[a]||(oh[a]=new WeakMap);const m=oh[a];l.forEach(p),y(t),c.clear();function p(g){!g||c.has(g)||(c.add(g),g.parentNode&&p(g.parentNode))}function y(g){!g||f.has(g)||[].forEach.call(g.children,x=>{if(zo(x)!=="script")if(c.has(x))y(x);else{const C=s?x.getAttribute(s):null,T=C!==null&&C!=="false",S=$C(s),R=(S.get(x)||0)+1,k=(m.get(x)||0)+1;S.set(x,R),m.set(x,k),d.push(x),R===1&&T&&ah.add(x),k===1&&x.setAttribute(a,""),!T&&s&&x.setAttribute(s,s==="inert"?"":"true")}})}return Gy+=1,()=>{d.forEach(g=>{const x=$C(s),T=(x.get(g)||0)-1,S=(m.get(g)||0)-1;x.set(g,T),m.set(g,S),T||(!ah.has(g)&&s&&g.removeAttribute(s),ah.delete(g)),S||g.removeAttribute(a)}),Gy-=1,Gy||(Bl.inert=new WeakMap,Bl["aria-hidden"]=new WeakMap,Bl.none=new WeakMap,ah=new WeakSet,oh={})}}function u$(e,t=!1,n=!1){const r=Kt(e[0]).body;return l$(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const yA=w.createContext(null),bA=()=>w.useContext(yA),c$=cu("portal");function vA(e={}){const{ref:t,container:n,componentProps:r=On,elementProps:a}=e,s=Vs(),l=bA(),c=l==null?void 0:l.portalNode,[f,d]=w.useState(null),[m,p]=w.useState(null),y=Ve(T=>{T!==null&&p(T)}),g=w.useRef(null);He(()=>{if(n===null){g.current&&(g.current=null,p(null),d(null));return}if(s==null)return;const T=(n&&(nx(n)?n:n.current))??c??document.body;if(T==null){g.current&&(g.current=null,p(null),d(null));return}g.current!==T&&(g.current=T,p(null),d(T))},[n,c,s]);const x=Ct("div",r,{ref:[t,y],props:[{id:s,[c$]:""},a]});return{portalNode:m,portalSubtree:f&&x?yi.createPortal(x,f):null}}const zx=w.forwardRef(function(t,n){const{children:r,container:a,className:s,render:l,renderGuards:c,...f}=t,{portalNode:d,portalSubtree:m}=vA({container:a,ref:n,componentProps:t,elementProps:f}),p=w.useRef(null),y=w.useRef(null),g=w.useRef(null),x=w.useRef(null),[C,T]=w.useState(null),S=C==null?void 0:C.modal,R=C==null?void 0:C.open,k=typeof c=="boolean"?c:!!C&&!C.modal&&C.open&&!!d;w.useEffect(()=>{if(!d||S)return;function D(O){d&&O.relatedTarget&&Fl(O)&&(O.type==="focusin"?VC:n$)(d)}return d.addEventListener("focusin",D,!0),d.addEventListener("focusout",D,!0),()=>{d.removeEventListener("focusin",D,!0),d.removeEventListener("focusout",D,!0)}},[d,S]),w.useEffect(()=>{!d||R||VC(d)},[R,d]);const M=w.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:y,beforeInsideRef:g,afterInsideRef:x,portalNode:d,setFocusManagerState:T}),[d]);return E.jsxs(w.Fragment,{children:[m,E.jsxs(yA.Provider,{value:M,children:[k&&d&&E.jsx(du,{"data-type":"outside",ref:p,onFocus:D=>{var O;if(Fl(D,d))(O=g.current)==null||O.focus();else{const N=C?C.domReference:null,_=cA(N);_==null||_.focus()}}}),k&&d&&E.jsx("span",{"aria-owns":d.id,style:bF}),d&&yi.createPortal(r,d),k&&d&&E.jsx(du,{"data-type":"outside",ref:y,onFocus:D=>{var O;if(Fl(D,d))(O=x.current)==null||O.focus();else{const N=C?C.domReference:null,_=_x(N);_==null||_.focus(),C!=null&&C.closeOnFocusOut&&(C==null||C.onOpenChange(!1,pt(_s,D.nativeEvent)))}}})]})]})});function d$(e,t){const n=jn(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 YC=20;let ko=[];function Fx(){ko=ko.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function f$(e){Fx(),e&&zo(e)!=="body"&&(ko.push(new WeakRef(e)),ko.length>YC&&(ko=ko.slice(-YC)))}function Xy(){var e;return Fx(),(e=ko[ko.length-1])==null?void 0:e.deref()}function h$(e){if(!e)return null;const t=wu();return lA(e,t)?e:Td(e,t)[0]||e}function p$(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Jr(e).display!=="none"}function WC(e,t){var l;if(!t.current.includes("floating")&&!((l=e.getAttribute("role"))!=null&&l.includes("dialog")))return;const n=wu(),a=J7(e,n).filter(c=>{const f=c.getAttribute("data-tabindex")||"";return lA(c,n)||c.hasAttribute("data-tabindex")&&!f.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||a.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Bx(e){const{context:t,children:n,disabled:r=!1,initialFocus:a=!0,returnFocus:s=!0,restoreFocus:l=!1,modal:c=!0,closeOnFocusOut:f=!0,openInteractionType:d="",nextFocusableElement:m,previousFocusableElement:p,beforeContentFocusGuardRef:y,externalTree:g}=e,x="rootStore"in t?t.rootStore:t,C=x.useState("open"),T=x.useState("domReferenceElement"),S=x.useState("floatingElement"),{events:R,dataRef:k}=x.context,M=Ve(()=>{var he;return(he=k.current.floatingContext)==null?void 0:he.nodeId}),D=a===!1,O=av(T)&&D,N=w.useRef(["content"]),_=rr(a),$=rr(s),F=rr(d),W=Vo(g),L=bA(),V=w.useRef(null),q=w.useRef(null),Y=w.useRef(!1),j=w.useRef(!1),z=w.useRef(!1),H=w.useRef(-1),K=w.useRef(""),P=w.useRef(""),B=w.useRef(null),G=w.useRef(null),I=Ni(B,y,L==null?void 0:L.beforeInsideRef),Q=Ni(G,L==null?void 0:L.afterInsideRef),Z=_n(),ie=_n(),ce=wd(),ge=L!=null,Ee=ad(S),_e=Ve((he=Ee)=>he?Td(he,wu()):[]),Ie=Ve(he=>{const be=_e(he);return N.current.map(()=>be).filter(Boolean).flat()});w.useEffect(()=>{if(r||!c)return;function he(Pe){Pe.key==="Tab"&&Et(Ee,Xr(Kt(Ee)))&&_e().length===0&&!O&&pr(Pe)}const be=Kt(Ee);return be.addEventListener("keydown",he),()=>{be.removeEventListener("keydown",he)}},[r,T,Ee,c,N,O,_e,Ie]),w.useEffect(()=>{if(r||!C)return;const he=Kt(Ee);function be(){z.current=!1}function Pe(Se){const Ce=Sr(Se),J=Et(S,Ce)||Et(T,Ce)||Et(L==null?void 0:L.portalNode,Ce);z.current=!J,P.current=Se.pointerType||"keyboard",Ce!=null&&Ce.closest(`[${yF}]`)&&(j.current=!0)}function Ae(){P.current="keyboard"}return he.addEventListener("pointerdown",Pe,!0),he.addEventListener("pointerup",be,!0),he.addEventListener("pointercancel",be,!0),he.addEventListener("keydown",Ae,!0),()=>{he.removeEventListener("pointerdown",Pe,!0),he.removeEventListener("pointerup",be,!0),he.removeEventListener("pointercancel",be,!0),he.removeEventListener("keydown",Ae,!0)}},[r,S,T,Ee,C,L]),w.useEffect(()=>{if(r||!f)return;const he=Kt(Ee);function be(){j.current=!0,ie.start(0,()=>{j.current=!1})}function Pe(Re){const xe=Sr(Re),$e=_e().indexOf(xe);$e!==-1&&(H.current=$e)}function Ae(Re){const xe=Re.relatedTarget,Be=Re.currentTarget,$e=Sr(Re);queueMicrotask(()=>{const te=M(),De=x.context.triggerElements,se=(xe==null?void 0:xe.hasAttribute(cu("focus-guard")))&&[B.current,G.current,L==null?void 0:L.beforeInsideRef.current,L==null?void 0:L.afterInsideRef.current,L==null?void 0:L.beforeOutsideRef.current,L==null?void 0:L.afterOutsideRef.current,Ta(p),Ta(m)].includes(xe),ye=!(Et(T,xe)||Et(S,xe)||Et(xe,S)||Et(L==null?void 0:L.portalNode,xe)||xe!=null&&De.hasElement(xe)||De.hasMatchingElement(we=>Et(we,xe))||se||W&&(As(W.nodesRef.current,te).find(we=>{var Me,Fe;return Et((Me=we.context)==null?void 0:Me.elements.floating,xe)||Et((Fe=we.context)==null?void 0:Fe.elements.domReference,xe)})||FC(W.nodesRef.current,te).find(we=>{var Me,Fe,ct;return[(Me=we.context)==null?void 0:Me.elements.floating,ad((Fe=we.context)==null?void 0:Fe.elements.floating)].includes(xe)||((ct=we.context)==null?void 0:ct.elements.domReference)===xe})));if(Be===T&&Ee&&WC(Ee,N),l&&Be!==T&&!p$($e)&&Xr(he)===he.body){if(Cn(Ee)&&(Ee.focus(),l==="popup")){ce.request(()=>{Ee.focus()});return}const we=H.current,Me=_e(),Fe=Me[we]||Me[Me.length-1]||Ee;Cn(Fe)&&Fe.focus()}if(k.current.insideReactTree){k.current.insideReactTree=!1;return}(O||!c)&&xe&&ye&&!j.current&&(O||xe!==Xy())&&(Y.current=!0,x.setOpen(!1,pt(_s,Re)))})}function Se(){z.current||(k.current.insideReactTree=!0,Z.start(0,()=>{k.current.insideReactTree=!1}))}const Ce=Cn(T)?T:null,J=[];if(!(!S&&!Ce))return Ce&&(Ce.addEventListener("focusout",Ae),Ce.addEventListener("pointerdown",be),J.push(()=>{Ce.removeEventListener("focusout",Ae),Ce.removeEventListener("pointerdown",be)})),S&&(S.addEventListener("focusin",Pe),S.addEventListener("focusout",Ae),L&&(S.addEventListener("focusout",Se,!0),J.push(()=>{S.removeEventListener("focusout",Se,!0)})),J.push(()=>{S.removeEventListener("focusin",Pe),S.removeEventListener("focusout",Ae)})),()=>{J.forEach(Re=>{Re()})}},[r,T,S,Ee,c,W,L,x,f,l,_e,O,M,N,k,Z,ie,ce,m,p]),w.useEffect(()=>{var Se,Ce,J;if(r||!S||!C)return;const he=Array.from(((Se=L==null?void 0:L.portalNode)==null?void 0:Se.querySelectorAll(`[${cu("portal")}]`))||[]),Pe=(J=(Ce=(W?FC(W.nodesRef.current,M()):[]).find(Re=>{var xe;return av(((xe=Re.context)==null?void 0:xe.elements.domReference)||null)}))==null?void 0:Ce.context)==null?void 0:J.elements.domReference,Ae=[S,Pe,...he,V.current,q.current,B.current,G.current,L==null?void 0:L.beforeOutsideRef.current,L==null?void 0:L.afterOutsideRef.current,Ta(p),Ta(m),O?T:null].filter(Re=>Re!=null);return u$(Ae,c||O)},[C,r,T,S,c,N,L,O,W,M,m,p]),He(()=>{if(!C||r||!Cn(Ee))return;const he=Kt(Ee),be=Xr(he);queueMicrotask(()=>{const Pe=Ie(Ee),Ae=_.current,Se=typeof Ae=="function"?Ae(F.current||""):Ae;if(Se===void 0||Se===!1)return;let Ce;Se===!0||Se===null?Ce=Pe[0]||Ee:Ce=Ta(Se),Ce=Ce||Pe[0]||Ee,!Et(Ee,be)&&Wc(Ce,{preventScroll:Ce===Ee})})},[r,C,Ee,D,Ie,_,F]),He(()=>{if(r||!Ee)return;const he=Kt(Ee),be=Xr(he);f$(be);function Pe(Ce){if(Ce.open||(K.current=d$(Ce.nativeEvent,P.current)),Ce.reason===wr&&Ce.nativeEvent.type==="mouseleave"&&(Y.current=!0),Ce.reason===Tp)if(Ce.nested)Y.current=!1;else if(KO(Ce.nativeEvent)||GO(Ce.nativeEvent))Y.current=!1;else{let J=!1;document.createElement("div").focus({get preventScroll(){return J=!0,!1}}),J?Y.current=!1:Y.current=!0}}R.on("openchange",Pe);const Ae=he.createElement("span");Ae.setAttribute("tabindex","-1"),Ae.setAttribute("aria-hidden","true"),Object.assign(Ae.style,wp),ge&&T&&T.insertAdjacentElement("afterend",Ae);function Se(){const Ce=$.current;let J=typeof Ce=="function"?Ce(K.current):Ce;if(J===void 0||J===!1)return null;if(J===null&&(J=!0),typeof J=="boolean"){const xe=T||Xy();return xe&&xe.isConnected?xe:Ae}const Re=T||Xy()||Ae;return Ta(J)||Re}return()=>{R.off("openchange",Pe);const Ce=Xr(he),J=Et(S,Ce)||W&&As(W.nodesRef.current,M(),!1).some(xe=>{var Be;return Et((Be=xe.context)==null?void 0:Be.elements.floating,Ce)}),Re=Se();queueMicrotask(()=>{const xe=h$(Re),Be=typeof $.current!="boolean";$.current&&!Y.current&&Cn(xe)&&(!(!Be&&xe!==Ce&&Ce!==he.body)||J)&&xe.focus({preventScroll:!0}),Ae.remove(),Y.current=!1})}},[r,S,Ee,$,k,R,W,ge,T,M]),He(()=>{if(!zp||C||!S)return;const he=Xr(Kt(S));!Cn(he)||!Fp(he)||Et(S,he)&&he.blur()},[C,S]),He(()=>{if(!(r||!L))return L.setFocusManagerState({modal:c,closeOnFocusOut:f,open:C,onOpenChange:x.setOpen,domReference:T}),()=>{L.setFocusManagerState(null)}},[r,L,c,C,x,f,T]),He(()=>{if(!(r||!Ee))return WC(Ee,N),()=>{queueMicrotask(Fx)}},[r,Ee,N]);const re=!r&&(c?!O:!0)&&(ge||c);return E.jsxs(w.Fragment,{children:[re&&E.jsx(du,{"data-type":"inside",ref:I,onFocus:he=>{var be;if(c){const Pe=Ie();Wc(Pe[Pe.length-1])}else if(L!=null&&L.portalNode)if(Y.current=!1,Fl(he,L.portalNode)){const Pe=_x(T);Pe==null||Pe.focus()}else(be=Ta(p??L.beforeOutsideRef))==null||be.focus()}}),n,re&&E.jsx(du,{"data-type":"inside",ref:Q,onFocus:he=>{var be;if(c)Wc(Ie()[0]);else if(L!=null&&L.portalNode)if(f&&(Y.current=!0),Fl(he,L.portalNode)){const Pe=cA(T);Pe==null||Pe.focus()}else(be=Ta(m??L.afterOutsideRef))==null||be.focus()}})]})}function xA(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:a=!0,event:s="click",toggle:l=!0,ignoreMouse:c=!1,stickIfOpen:f=!0,touchOpenDelay:d=0,reason:m=Ls}=t,p=w.useRef(void 0),y=wd(),g=_n(),x=w.useMemo(()=>({onPointerDown(C){p.current=C.pointerType},onMouseDown(C){const T=p.current,S=C.nativeEvent,R=n.select("open");if(C.button!==0||s==="click"||Bs(T,!0)&&c)return;const k=r.current.openEvent,M=k==null?void 0:k.type,D=n.select("domReferenceElement")!==C.currentTarget,O=R&&D||!(R&&l&&(!(k&&f)||M==="click"||M==="mousedown"));if(Fp(S.target)){const _=pt(m,S,S.target);O&&T==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,_)}):n.setOpen(O,_);return}const N=C.currentTarget;y.request(()=>{const _=pt(m,S,N);O&&T==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,_)}):n.setOpen(O,_)})},onClick(C){if(s==="mousedown-only")return;const T=p.current;if(s==="mousedown"&&T){p.current=void 0;return}if(Bs(T,!0)&&c)return;const S=n.select("open"),R=r.current.openEvent,k=n.select("domReferenceElement")!==C.currentTarget,M=S&&k||!(S&&l&&(!(R&&f)||XO(R))),D=pt(m,C.nativeEvent,C.currentTarget);M&&T==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,D)}):n.setOpen(M,D)},onKeyDown(){p.current=void 0}}),[r,s,c,n,f,l,y,g,d,m]);return w.useMemo(()=>a?{reference:x}:On,[a,x])}function m$(e,t){let n=null,r=null,a=!1;return{contextElement:e||void 0,getBoundingClientRect(){var g;const s=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l=t.axis==="x"||t.axis==="both",c=t.axis==="y"||t.axis==="both",f=["mouseenter","mousemove"].includes(((g=t.dataRef.current.openEvent)==null?void 0:g.type)||"")&&t.pointerType!=="touch";let d=s.width,m=s.height,p=s.x,y=s.y;return n==null&&t.x&&l&&(n=s.x-t.x),r==null&&t.y&&c&&(r=s.y-t.y),p-=n||0,y-=r||0,d=0,m=0,!a||f?(d=t.axis==="y"?s.width:0,m=t.axis==="x"?s.height:0,p=l&&t.x!=null?t.x:p,y=c&&t.y!=null?t.y:y):a&&!f&&(m=t.axis==="x"?s.height:m,d=t.axis==="y"?s.width:d),a=!0,{width:d,height:m,x:p,y,top:y,right:p+d,bottom:y+m,left:p}}}}function KC(e){return e!=null&&e.clientX!=null}function g$(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),a=n.useState("floatingElement"),s=n.useState("domReferenceElement"),l=n.context.dataRef,{enabled:c=!0,axis:f="both"}=t,d=w.useRef(!1),m=w.useRef(null),[p,y]=w.useState(),[g,x]=w.useState([]),C=Ve((M,D,O)=>{d.current||l.current.openEvent&&!KC(l.current.openEvent)||n.set("positionReference",m$(O??s,{x:M,y:D,axis:f,dataRef:l,pointerType:p}))}),T=Ve(M=>{r?m.current||x([]):C(M.clientX,M.clientY,M.currentTarget)}),S=Bs(p)?a:r,R=w.useCallback(()=>{if(!S||!c)return;const M=jn(a);function D(O){const N=Sr(O);Et(a,N)?(M.removeEventListener("mousemove",D),m.current=null):C(O.clientX,O.clientY)}if(!l.current.openEvent||KC(l.current.openEvent)){M.addEventListener("mousemove",D);const O=()=>{M.removeEventListener("mousemove",D),m.current=null};return m.current=O,O}n.set("positionReference",s)},[S,c,a,l,s,n,C]);w.useEffect(()=>R(),[R,g]),w.useEffect(()=>{c&&!a&&(d.current=!1)},[c,a]),w.useEffect(()=>{!c&&r&&(d.current=!0)},[c,r]);const k=w.useMemo(()=>{function M(D){y(D.pointerType)}return{onPointerDown:M,onPointerEnter:M,onMouseMove:T,onMouseEnter:T}},[T]);return w.useMemo(()=>c?{reference:k,trigger:k}:{},[c,k])}function GC(e,t,n){let{reference:r,floating:a}=e;const s=pi(t),l=Lx(t),c=Px(l),f=jr(t),d=s==="y",m=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,y=r[c]/2-a[c]/2;let g;switch(f){case"top":g={x:m,y:r.y-a.height};break;case"bottom":g={x:m,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:p};break;case"left":g={x:r.x-a.width,y:p};break;default:g={x:r.x,y:r.y}}switch(Uo(t)){case"start":g[l]-=y*(n&&d?-1:1);break;case"end":g[l]+=y*(n&&d?-1:1);break}return g}async function y$(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:s,rects:l,elements:c,strategy:f}=e,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:p="floating",altBoundary:y=!1,padding:g=0}=La(t,e),x=QO(g),T=c[y?p==="floating"?"reference":"floating":p],S=Gh(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(T)))==null||n?T:T.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:d,rootBoundary:m,strategy:f})),R=p==="floating"?{x:r,y:a,width:l.floating.width,height:l.floating.height}:l.reference,k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),M=await(s.isElement==null?void 0:s.isElement(k))?await(s.getScale==null?void 0:s.getScale(k))||{x:1,y:1}:{x:1,y:1},D=Gh(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:R,offsetParent:k,strategy:f}):R);return{top:(S.top-D.top+x.top)/M.y,bottom:(D.bottom-S.bottom+x.bottom)/M.y,left:(S.left-D.left+x.left)/M.x,right:(D.right-S.right+x.right)/M.x}}const b$=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:s=[],platform:l}=n,c=s.filter(Boolean),f=await(l.isRTL==null?void 0:l.isRTL(t));let d=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:m,y:p}=GC(d,r,f),y=r,g={},x=0;for(let T=0;T<c.length;T++){var C;const{name:S,fn:R}=c[T],{x:k,y:M,data:D,reset:O}=await R({x:m,y:p,initialPlacement:r,placement:y,strategy:a,middlewareData:g,rects:d,platform:{...l,detectOverflow:(C=l.detectOverflow)!=null?C:y$},elements:{reference:e,floating:t}});m=k??m,p=M??p,g={...g,[S]:{...g[S],...D}},O&&x<=50&&(x++,typeof O=="object"&&(O.placement&&(y=O.placement),O.rects&&(d=O.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:a}):O.rects),{x:m,y:p}=GC(d,y,f)),T=-1)}return{x:m,y:p,placement:y,strategy:a,middlewareData:g}},v$=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:s,rects:l,initialPlacement:c,platform:f,elements:d}=t,{mainAxis:m=!0,crossAxis:p=!0,fallbackPlacements:y,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:C=!0,...T}=La(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const S=jr(a),R=pi(c),k=jr(c)===c,M=await(f.isRTL==null?void 0:f.isRTL(d.floating)),D=y||(k||!C?[Kh(c)]:I7(c)),O=x!=="none";!y&&O&&D.push(...j7(c,C,x,M));const N=[c,...D],_=await f.detectOverflow(t,T),$=[];let F=((r=s.flip)==null?void 0:r.overflows)||[];if(m&&$.push(_[S]),p){const q=D7(a,l,M);$.push(_[q[0]],_[q[1]])}if(F=[...F,{placement:a,overflows:$}],!$.every(q=>q<=0)){var W,L;const q=(((W=s.flip)==null?void 0:W.index)||0)+1,Y=N[q];if(Y&&(!(p==="alignment"?R!==pi(Y):!1)||F.every(H=>pi(H.placement)===R?H.overflows[0]>0:!0)))return{data:{index:q,overflows:F},reset:{placement:Y}};let j=(L=F.filter(z=>z.overflows[0]<=0).sort((z,H)=>z.overflows[1]-H.overflows[1])[0])==null?void 0:L.placement;if(!j)switch(g){case"bestFit":{var V;const z=(V=F.filter(H=>{if(O){const K=pi(H.placement);return K===R||K==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(K=>K>0).reduce((K,P)=>K+P,0)]).sort((H,K)=>H[1]-K[1])[0])==null?void 0:V[0];z&&(j=z);break}case"initialPlacement":j=c;break}if(a!==j)return{reset:{placement:j}}}return{}}}};function XC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function QC(e){return M7.some(t=>e[t]>=0)}const x$=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...s}=La(e,t);switch(a){case"referenceHidden":{const l=await r.detectOverflow(t,{...s,elementContext:"reference"}),c=XC(l,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:QC(c)}}}case"escaped":{const l=await r.detectOverflow(t,{...s,altBoundary:!0}),c=XC(l,n.floating);return{data:{escapedOffsets:c,escaped:QC(c)}}}default:return{}}}}},wA=new Set(["left","top"]);async function w$(e,t){const{placement:n,platform:r,elements:a}=e,s=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=jr(n),c=Uo(n),f=pi(n)==="y",d=wA.has(l)?-1:1,m=s&&f?-1:1,p=La(t,e);let{mainAxis:y,crossAxis:g,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof x=="number"&&(g=c==="end"?x*-1:x),f?{x:g*m,y:y*d}:{x:y*d,y:g*m}}const S$=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:s,placement:l,middlewareData:c}=t,f=await w$(t,e);return l===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:a+f.x,y:s+f.y,data:{...f,placement:l}}}}},E$=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:s}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:f={fn:S=>{let{x:R,y:k}=S;return{x:R,y:k}}},...d}=La(e,t),m={x:n,y:r},p=await s.detectOverflow(t,d),y=pi(jr(a)),g=Ix(y);let x=m[g],C=m[y];if(l){const S=g==="y"?"top":"left",R=g==="y"?"bottom":"right",k=x+p[S],M=x-p[R];x=ov(k,x,M)}if(c){const S=y==="y"?"top":"left",R=y==="y"?"bottom":"right",k=C+p[S],M=C-p[R];C=ov(k,C,M)}const T=f.fn({...t,[g]:x,[y]:C});return{...T,data:{x:T.x-n,y:T.y-r,enabled:{[g]:l,[y]:c}}}}}},T$=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:s,middlewareData:l}=t,{offset:c=0,mainAxis:f=!0,crossAxis:d=!0}=La(e,t),m={x:n,y:r},p=pi(a),y=Ix(p);let g=m[y],x=m[p];const C=La(c,t),T=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:0,crossAxis:0,...C};if(f){const k=y==="y"?"height":"width",M=s.reference[y]-s.floating[k]+T.mainAxis,D=s.reference[y]+s.reference[k]-T.mainAxis;g<M?g=M:g>D&&(g=D)}if(d){var S,R;const k=y==="y"?"width":"height",M=wA.has(jr(a)),D=s.reference[p]-s.floating[k]+(M&&((S=l.offset)==null?void 0:S[p])||0)+(M?0:T.crossAxis),O=s.reference[p]+s.reference[k]+(M?0:((R=l.offset)==null?void 0:R[p])||0)-(M?T.crossAxis:0);x<D?x=D:x>O&&(x=O)}return{[y]:g,[p]:x}}}},C$=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:s,platform:l,elements:c}=t,{apply:f=()=>{},...d}=La(e,t),m=await l.detectOverflow(t,d),p=jr(a),y=Uo(a),g=pi(a)==="y",{width:x,height:C}=s.floating;let T,S;p==="top"||p==="bottom"?(T=p,S=y===(await(l.isRTL==null?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(S=p,T=y==="end"?"top":"bottom");const R=C-m.top-m.bottom,k=x-m.left-m.right,M=lu(C-m[T],R),D=lu(x-m[S],k),O=!t.middlewareData.shift;let N=M,_=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(N=R),O&&!y){const F=Qr(m.left,0),W=Qr(m.right,0),L=Qr(m.top,0),V=Qr(m.bottom,0);g?_=x-2*(F!==0||W!==0?F+W:Qr(m.left,m.right)):N=C-2*(L!==0||V!==0?L+V:Qr(m.top,m.bottom))}await f({...t,availableWidth:_,availableHeight:N});const $=await l.getDimensions(c.floating);return x!==$.width||C!==$.height?{reset:{rects:!0}}:{}}}};function SA(e){const t=Jr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Cn(e),s=a?e.offsetWidth:n,l=a?e.offsetHeight:r,c=Wh(n)!==s||Wh(r)!==l;return c&&(n=s,r=l),{width:n,height:r,$:c}}function Hx(e){return sn(e)?e:e.contextElement}function Hl(e){const t=Hx(e);if(!Cn(t))return Ki(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:s}=SA(t);let l=(s?Wh(n.width):n.width)/r,c=(s?Wh(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const R$=Ki(0);function EA(e){const t=jn(e);return!bp()||!t.visualViewport?R$:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function k$(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==jn(e)?!1:t}function Hs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),s=Hx(e);let l=Ki(1);t&&(r?sn(r)&&(l=Hl(r)):l=Hl(e));const c=k$(s,n,r)?EA(s):Ki(0);let f=(a.left+c.x)/l.x,d=(a.top+c.y)/l.y,m=a.width/l.x,p=a.height/l.y;if(s){const y=jn(s),g=r&&sn(r)?jn(r):r;let x=y,C=Lb(x);for(;C&&r&&g!==x;){const T=Hl(C),S=C.getBoundingClientRect(),R=Jr(C),k=S.left+(C.clientLeft+parseFloat(R.paddingLeft))*T.x,M=S.top+(C.clientTop+parseFloat(R.paddingTop))*T.y;f*=T.x,d*=T.y,m*=T.x,p*=T.y,f+=k,d+=M,x=jn(C),C=Lb(x)}}return Gh({width:m,height:p,x:f,y:d})}function Bp(e,t){const n=vp(e).scrollLeft;return t?t.left+n:Hs(Ji(e)).left+n}function TA(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Bp(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function M$(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const s=a==="fixed",l=Ji(r),c=t?yp(t.floating):!1;if(r===l||c&&s)return n;let f={scrollLeft:0,scrollTop:0},d=Ki(1);const m=Ki(0),p=Cn(r);if((p||!p&&!s)&&((zo(r)!=="body"||Fo(l))&&(f=vp(r)),Cn(r))){const g=Hs(r);d=Hl(r),m.x=g.x+r.clientLeft,m.y=g.y+r.clientTop}const y=l&&!p&&!s?TA(l,f):Ki(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-f.scrollLeft*d.x+m.x+y.x,y:n.y*d.y-f.scrollTop*d.y+m.y+y.y}}function O$(e){return Array.from(e.getClientRects())}function A$(e){const t=Ji(e),n=vp(e),r=e.ownerDocument.body,a=Qr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Qr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Bp(e);const c=-n.scrollTop;return Jr(r).direction==="rtl"&&(l+=Qr(t.clientWidth,r.clientWidth)-a),{width:a,height:s,x:l,y:c}}const ZC=25;function N$(e,t){const n=jn(e),r=Ji(e),a=n.visualViewport;let s=r.clientWidth,l=r.clientHeight,c=0,f=0;if(a){s=a.width,l=a.height;const m=bp();(!m||m&&t==="fixed")&&(c=a.offsetLeft,f=a.offsetTop)}const d=Bp(r);if(d<=0){const m=r.ownerDocument,p=m.body,y=getComputedStyle(p),g=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,x=Math.abs(r.clientWidth-p.clientWidth-g);x<=ZC&&(s-=x)}else d<=ZC&&(s+=d);return{width:s,height:l,x:c,y:f}}const D$=new Set(["absolute","fixed"]);function I$(e,t){const n=Hs(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,s=Cn(e)?Hl(e):Ki(1),l=e.clientWidth*s.x,c=e.clientHeight*s.y,f=a*s.x,d=r*s.y;return{width:l,height:c,x:f,y:d}}function JC(e,t,n){let r;if(t==="viewport")r=N$(e,n);else if(t==="document")r=A$(Ji(e));else if(sn(t))r=I$(t,n);else{const a=EA(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Gh(r)}function CA(e,t){const n=Xi(e);return n===t||!sn(n)||Wi(n)?!1:Jr(n).position==="fixed"||CA(n,t)}function P$(e,t){const n=t.get(e);if(n)return n;let r=Ao(e,[],!1).filter(c=>sn(c)&&zo(c)!=="body"),a=null;const s=Jr(e).position==="fixed";let l=s?Xi(e):e;for(;sn(l)&&!Wi(l);){const c=Jr(l),f=rx(l);!f&&c.position==="fixed"&&(a=null),(s?!f&&!a:!f&&c.position==="static"&&!!a&&D$.has(a.position)||Fo(l)&&!f&&CA(e,l))?r=r.filter(m=>m!==l):a=c,l=Xi(l)}return t.set(e,r),r}function L$(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?yp(t)?[]:P$(t,this._c):[].concat(n),r],c=l[0],f=l.reduce((d,m)=>{const p=JC(t,m,a);return d.top=Qr(p.top,d.top),d.right=lu(p.right,d.right),d.bottom=lu(p.bottom,d.bottom),d.left=Qr(p.left,d.left),d},JC(t,c,a));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function _$(e){const{width:t,height:n}=SA(e);return{width:t,height:n}}function j$(e,t,n){const r=Cn(t),a=Ji(t),s=n==="fixed",l=Hs(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const f=Ki(0);function d(){f.x=Bp(a)}if(r||!r&&!s)if((zo(t)!=="body"||Fo(a))&&(c=vp(t)),r){const g=Hs(t,!0,s,t);f.x=g.x+t.clientLeft,f.y=g.y+t.clientTop}else a&&d();s&&!r&&a&&d();const m=a&&!r&&!s?TA(a,c):Ki(0),p=l.left+c.scrollLeft-f.x-m.x,y=l.top+c.scrollTop-f.y-m.y;return{x:p,y,width:l.width,height:l.height}}function Qy(e){return Jr(e).position==="static"}function eR(e,t){if(!Cn(e)||Jr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ji(e)===n&&(n=n.ownerDocument.body),n}function RA(e,t){const n=jn(e);if(yp(e))return n;if(!Cn(e)){let a=Xi(e);for(;a&&!Wi(a);){if(sn(a)&&!Qy(a))return a;a=Xi(a)}return n}let r=eR(e,t);for(;r&&U5(r)&&Qy(r);)r=eR(r,t);return r&&Wi(r)&&Qy(r)&&!rx(r)?n:r||W5(e)||n}const z$=async function(e){const t=this.getOffsetParent||RA,n=this.getDimensions,r=await n(e.floating);return{reference:j$(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function F$(e){return Jr(e).direction==="rtl"}const B$={convertOffsetParentRelativeRectToViewportRelativeRect:M$,getDocumentElement:Ji,getClippingRect:L$,getOffsetParent:RA,getElementRects:z$,getClientRects:O$,getDimensions:_$,getScale:Hl,isElement:sn,isRTL:F$};function kA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function H$(e,t){let n=null,r;const a=Ji(e);function s(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function l(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),s();const d=e.getBoundingClientRect(),{left:m,top:p,width:y,height:g}=d;if(c||t(),!y||!g)return;const x=Pl(p),C=Pl(a.clientWidth-(m+y)),T=Pl(a.clientHeight-(p+g)),S=Pl(m),k={rootMargin:-x+"px "+-C+"px "+-T+"px "+-S+"px",threshold:Qr(0,lu(1,f))||1};let M=!0;function D(O){const N=O[0].intersectionRatio;if(N!==f){if(!M)return l();N?l(!1,N):r=setTimeout(()=>{l(!1,1e-7)},1e3)}N===1&&!kA(d,e.getBoundingClientRect())&&l(),M=!1}try{n=new IntersectionObserver(D,{...k,root:a.ownerDocument})}catch{n=new IntersectionObserver(D,k)}n.observe(e)}return l(!0),s}function tR(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,d=Hx(e),m=a||s?[...d?Ao(d):[],...Ao(t)]:[];m.forEach(S=>{a&&S.addEventListener("scroll",n,{passive:!0}),s&&S.addEventListener("resize",n)});const p=d&&c?H$(d,n):null;let y=-1,g=null;l&&(g=new ResizeObserver(S=>{let[R]=S;R&&R.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var k;(k=g)==null||k.observe(t)})),n()}),d&&!f&&g.observe(d),g.observe(t));let x,C=f?Hs(e):null;f&&T();function T(){const S=Hs(e);C&&!kA(C,S)&&n(),C=S,x=requestAnimationFrame(T)}return n(),()=>{var S;m.forEach(R=>{a&&R.removeEventListener("scroll",n),s&&R.removeEventListener("resize",n)}),p==null||p(),(S=g)==null||S.disconnect(),g=null,f&&cancelAnimationFrame(x)}}const U$=S$,V$=E$,q$=v$,$$=C$,Y$=x$,W$=T$,K$=(e,t,n)=>{const r=new Map,a={platform:B$,...n},s={...a.platform,_c:r};return b$(e,t,{...a,platform:s})};var G$=typeof document<"u",X$=function(){},kh=G$?w.useLayoutEffect:X$;function ep(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ep(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const s=a[r];if(!(s==="_owner"&&e.$$typeof)&&!ep(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function MA(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nR(e,t){const n=MA(e);return Math.round(t*n)/n}function Zy(e){const t=w.useRef(e);return kh(()=>{t.current=e}),t}function Q$(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:s,floating:l}={},transform:c=!0,whileElementsMounted:f,open:d}=e,[m,p]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,g]=w.useState(r);ep(y,r)||g(r);const[x,C]=w.useState(null),[T,S]=w.useState(null),R=w.useCallback(H=>{H!==O.current&&(O.current=H,C(H))},[]),k=w.useCallback(H=>{H!==N.current&&(N.current=H,S(H))},[]),M=s||x,D=l||T,O=w.useRef(null),N=w.useRef(null),_=w.useRef(m),$=f!=null,F=Zy(f),W=Zy(a),L=Zy(d),V=w.useCallback(()=>{if(!O.current||!N.current)return;const H={placement:t,strategy:n,middleware:y};W.current&&(H.platform=W.current),K$(O.current,N.current,H).then(K=>{const P={...K,isPositioned:L.current!==!1};q.current&&!ep(_.current,P)&&(_.current=P,yi.flushSync(()=>{p(P)}))})},[y,t,n,W,L]);kh(()=>{d===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,p(H=>({...H,isPositioned:!1})))},[d]);const q=w.useRef(!1);kh(()=>(q.current=!0,()=>{q.current=!1}),[]),kh(()=>{if(M&&(O.current=M),D&&(N.current=D),M&&D){if(F.current)return F.current(M,D,V);V()}},[M,D,V,F,$]);const Y=w.useMemo(()=>({reference:O,floating:N,setReference:R,setFloating:k}),[R,k]),j=w.useMemo(()=>({reference:M,floating:D}),[M,D]),z=w.useMemo(()=>{const H={position:n,left:0,top:0};if(!j.floating)return H;const K=nR(j.floating,m.x),P=nR(j.floating,m.y);return c?{...H,transform:"translate("+K+"px, "+P+"px)",...MA(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:P}},[n,c,j.floating,m.x,m.y]);return w.useMemo(()=>({...m,update:V,refs:Y,elements:j,floatingStyles:z}),[m,V,Y,j,z])}const Z$=(e,t)=>({...U$(e),options:[e,t]}),J$=(e,t)=>({...V$(e),options:[e,t]}),eY=(e,t)=>({...W$(e),options:[e,t]}),tY=(e,t)=>({...q$(e),options:[e,t]}),nY=(e,t)=>({...$$(e),options:[e,t]}),rY=(e,t)=>({...Y$(e),options:[e,t]}),iY={intentional:"onClick",sloppy:"onPointerDown"};function aY(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function Hp(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),a=n.useState("floatingElement"),s=n.useState("referenceElement"),l=n.useState("domReferenceElement"),{onOpenChange:c,dataRef:f}=n.context,{enabled:d=!0,escapeKey:m=!0,outsidePress:p=!0,outsidePressEvent:y="sloppy",referencePress:g=!1,referencePressEvent:x="sloppy",ancestorScroll:C=!1,bubbles:T,externalTree:S}=t,R=Vo(S),k=Ve(typeof p=="function"?p:()=>!1),M=typeof p=="function"?k:p,D=w.useRef(!1),{escapeKey:O,outsidePress:N}=aY(T),_=w.useRef(null),$=_n(),F=_n(),W=Ve(()=>{F.clear(),f.current.insideReactTree=!1}),L=w.useRef(!1),V=w.useRef(""),q=Ve(re=>{V.current=re.pointerType}),Y=Ve(()=>{const re=V.current,he=re==="pen"||!re?"mouse":re,be=typeof y=="function"?y():y;return typeof be=="string"?be:be[he]}),j=Ve(re=>{var Se;if(!r||!d||!m||re.key!=="Escape"||L.current)return;const he=(Se=f.current.floatingContext)==null?void 0:Se.nodeId,be=R?As(R.nodesRef.current,he):[];if(!O&&be.length>0){let Ce=!0;if(be.forEach(J=>{var Re;(Re=J.context)!=null&&Re.open&&!J.context.dataRef.current.__escapeKeyBubbles&&(Ce=!1)}),!Ce)return}const Pe=k7(re)?re.nativeEvent:re,Ae=pt(Cp,Pe);n.setOpen(!1,Ae),!O&&!Ae.isPropagationAllowed&&re.stopPropagation()}),z=Ve(re=>{const he=Y();return he==="intentional"&&re.type!=="click"||he==="sloppy"&&re.type==="click"}),H=Ve(()=>{f.current.insideReactTree=!0,F.start(0,W)}),K=Ve((re,he=!1)=>{var Be;if(z(re)){W();return}if(f.current.insideReactTree){W();return}if(Y()==="intentional"&&he||typeof M=="function"&&!M(re))return;const be=Sr(re),Pe=`[${cu("inert")}]`,Ae=Kt(n.select("floatingElement")).querySelectorAll(Pe),Se=n.context.triggerElements;if(be&&(Se.hasElement(be)||Se.hasMatchingElement($e=>Et($e,be))))return;let Ce=sn(be)?be:null;for(;Ce&&!Wi(Ce);){const $e=Xi(Ce);if(Wi($e)||!sn($e))break;Ce=$e}if(Ae.length&&sn(be)&&!C7(be)&&!Et(be,n.select("floatingElement"))&&Array.from(Ae).every($e=>!Et(Ce,$e)))return;if(Cn(be)&&!("touches"in re)){const $e=Wi(be),te=Jr(be),De=/auto|scroll/,se=$e||De.test(te.overflowX),ye=$e||De.test(te.overflowY),we=se&&be.clientWidth>0&&be.scrollWidth>be.clientWidth,Me=ye&&be.clientHeight>0&&be.scrollHeight>be.clientHeight,Fe=te.direction==="rtl",ct=Me&&(Fe?re.offsetX<=be.offsetWidth-be.clientWidth:re.offsetX>be.clientWidth),bt=we&&re.offsetY>be.clientHeight;if(ct||bt)return}const J=(Be=f.current.floatingContext)==null?void 0:Be.nodeId,Re=R&&As(R.nodesRef.current,J).some($e=>{var te;return Ri(re,(te=$e.context)==null?void 0:te.elements.floating)});if(Ri(re,n.select("floatingElement"))||Ri(re,n.select("domReferenceElement"))||Re)return;const xe=R?As(R.nodesRef.current,J):[];if(xe.length>0){let $e=!0;if(xe.forEach(te=>{var De;(De=te.context)!=null&&De.open&&!te.context.dataRef.current.__outsidePressBubbles&&($e=!1)}),!$e)return}n.setOpen(!1,pt(Tp,re)),W()}),P=Ve(re=>{Y()!=="sloppy"||re.pointerType==="touch"||!n.select("open")||!d||Ri(re,n.select("floatingElement"))||Ri(re,n.select("domReferenceElement"))||K(re)}),B=Ve(re=>{if(Y()!=="sloppy"||!n.select("open")||!d||Ri(re,n.select("floatingElement"))||Ri(re,n.select("domReferenceElement")))return;const he=re.touches[0];he&&(_.current={startTime:Date.now(),startX:he.clientX,startY:he.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},$.start(1e3,()=>{_.current&&(_.current.dismissOnTouchEnd=!1,_.current.dismissOnMouseDown=!1)}))}),G=Ve(re=>{const he=Sr(re);function be(){B(re),he==null||he.removeEventListener(re.type,be)}he==null||he.addEventListener(re.type,be)}),I=Ve(re=>{const he=D.current;if(D.current=!1,$.clear(),re.type==="mousedown"&&_.current&&!_.current.dismissOnMouseDown)return;const be=Sr(re);function Pe(){re.type==="pointerdown"?P(re):K(re,he),be==null||be.removeEventListener(re.type,Pe)}be==null||be.addEventListener(re.type,Pe)}),Q=Ve(re=>{if(Y()!=="sloppy"||!_.current||Ri(re,n.select("floatingElement"))||Ri(re,n.select("domReferenceElement")))return;const he=re.touches[0];if(!he)return;const be=Math.abs(he.clientX-_.current.startX),Pe=Math.abs(he.clientY-_.current.startY),Ae=Math.sqrt(be*be+Pe*Pe);Ae>5&&(_.current.dismissOnTouchEnd=!0),Ae>10&&(K(re),$.clear(),_.current=null)}),Z=Ve(re=>{const he=Sr(re);function be(){Q(re),he==null||he.removeEventListener(re.type,be)}he==null||he.addEventListener(re.type,be)}),ie=Ve(re=>{Y()!=="sloppy"||!_.current||Ri(re,n.select("floatingElement"))||Ri(re,n.select("domReferenceElement"))||(_.current.dismissOnTouchEnd&&K(re),$.clear(),_.current=null)}),ce=Ve(re=>{const he=Sr(re);function be(){ie(re),he==null||he.removeEventListener(re.type,be)}he==null||he.addEventListener(re.type,be)});w.useEffect(()=>{if(!r||!d)return;f.current.__escapeKeyBubbles=O,f.current.__outsidePressBubbles=N;const re=new Qi;function he(Ce){n.setOpen(!1,pt(Di,Ce))}function be(){re.clear(),L.current=!0}function Pe(){re.start(bp()?5:0,()=>{L.current=!1})}const Ae=Kt(a);Ae.addEventListener("pointerdown",q,!0),m&&(Ae.addEventListener("keydown",j),Ae.addEventListener("compositionstart",be),Ae.addEventListener("compositionend",Pe)),M&&(Ae.addEventListener("click",I,!0),Ae.addEventListener("pointerdown",I,!0),Ae.addEventListener("touchstart",G,!0),Ae.addEventListener("touchmove",Z,!0),Ae.addEventListener("touchend",ce,!0),Ae.addEventListener("mousedown",I,!0));let Se=[];return C&&(sn(l)&&(Se=Ao(l)),sn(a)&&(Se=Se.concat(Ao(a))),!sn(s)&&s&&s.contextElement&&(Se=Se.concat(Ao(s.contextElement)))),Se=Se.filter(Ce=>{var J;return Ce!==((J=Ae.defaultView)==null?void 0:J.visualViewport)}),Se.forEach(Ce=>{Ce.addEventListener("scroll",he,{passive:!0})}),()=>{Ae.removeEventListener("pointerdown",q,!0),m&&(Ae.removeEventListener("keydown",j),Ae.removeEventListener("compositionstart",be),Ae.removeEventListener("compositionend",Pe)),M&&(Ae.removeEventListener("click",I,!0),Ae.removeEventListener("pointerdown",I,!0),Ae.removeEventListener("touchstart",G,!0),Ae.removeEventListener("touchmove",Z,!0),Ae.removeEventListener("touchend",ce,!0),Ae.removeEventListener("mousedown",I,!0)),Se.forEach(Ce=>{Ce.removeEventListener("scroll",he)}),re.clear(),D.current=!1}},[f,a,s,l,m,M,r,c,C,d,O,N,j,K,I,P,G,Z,ce,q,n]),w.useEffect(W,[M,W]);const ge=w.useMemo(()=>({onKeyDown:j,...g&&{[iY[x]]:re=>{n.setOpen(!1,pt(Ls,re.nativeEvent))},...x!=="intentional"&&{onClick(re){n.setOpen(!1,pt(Ls,re.nativeEvent))}}}}),[j,n,g,x]),Ee=Ve(re=>{const he=Sr(re.nativeEvent);!Et(n.select("floatingElement"),he)||re.button!==0||(D.current=!0)}),_e=Ve(re=>{!r||!d||re.button!==0||(D.current=!0)}),Ie=w.useMemo(()=>({onKeyDown:j,onPointerDown:Ee,onMouseDown:Ee,onMouseUp:Ee,onClickCapture:H,onMouseDownCapture(re){H(),_e(re)},onPointerDownCapture(re){H(),_e(re)},onMouseUpCapture:H,onTouchEndCapture:H,onTouchMoveCapture:H}),[j,Ee,H,_e]);return w.useMemo(()=>d?{reference:ge,floating:Ie,trigger:ge}:{},[d,ge,Ie])}const oY={open:Ye(e=>e.open),domReferenceElement:Ye(e=>e.domReferenceElement),referenceElement:Ye(e=>e.positionReference??e.referenceElement),floatingElement:Ye(e=>e.floatingElement),floatingId:Ye(e=>e.floatingId)};class Ux extends jp{constructor(n){const{nested:r,noEmit:a,onOpenChange:s,triggerElements:l,...c}=n;super({...c,positionReference:c.referenceElement,domReferenceElement:c.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:fA(),nested:r,noEmit:a,triggerElements:l},oY);tt(this,"setOpen",(n,r)=>{var a,s;if((!n||!this.state.open||XO(r.event))&&(this.context.dataRef.current.openEvent=n?r.event:void 0),!this.context.noEmit){const l={open:n,reason:r.reason,nativeEvent:r.event,nested:this.context.nested,triggerElement:r.trigger};this.context.events.emit("openchange",l)}(s=(a=this.context).onOpenChange)==null||s.call(a,n,r)})}}function sY(e,t){const n=w.useRef(null),r=w.useRef(null);return w.useCallback(a=>{if(e!==void 0){if(n.current!==null){const s=n.current,l=r.current,c=t.context.triggerElements.getById(s);l&&c===l&&t.context.triggerElements.delete(s),n.current=null,r.current=null}a!==null&&(n.current=e,r.current=a,t.context.triggerElements.add(e,a))}},[t,e])}function OA(e,t,n,r){const a=n.useState("isMountedByTrigger",e),s=sY(e,n),l=Ve(c=>{if(s(c),!c||!n.select("open"))return;const f=n.select("activeTriggerId");if(f===e){n.update({activeTriggerElement:c,...r});return}f==null&&n.update({activeTriggerId:e,activeTriggerElement:c,...r})});return He(()=>{a&&n.update({activeTriggerElement:t.current,...r})},[a,n,t,...Object.values(r)]),{registerTrigger:l,isMountedByThisTrigger:a}}function Vx(e){const t=e.useState("open");He(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[r,a]=n.value;e.update({activeTriggerId:r,activeTriggerElement:a})}}},[t,e])}function qx(e,t,n){const{mounted:r,setMounted:a,transitionStatus:s}=Sd(e);t.useSyncedValues({mounted:r,transitionStatus:s});const l=Ve(()=>{var f,d;a(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n==null||n(),(d=(f=t.context).onOpenChangeComplete)==null||d.call(f,!1)}),c=t.useState("preventUnmountingOnClose");return za({enabled:!c,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:s}}class Cd{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elementsSet.delete(r),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 lY(){return new Ux({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Cd,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function $x(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:lY(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:On,inactiveTriggerProps:On,popupProps:On}}const sh=Ye(e=>e.triggerIdProp??e.activeTriggerId),Yx={open:Ye(e=>e.openProp??e.open),mounted:Ye(e=>e.mounted),transitionStatus:Ye(e=>e.transitionStatus),floatingRootContext:Ye(e=>e.floatingRootContext),preventUnmountingOnClose:Ye(e=>e.preventUnmountingOnClose),payload:Ye(e=>e.payload),activeTriggerId:sh,activeTriggerElement:Ye(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:Ye((e,t)=>t!==void 0&&sh(e)===t),isOpenedByTrigger:Ye((e,t)=>t!==void 0&&sh(e)===t&&e.open),isMountedByTrigger:Ye((e,t)=>t!==void 0&&sh(e)===t&&e.mounted),triggerProps:Ye((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:Ye(e=>e.popupProps),popupElement:Ye(e=>e.popupElement),positionerElement:Ye(e=>e.positionerElement)};function AA(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,a=Vs(),s=Fa()!=null,l=Jn(()=>new Ux({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Cd,floatingId:a,nested:s,noEmit:!1})).current;return He(()=>{const c={open:t,floatingId:a};r.reference!==void 0&&(c.referenceElement=r.reference,c.domReferenceElement=sn(r.reference)?r.reference:null),r.floating!==void 0&&(c.floatingElement=r.floating),l.update(c)},[t,a,r.reference,r.floating,l]),l.context.onOpenChange=n,l.context.nested=s,l.context.noEmit=!1,l}function uY(e={}){const{nodeId:t,externalTree:n}=e,r=AA(e),a=e.rootContext||r,s={reference:a.useState("referenceElement"),floating:a.useState("floatingElement"),domReference:a.useState("domReferenceElement")},[l,c]=w.useState(null),f=w.useRef(null),d=Vo(n);He(()=>{s.domReference&&(f.current=s.domReference)},[s.domReference]);const m=Q$({...e,elements:{...s,...l&&{reference:l}}}),p=w.useCallback(N=>{const _=sn(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),getClientRects:()=>N.getClientRects(),contextElement:N}:N;c(_),m.refs.setReference(_)},[m.refs]),[y,g]=w.useState(null),[x,C]=w.useState(null);a.useSyncedValue("referenceElement",y),a.useSyncedValue("domReferenceElement",sn(y)?y:null),a.useSyncedValue("floatingElement",x);const T=w.useCallback(N=>{(sn(N)||N===null)&&(f.current=N,g(N)),(sn(m.refs.reference.current)||m.refs.reference.current===null||N!==null&&!sn(N))&&m.refs.setReference(N)},[m.refs,g]),S=w.useCallback(N=>{C(N),m.refs.setFloating(N)},[m.refs]),R=w.useMemo(()=>({...m.refs,setReference:T,setFloating:S,setPositionReference:p,domReference:f}),[m.refs,T,S,p]),k=w.useMemo(()=>({...m.elements,domReference:s.domReference}),[m.elements,s.domReference]),M=a.useState("open"),D=a.useState("floatingId"),O=w.useMemo(()=>({...m,dataRef:a.context.dataRef,open:M,onOpenChange:a.setOpen,events:a.context.events,floatingId:D,refs:R,elements:k,nodeId:t,rootStore:a}),[m,R,k,t,a,M,D]);return He(()=>{a.context.dataRef.current.floatingContext=O;const N=d==null?void 0:d.nodesRef.current.find(_=>_.id===t);N&&(N.context=O)}),w.useMemo(()=>({...m,context:O,refs:R,elements:k,rootStore:a}),[m,R,k,O,a])}function Wx(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:a}=e,s=Vs(),l=Fa()!=null,c=t.useState("open"),f=t.useState("activeTriggerElement"),d=t.useState(r?"popupElement":"positionerElement"),m=t.context.triggerElements,p=Jn(()=>new Ux({open:c,referenceElement:f,floatingElement:d,triggerElements:m,onOpenChange:a,floatingId:s,nested:l,noEmit:n})).current;return He(()=>{const y={open:c,floatingId:s,referenceElement:f,floatingElement:d};sn(f)&&(y.domReferenceElement=f),p.state.positionReference===p.state.referenceElement&&(y.positionReference=f),p.update(y)},[c,s,f,d,p]),p.context.onOpenChange=a,p.context.nested=l,p.context.noEmit=n,p}const Jy=w7&&VO;function NA(e,t={}){const n="rootStore"in e?e.rootStore:e,{events:r,dataRef:a}=n.context,{enabled:s=!0,delay:l}=t,c=w.useRef(!1),f=w.useRef(null),d=_n(),m=w.useRef(!0);w.useEffect(()=>{const y=n.select("domReferenceElement");if(!s)return;const g=jn(y);function x(){const S=n.select("domReferenceElement");!n.select("open")&&Cn(S)&&S===Xr(Kt(S))&&(c.current=!0)}function C(){m.current=!0}function T(){m.current=!1}return g.addEventListener("blur",x),Jy&&(g.addEventListener("keydown",C,!0),g.addEventListener("pointerdown",T,!0)),()=>{g.removeEventListener("blur",x),Jy&&(g.removeEventListener("keydown",C,!0),g.removeEventListener("pointerdown",T,!0))}},[n,s]),w.useEffect(()=>{if(!s)return;function y(g){if(g.reason===Ls||g.reason===Cp){const x=n.select("domReferenceElement");sn(x)&&(f.current=x,c.current=!0)}}return r.on("openchange",y),()=>{r.off("openchange",y)}},[r,s,n]);const p=w.useMemo(()=>({onMouseLeave(){c.current=!1,f.current=null},onFocus(y){const g=y.currentTarget;if(c.current){if(f.current===g)return;c.current=!1,f.current=null}const x=Sr(y.nativeEvent);if(sn(x)){if(Jy&&!y.relatedTarget){if(!m.current&&!Fp(x))return}else if(!R7(x))return}const C=Yh(y.relatedTarget,n.context.triggerElements),{nativeEvent:T,currentTarget:S}=y,R=typeof l=="function"?l():l;if(n.select("open")&&C||R===0||R===void 0){n.setOpen(!0,pt(_l,T,S));return}d.start(R,()=>{c.current||n.setOpen(!0,pt(_l,T,S))})},onBlur(y){c.current=!1,f.current=null;const g=y.relatedTarget,x=y.nativeEvent,C=sn(g)&&g.hasAttribute(cu("focus-guard"))&&g.getAttribute("data-type")==="outside";d.start(0,()=>{var k;const T=n.select("domReferenceElement"),S=Xr(T?T.ownerDocument:document);!g&&S===T||Et((k=a.current.floatingContext)==null?void 0:k.refs.floating.current,S)||Et(T,S)||C||Yh(g??S,n.context.triggerElements)||n.setOpen(!1,pt(_l,x))})}}),[a,n,d,l]);return w.useMemo(()=>s?{reference:p,trigger:p}:{},[s,p])}const dv=cu("safe-polygon"),cY=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${WO}`;function dY(e){return e?!!e.closest(cY):!1}class Kx{constructor(){tt(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});tt(this,"disposeEffect",()=>this.dispose);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 Qi,this.restTimeout=new Qi,this.handleCloseOptions=void 0}static create(){return new Kx}}function DA(e){const t=Jn(Kx.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),Np(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}const fY=new Set(["click","mousedown"]);function IA(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),a=n.useState("floatingElement"),s=n.useState("domReferenceElement"),{dataRef:l}=n.context,{enabled:c=!0,closeDelay:f=0}=t,d=DA(n),m=Vo(),p=Fa(),y=Ve(()=>d.interactedInside?!0:l.current.openEvent?fY.has(l.current.openEvent.type):!1),g=Ve(()=>{var M;const k=(M=l.current.openEvent)==null?void 0:M.type;return(k==null?void 0:k.includes("mouse"))&&k!=="mousedown"}),x=Ve(k=>Yh(k,n.context.triggerElements)),C=w.useCallback((k,M=!0)=>{const D=hY(f,d.pointerType);D&&!d.handler?d.openChangeTimeout.start(D,()=>n.setOpen(!1,pt(wr,k))):M&&(d.openChangeTimeout.clear(),n.setOpen(!1,pt(wr,k)))},[f,n,d]),T=Ve(()=>{d.unbindMouseMove(),d.handler=void 0}),S=Ve(()=>{if(d.performedPointerEventsMutation){const k=Kt(a).body;k.style.pointerEvents="",k.removeAttribute(dv),d.performedPointerEventsMutation=!1}}),R=Ve(k=>{const M=Sr(k);if(!dY(M)){d.interactedInside=!1;return}d.interactedInside=!0});He(()=>{r||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,T(),S())},[r,d,T,S]),w.useEffect(()=>()=>{T()},[T]),w.useEffect(()=>S,[S]),He(()=>{var k,M,D;if(c&&r&&(k=d.handleCloseOptions)!=null&&k.blockPointerEvents&&g()&&sn(s)&&a){d.performedPointerEventsMutation=!0;const O=Kt(a).body;O.setAttribute(dv,"");const N=s,_=a,$=(D=(M=m==null?void 0:m.nodesRef.current.find(F=>F.id===p))==null?void 0:M.context)==null?void 0:D.elements.floating;return $&&($.style.pointerEvents=""),O.style.pointerEvents="none",N.style.pointerEvents="auto",_.style.pointerEvents="auto",()=>{O.style.pointerEvents="",N.style.pointerEvents="",_.style.pointerEvents=""}}},[c,r,s,a,d,g,m,p]),w.useEffect(()=>{if(!c)return;function k(N){y()||!l.current.floatingContext||!n.select("open")||x(N.relatedTarget)||(S(),T(),y()||C(N))}function M(N){var _;d.openChangeTimeout.clear(),S(),(_=d.handler)==null||_.call(d,N),T()}function D(N){y()||C(N,!1)}const O=a;return O&&(O.addEventListener("mouseleave",k),O.addEventListener("mouseenter",M),O.addEventListener("mouseleave",D),O.addEventListener("pointerdown",R,!0)),()=>{O&&(O.removeEventListener("mouseleave",k),O.removeEventListener("mouseenter",M),O.removeEventListener("mouseleave",D),O.removeEventListener("pointerdown",R,!0))}},[c,a,n,l,y,x,C,S,T,R,d])}function hY(e,t){return t&&!Bs(t)?0:typeof e=="function"?e():e}function eb(e){return typeof e=="function"?e():e}const pY={current:null};function PA(e,t={}){var F;const n="rootStore"in e?e.rootStore:e,{dataRef:r,events:a}=n.context,{enabled:s=!0,delay:l=0,handleClose:c=null,mouseOnly:f=!1,restMs:d=0,move:m=!0,triggerElementRef:p=pY,externalTree:y,isActiveTrigger:g=!0}=t,x=Vo(y),C=DA(n),T=rr(c),S=rr(l),R=rr(d),k=rr(s);g&&(C.handleCloseOptions=(F=T.current)==null?void 0:F.__options);const M=Ve(()=>C.interactedInside?!0:r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1),D=Ve(W=>Yh(W,n.context.triggerElements)),O=w.useCallback((W,L=!0)=>{const V=Rh(S.current,"close",C.pointerType);V&&!C.handler?C.openChangeTimeout.start(V,()=>n.setOpen(!1,pt(wr,W))):L&&(C.openChangeTimeout.clear(),n.setOpen(!1,pt(wr,W)))},[S,n,C]),N=Ve(()=>{C.unbindMouseMove(),C.handler=void 0}),_=Ve(()=>{if(C.performedPointerEventsMutation){const W=Kt(n.select("domReferenceElement")).body;W.style.pointerEvents="",W.removeAttribute(dv),C.performedPointerEventsMutation=!1}});w.useEffect(()=>{if(!s)return;function W(L){L.open||(C.openChangeTimeout.clear(),C.restTimeout.clear(),C.blockMouseMove=!0,C.restTimeoutPending=!1)}return a.on("openchange",W),()=>{a.off("openchange",W)}},[s,a,C]);const $=Ve(W=>{var V;if(M()||!r.current.floatingContext||D(W.relatedTarget))return;const L=p.current;(V=T.current)==null||V.call(T,{...r.current.floatingContext,tree:x,x:W.clientX,y:W.clientY,onClose(){_(),N(),!M()&&L===n.select("domReferenceElement")&&O(W)}})(W)});return w.useEffect(()=>{if(!s)return;const W=p.current??(g?n.select("domReferenceElement"):null);if(!sn(W))return;function L(Y){if(C.openChangeTimeout.clear(),C.blockMouseMove=!1,f&&!Bs(C.pointerType)||eb(R.current)>0&&!Rh(S.current,"open"))return;const j=Rh(S.current,"open",C.pointerType),z=n.select("domReferenceElement"),H=n.context.triggerElements,K=(H.hasElement(Y.target)||H.hasMatchingElement(I=>Et(I,Y.target)))&&(!z||!Et(z,Y.target)),P=Y.currentTarget??null,B=n.select("open"),G=!B||K;K&&B?n.setOpen(!0,pt(wr,Y,P)):j?C.openChangeTimeout.start(j,()=>{G&&n.setOpen(!0,pt(wr,Y,P))}):G&&n.setOpen(!0,pt(wr,Y,P))}function V(Y){if(M()){_();return}C.unbindMouseMove();const j=n.select("domReferenceElement"),z=Kt(j);if(C.restTimeout.clear(),C.restTimeoutPending=!1,D(Y.relatedTarget))return;if(T.current&&r.current.floatingContext){n.select("open")||C.openChangeTimeout.clear();const K=p.current;C.handler=T.current({...r.current.floatingContext,tree:x,x:Y.clientX,y:Y.clientY,onClose(){_(),N(),k.current&&!M()&&K===n.select("domReferenceElement")&&O(Y,!0)}});const P=C.handler;P(Y),z.addEventListener("mousemove",P),C.unbindMouseMove=()=>{z.removeEventListener("mousemove",P)};return}(C.pointerType==="touch"?!Et(n.select("floatingElement"),Y.relatedTarget):!0)&&O(Y)}function q(Y){$(Y)}return n.select("open")&&W.addEventListener("mouseleave",q),m&&W.addEventListener("mousemove",L,{once:!0}),W.addEventListener("mouseenter",L),W.addEventListener("mouseleave",V),()=>{W.removeEventListener("mouseleave",q),m&&W.removeEventListener("mousemove",L),W.removeEventListener("mouseenter",L),W.removeEventListener("mouseleave",V)}},[N,_,r,S,O,n,s,T,$,C,g,M,D,f,m,R,p,x,k]),w.useMemo(()=>{if(!s)return;function W(L){C.pointerType=L.pointerType}return{onPointerDown:W,onPointerEnter:W,onMouseMove(L){const{nativeEvent:V}=L,q=L.currentTarget,Y=n.select("domReferenceElement"),j=n.context.triggerElements,z=n.select("open"),H=(j.hasElement(L.target)||j.hasMatchingElement(P=>Et(P,L.target)))&&(!Y||!Et(Y,L.target));if(f&&!Bs(C.pointerType)||z&&!H||eb(R.current)===0||!H&&C.restTimeoutPending&&L.movementX**2+L.movementY**2<2)return;C.restTimeout.clear();function K(){if(C.restTimeoutPending=!1,M())return;const P=n.select("open");!C.blockMouseMove&&(!P||H)&&n.setOpen(!0,pt(wr,V,q))}C.pointerType==="touch"?yi.flushSync(()=>{K()}):H&&z?K():(C.restTimeoutPending=!0,C.restTimeout.start(eb(R.current),K))}}},[s,C,M,f,n,R])}function Rd(e=[]){const t=e.map(d=>d==null?void 0:d.reference),n=e.map(d=>d==null?void 0:d.floating),r=e.map(d=>d==null?void 0:d.item),a=e.map(d=>d==null?void 0:d.trigger),s=w.useCallback(d=>lh(d,e,"reference"),t),l=w.useCallback(d=>lh(d,e,"floating"),n),c=w.useCallback(d=>lh(d,e,"item"),r),f=w.useCallback(d=>lh(d,e,"trigger"),a);return w.useMemo(()=>({getReferenceProps:s,getFloatingProps:l,getItemProps:c,getTriggerProps:f}),[s,l,c,f])}function lh(e,t,n){var l;const r=new Map,a=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[iv]="");for(const c in e)a&&e&&(c===$O||c===YO)||(s[c]=e[c]);for(let c=0;c<t.length;c+=1){let f;const d=(l=t[c])==null?void 0:l[n];typeof d=="function"?f=e?d(e):null:f=d,f&&rR(s,f,a,r)}return rR(s,e,a,r),s}function rR(e,t,n,r){var a;for(const s in t){const l=t[s];n&&(s===$O||s===YO)||(s.startsWith("on")?(r.has(s)||r.set(s,[]),typeof l=="function"&&((a=r.get(s))==null||a.push(l),e[s]=(...c)=>{var f;return(f=r.get(s))==null?void 0:f.map(d=>d(...c)).find(d=>d!==void 0)})):e[s]=l)}}const mY="Escape";function Up(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function uh(e,t){return Up(t,e===Dx||e===Ed,e===No||e===Do)}function tb(e,t,n){return Up(t,e===Ed,n?e===No:e===Do)||e==="Enter"||e===" "||e===""}function gY(e,t,n){return Up(t,n?e===No:e===Do,e===Ed)}function yY(e,t,n,r){const a=n?e===Do:e===No,s=e===Dx;return t==="both"||t==="horizontal"&&r&&r>1?e===mY:Up(t,a,s)}function LA(e,t){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),a=n.useState("floatingElement"),s=n.useState("domReferenceElement"),l=n.context.dataRef,{listRef:c,activeIndex:f,onNavigate:d=()=>{},enabled:m=!0,selectedIndex:p=null,allowEscape:y=!1,loopFocus:g=!1,nested:x=!1,rtl:C=!1,virtual:T=!1,focusItemOnOpen:S="auto",focusItemOnHover:R=!0,openOnArrowKeyDown:k=!0,disabledIndices:M=void 0,orientation:D="vertical",parentOrientation:O,cols:N=1,id:_,resetOnPointerLeave:$=!0,externalTree:F}=t,W=ad(a),L=rr(W),V=Fa(),q=Vo(F);He(()=>{l.current.orientation=D},[l,D]);const Y=av(s),j=w.useRef(S),z=w.useRef(p??-1),H=w.useRef(null),K=w.useRef(!0),P=Ve(J=>{d(z.current===-1?null:z.current,J)}),B=w.useRef(P),G=w.useRef(!!a),I=w.useRef(r),Q=w.useRef(!1),Z=w.useRef(!1),ie=rr(M),ce=rr(r),ge=rr(p),Ee=rr($),_e=Ve(()=>{function J($e){T?q==null||q.events.emit("virtualfocus",$e):Wc($e,{sync:Q.current,preventScroll:!0})}const Re=c.current[z.current],xe=Z.current;Re&&J(Re),(Q.current?$e=>$e():requestAnimationFrame)(()=>{var De;const $e=c.current[z.current]||Re;if(!$e)return;Re||J($e),re&&(xe||!K.current)&&((De=$e.scrollIntoView)==null||De.call($e,{block:"nearest",inline:"nearest"}))})});He(()=>{m&&(r&&a?(z.current=p??-1,j.current&&p!=null&&(Z.current=!0,P())):G.current&&(z.current=-1,B.current()))},[m,r,a,p,P]),He(()=>{if(m){if(!r){Q.current=!1;return}if(a)if(f==null){if(Q.current=!1,ge.current!=null)return;if(G.current&&(z.current=-1,_e()),(!I.current||!G.current)&&j.current&&(H.current!=null||j.current===!0&&H.current==null)){let J=0;const Re=()=>{c.current[0]==null?(J<2&&(J?requestAnimationFrame:queueMicrotask)(Re),J+=1):(z.current=H.current==null||tb(H.current,D,C)||x?Ch(c):lv(c),H.current=null,P())};Re()}}else zl(c,f)||(z.current=f,_e(),Z.current=!1)}},[m,r,a,f,ge,x,c,D,C,P,_e,ie]),He(()=>{var $e,te;if(!m||a||!q||T||!G.current)return;const J=q.nodesRef.current,Re=(te=($e=J.find(De=>De.id===V))==null?void 0:$e.context)==null?void 0:te.elements.floating,xe=Xr(Kt(a)),Be=J.some(De=>De.context&&Et(De.context.elements.floating,xe));Re&&!Be&&K.current&&Re.focus({preventScroll:!0})},[m,a,q,V,T]),He(()=>{B.current=P,I.current=r,G.current=!!a}),He(()=>{r||(H.current=null,j.current=S)},[r,S]);const Ie=f!=null,re=w.useMemo(()=>{function J(xe){if(!ce.current)return;const Be=c.current.indexOf(xe.currentTarget);Be!==-1&&z.current!==Be&&(z.current=Be,P(xe))}return{onFocus(xe){Q.current=!0,J(xe)},onClick:({currentTarget:xe})=>xe.focus({preventScroll:!0}),onMouseMove(xe){Q.current=!0,Z.current=!1,R&&J(xe)},onPointerLeave(xe){var $e;if(!ce.current||!K.current||xe.pointerType==="touch")return;Q.current=!0;const Be=xe.relatedTarget;!R||c.current.includes(Be)||Ee.current&&(Wc(null,{sync:!0}),z.current=-1,P(xe),T||($e=L.current)==null||$e.focus({preventScroll:!0}))}}},[ce,L,R,c,P,Ee,T]),he=w.useCallback(()=>{var J,Re,xe;return O??((xe=(Re=(J=q==null?void 0:q.nodesRef.current.find(Be=>Be.id===V))==null?void 0:J.context)==null?void 0:Re.dataRef)==null?void 0:xe.current.orientation)},[V,q,O]),be=Ve(J=>{if(K.current=!1,Q.current=!0,J.which===229||!ce.current&&J.currentTarget===L.current)return;if(x&&yY(J.key,D,C,N)){uh(J.key,he())||pr(J),n.setOpen(!1,pt(Sh,J.nativeEvent)),Cn(s)&&(T?q==null||q.events.emit("virtualfocus",s):s.focus());return}const Re=z.current,xe=Ch(c,M),Be=lv(c,M);if(Y||(J.key==="Home"&&(pr(J),z.current=xe,P(J)),J.key==="End"&&(pr(J),z.current=Be,P(J))),N>1){const $e=Array.from({length:c.current.length},()=>({width:1,height:1})),te=JO($e,N,!1),De=te.findIndex(we=>we!=null&&!Io(c,we,M)),se=te.reduce((we,Me,Fe)=>Me!=null&&!Io(c,Me,M)?Fe:we,-1),ye=te[ZO({current:te.map(we=>we!=null?c.current[we]:null)},{event:J,orientation:D,loopFocus:g,rtl:C,cols:N,disabledIndices:tA([...(typeof M!="function"?M:null)||c.current.map((we,Me)=>Io(c,Me,M)?Me:void 0),void 0],te),minIndex:De,maxIndex:se,prevIndex:eA(z.current>Be?xe:z.current,$e,te,N,J.key===Ed?"bl":J.key===(C?No:Do)?"tr":"tl"),stopEvent:!0})];if(ye!=null&&(z.current=ye,P(J)),D==="both")return}if(uh(J.key,D)){if(pr(J),r&&!T&&Xr(J.currentTarget.ownerDocument)===J.currentTarget){z.current=tb(J.key,D,C)?xe:Be,P(J);return}tb(J.key,D,C)?g?Re>=Be?y&&Re!==c.current.length?z.current=-1:(Q.current=!1,z.current=xe):z.current=ur(c,{startingIndex:Re,disabledIndices:M}):z.current=Math.min(Be,ur(c,{startingIndex:Re,disabledIndices:M})):g?Re<=xe?y&&Re!==-1?z.current=c.current.length:(Q.current=!1,z.current=Be):z.current=ur(c,{startingIndex:Re,decrement:!0,disabledIndices:M}):z.current=Math.max(xe,ur(c,{startingIndex:Re,decrement:!0,disabledIndices:M})),zl(c,z.current)&&(z.current=-1),P(J)}}),Pe=w.useMemo(()=>T&&r&&Ie&&{"aria-activedescendant":`${_}-${f}`},[T,r,Ie,_,f]),Ae=w.useMemo(()=>({"aria-orientation":D==="both"?void 0:D,...Y?{}:Pe,onKeyDown(J){if(J.key==="Tab"&&J.shiftKey&&r&&!T){const Re=Sr(J.nativeEvent);if(Re&&!Et(L.current,Re))return;pr(J),n.setOpen(!1,pt(_s,J.nativeEvent)),Cn(s)&&s.focus();return}be(J)},onPointerMove(){K.current=!0}}),[Pe,be,L,D,Y,n,r,T,s]),Se=w.useMemo(()=>{function J(xe){S==="auto"&&KO(xe.nativeEvent)&&(j.current=!T)}function Re(xe){j.current=S,S==="auto"&&GO(xe.nativeEvent)&&(j.current=!0)}return{onKeyDown(xe){const Be=n.select("open");K.current=!1;const $e=xe.key.startsWith("Arrow"),te=gY(xe.key,he(),C),De=uh(xe.key,D),se=(x?te:De)||xe.key==="Enter"||xe.key.trim()==="";if(T&&Be)return be(xe);if(!(!Be&&!k&&$e)){if(se){const ye=uh(xe.key,he());H.current=x&&ye?null:xe.key}if(x){te&&(pr(xe),Be?(z.current=Ch(c,ie.current),P(xe)):n.setOpen(!0,pt(Sh,xe.nativeEvent,xe.currentTarget)));return}De&&(ge.current!=null&&(z.current=ge.current),pr(xe),!Be&&k?n.setOpen(!0,pt(Sh,xe.nativeEvent,xe.currentTarget)):be(xe),Be&&P(xe))}},onFocus(xe){n.select("open")&&!T&&(z.current=-1,P(xe))},onPointerDown:Re,onPointerEnter:Re,onMouseDown:J,onClick:J}},[be,ie,S,c,x,P,n,k,D,he,C,ge,T]),Ce=w.useMemo(()=>({...Pe,...Se}),[Pe,Se]);return w.useMemo(()=>m?{reference:Ce,floating:Ae,item:re,trigger:Se}:{},[m,Ce,Ae,Se,re])}const bY=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function _A(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),a=n.useState("floatingId"),s=n.useState("domReferenceElement"),l=n.useState("floatingElement"),{role:c="dialog"}=t,f=Vs(),d=(s==null?void 0:s.id)||f,m=w.useMemo(()=>{var R;return((R=ad(l))==null?void 0:R.id)||a},[l,a]),p=bY.get(c)??c,g=Fa()!=null,x=w.useMemo(()=>p==="tooltip"||c==="label"?On:{"aria-haspopup":p==="alertdialog"?"dialog":p,"aria-expanded":"false",...p==="listbox"&&{role:"combobox"},...p==="menu"&&g&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[p,g,c]),C=w.useMemo(()=>p==="tooltip"||c==="label"?{[`aria-${c==="label"?"labelledby":"describedby"}`]:r?m:void 0}:{...x,"aria-expanded":r?"true":"false","aria-controls":r?m:void 0,...p==="menu"&&{id:d}},[p,m,r,d,c,x]),T=w.useMemo(()=>{const R={id:m,...p&&{role:p}};return p==="tooltip"||c==="label"?R:{...R,...p==="menu"&&{"aria-labelledby":d}}},[p,m,d,c]),S=w.useCallback(({active:R,selected:k})=>{const M={role:"option",...R&&{id:`${m}-fui-option`}};switch(c){case"select":case"combobox":return{...M,"aria-selected":k}}return{}},[m,c]);return w.useMemo(()=>({reference:C,floating:T,item:S,trigger:x}),[C,T,x,S])}function jA(e,t){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,a=n.useState("open"),{listRef:s,activeIndex:l,onMatch:c,onTypingChange:f,enabled:d=!0,resetMs:m=750,selectedIndex:p=null}=t,y=_n(),g=w.useRef(""),x=w.useRef(p??l??-1),C=w.useRef(null);He(()=>{!a&&p!==null||(y.clear(),C.current=null,g.current!==""&&(g.current=""))},[a,p,y]),He(()=>{a&&g.current===""&&(x.current=p??l??-1)},[a,p,l]);const T=Ve(D=>{D?r.current.typing||(r.current.typing=D,f==null||f(D)):r.current.typing&&(r.current.typing=D,f==null||f(D))}),S=Ve(D=>{function O(L,V,q){const Y=V.find(j=>(j==null?void 0:j.toLocaleLowerCase().indexOf(q.toLocaleLowerCase()))===0);return Y?L.indexOf(Y):-1}const N=s.current;if(g.current.length>0&&g.current[0]!==" "&&(O(N,N,g.current)===-1?T(!1):D.key===" "&&pr(D)),N==null||D.key.length!==1||D.ctrlKey||D.metaKey||D.altKey)return;a&&D.key!==" "&&(pr(D),T(!0));const _=g.current==="";_&&(x.current=p??l??-1),N.every(L=>{var V,q;return L?((V=L[0])==null?void 0:V.toLocaleLowerCase())!==((q=L[1])==null?void 0:q.toLocaleLowerCase()):!0})&&g.current===D.key&&(g.current="",x.current=C.current),g.current+=D.key,y.start(m,()=>{g.current="",x.current=C.current,T(!1)});const F=_?p??l??-1:x.current,W=O(N,[...N.slice((F||0)+1),...N.slice(0,(F||0)+1)],g.current);W!==-1?(c==null||c(W),C.current=W):D.key!==" "&&(g.current="",T(!1))}),R=Ve(D=>{const O=D.relatedTarget,N=n.select("domReferenceElement"),_=n.select("floatingElement"),$=Et(N,O),F=Et(_,O);$||F||(y.clear(),g.current="",x.current=C.current,T(!1))}),k=w.useMemo(()=>({onKeyDown:S,onBlur:R}),[S,R]),M=w.useMemo(()=>({onKeyDown:S,onKeyUp(D){D.key===" "&&T(!1)},onBlur:R}),[S,R,T]);return w.useMemo(()=>d?{reference:k,floating:M}:{},[d,k,M])}function iR(e,t){const[n,r]=e;let a=!1;const s=t.length;for(let l=0,c=s-1;l<s;c=l++){const[f,d]=t[l]||[0,0],[m,p]=t[c]||[0,0];d>=r!=p>=r&&n<=(m-f)*(r-d)/(p-d)+f&&(a=!a)}return a}function vY(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function zA(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,a=new Qi;let s=!1,l=null,c=null,f=typeof performance<"u"?performance.now():0;function d(p,y){const g=performance.now(),x=g-f;if(l===null||c===null||x===0)return l=p,c=y,f=g,null;const C=p-l,T=y-c,R=Math.sqrt(C*C+T*T)/x;return l=p,c=y,f=g,R}const m=({x:p,y,placement:g,elements:x,onClose:C,nodeId:T,tree:S})=>function(k){function M(){a.clear(),C()}if(a.clear(),!x.domReference||!x.floating||g==null||p==null||y==null)return;const{clientX:D,clientY:O}=k,N=[D,O],_=Sr(k),$=k.type==="mouseleave",F=Et(x.floating,_),W=Et(x.domReference,_),L=x.domReference.getBoundingClientRect(),V=x.floating.getBoundingClientRect(),q=g.split("-")[0],Y=p>V.right-V.width/2,j=y>V.bottom-V.height/2,z=vY(N,L),H=V.width>L.width,K=V.height>L.height,P=(H?L:V).left,B=(H?L:V).right,G=(K?L:V).top,I=(K?L:V).bottom;if(F&&(s=!0,!$))return;if(W&&(s=!1),W&&!$){s=!0;return}if($&&sn(k.relatedTarget)&&Et(x.floating,k.relatedTarget)||S&&As(S.nodesRef.current,T).some(({context:ie})=>ie==null?void 0:ie.open))return;if(q==="top"&&y>=L.bottom-1||q==="bottom"&&y<=L.top+1||q==="left"&&p>=L.right-1||q==="right"&&p<=L.left+1)return M();let Q=[];switch(q){case"top":Q=[[P,L.top+1],[P,V.bottom-1],[B,V.bottom-1],[B,L.top+1]];break;case"bottom":Q=[[P,V.top+1],[P,L.bottom-1],[B,L.bottom-1],[B,V.top+1]];break;case"left":Q=[[V.right-1,I],[V.right-1,G],[L.left+1,G],[L.left+1,I]];break;case"right":Q=[[L.right-1,I],[L.right-1,G],[V.left+1,G],[V.left+1,I]];break}function Z([ie,ce]){switch(q){case"top":{const ge=[H?ie+t/2:Y?ie+t*4:ie-t*4,ce+t+1],Ee=[H?ie-t/2:Y?ie+t*4:ie-t*4,ce+t+1],_e=[[V.left,Y||H?V.bottom-t:V.top],[V.right,Y?H?V.bottom-t:V.top:V.bottom-t]];return[ge,Ee,..._e]}case"bottom":{const ge=[H?ie+t/2:Y?ie+t*4:ie-t*4,ce-t],Ee=[H?ie-t/2:Y?ie+t*4:ie-t*4,ce-t],_e=[[V.left,Y||H?V.top+t:V.bottom],[V.right,Y?H?V.top+t:V.bottom:V.top+t]];return[ge,Ee,..._e]}case"left":{const ge=[ie+t+1,K?ce+t/2:j?ce+t*4:ce-t*4],Ee=[ie+t+1,K?ce-t/2:j?ce+t*4:ce-t*4];return[...[[j||K?V.right-t:V.left,V.top],[j?K?V.right-t:V.left:V.right-t,V.bottom]],ge,Ee]}case"right":{const ge=[ie-t,K?ce+t/2:j?ce+t*4:ce-t*4],Ee=[ie-t,K?ce-t/2:j?ce+t*4:ce-t*4],_e=[[j||K?V.left+t:V.right,V.top],[j?K?V.left+t:V.right:V.left+t,V.bottom]];return[ge,Ee,..._e]}default:return[]}}if(!iR([D,O],Q)){if(s&&!z)return M();if(!$&&r){const ie=d(k.clientX,k.clientY);if(ie!==null&&ie<.1)return M()}iR([D,O],Z([p,y]))?!s&&r&&a.start(40,M):M()}};return m.__options={blockPointerEvents:n},m}const FA=w.createContext(null),BA=w.createContext(null);function ta(){const e=w.useContext(FA);if(e===null)throw new Error(Sn(60));return e}function HA(){const e=w.useContext(BA);if(e===null)throw new Error(Sn(61));return e}const xY=(e,t)=>Object.is(e,t);function fu(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function wY(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:fu(t,r,n))}function Kc(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:fu(r,t,n))}function SY(e,t,n){return e.filter(r=>!fu(t,r,n))}function fv(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function UA(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function EY(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(UA(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 TY(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return fv(e)}function Dl(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?fv(e.value):fv(e)}function VA(e,t,n){function r(){return TY(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const a=UA(t)?t.flatMap(s=>s.items):t;if(e==null||typeof e!="object"){const s=a.find(l=>l.value===e);return s&&s.label!=null?s.label:r()}if("value"in e){const s=a.find(l=>l&&l.value===e.value);if(s&&s.label!=null)return s.label}}return r()}function CY(e,t,n){return e.reduce((r,a,s)=>(s>0&&r.push(", "),r.push(E.jsx(w.Fragment,{children:VA(a,t,n)},s)),r),[])}const yt={id:Ye(e=>e.id),modal:Ye(e=>e.modal),multiple:Ye(e=>e.multiple),items:Ye(e=>e.items),itemToStringLabel:Ye(e=>e.itemToStringLabel),itemToStringValue:Ye(e=>e.itemToStringValue),isItemEqualToValue:Ye(e=>e.isItemEqualToValue),value:Ye(e=>e.value),hasSelectedValue:Ye(e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Dl(t,r)!==""}),hasNullItemLabel:Ye((e,t)=>t?EY(e.items):!1),open:Ye(e=>e.open),mounted:Ye(e=>e.mounted),forceMount:Ye(e=>e.forceMount),transitionStatus:Ye(e=>e.transitionStatus),openMethod:Ye(e=>e.openMethod),activeIndex:Ye(e=>e.activeIndex),selectedIndex:Ye(e=>e.selectedIndex),isActive:Ye((e,t)=>e.activeIndex===t),isSelected:Ye((e,t,n)=>{const r=e.isItemEqualToValue,a=e.value;return e.multiple?Array.isArray(a)&&a.some(s=>fu(n,s,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:fu(n,a,r)}),isSelectedByFocus:Ye((e,t)=>e.selectedIndex===t),popupProps:Ye(e=>e.popupProps),triggerProps:Ye(e=>e.triggerProps),triggerElement:Ye(e=>e.triggerElement),positionerElement:Ye(e=>e.positionerElement),listElement:Ye(e=>e.listElement),scrollUpArrowVisible:Ye(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Ye(e=>e.scrollDownArrowVisible),hasScrollArrows:Ye(e=>e.hasScrollArrows)};function RY(e){const t=w.useRef(""),n=w.useCallback(a=>{a.defaultPrevented||(t.current=a.pointerType,e(a,a.pointerType))},[e]);return{onClick:w.useCallback(a=>{if(a.detail===0){e(a,"keyboard");return}"pointerType"in a?e(a,a.pointerType):e(a,t.current),t.current=""},[e]),onPointerDown:n}}function Gx(e){const[t,n]=w.useState(null),r=Ve((c,f)=>{e||n(f||(UO?"touch":""))}),a=w.useCallback(()=>{n(null)},[]),{onClick:s,onPointerDown:l}=RY(r);return w.useMemo(()=>({openMethod:t,reset:a,triggerProps:{onClick:s,onPointerDown:l}}),[t,a,s,l])}function kY(e){const{id:t,value:n,defaultValue:r=null,onValueChange:a,open:s,defaultOpen:l=!1,onOpenChange:c,name:f,autoComplete:d,disabled:m=!1,readOnly:p=!1,required:y=!1,modal:g=!0,actionsRef:x,inputRef:C,onOpenChangeComplete:T,items:S,multiple:R=!1,itemToStringLabel:k,itemToStringValue:M,isItemEqualToValue:D=xY,highlightItemOnHover:O=!0,children:N}=e,{clearErrors:_}=lx(),{setDirty:$,setTouched:F,setFocused:W,shouldValidateOnChange:L,validityData:V,setFilled:q,name:Y,disabled:j,validation:z,validationMode:H}=yu(),K=Ep({id:t}),P=j||m,B=Y??f,[G,I]=au({controlled:n,default:R?r??Lo:r,name:"Select",state:"value"}),[Q,Z]=au({controlled:s,default:l,name:"Select",state:"open"}),ie=w.useRef([]),ce=w.useRef([]),ge=w.useRef(null),Ee=w.useRef(null),_e=w.useRef(0),Ie=w.useRef(null),re=w.useRef([]),he=w.useRef(!1),be=w.useRef(!1),Pe=w.useRef(null),Ae=w.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),Se=w.useRef(!1),{mounted:Ce,setMounted:J,transitionStatus:Re}=Sd(Q),{openMethod:xe,triggerProps:Be,reset:$e}=Gx(Q),te=Jn(()=>new FO({id:K,modal:g,multiple:R,itemToStringLabel:k,itemToStringValue:M,isItemEqualToValue:D,value:G,open:Q,mounted:Ce,transitionStatus:Re,items:S,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,De=xt(te,yt.activeIndex),se=xt(te,yt.selectedIndex),ye=xt(te,yt.triggerElement),we=xt(te,yt.positionerElement),Me=w.useMemo(()=>R&&Array.isArray(G)&&G.length===0?"":Dl(G,M),[R,G,M]),Fe=w.useMemo(()=>R&&Array.isArray(G)?G.map(ft=>Dl(ft,M)):Dl(G,M),[R,G,M]),ct=rr(te.state.triggerElement);ux({id:K,commit:z.commit,value:G,controlRef:ct,name:B,getValue:()=>Fe});const bt=w.useRef(G);He(()=>{G!==bt.current&&te.set("forceMount",!0)},[te,G]),He(()=>{q(R?Array.isArray(G)&&G.length>0:G!=null)},[R,G,q]),He(function(){if(Q)return;const Ht=re.current;if(R){const ae=Array.isArray(G)?G:[];if(ae.length===0){te.set("selectedIndex",null);return}const de=ae[ae.length-1],ke=Kc(Ht,de,D);te.set("selectedIndex",ke===-1?null:ke);return}const X=Kc(Ht,G,D);te.set("selectedIndex",X===-1?null:X)},[R,Q,G,re,D,te]),CM(G,()=>{_(B),$(G!==V.initialValue),L()?z.commit(G):z.commit(G,!0)});const Ot=Ve((ft,Ht)=>{if(c==null||c(ft,Ht),!Ht.isCanceled&&(Z(ft),!ft&&(Ht.reason===_s||Ht.reason===Tp)&&(F(!0),W(!1),H==="onBlur"&&z.commit(G)),!ft&&te.state.activeIndex!==null)){const X=ie.current[te.state.activeIndex];queueMicrotask(()=>{X==null||X.setAttribute("tabindex","-1")})}}),We=Ve(()=>{J(!1),te.set("activeIndex",null),$e(),T==null||T(!1)});za({enabled:!x,open:Q,ref:ge,onComplete(){Q||We()}}),w.useImperativeHandle(x,()=>({unmount:We}),[We]);const ot=Ve((ft,Ht)=>{a==null||a(ft,Ht),!Ht.isCanceled&&I(ft)}),st=Ve(()=>{const ft=te.state.listElement||ge.current;if(!ft)return;const Ht=ft.scrollTop,X=ft.scrollTop+ft.clientHeight,ae=Ht>1,de=X<ft.scrollHeight-1;te.state.scrollUpArrowVisible!==ae&&te.set("scrollUpArrowVisible",ae),te.state.scrollDownArrowVisible!==de&&te.set("scrollDownArrowVisible",de)}),jt=AA({open:Q,onOpenChange:Ot,elements:{reference:ye,floating:we}}),zt=xA(jt,{enabled:!p&&!P,event:"mousedown"}),gt=Hp(jt,{bubbles:!1}),Rt=LA(jt,{enabled:!p&&!P,listRef:ie,activeIndex:De,selectedIndex:se,disabledIndices:Lo,onNavigate(ft){ft===null&&!Q||te.set("activeIndex",ft)},focusItemOnHover:!1}),Je=jA(jt,{enabled:!p&&!P&&(Q||!R),listRef:ce,activeIndex:De,selectedIndex:se,onMatch(ft){Q?te.set("activeIndex",ft):ot(re.current[ft],pt("none"))},onTypingChange(ft){he.current=ft}}),{getReferenceProps:kt,getFloatingProps:Ft,getItemProps:Xe}=Rd([zt,gt,Rt,Je]),Bt=w.useMemo(()=>bi(kt(),Be,K?{id:K}:On),[kt,Be,K]);_p(()=>{te.update({popupProps:Ft(),triggerProps:Bt})}),He(()=>{te.update({id:K,modal:g,multiple:R,value:G,open:Q,mounted:Ce,transitionStatus:Re,popupProps:Ft(),triggerProps:Bt,items:S,itemToStringLabel:k,itemToStringValue:M,isItemEqualToValue:D,openMethod:xe})},[te,K,g,R,G,Q,Ce,Re,Ft,Bt,S,k,M,D,xe]);const cn=w.useMemo(()=>({store:te,name:B,required:y,disabled:P,readOnly:p,multiple:R,itemToStringLabel:k,itemToStringValue:M,highlightItemOnHover:O,setValue:ot,setOpen:Ot,listRef:ie,popupRef:ge,scrollHandlerRef:Ee,handleScrollArrowVisibility:st,scrollArrowsMountedCountRef:_e,getItemProps:Xe,events:jt.context.events,valueRef:Ie,valuesRef:re,labelsRef:ce,typingRef:he,selectionRef:Ae,selectedItemTextRef:Pe,validation:z,onOpenChangeComplete:T,keyboardActiveRef:be,alignItemWithTriggerActiveRef:Se,initialValueRef:bt}),[te,B,y,P,p,R,k,M,O,ot,Ot,Xe,jt.context.events,z,T,st]),tn=Ni(C,z.inputRef),Un=R&&Array.isArray(G)&&G.length>0,nn=w.useMemo(()=>!R||!Array.isArray(G)||!B?null:G.map(ft=>{const Ht=Dl(ft,M);return E.jsx("input",{type:"hidden",name:B,value:Ht},Ht)}),[R,G,B,M]);return E.jsx(FA.Provider,{value:cn,children:E.jsxs(BA.Provider,{value:jt,children:[N,E.jsx("input",{...z.getInputValidationProps({onFocus(){var ft;(ft=te.state.triggerElement)==null||ft.focus({focusVisible:!0})},onChange(ft){if(ft.nativeEvent.defaultPrevented)return;const Ht=ft.target.value,X=pt(Di,ft.nativeEvent);function ae(){if(R)return;const de=re.current.find(ke=>Dl(ke,M).toLowerCase()===Ht.toLowerCase());de!=null&&($(de!==V.initialValue),ot(de,X),L()&&z.commit(de))}te.set("forceMount",!0),queueMicrotask(ae)}}),name:R?void 0:B,autoComplete:d,value:Me,disabled:P,required:y&&!Un,readOnly:p,ref:tn,style:B?wM:wp,tabIndex:-1,"aria-hidden":!0}),nn]})})}let ys=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=zs.startingStyle]="startingStyle",e[e.endingStyle=zs.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),tp=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const MY={[tp.popupOpen]:""},OY={[tp.popupOpen]:"",[tp.pressed]:""},AY={[ys.open]:""},NY={[ys.closed]:""},DY={[ys.anchorHidden]:""},qA={open(e){return e?MY:null}},hv={open(e){return e?OY:null}},Ba={open(e){return e?AY:NY},anchorHidden(e){return e?DY:null}};function $A(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),r=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||r.content!=="none"))return t;const s=parseFloat(n.width)||0,l=parseFloat(n.height)||0,c=parseFloat(r.width)||0,f=parseFloat(r.height)||0,d=Math.max(t.width,s,c),m=Math.max(t.height,l,f),p=d-t.width,y=m-t.height;return{left:t.left-p/2,right:t.right+p/2,top:t.top-y/2,bottom:t.bottom+y/2}}const ch=2,IY=400,aR=200,PY={...hv,...sx,value:()=>null},LY=w.forwardRef(function(t,n){const{render:r,className:a,id:s,disabled:l=!1,nativeButton:c=!0,...f}=t,{setTouched:d,setFocused:m,validationMode:p,state:y,disabled:g}=yu(),{labelId:x}=Sp(),{store:C,setOpen:T,selectionRef:S,validation:R,readOnly:k,required:M,alignItemWithTriggerActiveRef:D,disabled:O,keyboardActiveRef:N}=ta(),_=g||O||l,$=xt(C,yt.open),F=xt(C,yt.value),W=xt(C,yt.triggerProps),L=xt(C,yt.positionerElement),V=xt(C,yt.listElement),q=xt(C,yt.id),Y=xt(C,yt.hasSelectedValue),j=!Y&&$,z=xt(C,yt.hasNullItemLabel,j),H=s??q;Ep({id:H});const K=rr(L),P=w.useRef(null),{getButtonProps:B,buttonRef:G}=_a({disabled:_,native:c}),I=Ve(re=>{C.set("triggerElement",re)}),Q=Ni(n,P,G,I),Z=_n(),ie=_n(),ce=_n(),ge=_n();w.useEffect(()=>{if($)return!(Y||z)?ce.start(IY,()=>{S.current.allowUnselectedMouseUp=!0,S.current.allowSelectedMouseUp=!0}):ge.start(aR,()=>{S.current.allowUnselectedMouseUp=!0,ce.start(aR,()=>{S.current.allowSelectedMouseUp=!0})}),()=>{ce.clear(),ge.clear()};S.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},ie.clear()},[$,Y,z,S,ie,ce,ge]);const Ee=w.useMemo(()=>{var re;return(V==null?void 0:V.id)??((re=ad(L))==null?void 0:re.id)},[V,L]),_e=bi(W,{id:H,role:"combobox","aria-expanded":$?"true":"false","aria-haspopup":"listbox","aria-controls":$?Ee:void 0,"aria-labelledby":x,"aria-readonly":k||void 0,"aria-required":M||void 0,tabIndex:_?-1:0,ref:Q,onFocus(re){m(!0),$&&D.current&&T(!1,pt(Di,re.nativeEvent)),Z.start(0,()=>{C.set("forceMount",!0)})},onBlur(re){Et(L,re.relatedTarget)||(d(!0),m(!1),p==="onBlur"&&R.commit(F))},onPointerMove(){N.current=!1},onKeyDown(){N.current=!0},onMouseDown(re){if($)return;const he=Kt(re.currentTarget);function be(Pe){if(!P.current)return;const Ae=Pe.target;if(Et(P.current,Ae)||Et(K.current,Ae)||Ae===P.current)return;const Se=$A(P.current);Pe.clientX>=Se.left-ch&&Pe.clientX<=Se.right+ch&&Pe.clientY>=Se.top-ch&&Pe.clientY<=Se.bottom+ch||T(!1,pt(TM,Pe))}ie.start(0,()=>{he.addEventListener("mouseup",be,{once:!0})})}},R.getValidationProps,f,B);_e.role="combobox";const Ie={...y,open:$,disabled:_,value:F,readOnly:k,placeholder:!Y};return Ct("button",t,{ref:[n,P],state:Ie,stateAttributesMapping:PY,props:_e})}),_Y={value:()=>null},jY=w.forwardRef(function(t,n){const{className:r,render:a,children:s,placeholder:l,...c}=t,{store:f,valueRef:d}=ta(),m=xt(f,yt.value),p=xt(f,yt.items),y=xt(f,yt.itemToStringLabel),g=xt(f,yt.hasSelectedValue),x=!g&&l!=null&&s==null,C=xt(f,yt.hasNullItemLabel,x),T={value:m,placeholder:!g};let S=null;return typeof s=="function"?S=s(m):s!=null?S=s:!g&&l!=null&&!C?S=l:Array.isArray(m)?S=CY(m,p,y):S=VA(m,p,y),Ct("span",t,{state:T,ref:[n,d],props:[{children:S},c],stateAttributesMapping:_Y})}),zY=w.forwardRef(function(t,n){const{className:r,render:a,...s}=t,{store:l}=ta(),f={open:xt(l,yt.open)};return Ct("span",t,{state:f,ref:n,props:[{"aria-hidden":!0,children:"▼"},s],stateAttributesMapping:qA})}),FY=w.createContext(void 0),BY=w.forwardRef(function(t,n){const{store:r}=ta(),a=xt(r,yt.mounted),s=xt(r,yt.forceMount);return a||s?E.jsx(FY.Provider,{value:!0,children:E.jsx(zx,{ref:n,...t})}):null});function Xx(e){return ax(19)?e:e?"true":void 0}let oR={},sR={},lR="";function HY(e){if(typeof document>"u")return!1;const t=Kt(e);return jn(t).innerWidth-t.documentElement.clientWidth>0}function UY(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Kt(e),r=n.documentElement,a=n.body,s=Fo(r)?r:a,l=s.style.overflowY,c=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",s.style.overflowY="scroll";const f=s.offsetWidth;s.style.overflowY="hidden";const d=s.offsetWidth;return s.style.overflowY=l,r.style.scrollbarGutter=c,f===d}function VY(e){const t=Kt(e),n=t.documentElement,r=t.body,a=Fo(n)?n:r,s={overflowY:a.style.overflowY,overflowX:a.style.overflowX};return Object.assign(a.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(a.style,s)}}function qY(e){var y;const t=Kt(e),n=t.documentElement,r=t.body,a=jn(n);let s=0,l=0,c=!1;const f=Ln.create();if(zp&&(((y=a.visualViewport)==null?void 0:y.scale)??1)!==1)return()=>{};function d(){const g=a.getComputedStyle(n),x=a.getComputedStyle(r),S=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,l=n.scrollLeft,oR={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},lR=n.style.scrollBehavior,sR={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const R=n.scrollHeight>n.clientHeight,k=n.scrollWidth>n.clientWidth,M=g.overflowY==="scroll"||x.overflowY==="scroll",D=g.overflowX==="scroll"||x.overflowX==="scroll",O=Math.max(0,a.innerWidth-r.clientWidth),N=Math.max(0,a.innerHeight-r.clientHeight),_=parseFloat(x.marginTop)+parseFloat(x.marginBottom),$=parseFloat(x.marginLeft)+parseFloat(x.marginRight),F=Fo(n)?n:r;if(c=UY(e),c){n.style.scrollbarGutter=S,F.style.overflowY="hidden",F.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:S,overflowY:"hidden",overflowX:"hidden"}),(R||M)&&(n.style.overflowY="scroll"),(k||D)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:_||N?`calc(100dvh - ${_+N}px)`:"100dvh",width:$||O?`calc(100vw - ${$+O}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=l,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function m(){Object.assign(n.style,oR),Object.assign(r.style,sR),c||(n.scrollTop=s,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=lR)}function p(){m(),f.request(d)}return d(),a.addEventListener("resize",p),()=>{f.cancel(),m(),typeof a.removeEventListener=="function"&&a.removeEventListener("resize",p)}}class $Y{constructor(){tt(this,"lockCount",0);tt(this,"restore",null);tt(this,"timeoutLock",Qi.create());tt(this,"timeoutUnlock",Qi.create());tt(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});tt(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const r=Kt(t).documentElement,a=jn(r).getComputedStyle(r).overflowY;if(a==="hidden"||a==="clip"){this.restore=_r;return}const s=UO||!HY(t);this.restore=s?VY(t):qY(t)}}const YY=new $Y;function Qx(e=!0,t=null){He(()=>{if(e)return YY.acquire(t)},[e,t])}const YA=w.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function WY(){return w.useContext(YA)}function Vp(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:a}=e,s=Ve(a),l=w.useRef(0),c=Jn(GY).current,f=Jn(KY).current,[d,m]=w.useState(0),p=w.useRef(d),y=Ve((S,R)=>{f.set(S,R??null),p.current+=1,m(p.current)}),g=Ve(S=>{f.delete(S),p.current+=1,m(p.current)}),x=w.useMemo(()=>{const S=new Map;return Array.from(f.keys()).filter(k=>k.isConnected).sort(XY).forEach((k,M)=>{const D=f.get(k)??{};S.set(k,{...D,index:M})}),S},[f,d]);He(()=>{if(typeof MutationObserver!="function"||x.size===0)return;const S=new MutationObserver(R=>{const k=new Set,M=D=>k.has(D)?k.delete(D):k.add(D);R.forEach(D=>{D.removedNodes.forEach(M),D.addedNodes.forEach(M)}),k.size===0&&(p.current+=1,m(p.current))});return x.forEach((R,k)=>{k.parentElement&&S.observe(k.parentElement,{childList:!0})}),()=>{S.disconnect()}},[x]),He(()=>{p.current===d&&(n.current.length!==x.size&&(n.current.length=x.size),r&&r.current.length!==x.size&&(r.current.length=x.size),l.current=x.size),s(x)},[s,x,n,r,d]),He(()=>()=>{n.current=[]},[n]),He(()=>()=>{r&&(r.current=[])},[r]);const C=Ve(S=>(c.add(S),()=>{c.delete(S)}));He(()=>{c.forEach(S=>S(x))},[c,x]);const T=w.useMemo(()=>({register:y,unregister:g,subscribeMapChange:C,elementsRef:n,labelsRef:r,nextIndexRef:l}),[y,g,C,n,r,l]);return E.jsx(YA.Provider,{value:T,children:t})}function KY(){return new Map}function GY(){return new Set}function XY(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 QY=w.createContext(void 0);function Su(){const e=w.useContext(QY);return(e==null?void 0:e.direction)??"ltr"}const ZY=e=>({name:"arrow",options:e,async fn(t){var K,P;const{x:n,y:r,placement:a,rects:s,platform:l,elements:c,middlewareData:f}=t,{element:d,padding:m=0,offsetParent:p="real"}=La(e,t)||{};if(d==null)return{};const y=QO(m),g={x:n,y:r},x=Lx(a),C=Px(x),T=await l.getDimensions(d),S=x==="y",R=S?"top":"left",k=S?"bottom":"right",M=S?"clientHeight":"clientWidth",D=s.reference[C]+s.reference[x]-g[x]-s.floating[C],O=g[x]-s.reference[x],N=p==="real"?await((K=l.getOffsetParent)==null?void 0:K.call(l,d)):c.floating;let _=c.floating[M]||s.floating[C];(!_||!await((P=l.isElement)==null?void 0:P.call(l,N)))&&(_=c.floating[M]||s.floating[C]);const $=D/2-O/2,F=_/2-T[C]/2-1,W=Math.min(y[R],F),L=Math.min(y[k],F),V=W,q=_-T[C]-L,Y=_/2-T[C]/2+$,j=ov(V,Y,q),z=!f.arrow&&Uo(a)!=null&&Y!==j&&s.reference[C]/2-(Y<V?W:L)-T[C]/2<0,H=z?Y<V?Y-V:Y-q:0;return{[x]:g[x]+H,data:{[x]:j,centerOffset:Y-j-H,...z&&{alignmentOffset:H}},reset:z}}}),JY=(e,t)=>({...ZY(e),options:[e,t]}),eW={name:"hide",async fn(e){var c;const{width:t,height:n,x:r,y:a}=e.rects.reference,s=t===0&&n===0&&r===0&&a===0;return{data:{referenceHidden:((c=(await rY().fn(e)).data)==null?void 0:c.referenceHidden)||s}}}},Mh={sideX:"left",sideY:"top"},tW={name:"adaptiveOrigin",async fn(e){var R,k;const{x:t,y:n,rects:{floating:r},elements:{floating:a},platform:s,strategy:l,placement:c}=e,f=jn(a),d=f.getComputedStyle(a);if(!(d.transitionDuration!=="0s"&&d.transitionDuration!==""))return{x:t,y:n,data:Mh};const p=await((R=s.getOffsetParent)==null?void 0:R.call(s,a));let y={width:0,height:0};if(l==="fixed"&&(f!=null&&f.visualViewport))y={width:f.visualViewport.width,height:f.visualViewport.height};else if(p===f){const M=Kt(a);y={width:M.documentElement.clientWidth,height:M.documentElement.clientHeight}}else await((k=s.isElement)==null?void 0:k.call(s,p))&&(y=await s.getDimensions(p));const g=jr(c);let x=t,C=n;g==="left"&&(x=y.width-(t+r.width)),g==="top"&&(C=y.height-(n+r.height));const T=g==="left"?"right":Mh.sideX,S=g==="top"?"bottom":Mh.sideY;return{x,y:C,data:{sideX:T,sideY:S}}}};function WA(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function uR(e,t,n){const{rects:r,placement:a}=e;return{side:WA(t,jr(a),n),align:Uo(a)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Zx(e){var jt,zt;const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:a=0,align:s="center",alignOffset:l=0,collisionBoundary:c,collisionPadding:f=5,sticky:d=!1,arrowPadding:m=5,disableAnchorTracking:p=!1,keepMounted:y=!1,floatingRootContext:g,mounted:x,collisionAvoidance:C,shiftCrossAxis:T=!1,nodeId:S,adaptiveOrigin:R,lazyFlip:k=!1,externalTree:M}=e,[D,O]=w.useState(null);!x&&D!==null&&O(null);const N=C.side||"flip",_=C.align||"flip",$=C.fallbackAxisSide||"end",F=typeof t=="function"?t:void 0,W=Ve(F),L=F?W:t,V=rr(t),Y=Su()==="rtl",j=D||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":Y?"left":"right","inline-start":Y?"right":"left"}[r],z=s==="center"?j:`${j}-${s}`;let H=f;const K=1,P=r==="bottom"?K:0,B=r==="top"?K:0,G=r==="right"?K:0,I=r==="left"?K:0;typeof H=="number"?H={top:H+P,right:H+I,bottom:H+B,left:H+G}:H&&(H={top:(H.top||0)+P,right:(H.right||0)+I,bottom:(H.bottom||0)+B,left:(H.left||0)+G});const Q={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:H},Z=w.useRef(null),ie=rr(a),ce=rr(l),_e=[Z$(gt=>{const Rt=uR(gt,r,Y),Je=typeof ie.current=="function"?ie.current(Rt):ie.current,kt=typeof ce.current=="function"?ce.current(Rt):ce.current;return{mainAxis:Je,crossAxis:kt,alignmentAxis:kt}},[typeof a!="function"?a:0,typeof l!="function"?l:0,Y,r])],Ie=_==="none"&&N!=="shift",re=!Ie&&(d||T||N==="shift"),he=N==="none"?null:tY({...Q,padding:{top:H.top+K,right:H.right+K,bottom:H.bottom+K,left:H.left+K},mainAxis:!T&&N==="flip",crossAxis:_==="flip"?"alignment":!1,fallbackAxisSideDirection:$}),be=Ie?null:J$(gt=>{const Rt=Kt(gt.elements.floating).documentElement;return{...Q,rootBoundary:T?{x:0,y:0,width:Rt.clientWidth,height:Rt.clientHeight}:void 0,mainAxis:_!=="none",crossAxis:re,limiter:d||T?void 0:eY(Je=>{if(!Z.current)return{};const{width:kt,height:Ft}=Z.current.getBoundingClientRect(),Xe=pi(jr(Je.placement)),Bt=Xe==="y"?kt:Ft,cn=Xe==="y"?H.left+H.right:H.top+H.bottom;return{offset:Bt/2+cn/2}})}},[Q,d,T,H,_]);N==="shift"||_==="shift"||s==="center"?_e.push(be,he):_e.push(he,be),_e.push(nY({...Q,apply({elements:{floating:gt},rects:{reference:Rt},availableWidth:Je,availableHeight:kt}){const Ft=gt.style;Ft.setProperty("--available-width",`${Je}px`),Ft.setProperty("--available-height",`${kt}px`),Ft.setProperty("--anchor-width",`${Rt.width}px`),Ft.setProperty("--anchor-height",`${Rt.height}px`)}}),JY(()=>({element:Z.current||document.createElement("div"),padding:m,offsetParent:"floating"}),[m]),{name:"transformOrigin",fn(gt){var Ke,Qe,vt;const{elements:Rt,middlewareData:Je,placement:kt,rects:Ft,y:Xe}=gt,Bt=jr(kt),cn=pi(Bt),tn=Z.current,Un=((Ke=Je.arrow)==null?void 0:Ke.x)||0,nn=((Qe=Je.arrow)==null?void 0:Qe.y)||0,ft=(tn==null?void 0:tn.clientWidth)||0,Ht=(tn==null?void 0:tn.clientHeight)||0,X=Un+ft/2,ae=nn+Ht/2,de=Math.abs(((vt=Je.shift)==null?void 0:vt.y)||0),ke=Ft.reference.height/2,je=typeof a=="function"?a(uR(gt,r,Y)):a,it=de>je,et={top:`${X}px calc(100% + ${je}px)`,bottom:`${X}px ${-je}px`,left:`calc(100% + ${je}px) ${ae}px`,right:`${-je}px ${ae}px`}[Bt],qe=`${X}px ${Ft.reference.y+ke-Xe}px`;return Rt.floating.style.setProperty("--transform-origin",re&&cn==="y"&&it?qe:et),{}}},eW,R),He(()=>{!x&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[x,g]);const Pe=w.useMemo(()=>({elementResize:!p&&typeof ResizeObserver<"u",layoutShift:!p&&typeof IntersectionObserver<"u"}),[p]),{refs:Ae,elements:Se,x:Ce,y:J,middlewareData:Re,update:xe,placement:Be,context:$e,isPositioned:te,floatingStyles:De}=uY({rootContext:g,placement:z,middleware:_e,strategy:n,whileElementsMounted:y?void 0:(...gt)=>tR(...gt,Pe),nodeId:S,externalTree:M}),{sideX:se,sideY:ye}=Re.adaptiveOrigin||Mh,we=te?n:"fixed",Me=w.useMemo(()=>{const gt=R?{position:we,[se]:Ce,[ye]:J}:{position:we,...De};return te||(gt.opacity=0),gt},[R,we,se,Ce,ye,J,De,te]),Fe=w.useRef(null);He(()=>{if(!x)return;const gt=V.current,Rt=typeof gt=="function"?gt():gt,kt=(cR(Rt)?Rt.current:Rt)||null||null;kt!==Fe.current&&(Ae.setPositionReference(kt),Fe.current=kt)},[x,Ae,L,V]),w.useEffect(()=>{if(!x)return;const gt=V.current;typeof gt!="function"&&cR(gt)&&gt.current!==Fe.current&&(Ae.setPositionReference(gt.current),Fe.current=gt.current)},[x,Ae,L,V]),w.useEffect(()=>{if(y&&x&&Se.domReference&&Se.floating)return tR(Se.domReference,Se.floating,xe,Pe)},[y,x,Se,xe,Pe]);const ct=jr(Be),bt=WA(r,ct,Y),Ot=Uo(Be)||"center",We=!!((jt=Re.hide)!=null&&jt.referenceHidden);He(()=>{k&&x&&te&&O(ct)},[k,x,te,ct]);const ot=w.useMemo(()=>{var gt,Rt;return{position:"absolute",top:(gt=Re.arrow)==null?void 0:gt.y,left:(Rt=Re.arrow)==null?void 0:Rt.x}},[Re.arrow]),st=((zt=Re.arrow)==null?void 0:zt.centerOffset)!==0;return w.useMemo(()=>({positionerStyles:Me,arrowStyles:ot,arrowRef:Z,arrowUncentered:st,side:bt,align:Ot,physicalSide:ct,anchorHidden:We,refs:Ae,context:$e,isPositioned:te,update:xe}),[Me,ot,Z,st,bt,Ot,ct,We,Ae,$e,te,xe])}function cR(e){return e!=null&&"current"in e}const KA=w.createContext(void 0);function Jx(){const e=w.useContext(KA);if(!e)throw new Error(Sn(59));return e}const e0=w.forwardRef(function(t,n){const{cutout:r,...a}=t;let s;if(r){const l=r==null?void 0:r.getBoundingClientRect();s=`polygon(
374
+ 0% 0%,
375
+ 100% 0%,
376
+ 100% 100%,
377
+ 0% 100%,
378
+ 0% 0%,
379
+ ${l.left}px ${l.top}px,
380
+ ${l.left}px ${l.bottom}px,
381
+ ${l.right}px ${l.bottom}px,
382
+ ${l.right}px ${l.top}px,
383
+ ${l.left}px ${l.top}px
384
+ )`}return E.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...a,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});function Eu(e){return e==="starting"?gF:On}function np(e,t){e&&Object.assign(e.style,t)}const GA={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},nW={position:"fixed"},rW=w.forwardRef(function(t,n){const{anchor:r,positionMethod:a="absolute",className:s,render:l,side:c="bottom",align:f="center",sideOffset:d=0,alignOffset:m=0,collisionBoundary:p="clipping-ancestors",collisionPadding:y,arrowPadding:g=5,sticky:x=!1,disableAnchorTracking:C,alignItemWithTrigger:T=!0,collisionAvoidance:S=iM,...R}=t,{store:k,listRef:M,labelsRef:D,alignItemWithTriggerActiveRef:O,selectedItemTextRef:N,valuesRef:_,initialValueRef:$,popupRef:F,setValue:W}=ta(),L=HA(),V=xt(k,yt.open),q=xt(k,yt.mounted),Y=xt(k,yt.modal),j=xt(k,yt.value),z=xt(k,yt.openMethod),H=xt(k,yt.positionerElement),K=xt(k,yt.triggerElement),P=xt(k,yt.isItemEqualToValue),B=xt(k,yt.transitionStatus),G=w.useRef(null),I=w.useRef(null),[Q,Z]=w.useState(T),ie=q&&Q&&z!=="touch";!q&&Q!==T&&Z(T),He(()=>{q||(yt.scrollUpArrowVisible(k.state)&&k.set("scrollUpArrowVisible",!1),yt.scrollDownArrowVisible(k.state)&&k.set("scrollDownArrowVisible",!1))},[k,q]),w.useImperativeHandle(O,()=>ie),Qx((ie||Y)&&V&&z!=="touch",K);const ce=Zx({anchor:r,floatingRootContext:L,positionMethod:a,mounted:q,side:c,sideOffset:d,align:f,alignOffset:m,arrowPadding:g,collisionBoundary:p,collisionPadding:y,sticky:x,disableAnchorTracking:C??ie,collisionAvoidance:S,keepMounted:!0}),ge=ie?"none":ce.side,Ee=ie?nW:ce.positionerStyles,_e=w.useMemo(()=>{const Se={};return V||(Se.pointerEvents="none"),{role:"presentation",hidden:!q,style:{...Ee,...Se}}},[V,q,Ee]),Ie={open:V,side:ge,align:ce.align,anchorHidden:ce.anchorHidden},re=Ve(Se=>{k.set("positionerElement",Se)}),he=Ct("div",t,{ref:[n,re],state:Ie,stateAttributesMapping:Ba,props:[_e,Eu(B),R]}),be=w.useRef(0),Pe=Ve(Se=>{if(Se.size===0&&be.current===0||_.current.length===0)return;const Ce=be.current;if(be.current=Se.size,Se.size===Ce)return;const J=pt(Di);if(Ce!==0&&!k.state.multiple&&j!==null&&Kc(_.current,j,P)===-1){const xe=$.current,$e=xe!=null&&Kc(_.current,xe,P)!==-1?xe:null;W($e,J),$e===null&&(k.set("selectedIndex",null),N.current=null)}if(Ce!==0&&k.state.multiple&&Array.isArray(j)){const Re=Be=>Kc(_.current,Be,P)!==-1,xe=j.filter(Be=>Re(Be));(xe.length!==j.length||xe.some(Be=>!wY(j,Be,P)))&&(W(xe,J),xe.length===0&&(k.set("selectedIndex",null),N.current=null))}if(V&&ie){k.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Re={height:""};np(H,Re),np(F.current,Re)}}),Ae=w.useMemo(()=>({...ce,side:ge,alignItemWithTriggerActive:ie,setControlledAlignItemWithTrigger:Z,scrollUpArrowRef:G,scrollDownArrowRef:I}),[ce,ge,ie,Z]);return E.jsx(Vp,{elementsRef:M,labelsRef:D,onMapChange:Pe,children:E.jsxs(KA.Provider,{value:Ae,children:[q&&Y&&E.jsx(e0,{inert:Xx(!V),cutout:K}),he]})})});function XA(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 dh="base-ui-disable-scrollbar",od={className:dh,getElement(e){return E.jsx("style",{nonce:e,href:dh,precedence:"base-ui:low",children:`.${dh}{scrollbar-width:none}.${dh}::-webkit-scrollbar{display:none}`})}},iW=w.createContext(void 0);function QA(e){return w.useContext(iW)}const Ul="ArrowUp",bs="ArrowDown",sd="ArrowLeft",Vl="ArrowRight",kd="Home",Md="End",ZA=new Set([sd,Vl]),aW=new Set([sd,Vl,kd,Md]),JA=new Set([Ul,bs]),oW=new Set([Ul,bs,kd,Md]),eN=new Set([...ZA,...JA]),sW=new Set([...eN,kd,Md]),t0=new Set([Ul,bs,sd,Vl,kd,Md]),lW="Shift",uW="Control",cW="Alt",dW="Meta",fW=new Set([lW,uW,cW,dW]);function hW(e){return Cn(e)&&e.tagName==="INPUT"}function dR(e){return!!(hW(e)&&e.selectionStart!=null||Cn(e)&&e.tagName==="TEXTAREA")}function fR(e,t,n,r){if(!e||!t||!t.scrollTo)return;let a=e.scrollLeft,s=e.scrollTop;const l=e.clientWidth<e.scrollWidth,c=e.clientHeight<e.scrollHeight;if(l&&r!=="vertical"){const f=hR(e,t,"left"),d=fh(e),m=fh(t);n==="ltr"&&(f+t.offsetWidth+m.scrollMarginRight>e.scrollLeft+e.clientWidth-d.scrollPaddingRight?a=f+t.offsetWidth+m.scrollMarginRight-e.clientWidth+d.scrollPaddingRight:f-m.scrollMarginLeft<e.scrollLeft+d.scrollPaddingLeft&&(a=f-m.scrollMarginLeft-d.scrollPaddingLeft)),n==="rtl"&&(f-m.scrollMarginRight<e.scrollLeft+d.scrollPaddingLeft?a=f-m.scrollMarginLeft-d.scrollPaddingLeft:f+t.offsetWidth+m.scrollMarginRight>e.scrollLeft+e.clientWidth-d.scrollPaddingRight&&(a=f+t.offsetWidth+m.scrollMarginRight-e.clientWidth+d.scrollPaddingRight))}if(c&&r!=="horizontal"){const f=hR(e,t,"top"),d=fh(e),m=fh(t);f-m.scrollMarginTop<e.scrollTop+d.scrollPaddingTop?s=f-m.scrollMarginTop-d.scrollPaddingTop:f+t.offsetHeight+m.scrollMarginBottom>e.scrollTop+e.clientHeight-d.scrollPaddingBottom&&(s=f+t.offsetHeight+m.scrollMarginBottom-e.clientHeight+d.scrollPaddingBottom)}e.scrollTo({left:a,top:s,behavior:"auto"})}function hR(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let a=0;for(;t.offsetParent&&(a+=t[r],t.offsetParent!==e);)t=t.offsetParent;return a}function fh(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 Na(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const pW=w.createContext(void 0),mW={disableStyleElements:!1};function tN(){return w.useContext(pW)??mW}const ps=1,gW={...Ba,...Ho},yW=w.forwardRef(function(t,n){const{render:r,className:a,finalFocus:s,...l}=t,{store:c,popupRef:f,onOpenChangeComplete:d,setOpen:m,valueRef:p,selectedItemTextRef:y,keyboardActiveRef:g,multiple:x,handleScrollArrowVisibility:C,scrollHandlerRef:T,highlightItemOnHover:S}=ta(),{side:R,align:k,alignItemWithTriggerActive:M,setControlledAlignItemWithTrigger:D,scrollDownArrowRef:O,scrollUpArrowRef:N}=Jx(),_=QA()!=null,$=HA(),{nonce:F,disableStyleElements:W}=tN(),L=_n(),V=xt(c,yt.id),q=xt(c,yt.open),Y=xt(c,yt.mounted),j=xt(c,yt.popupProps),z=xt(c,yt.transitionStatus),H=xt(c,yt.triggerElement),K=xt(c,yt.positionerElement),P=xt(c,yt.listElement),B=w.useRef(0),G=w.useRef(!1),I=w.useRef(0),Q=w.useRef(!1),Z=w.useRef({}),ie=wd(),ce=Ve(Ie=>{if(!K||!f.current||!Q.current)return;if(G.current||!M){C();return}const re=K.style.top==="0px",he=K.style.bottom==="0px",be=K.getBoundingClientRect().height,Pe=Kt(K),Ae=getComputedStyle(K),Se=parseFloat(Ae.marginTop),Ce=parseFloat(Ae.marginBottom),J=pR(getComputedStyle(f.current)),Re=Math.min(Pe.documentElement.clientHeight-Se-Ce,J),xe=Ie.scrollTop,Be=mR(Ie);let $e=0,te=null,De=!1,se=!1;const ye=Me=>{K.style.height=`${Me}px`},we=(Me,Fe)=>{const ct=Na(Me,0,Re-be);ct>0&&ye(be+ct),Ie.scrollTop=Fe,Re-(be+ct)<=ps&&(G.current=!0),C()};if(re){const Me=Be-xe,Fe=be+Me,ct=Math.min(Fe,Re);if($e=ct,Me<=ps){we(Me,Be);return}Re-ct>ps?se=!0:De=!0}else if(he){const Me=xe,Fe=be+Me,ct=Math.min(Fe,Re),bt=Fe-Re;if($e=ct,Me<=ps){we(Me,0);return}Re-ct>ps?te=0:(De=!0,xe<Be&&(te=xe-(Me-bt)))}if($e=Math.ceil($e),$e!==0&&ye($e),se||te!=null){const Me=mR(Ie),Fe=se?Me:Na(te,0,Me);Math.abs(Ie.scrollTop-Fe)>ps&&(Ie.scrollTop=Fe)}(De||$e>=Re-ps)&&(G.current=!0),C()});w.useImperativeHandle(T,()=>ce,[ce]),za({open:q,ref:f,onComplete(){q&&(d==null||d(!0))}});const ge={open:q,transitionStatus:z,side:R,align:k};He(()=>{!K||!f.current||Object.keys(Z.current).length||(Z.current={top:K.style.top||"0",left:K.style.left||"0",right:K.style.right,height:K.style.height,bottom:K.style.bottom,minHeight:K.style.minHeight,maxHeight:K.style.maxHeight,marginTop:K.style.marginTop,marginBottom:K.style.marginBottom})},[f,K]),He(()=>{q||M||(Q.current=!1,G.current=!1,B.current=0,I.current=0,np(K,Z.current))},[q,M,K,f]),He(()=>{const Ie=f.current;if(!(!q||!H||!K||!Ie||c.state.transitionStatus==="ending")){if(!M){Q.current=!0,ie.request(C),Ie.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{var he;const re=bW(Ie);Ie.style.removeProperty("--transform-origin");try{const be=getComputedStyle(K),Pe=getComputedStyle(Ie),Ae=Kt(H),Se=jn(K),Ce=H.getBoundingClientRect(),J=K.getBoundingClientRect(),Re=Ce.left,xe=Ce.height,Be=P||Ie,$e=Be.scrollHeight,te=parseFloat(Pe.borderBottomWidth),De=parseFloat(be.marginTop)||10,se=parseFloat(be.marginBottom)||10,ye=parseFloat(be.minHeight)||100,we=pR(Pe),Me=5,Fe=5,ct=20,bt=Ae.documentElement.clientHeight-De-se,Ot=Ae.documentElement.clientWidth,We=bt-Ce.bottom+xe,ot=y.current,st=p.current;let jt,zt=0,gt=0;if(ot&&st){const Ht=st.getBoundingClientRect();jt=ot.getBoundingClientRect();const X=Ht.left-Re,ae=jt.left-J.left,de=Ht.top-Ce.top+Ht.height/2,ke=jt.top-J.top+jt.height/2;zt=X-ae,gt=ke-de}const Rt=We+gt+se+te;let Je=Math.min(bt,Rt);const kt=bt-De-se,Ft=Rt-Je,Xe=Math.max(Me,Re+zt),Bt=Ot-Fe,cn=Math.max(0,Xe+J.width-Bt);K.style.left=`${Xe-cn}px`,K.style.height=`${Je}px`,K.style.maxHeight="auto",K.style.marginTop=`${De}px`,K.style.marginBottom=`${se}px`,Ie.style.height="100%";const tn=Be.scrollHeight-Be.clientHeight,Un=Ft>=tn;Un&&(Je=Math.min(bt,J.height)-(Ft-tn));const nn=Ce.top<ct||Ce.bottom>bt-ct||Je<Math.min($e,ye),ft=(((he=Se.visualViewport)==null?void 0:he.scale)??1)!==1&&zp;if(nn||ft){Q.current=!0,np(K,Z.current),yi.flushSync(()=>D(!1));return}if(Un){const Ht=Math.max(0,bt-Rt);K.style.top=J.height>=kt?"0":`${Ht}px`,K.style.height=`${Je}px`,Be.scrollTop=Be.scrollHeight-Be.clientHeight,B.current=Math.max(ye,Je)}else K.style.bottom="0",B.current=Math.max(ye,Je),Be.scrollTop=Ft;if(jt){const Ht=J.top,X=J.height,ae=jt.top+jt.height/2,de=X>0?(ae-Ht)/X*100:50,ke=Na(de,0,100);Ie.style.setProperty("--transform-origin",`50% ${ke}%`)}(B.current===bt||Je>=we)&&(G.current=!0),C(),setTimeout(()=>{Q.current=!0})}finally{re()}})}},[c,q,K,H,p,y,f,C,M,D,ie,O,N,P]),w.useEffect(()=>{if(!M||!K||!q)return;const Ie=jn(K);function re(he){m(!1,pt(SB,he))}return Ie.addEventListener("resize",re),()=>{Ie.removeEventListener("resize",re)}},[m,M,K,q]);const Ee={...P?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":x||void 0,id:`${V}-list`},onKeyDown(Ie){g.current=!0,_&&t0.has(Ie.key)&&Ie.stopPropagation()},onMouseMove(){g.current=!1},onPointerLeave(Ie){if(!S||XA(Ie)||Ie.pointerType==="touch")return;const re=Ie.currentTarget;L.start(0,()=>{c.set("activeIndex",null),re.focus({preventScroll:!0})})},onScroll(Ie){P||ce(Ie.currentTarget)},...M&&{style:P?{height:"100%"}:GA}},_e=Ct("div",t,{ref:[n,f],state:ge,stateAttributesMapping:gW,props:[j,Ee,Eu(z),{className:!P&&M?od.className:void 0},l]});return E.jsxs(w.Fragment,{children:[!W&&od.getElement(F),E.jsx(Bx,{context:$,modal:!1,disabled:!Y,returnFocus:s,restoreFocus:!0,children:_e})]})});function pR(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function mR(e){return Math.max(0,e.scrollHeight-e.clientHeight)}const gR=[["transform","none"],["scale","1"],["translate","0 0"]];function bW(e){const{style:t}=e,n={};for(const[r,a]of gR)n[r]=t.getPropertyValue(r),t.setProperty(r,a,"important");return()=>{for(const[r]of gR){const a=n[r];a?t.setProperty(r,a):t.removeProperty(r)}}}const vW=w.forwardRef(function(t,n){const{className:r,render:a,...s}=t,{store:l,scrollHandlerRef:c}=ta(),{alignItemWithTriggerActive:f}=Jx(),d=xt(l,yt.hasScrollArrows),m=xt(l,yt.openMethod),p=xt(l,yt.multiple),g={id:`${xt(l,yt.id)}-list`,role:"listbox","aria-multiselectable":p||void 0,onScroll(C){var T;(T=c.current)==null||T.call(c,C.currentTarget)},...f&&{style:GA},className:d&&m!=="touch"?od.className:void 0},x=Ve(C=>{l.set("listElement",C)});return Ct("div",t,{ref:[n,x],props:[g,s]})});let nN=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function n0(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:a,index:s}=e,{register:l,unregister:c,subscribeMapChange:f,elementsRef:d,labelsRef:m,nextIndexRef:p}=WY(),y=w.useRef(-1),[g,x]=w.useState(s??(a===nN.GuessFromOrder?()=>{if(y.current===-1){const S=p.current;p.current+=1,y.current=S}return y.current}:-1)),C=w.useRef(null),T=w.useCallback(S=>{var R;if(C.current=S,g!==-1&&S!==null&&(d.current[g]=S,m)){const k=t!==void 0;m.current[g]=k?t:((R=r==null?void 0:r.current)==null?void 0:R.textContent)??S.textContent}},[g,d,m,t,r]);return He(()=>{if(s!=null)return;const S=C.current;if(S)return l(S,n),()=>{c(S)}},[s,l,c,n]),He(()=>{if(s==null)return f(S=>{var k;const R=C.current?(k=S.get(C.current))==null?void 0:k.index:null;R!=null&&x(R)})},[s,f,x]),w.useMemo(()=>({ref:T,index:g}),[g,T])}const rN=w.createContext(void 0);function r0(){const e=w.useContext(rN);if(!e)throw new Error(Sn(57));return e}const xW=w.memo(w.forwardRef(function(t,n){const{render:r,className:a,value:s=null,label:l,disabled:c=!1,nativeButton:f=!1,...d}=t,m=w.useRef(null),p=n0({label:l,textRef:m,indexGuessBehavior:nN.GuessFromOrder}),{store:y,getItemProps:g,setOpen:x,setValue:C,selectionRef:T,typingRef:S,valuesRef:R,keyboardActiveRef:k,multiple:M,highlightItemOnHover:D}=ta(),O=_n(),N=xt(y,yt.isActive,p.index),_=xt(y,yt.isSelected,p.index,s),$=xt(y,yt.isSelectedByFocus,p.index),F=xt(y,yt.isItemEqualToValue),W=p.index,L=W!==-1,V=w.useRef(null),q=rr(W);He(()=>{if(!L)return;const ie=R.current;return ie[W]=s,()=>{delete ie[W]}},[L,W,s,R]),He(()=>{if(!L)return;const ie=y.state.value;let ce=ie;M&&Array.isArray(ie)&&ie.length>0&&(ce=ie[ie.length-1]),ce!==void 0&&fu(s,ce,F)&&y.set("selectedIndex",W)},[L,W,M,F,y,s]);const Y={disabled:c,selected:_,highlighted:N},j=g({active:N,selected:_});j.onFocus=void 0,j.id=void 0;const z=w.useRef(null),H=w.useRef("mouse"),K=w.useRef(!1),{getButtonProps:P,buttonRef:B}=_a({disabled:c,focusableWhenDisabled:!0,native:f});function G(ie){const ce=y.state.value;if(M){const ge=Array.isArray(ce)?ce:[],Ee=_?SY(ge,s,F):[...ge,s];C(Ee,pt(Hc,ie))}else C(s,pt(Hc,ie)),x(!1,pt(Hc,ie))}const I={role:"option","aria-selected":_,tabIndex:N?0:-1,onFocus(){y.set("activeIndex",W)},onMouseEnter(){!k.current&&y.state.selectedIndex===null&&D&&y.set("activeIndex",W)},onMouseMove(){D&&y.set("activeIndex",W)},onMouseLeave(ie){!D||k.current||XA(ie)||O.start(0,()=>{y.state.activeIndex===W&&y.set("activeIndex",null)})},onTouchStart(){T.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(ie){z.current=ie.key,y.set("activeIndex",W)},onClick(ie){K.current=!1,!(ie.type==="keydown"&&z.current===null)&&(c||z.current===" "&&S.current||H.current!=="touch"&&!N||(z.current=null,G(ie.nativeEvent)))},onPointerEnter(ie){H.current=ie.pointerType},onPointerDown(ie){H.current=ie.pointerType,K.current=!0},onMouseUp(ie){if(c)return;if(K.current){K.current=!1;return}const ce=!T.current.allowSelectedMouseUp&&_,ge=!T.current.allowUnselectedMouseUp&&!_;ce||ge||H.current!=="touch"&&!N||G(ie.nativeEvent)}},Q=Ct("div",t,{ref:[B,n,p.ref,V],state:Y,props:[j,I,d,P]}),Z=w.useMemo(()=>({selected:_,indexRef:q,textRef:m,selectedByFocus:$,hasRegistered:L}),[_,q,m,$,L]);return E.jsx(rN.Provider,{value:Z,children:Q})})),wW=w.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:a}=r0();return r||a?E.jsx(SW,{...t,ref:n}):null}),SW=w.memo(w.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:a,...s}=e,{selected:l}=r0(),c=w.useRef(null),{transitionStatus:f,setMounted:d}=Sd(l),p=Ct("span",e,{ref:[t,c],state:{selected:l,transitionStatus:f},props:[{"aria-hidden":!0,children:"✔️"},s],stateAttributesMapping:Ho});return za({open:l,ref:c,onComplete(){l||d(!1)}}),p})),EW=w.memo(w.forwardRef(function(t,n){const{indexRef:r,textRef:a,selectedByFocus:s,hasRegistered:l}=r0(),{selectedItemTextRef:c}=ta(),{className:f,render:d,...m}=t,p=w.useCallback(g=>{if(!g||!l)return;const x=c.current===null||!c.current.isConnected;(s||x&&r.current===0)&&(c.current=g)},[c,r,s,l]);return Ct("div",t,{ref:[p,n,a],props:m})})),iN=w.forwardRef(function(t,n){const{render:r,className:a,direction:s,keepMounted:l=!1,...c}=t,{store:f,popupRef:d,listRef:m,handleScrollArrowVisibility:p,scrollArrowsMountedCountRef:y}=ta(),{side:g,scrollDownArrowRef:x,scrollUpArrowRef:C}=Jx(),T=s==="up"?yt.scrollUpArrowVisible:yt.scrollDownArrowVisible,S=xt(f,T),R=xt(f,yt.openMethod),k=S&&R!=="touch",M=_n(),D=s==="up"?C:x,{transitionStatus:O,setMounted:N}=Sd(k);He(()=>(y.current+=1,f.state.hasScrollArrows||f.set("hasScrollArrows",!0),()=>{y.current=Math.max(0,y.current-1),y.current===0&&f.state.hasScrollArrows&&f.set("hasScrollArrows",!1)}),[f,y]),za({open:k,ref:D,onComplete(){k||N(!1)}});const F=Ct("div",t,{ref:[n,D],state:{direction:s,visible:k,side:g,transitionStatus:O},props:[{"aria-hidden":!0,children:s==="up"?"▲":"▼",style:{position:"absolute"},onMouseMove(L){if(L.movementX===0&&L.movementY===0||M.isStarted())return;f.set("activeIndex",null);function V(){var H;const q=f.state.listElement??d.current;if(!q)return;f.set("activeIndex",null),p();const Y=q.scrollTop===0,j=Math.round(q.scrollTop+q.clientHeight)>=q.scrollHeight;if(m.current.length===0&&(s==="up"?f.set("scrollUpArrowVisible",!Y):f.set("scrollDownArrowVisible",!j)),s==="up"&&Y||s==="down"&&j){M.clear();return}if((f.state.listElement||d.current)&&m.current&&m.current.length>0){const K=m.current,P=((H=D.current)==null?void 0:H.offsetHeight)||0;if(s==="up"){let B=0;const G=q.scrollTop+P;for(let Q=0;Q<K.length;Q+=1){const Z=K[Q];if(Z&&Z.offsetTop>=G){B=Q;break}}const I=Math.max(0,B-1);if(I<B){const Q=K[I];Q&&(q.scrollTop=Math.max(0,Q.offsetTop-P))}else q.scrollTop=0}else{let B=K.length-1;const G=q.scrollTop+q.clientHeight-P;for(let Q=0;Q<K.length;Q+=1){const Z=K[Q];if(Z&&Z.offsetTop+Z.offsetHeight>G){B=Math.max(0,Q-1);break}}const I=Math.min(K.length-1,B+1);if(I>B){const Q=K[I];Q&&(q.scrollTop=Q.offsetTop+Q.offsetHeight-q.clientHeight+P)}else q.scrollTop=q.scrollHeight-q.clientHeight}}M.start(40,V)}M.start(40,V)},onMouseLeave(){M.clear()}},c]});return k||l?F:null}),TW=w.forwardRef(function(t,n){return E.jsx(iN,{...t,ref:n,direction:"down"})}),CW=w.forwardRef(function(t,n){return E.jsx(iN,{...t,ref:n,direction:"up"})}),aN=w.createContext(void 0);function RW(){const e=w.useContext(aN);if(e===void 0)throw new Error(Sn(56));return e}const kW=w.forwardRef(function(t,n){const{className:r,render:a,...s}=t,[l,c]=w.useState(),f=w.useMemo(()=>({labelId:l,setLabelId:c}),[l,c]),d=Ct("div",t,{ref:n,props:[{role:"group","aria-labelledby":l},s]});return E.jsx(aN.Provider,{value:f,children:d})}),MW=w.forwardRef(function(t,n){const{className:r,render:a,id:s,...l}=t,{setLabelId:c}=RW(),f=Pi(s);return He(()=>{c(f)},[f,c]),Ct("div",t,{ref:n,props:[{id:f},l]})}),oN=w.forwardRef(function(t,n){const{className:r,render:a,orientation:s="horizontal",...l}=t;return Ct("div",t,{state:{orientation:s},ref:n,props:[{role:"separator","aria-orientation":s},l]})}),Oh=kY;function OW({className:e,...t}){return E.jsx(kW,{"data-slot":"select-group",className:Le("scroll-my-1 p-1",e),...t})}function nb({className:e,...t}){return E.jsx(jY,{"data-slot":"select-value",className:Le("flex flex-1 text-left",e),...t})}function Ah({className:e,size:t="default",children:n,...r}){return E.jsxs(LY,{"data-slot":"select-trigger","data-size":t,className:Le("border-input data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm transition-colors select-none focus-visible:ring-2 aria-invalid:ring-2 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...r,children:[n,E.jsx(zY,{render:E.jsx(Kk,{className:"text-muted-foreground size-4 pointer-events-none"})})]})}function Nh({className:e,children:t,side:n="bottom",sideOffset:r=4,align:a="center",alignOffset:s=0,alignItemWithTrigger:l=!0,...c}){return E.jsx(BY,{children:E.jsx(rW,{side:n,sideOffset:r,align:a,alignOffset:s,alignItemWithTrigger:l,className:"isolate z-50",children:E.jsxs(yW,{"data-slot":"select-content","data-align-trigger":l,className:Le("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-36 rounded-lg shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto data-[align-trigger=true]:animate-none",e),...c,children:[E.jsx(NW,{}),E.jsx(vW,{children:t}),E.jsx(DW,{})]})})})}function AW({className:e,...t}){return E.jsx(MW,{"data-slot":"select-label",className:Le("text-muted-foreground px-1.5 py-1 text-xs",e),...t})}function Ca({className:e,children:t,...n}){return E.jsxs(xW,{"data-slot":"select-item",className:Le("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[E.jsx(EW,{className:"flex flex-1 gap-2 shrink-0 whitespace-nowrap",children:t}),E.jsx(wW,{render:E.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:E.jsx(zh,{className:"pointer-events-none"})})]})}function NW({className:e,...t}){return E.jsx(CW,{"data-slot":"select-scroll-up-button",className:Le("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 top-0 w-full",e),...t,children:E.jsx(U4,{})})}function DW({className:e,...t}){return E.jsx(TW,{"data-slot":"select-scroll-down-button",className:Le("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 bottom-0 w-full",e),...t,children:E.jsx(Kk,{})})}const pv="::";function yR(e,t){return`${e??""}${pv}${t}`}function IW(e){const t=e.indexOf(pv);return t<0?{providerId:null,modelId:e}:{providerId:e.slice(0,t)||null,modelId:e.slice(t+pv.length)}}function PW({providerId:e,modelId:t,onChange:n,disabled:r,className:a}){var C;const{t:s}=xn(),{data:l}=Po({queryKey:["llm-providers"],queryFn:async()=>{const T=await fetch("/api/llm/providers");if(!T.ok)throw new Error("Failed to load providers");return await T.json()},throwOnError:!1}),{data:c}=Po({queryKey:["llm-settings"],queryFn:async()=>{const T=await fetch("/api/llm/settings");if(!T.ok)throw new Error("Failed to load settings");return await T.json()},throwOnError:!1}),f=((l==null?void 0:l.providers)??[]).filter(T=>T.enabled&&T.models.length>0),d=e??(c==null?void 0:c.settings.defaultProviderId)??null,m=t??(c==null?void 0:c.settings.defaultModelId)??null,p=m?yR(d,m):"",y=f.some(T=>T.id===d&&T.models.includes(m??"")),g=((C=f.find(T=>T.id===d))==null?void 0:C.name)??null,x=m?g?`${g}/${m}`:m:s("agent.model.placeholder");return E.jsxs(Oh,{value:p,onValueChange:T=>{if(typeof T!="string"||!T)return;const S=IW(T);n(S.providerId,S.modelId)},disabled:r||f.length===0,children:[E.jsx(Ah,{size:"sm",className:Le("h-7 w-full min-w-0 border-transparent bg-transparent text-muted-foreground text-xs hover:border-border/40 dark:bg-transparent dark:hover:bg-transparent",a),"data-testid":"agent-model-picker","aria-label":s("agent.model.select"),children:E.jsx("span",{className:"min-w-0 truncate",children:x})}),E.jsxs(Nh,{children:[!y&&m&&E.jsx(Ca,{value:p,className:"text-muted-foreground",children:m}),f.map(T=>E.jsxs(OW,{children:[E.jsx(AW,{children:T.name}),T.models.map(S=>E.jsx(Ca,{value:yR(T.id,S),children:S},`${T.id}:${S}`))]},T.id))]})]})}function LW({queued:e,onEdit:t,onWithdraw:n,onSteer:r}){const{t:a}=xn(),[s,l]=w.useState(null),[c,f]=w.useState("");if(e.length===0)return null;const d=p=>{l(p.id),f(p.text)},m=p=>{const y=c.trim();y&&t(p,y),l(null)};return E.jsxs("div",{"data-testid":"agent-queue",className:"bg-muted/50 mx-3 mb-2 flex shrink-0 flex-col gap-1.5 rounded-xl px-2.5 py-2",children:[E.jsxs("div",{className:"flex items-center justify-between",children:[E.jsx("span",{className:"text-muted-foreground text-xs font-medium",children:a("agent.queue.title",{count:e.length})}),E.jsxs(_t,{"data-testid":"agent-queue-steer",size:"xs",variant:"outline",onClick:r,title:a("agent.queue.steerHint"),children:[E.jsx(Qk,{}),a("agent.queue.steer")]})]}),E.jsx("ul",{className:"flex flex-col gap-1",children:e.map(p=>E.jsx("li",{"data-testid":`agent-queue-item-${p.id}`,className:"bg-background/60 flex items-start gap-1.5 rounded-lg px-2 py-1",children:s===p.id?E.jsxs(E.Fragment,{children:[E.jsx(dx,{value:c,onChange:y=>f(y.target.value),onKeyDown:y=>{y.key==="Enter"&&!y.shiftKey&&(y.preventDefault(),m(p.id)),y.key==="Escape"&&l(null)},rows:1,className:"max-h-32 min-h-7 flex-1 resize-none text-xs",autoFocus:!0}),E.jsx(_t,{size:"icon-sm",variant:"ghost",onClick:()=>m(p.id),"aria-label":a("common.save"),children:E.jsx(zh,{})})]}):E.jsxs(E.Fragment,{children:[E.jsx("span",{className:"min-w-0 flex-1 truncate text-xs",children:p.text}),E.jsx(_t,{size:"icon-sm",variant:"ghost",onClick:()=>d(p),"aria-label":a("common.edit"),children:E.jsx(pp,{})}),E.jsx(_t,{"data-testid":`agent-queue-withdraw-${p.id}`,size:"icon-sm",variant:"ghost",onClick:()=>n(p.id),"aria-label":a("agent.queue.withdraw"),children:E.jsx(Pa,{})})]})},p.id))})]})}function _W({onSend:e,onSteer:t,onStop:n,running:r,steerable:a,disabled:s,modelPicker:l,writeModeControl:c}){const{t:f}=xn(),[d,m]=w.useState(""),p=()=>{const g=d.trim();!g||s||(e==null||e(g),m(""))},y=()=>{const g=d.trim();!g||s||(t==null||t(g),m(""))};return E.jsxs("div",{"data-testid":"agent-chat-input",className:"bg-chat-surface flex shrink-0 flex-col gap-2 mx-3 mb-2.5 rounded-xl mt-1.5 focus-within:ring-1 focus-within:ring-ring/30",children:[E.jsx(dx,{"data-testid":"agent-chat-input-textarea",value:d,onChange:g=>m(g.target.value),onKeyDown:g=>{g.key==="Enter"&&!g.shiftKey&&!g.nativeEvent.isComposing&&(g.preventDefault(),p())},placeholder:f("agent.panel.inputPlaceholder"),disabled:s,className:"max-h-40 min-h-[4.5rem] w-full resize-none border-transparent bg-transparent text-[13px] shadow-none focus-visible:border-transparent focus-visible:ring-0 disabled:bg-transparent dark:bg-transparent dark:disabled:bg-transparent",rows:3}),E.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 px-2.5 pb-2.5",children:[E.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[c,l&&E.jsx("div",{className:"min-w-0 flex-1",children:l})]}),r?E.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[a&&E.jsx(_t,{"data-testid":"agent-chat-steer",size:"icon",variant:"outline",disabled:s||d.trim().length===0,onClick:y,"aria-label":f("agent.queue.steer"),title:f("agent.queue.steerHint"),children:E.jsx(Qk,{})}),E.jsx(_t,{"data-testid":"agent-chat-send",size:"icon",variant:"secondary",disabled:s||d.trim().length===0,onClick:p,"aria-label":f("agent.panel.send"),children:E.jsx(RT,{})}),E.jsx(_t,{"data-testid":"agent-chat-stop",size:"icon",variant:"destructive",onClick:()=>n==null?void 0:n(),"aria-label":f("agent.panel.stop"),children:E.jsx(A5,{})})]}):E.jsx(_t,{"data-testid":"agent-chat-send",size:"icon",className:"ml-auto shrink-0",disabled:s||d.trim().length===0,onClick:p,"aria-label":f("agent.panel.send"),children:E.jsx(RT,{})})]})]})}function jW(e,t,n){var s;if(!e.deviceId||!e.paneId)return null;const r=((s=n==null?void 0:n.find(l=>l.id===e.deviceId))==null?void 0:s.name)??null,a=t[e.deviceId];if(!(a!=null&&a.session))return{label:`${e.paneId}@${r??"?"}`,state:"unknown",windowId:null};for(const l of a.session.windows){const c=l.panes.find(f=>f.id===e.paneId);if(c)return{label:PB({paneIdx:c.index,windowIdx:l.index,paneTitle:c.title,windowName:l.name,windowCustomName:l.customName,deviceName:r}),state:"valid",windowId:l.id}}return{label:`${e.paneId}@${r??"?"}`,state:"invalid",windowId:null}}function zW(){var Q;const{t:e}=xn(),t=Yv(),n=Ia(Z=>Z.setSidebarTab),r=iL("/devices/:deviceId/windows/:windowId/panes/:paneId"),a=(r==null?void 0:r.params.deviceId)??null,s=(r==null?void 0:r.params.paneId)??null,l=on(Z=>Z.sessions),c=on(Z=>Z.activeSessionId),f=on(Z=>Z.draft),d=on(Z=>Z.activeSessionId?Z.messages[Z.activeSessionId]:void 0),m=on(Z=>Z.activeSessionId?Z.inProgress[Z.activeSessionId]:void 0),p=on(Z=>Z.activeSessionId?Z.pendingConfirmations[Z.activeSessionId]:void 0),y=on(Z=>Z.activeSessionId?Z.sending[Z.activeSessionId]:void 0),g=on(Z=>Z.activeSessionId?Z.queued[Z.activeSessionId]:void 0),x=on(Z=>Z.defaultWriteMode),C=Qn(Z=>Z.snapshots),{data:T}=Po({queryKey:["devices"],queryFn:async()=>{const Z=await fetch("/api/devices");if(!Z.ok)throw new Error("Failed to load devices");return Z.json()},throwOnError:!1});w.useEffect(()=>{const Z=on.getState();Z.ensureInitialized(),Z.loadSessions()},[]);const S=c?l[c]:void 0,R=w.useMemo(()=>{var ie,ce;if(!a||!s)return null;const Z=(ce=(ie=C[a])==null?void 0:ie.session)==null?void 0:ce.windows;for(const ge of Z??[]){const Ee=ge.panes.find(_e=>_e.id===s);if(Ee)return Ee.title??null}return null},[a,s,C]);w.useEffect(()=>{!S&&!f&&a&&s&&on.getState().startDraft(a,s,R)},[S,f,a,s,R]);const k=w.useMemo(()=>{const Z=new Map;for(const ie of p??[])Z.set(ie.toolCallId,ie.id);return Z},[p]),M=w.useMemo(()=>{const Z=RB(d,m),ie=new Set;for(const ge of Z)ge.kind==="tool-call"&&ie.add(ge.call.toolCallId);const ce=[];for(const ge of p??[])ie.has(ge.toolCallId)||ce.push({kind:"tool-call",key:`confirmation-${ge.id}`,call:{toolCallId:ge.toolCallId,toolName:ge.toolName,input:ge.input,isError:!1,denied:!1,resolved:!1}});return ce.length>0?[...Z,...ce]:Z},[d,m,p]),D=S?jW(S,C,T==null?void 0:T.devices):null,O=!!(S&&s&&a&&(S.paneId!==s||S.deviceId!==a)),N=(S==null?void 0:S.status)==="running",_=kB(d),$=!!(S&&(!S.deviceId||!((Q=T==null?void 0:T.devices)!=null&&Q.some(Z=>Z.id===S.deviceId))||(D==null?void 0:D.state)==="invalid")),F=g??[],W=(Z,ie)=>{c&&on.getState().decideConfirmation(c,Z,ie)},L=()=>{if(S!=null&&S.deviceId){if((D==null?void 0:D.state)==="valid"&&D.windowId&&S.paneId){t(`/devices/${S.deviceId}/windows/${D.windowId}/panes/${encodeURIComponent(S.paneId)}`);return}(D==null?void 0:D.state)==="unknown"&&t(`/devices/${S.deviceId}`)}},V=()=>{!a||!s||on.getState().startDraft(a,s,R)},q=(Z,ie)=>{S?on.getState().setSessionModel(S.id,Z,ie):f&&on.getState().updateDraft({providerId:Z,modelId:ie})},Y=Z=>{const ie=on.getState();if(S){S.status==="running"?ie.enqueueMessage(S.id,Z):ie.sendMessage(S.id,Z);return}f&&(async()=>{const ce=await ie.materializeDraft();ce&&await ie.sendMessage(ce.id,Z)})()},j=Z=>{S&&on.getState().enqueueMessage(S.id,Z,!0)},z=()=>{if(!S)return;const Z=F[0];if(!Z)return;const ie=on.getState();(async()=>(await ie.withdrawQueuedMessage(S.id,Z.id),await ie.enqueueMessage(S.id,Z.text,!0)))()},H=S?S.providerId:(f==null?void 0:f.providerId)??null,K=S?S.modelId:(f==null?void 0:f.modelId)??null,P=!!(S||f),B=S?S.writeMode:x,G=!!(S&&((d==null?void 0:d.length)??0)>0),I=$||!P||(S==null?void 0:S.status)==="waiting_confirmation"||!!y;return E.jsxs("div",{"data-testid":"agent-tab",className:"flex h-full min-h-0 flex-col",children:[E.jsxs("div",{className:"flex shrink-0 items-center gap-2 px-3 py-2",children:[S&&D?E.jsxs("button",{type:"button","data-testid":"agent-binding-chip","data-binding-state":D.state,className:Le("border-border flex min-w-0 items-center gap-1 rounded-full border px-2 py-0.5 text-xs",D.state==="valid"?"hover:bg-muted cursor-pointer":"text-muted-foreground",D.state==="invalid"&&"opacity-60"),onClick:L,disabled:D.state==="invalid",children:[E.jsx(P5,{className:"size-3 shrink-0"}),E.jsx("span",{className:"min-w-0 truncate",children:D.label}),D.state==="invalid"&&E.jsxs("span",{className:"shrink-0",children:["· ",e("agent.binding.invalid")]})]}):E.jsx("div",{className:"min-w-0 flex-1"}),E.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[E.jsx(_t,{"data-testid":"agent-session-switch",size:"icon-sm",variant:"ghost",onClick:()=>n("panes"),"aria-label":e("agent.session.switch"),title:e("agent.session.switch"),children:E.jsx(r5,{})}),G&&E.jsx(_t,{"data-testid":"agent-session-new",size:"icon-sm",variant:"ghost",disabled:!a||!s,onClick:V,"aria-label":e("agent.session.new"),title:e(!a||!s?"agent.session.selectPaneHint":"agent.session.new"),children:E.jsx(mp,{})})]})]}),$&&E.jsxs("div",{"data-testid":"agent-orphan-banner",className:"bg-muted/50 text-muted-foreground mx-3 mb-1.5 flex shrink-0 items-start gap-2 rounded-lg px-2 py-1.5 text-xs",children:[E.jsx(Fc,{className:"mt-0.5 size-3.5 shrink-0"}),E.jsx("span",{className:"min-w-0 flex-1",children:e("agent.orphan.readonly")})]}),S&&!$&&O&&E.jsxs("div",{"data-testid":"agent-pane-mismatch",className:"bg-muted/50 mx-3 mb-1.5 flex shrink-0 flex-wrap items-center gap-2 rounded-lg px-2 py-1.5 text-xs",children:[E.jsx(Fc,{className:"text-muted-foreground size-3.5 shrink-0"}),E.jsx("span",{className:"text-muted-foreground min-w-0 flex-1",children:e("agent.binding.mismatchTitle")}),(D==null?void 0:D.state)==="valid"&&E.jsx(_t,{"data-testid":"agent-binding-goto",size:"xs",variant:"outline",onClick:L,children:e("agent.binding.goTo")}),s&&E.jsx(_t,{"data-testid":"agent-binding-rebind",size:"xs",variant:"outline",onClick:()=>{on.getState().rebindPane(S.id,s)},children:e("agent.binding.rebind")})]}),(S==null?void 0:S.status)==="error"&&S.lastError&&E.jsxs("div",{"data-testid":"agent-error-banner",className:"bg-destructive/10 text-destructive mx-3 mb-1.5 flex shrink-0 items-start gap-2 rounded-lg px-2 py-1.5 text-xs",children:[E.jsx(Fc,{className:"mt-0.5 size-3.5 shrink-0"}),E.jsx("span",{className:"min-w-0 flex-1 break-words",children:S.lastError}),_&&!$&&E.jsx(_t,{"data-testid":"agent-error-retry",size:"xs",variant:"outline",className:"shrink-0",disabled:!!y,onClick:()=>{on.getState().sendMessage(S.id,_)},children:e("agent.panel.retry")})]}),E.jsx(Wq,{blocks:S?M:[],running:!!N,emptyText:e(P?"agent.panel.empty":"agent.session.selectPaneHint"),confirmationByToolCallId:k,onDecide:W,className:"bg-chat-surface mx-3 mb-2 overflow-hidden rounded-xl"},(S==null?void 0:S.id)??(f?"draft":"none")),S&&!$&&F.length>0&&E.jsx(LW,{queued:F,onEdit:(Z,ie)=>void on.getState().editQueuedMessage(S.id,Z,ie),onWithdraw:Z=>void on.getState().withdrawQueuedMessage(S.id,Z),onSteer:z}),E.jsx(_W,{disabled:I,running:!!N,steerable:!!S,onSend:Y,onSteer:j,onStop:()=>{S&&on.getState().stopSession(S.id)},modelPicker:P?E.jsx(PW,{providerId:H,modelId:K,onChange:q,disabled:N}):void 0,writeModeControl:E.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[E.jsx("span",{className:"text-muted-foreground text-xs",children:e(B==="auto"?"agent.writeMode.auto":"agent.writeMode.confirm")}),E.jsx(Bh,{"data-testid":"agent-write-mode-switch",checked:B==="auto",disabled:!!S&&$,onCheckedChange:Z=>{const ie=Z?"auto":"confirm";on.getState().setDefaultWriteMode(ie),S&&on.getState().setWriteMode(S.id,ie)}})]})})]})}function FW(){const{t:e}=xn();return E.jsxs("div",{"data-testid":"files-tab",className:"text-muted-foreground flex h-full flex-col items-center justify-center gap-2 px-4 text-center",children:[E.jsx(X4,{className:"size-8 opacity-50"}),E.jsx("span",{className:"text-sm",children:e("agent.files.comingSoon")})]})}const rb=768;function BW(){const[e,t]=w.useState(void 0);return w.useEffect(()=>{const n=window.matchMedia(`(max-width: ${rb-1}px)`),r=()=>{t(window.innerWidth<rb)};return n.addEventListener("change",r),t(window.innerWidth<rb),()=>n.removeEventListener("change",r)},[]),!!e}const HW=w.forwardRef(function(t,n){const{render:r,className:a,id:s,name:l,value:c,disabled:f=!1,onValueChange:d,defaultValue:m,autoFocus:p=!1,...y}=t,{state:g,name:x,disabled:C,setTouched:T,setDirty:S,validityData:R,setFocused:k,setFilled:M,validationMode:D,validation:O}=yu(),N=C||f,_=x??l,$={...g,disabled:N},{labelId:F}=Sp(),W=Ep({id:s});He(()=>{var H;const z=c!=null;(H=O.inputRef.current)!=null&&H.value||z&&c!==""?M(!0):z&&c===""&&M(!1)},[O.inputRef,M,c]);const L=w.useRef(null);He(()=>{p&&L.current===Xr(Kt(L.current))&&k(!0)},[p,k]);const[V]=au({controlled:c,default:m,name:"FieldControl",state:"value"}),q=c!==void 0,Y=q?V:void 0;return ux({id:W,name:_,commit:O.commit,value:Y,getValue:()=>{var z;return(z=O.inputRef.current)==null?void 0:z.value},controlRef:O.inputRef}),Ct("input",t,{ref:[n,L],state:$,props:[{id:W,disabled:N,name:_,ref:O.inputRef,"aria-labelledby":F,autoFocus:p,...q?{value:Y}:{defaultValue:m},onChange(z){const H=z.currentTarget.value;d==null||d(H,pt(Di,z.nativeEvent)),S(H!==R.initialValue),M(H!=="")},onFocus(){k(!0)},onBlur(z){T(!0),k(!1),D==="onBlur"&&O.commit(z.currentTarget.value)},onKeyDown(z){z.currentTarget.tagName==="INPUT"&&z.key==="Enter"&&(T(!0),O.commit(z.currentTarget.value))}},O.getInputValidationProps(),y],stateAttributesMapping:sx})}),UW=w.forwardRef(function(t,n){return E.jsx(HW,{ref:n,...t})});function ki({className:e,type:t,...n}){return E.jsx(UW,{type:t,"data-slot":"input",className:Le("dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-lg border bg-transparent px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-2 aria-invalid:ring-2 md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",e),...n})}function VW({className:e,orientation:t="horizontal",...n}){return E.jsx(oN,{"data-slot":"separator",orientation:t,className:Le("bg-border shrink-0 data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",e),...n})}const i0=w.createContext(void 0);function qo(e){const t=w.useContext(i0);if(e===!1&&t===void 0)throw new Error(Sn(27));return t}const qW={...Ba,...Ho},a0=w.forwardRef(function(t,n){const{render:r,className:a,forceRender:s=!1,...l}=t,{store:c}=qo(),f=c.useState("open"),d=c.useState("nested"),m=c.useState("mounted"),p=c.useState("transitionStatus");return Ct("div",t,{state:{open:f,transitionStatus:p},ref:[c.context.backdropRef,n],stateAttributesMapping:qW,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:s||!d})}),qp=w.forwardRef(function(t,n){const{render:r,className:a,disabled:s=!1,nativeButton:l=!0,...c}=t,{store:f}=qo(),d=f.useState("open");function m(x){d&&f.setOpen(!1,pt(xB,x.nativeEvent))}const{getButtonProps:p,buttonRef:y}=_a({disabled:s,native:l});return Ct("button",t,{state:{disabled:s},ref:[n,y],props:[{onClick:m},c,p]})}),o0=w.forwardRef(function(t,n){const{render:r,className:a,id:s,...l}=t,{store:c}=qo(),f=Pi(s);return c.useSyncedValueWithCleanup("descriptionElementId",f),Ct("p",t,{ref:n,props:[{id:f},l]})});let $W=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),YW=(function(e){return e[e.open=ys.open]="open",e[e.closed=ys.closed]="closed",e[e.startingStyle=ys.startingStyle]="startingStyle",e[e.endingStyle=ys.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const sN=w.createContext(void 0);function WW(){const e=w.useContext(sN);if(e===void 0)throw new Error(Sn(26));return e}const KW={...Ba,...Ho,nestedDialogOpen(e){return e?{[YW.nestedDialogOpen]:""}:null}},s0=w.forwardRef(function(t,n){const{className:r,finalFocus:a,initialFocus:s,render:l,...c}=t,{store:f}=qo(),d=f.useState("descriptionElementId"),m=f.useState("disablePointerDismissal"),p=f.useState("floatingRootContext"),y=f.useState("popupProps"),g=f.useState("modal"),x=f.useState("mounted"),C=f.useState("nested"),T=f.useState("nestedOpenDialogCount"),S=f.useState("open"),R=f.useState("openMethod"),k=f.useState("titleElementId"),M=f.useState("transitionStatus"),D=f.useState("role");WW(),za({open:S,ref:f.context.popupRef,onComplete(){var W,L;S&&((L=(W=f.context).onOpenChangeComplete)==null||L.call(W,!0))}});function O(W){return W==="touch"?f.context.popupRef.current:!0}const N=s===void 0?O:s,_=T>0,F=Ct("div",t,{state:{open:S,nested:C,transitionStatus:M,nestedDialogOpen:_},props:[y,{"aria-labelledby":k??void 0,"aria-describedby":d??void 0,role:D,tabIndex:-1,hidden:!x,onKeyDown(W){t0.has(W.key)&&W.stopPropagation()},style:{[$W.nestedDialogs]:T}},c],ref:[n,f.context.popupRef,f.useStateSetter("popupElement")],stateAttributesMapping:KW});return E.jsx(Bx,{context:p,openInteractionType:R,disabled:!x,closeOnFocusOut:!m,initialFocus:N,returnFocus:a,modal:g!==!1,restoreFocus:"popup",children:F})}),l0=w.forwardRef(function(t,n){const{keepMounted:r=!1,...a}=t,{store:s}=qo(),l=s.useState("mounted"),c=s.useState("modal"),f=s.useState("open");return l||r?E.jsx(sN.Provider,{value:r,children:E.jsxs(zx,{ref:n,...a,children:[l&&c===!0&&E.jsx(e0,{ref:s.context.internalBackdropRef,inert:Xx(!f)}),t.children]})}):null});function lN(e){const{store:t,parentContext:n,actionsRef:r}=e,a=t.useState("open"),s=t.useState("disablePointerDismissal"),l=t.useState("modal"),c=t.useState("popupElement"),{openMethod:f,triggerProps:d,reset:m}=Gx(a);Vx(t);const{forceUnmount:p}=qx(a,t,()=>{m()}),y=Ve(F=>{const W=pt(F);return W.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},W}),g=w.useCallback(()=>{t.setOpen(!1,y(cx))},[t,y]);w.useImperativeHandle(r,()=>({unmount:p,close:g}),[p,g]);const x=Wx({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[C,T]=w.useState(0),S=C===0,R=_A(x),k=Hp(x,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:l==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(F){if(!t.context.outsidePressEnabledRef.current||"button"in F&&F.button!==0||"touches"in F&&F.touches.length!==1)return!1;const W=Sr(F);if(S&&!s){const L=W;return l&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===L||t.context.backdropRef.current===L||Et(L,c)&&!(L!=null&&L.hasAttribute("data-base-ui-portal")):!0}return!1},escapeKey:S});Qx(a&&l===!0,c);const{getReferenceProps:M,getFloatingProps:D,getTriggerProps:O}=Rd([R,k]);t.useContextCallback("onNestedDialogOpen",F=>{T(F+1)}),t.useContextCallback("onNestedDialogClose",()=>{T(0)}),w.useEffect(()=>(n!=null&&n.onNestedDialogOpen&&a&&n.onNestedDialogOpen(C),n!=null&&n.onNestedDialogClose&&!a&&n.onNestedDialogClose(),()=>{n!=null&&n.onNestedDialogClose&&a&&n.onNestedDialogClose()}),[a,n,C]);const N=w.useMemo(()=>M(d),[M,d]),_=w.useMemo(()=>O(d),[O,d]),$=w.useMemo(()=>D(),[D]);t.useSyncedValues({openMethod:f,activeTriggerProps:N,inactiveTriggerProps:_,popupProps:$,floatingRootContext:x,nestedOpenDialogCount:C})}const GW={...Yx,modal:Ye(e=>e.modal),nested:Ye(e=>e.nested),nestedOpenDialogCount:Ye(e=>e.nestedOpenDialogCount),disablePointerDismissal:Ye(e=>e.disablePointerDismissal),openMethod:Ye(e=>e.openMethod),descriptionElementId:Ye(e=>e.descriptionElementId),titleElementId:Ye(e=>e.titleElementId),viewportElement:Ye(e=>e.viewportElement),role:Ye(e=>e.role)};class uN extends jp{constructor(n){super(XW(n),{popupRef:w.createRef(),backdropRef:w.createRef(),internalBackdropRef:w.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new Cd,onOpenChange:void 0,onOpenChangeComplete:void 0},GW);tt(this,"setOpen",(n,r)=>{var c,f,d,m;if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&r.trigger==null&&this.state.activeTriggerId!=null&&(r.trigger=this.state.activeTriggerElement??void 0),(f=(c=this.context).onOpenChange)==null||f.call(c,n,r),r.isCanceled)return;const a={open:n,nativeEvent:r.event,reason:r.reason,nested:this.state.nested};(d=this.state.floatingRootContext.context.events)==null||d.emit("openchange",a);const s={open:n},l=((m=r.trigger)==null?void 0:m.id)??null;(l||n)&&(s.activeTriggerId=l,s.activeTriggerElement=r.trigger??null),this.update(s)})}}function XW(e={}){return{...$x(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function cN(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:a,onOpenChangeComplete:s,disablePointerDismissal:l=!1,modal:c=!0,actionsRef:f,handle:d,triggerId:m,defaultTriggerId:p=null}=e,y=qo(!0),g=!!y,x=Jn(()=>(d==null?void 0:d.store)??new uN({open:r,openProp:n,activeTriggerId:p,triggerIdProp:m,modal:c,disablePointerDismissal:l,nested:g})).current;_p(()=>{n===void 0&&x.state.open===!1&&r===!0&&x.update({open:!0,activeTriggerId:p})}),x.useControlledProp("openProp",n),x.useControlledProp("triggerIdProp",m),x.useSyncedValues({disablePointerDismissal:l,nested:g,modal:c}),x.useContextCallback("onOpenChange",a),x.useContextCallback("onOpenChangeComplete",s);const C=x.useState("payload");lN({store:x,actionsRef:f,parentContext:y==null?void 0:y.store.context});const T=w.useMemo(()=>({store:x}),[x]);return E.jsx(i0.Provider,{value:T,children:typeof t=="function"?t({payload:C}):t})}const u0=w.forwardRef(function(t,n){const{render:r,className:a,id:s,...l}=t,{store:c}=qo(),f=Pi(s);return c.useSyncedValueWithCleanup("titleElementId",f),Ct("h2",t,{ref:n,props:[{id:f},l]})});function QW({...e}){return E.jsx(cN,{"data-slot":"sheet",...e})}function ZW({...e}){return E.jsx(l0,{"data-slot":"sheet-portal",...e})}function JW({className:e,...t}){return E.jsx(a0,{"data-slot":"sheet-overlay",className:Le("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50",e),...t})}function eK({className:e,children:t,side:n="right",showCloseButton:r=!0,...a}){return E.jsxs(ZW,{children:[E.jsx(JW,{}),E.jsxs(s0,{"data-slot":"sheet-content","data-side":n,className:Le("bg-background data-open:animate-in data-closed:animate-out data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:fade-out-0 data-open:fade-in-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10 fixed z-50 flex flex-col gap-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...a,children:[t,r&&E.jsxs(qp,{"data-slot":"sheet-close",render:E.jsx(_t,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[E.jsx(Pa,{}),E.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function tK({className:e,...t}){return E.jsx("div",{"data-slot":"sheet-header",className:Le("gap-0.5 p-4 flex flex-col",e),...t})}function nK({className:e,...t}){return E.jsx(u0,{"data-slot":"sheet-title",className:Le("text-foreground text-base font-medium",e),...t})}function rK({className:e,...t}){return E.jsx(o0,{"data-slot":"sheet-description",className:Le("text-muted-foreground text-sm",e),...t})}const dN=w.createContext(void 0);function Od(e){const t=w.useContext(dN);if(t===void 0&&!e)throw new Error(Sn(72));return t}const iK={...Yx,disabled:Ye(e=>e.disabled),instantType:Ye(e=>e.instantType),isInstantPhase:Ye(e=>e.isInstantPhase),trackCursorAxis:Ye(e=>e.trackCursorAxis),disableHoverablePopup:Ye(e=>e.disableHoverablePopup),lastOpenChangeReason:Ye(e=>e.openChangeReason),closeDelay:Ye(e=>e.closeDelay),hasViewport:Ye(e=>e.hasViewport)};class c0 extends jp{constructor(n){super({...aK(),...n},{popupRef:w.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Cd},iK);tt(this,"setOpen",(n,r)=>{var d,m;const a=r.reason,s=a===wr,l=n&&a===_l,c=!n&&(a===Ls||a===Cp);if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},(m=(d=this.context).onOpenChange)==null||m.call(d,n,r),r.isCanceled)return;const f=()=>{var g;const p={open:n,openChangeReason:a};l?p.instantType="focus":c?p.instantType="dismiss":a===wr&&(p.instantType=void 0);const y=((g=r.trigger)==null?void 0:g.id)??null;(y||n)&&(p.activeTriggerId=y,p.activeTriggerElement=r.trigger??null),this.update(p)};s?yi.flushSync(f):f()})}static useStore(n,r){const a=Jn(()=>new c0(r)).current,s=n??a,l=Wx({popupStore:s,onOpenChange:s.setOpen});return s.state.floatingRootContext=l,s}}function aK(){return{...$x(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}const oK=Nx(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:a,disableHoverablePopup:s=!1,trackCursorAxis:l="none",actionsRef:c,onOpenChange:f,onOpenChangeComplete:d,handle:m,triggerId:p,defaultTriggerId:y=null,children:g}=t,x=c0.useStore(m==null?void 0:m.store,{open:r,openProp:a,activeTriggerId:y,triggerIdProp:p});_p(()=>{a===void 0&&x.state.open===!1&&r===!0&&x.update({open:!0,activeTriggerId:y})}),x.useControlledProp("openProp",a),x.useControlledProp("triggerIdProp",p),x.useContextCallback("onOpenChange",f),x.useContextCallback("onOpenChangeComplete",d);const C=x.useState("open"),T=!n&&C,S=x.useState("activeTriggerId"),R=x.useState("payload");x.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:s}),He(()=>{C&&n&&x.setOpen(!1,pt(wB))},[C,n,x]),x.useSyncedValue("disabled",n),Vx(x);const{forceUnmount:k,transitionStatus:M}=qx(T,x),D=x.useState("isInstantPhase"),O=x.useState("instantType"),N=x.useState("lastOpenChangeReason"),_=w.useRef(null);He(()=>{M==="ending"&&N===Di||M!=="ending"&&D?(O!=="delay"&&(_.current=O),x.set("instantType","delay")):_.current!==null&&(x.set("instantType",_.current),_.current=null)},[M,D,N,O,x]),He(()=>{T&&S==null&&x.set("payload",void 0)},[x,S,T]);const $=w.useCallback(()=>{x.setOpen(!1,sK(x,cx))},[x]);w.useImperativeHandle(c,()=>({unmount:k,close:$}),[k,$]);const F=x.useState("floatingRootContext"),W=Hp(F,{enabled:!n,referencePress:!0}),L=g$(F,{enabled:!n&&l!=="none",axis:l==="none"?void 0:l}),{getReferenceProps:V,getFloatingProps:q,getTriggerProps:Y}=Rd([W,L]),j=w.useMemo(()=>V(),[V]),z=w.useMemo(()=>Y(),[Y]),H=w.useMemo(()=>q(),[q]);return x.useSyncedValues({activeTriggerProps:j,inactiveTriggerProps:z,popupProps:H}),E.jsx(dN.Provider,{value:x,children:typeof g=="function"?g({payload:R}):g})});function sK(e,t){const n=pt(t);return n.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},n}const lK=w.createContext(void 0);function uK(){return w.useContext(lK)}let cK=(function(e){return e[e.popupOpen=tp.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const dK=600,fK=zO(function(t,n){const{className:r,render:a,handle:s,payload:l,disabled:c,delay:f,closeDelay:d,id:m,...p}=t,y=Od(!0),g=(s==null?void 0:s.store)??y;if(!g)throw new Error(Sn(82));const x=Pi(m),C=g.useState("isTriggerActive",x),T=g.useState("isOpenedByTrigger",x),S=g.useState("floatingRootContext"),R=w.useRef(null),k=f??dK,M=d??0,{registerTrigger:D,isMountedByThisTrigger:O}=OA(x,R,g,{payload:l,closeDelay:M}),N=uK(),{delayRef:_,isInstantPhase:$,hasProvider:F}=o$(S,{open:T});g.useSyncedValue("isInstantPhase",$);const W=g.useState("disabled"),L=c??W,V=g.useState("trackCursorAxis"),q=g.useState("disableHoverablePopup"),Y=PA(S,{enabled:!L,mouseOnly:!0,move:!1,handleClose:!q&&V!=="both"?zA():null,restMs(){const P=N==null?void 0:N.delay,B=typeof _.current=="object"?_.current.open:void 0;let G=k;return F&&(B!==0?G=f??P??k:G=0),G},delay(){const P=typeof _.current=="object"?_.current.close:void 0;let B=M;return d==null&&F&&(B=P),{close:B}},triggerElementRef:R,isActiveTrigger:C}),j=NA(S,{enabled:!L}).reference,z={open:T},H=g.useState("triggerProps",O);return Ct("button",t,{state:z,ref:[n,D,R],props:[Y,j,H,{id:x,[cK.triggerDisabled]:L?"":void 0},p],stateAttributesMapping:qA})}),fN=w.createContext(void 0);function hK(){const e=w.useContext(fN);if(e===void 0)throw new Error(Sn(70));return e}const pK=w.forwardRef(function(t,n){const{children:r,container:a,className:s,render:l,...c}=t,{portalNode:f,portalSubtree:d}=vA({container:a,ref:n,componentProps:t,elementProps:c});return!d&&!f?null:E.jsxs(w.Fragment,{children:[d,f&&yi.createPortal(r,f)]})}),mK=w.forwardRef(function(t,n){const{keepMounted:r=!1,...a}=t;return Od().useState("mounted")||r?E.jsx(fN.Provider,{value:r,children:E.jsx(pK,{ref:n,...a})}):null}),hN=w.createContext(void 0);function pN(){const e=w.useContext(hN);if(e===void 0)throw new Error(Sn(71));return e}const gK=w.forwardRef(function(t,n){const{render:r,className:a,anchor:s,positionMethod:l="absolute",side:c="top",align:f="center",sideOffset:d=0,alignOffset:m=0,collisionBoundary:p="clipping-ancestors",collisionPadding:y=5,arrowPadding:g=5,sticky:x=!1,disableAnchorTracking:C=!1,collisionAvoidance:T=aM,...S}=t,R=Od(),k=hK(),M=R.useState("open"),D=R.useState("mounted"),O=R.useState("trackCursorAxis"),N=R.useState("disableHoverablePopup"),_=R.useState("floatingRootContext"),$=R.useState("instantType"),F=R.useState("transitionStatus"),W=R.useState("hasViewport"),L=Zx({anchor:s,positionMethod:l,floatingRootContext:_,mounted:D,side:c,sideOffset:d,align:f,alignOffset:m,collisionBoundary:p,collisionPadding:y,sticky:x,arrowPadding:g,disableAnchorTracking:C,keepMounted:k,collisionAvoidance:T,adaptiveOrigin:W?tW:void 0}),V=w.useMemo(()=>{const z={};return(!M||O==="both"||N)&&(z.pointerEvents="none"),{role:"presentation",hidden:!D,style:{...L.positionerStyles,...z}}},[M,O,N,D,L.positionerStyles]),q=w.useMemo(()=>({open:M,side:L.side,align:L.align,anchorHidden:L.anchorHidden,instant:O!=="none"?"tracking-cursor":$}),[M,L.side,L.align,L.anchorHidden,O,$]),Y=w.useMemo(()=>({...q,arrowRef:L.arrowRef,arrowStyles:L.arrowStyles,arrowUncentered:L.arrowUncentered}),[q,L.arrowRef,L.arrowStyles,L.arrowUncentered]),j=Ct("div",t,{state:q,props:[V,Eu(F),S],ref:[n,R.useStateSetter("positionerElement")],stateAttributesMapping:Ba});return E.jsx(hN.Provider,{value:Y,children:j})}),yK={...Ba,...Ho},bK=w.forwardRef(function(t,n){const{className:r,render:a,...s}=t,l=Od(),{side:c,align:f}=pN(),d=l.useState("open"),m=l.useState("instantType"),p=l.useState("transitionStatus"),y=l.useState("popupProps"),g=l.useState("floatingRootContext");za({open:d,ref:l.context.popupRef,onComplete(){var R,k;d&&((k=(R=l.context).onOpenChangeComplete)==null||k.call(R,!0))}});const x=l.useState("disabled"),C=l.useState("closeDelay");return IA(g,{enabled:!x,closeDelay:C}),Ct("div",t,{state:{open:d,side:c,align:f,instant:m,transitionStatus:p},ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],props:[y,Eu(p),s],stateAttributesMapping:yK})}),vK=w.forwardRef(function(t,n){const{className:r,render:a,...s}=t,c=Od().useState("instantType"),{open:f,arrowRef:d,side:m,align:p,arrowUncentered:y,arrowStyles:g}=pN();return Ct("div",t,{state:{open:f,side:m,align:p,uncentered:y,instant:c},ref:[n,d],props:[{style:g,"aria-hidden":!0},s],stateAttributesMapping:Ba})});function xK({...e}){return E.jsx(oK,{"data-slot":"tooltip",...e})}function wK({...e}){return E.jsx(fK,{"data-slot":"tooltip-trigger",...e})}function SK({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:a=0,children:s,...l}){return E.jsx(mK,{children:E.jsx(gK,{align:r,alignOffset:a,side:t,sideOffset:n,className:"isolate z-50",children:E.jsxs(bK,{"data-slot":"tooltip-content",className:Le("data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-md px-3 py-1.5 text-xs data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 bg-foreground text-background z-50 w-fit max-w-xs origin-(--transform-origin)",e),...l,children:[s,E.jsx(vK,{className:"size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 bg-foreground fill-foreground z-50 data-[side=bottom]:top-1 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const EK="sidebar_state",TK=3600*24*7,ib="100vw",CK="3rem",RK="b",Mc=320,rp=320,kK=450,ab="tmex_sidebar_width";function MK(){const e=typeof window>"u"?Number.POSITIVE_INFINITY:window.innerWidth;return Math.max(rp,e-kK)}function hh(e){return Math.min(MK(),Math.max(rp,Math.round(e)))}const mN=w.createContext(null);function na(){const e=w.useContext(mN);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function OK({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:s,...l}){const c=BW(),[f,d]=w.useState(!1),m=w.useRef(Mc),[p,y]=w.useState(()=>{if(typeof window>"u")return Mc;const _=Number(window.localStorage.getItem(ab)),$=Number.isFinite(_)&&_>0?Math.max(rp,Math.round(_)):Mc;return m.current=$,hh($)}),[g,x]=w.useState(!1),C=w.useCallback(_=>{const $=Math.max(rp,Math.round(_));m.current=$,y(hh(_)),window.localStorage.setItem(ab,String($))},[]),T=w.useCallback(()=>{m.current=Mc,y(hh(Mc)),window.localStorage.removeItem(ab)},[]);w.useEffect(()=>{const _=()=>{y(hh(m.current))};return window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[]);const[S,R]=w.useState(e),k=t??S,M=w.useCallback(_=>{const $=typeof _=="function"?_(k):_;n?n($):R($),document.cookie=`${EK}=${$}; path=/; max-age=${TK}`},[n,k]),D=w.useCallback(()=>c?d(_=>!_):M(_=>!_),[c,M,d]);w.useEffect(()=>{const _=$=>{$.defaultPrevented||$.target instanceof HTMLElement&&$.target.closest(".xterm")||$.key===RK&&($.metaKey||$.ctrlKey)&&($.preventDefault(),D())};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[D]);const O=k?"expanded":"collapsed",N=w.useMemo(()=>({state:O,open:k,setOpen:M,isMobile:c,openMobile:f,setOpenMobile:d,toggleSidebar:D,width:p,setWidth:C,resetWidth:T,isResizing:g,setIsResizing:x}),[O,k,M,c,f,d,D,p,C,T,g]);return E.jsx(mN.Provider,{value:N,children:E.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":`${p}px`,"--sidebar-width-icon":CK,...a},className:Le("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...l,children:s})})}function AK({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:a,dir:s,...l}){const{isMobile:c,state:f,openMobile:d,setOpenMobile:m,isResizing:p}=na();return n==="none"?E.jsx("div",{"data-slot":"sidebar",className:Le("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...l,children:a}):c?E.jsx(QW,{open:d,onOpenChange:m,...l,children:E.jsxs(eK,{dir:s,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true","data-testid":"mobile-sidebar-sheet",className:"bg-sidebar text-sidebar-foreground p-0 [&>button]:hidden",style:{"--sidebar-width":ib,width:ib,maxWidth:ib},side:e,children:[E.jsxs(tK,{className:"sr-only",children:[E.jsx(nK,{children:"Sidebar"}),E.jsx(rK,{children:"Displays the mobile sidebar."})]}),E.jsx("div",{className:"flex h-full w-full flex-col","data-testid":"sidebar",style:{paddingBottom:"var(--tmex-safe-area-bottom)"},children:a})]})}):E.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":f,"data-collapsible":f==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[E.jsx("div",{"data-slot":"sidebar-gap",className:Le(!p&&"transition-[width] duration-200 ease-linear","relative w-(--sidebar-width) bg-transparent","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),E.jsxs("div",{"data-slot":"sidebar-container","data-side":e,className:Le(!p&&"transition-[left,right,width] duration-200 ease-linear","fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...l,children:[E.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner","data-testid":"sidebar",className:"bg-sidebar group-data-[variant=floating]:ring-sidebar-border group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 flex size-full flex-col",style:{paddingBottom:"var(--tmex-safe-area-bottom)"},children:a}),f==="expanded"&&E.jsx(NK,{side:e})]})]})}function NK({side:e}){const{width:t,setWidth:n,resetWidth:r,setIsResizing:a}=na(),s=w.useRef(null);return E.jsx("div",{"data-slot":"sidebar-resizer","data-testid":"sidebar-resizer","aria-hidden":"true",className:Le("absolute inset-y-0 z-30 w-2 cursor-col-resize touch-none select-none","after:absolute after:inset-y-0 after:w-[2px] after:bg-transparent hover:after:bg-sidebar-border active:after:bg-sidebar-border",e==="left"?"-right-1 after:right-[3px]":"-left-1 after:left-[3px]"),onPointerDown:l=>{l.preventDefault(),s.current={pointerId:l.pointerId,startX:l.clientX,startWidth:t},l.currentTarget.setPointerCapture(l.pointerId),a(!0)},onPointerMove:l=>{const c=s.current;if(!c||c.pointerId!==l.pointerId)return;const f=l.clientX-c.startX;n(c.startWidth+(e==="left"?f:-f))},onPointerUp:l=>{var c;((c=s.current)==null?void 0:c.pointerId)===l.pointerId&&(s.current=null,a(!1))},onPointerCancel:l=>{var c;((c=s.current)==null?void 0:c.pointerId)===l.pointerId&&(s.current=null,a(!1))},onDoubleClick:r})}function DK({className:e,onClick:t,...n}){const{toggleSidebar:r}=na();return E.jsxs(_t,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:Le(e),onClick:a=>{t==null||t(a),r()},...n,children:[E.jsx(u5,{}),E.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function IK({className:e,...t}){return E.jsx("main",{"data-slot":"sidebar-inset",className:Le("bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 relative flex w-full flex-1 flex-col",e),...t})}function PK({className:e,...t}){return E.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:Le("gap-2 p-2 flex flex-col",e),...t})}function LK({className:e,...t}){return E.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:Le("gap-2 p-2 flex flex-col",e),...t})}function _K({className:e,...t}){return E.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:Le("no-scrollbar gap-0 flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function gN({className:e,...t}){return E.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:Le("p-2 relative flex w-full min-w-0 flex-col",e),...t})}function jK({className:e,...t}){return E.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:Le("gap-0 flex w-full min-w-0 flex-col",e),...t})}function zK({className:e,...t}){return E.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:Le("group/menu-item relative",e),...t})}const FK=xp("ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground gap-2 rounded-md p-2 text-left text-sm transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! focus-visible:ring-2 data-active:font-medium peer/menu-button flex w-full items-center overflow-hidden outline-hidden group/menu-button disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function BK({render:e,isActive:t=!1,variant:n="default",size:r="default",tooltip:a,className:s,...l}){const{isMobile:c,state:f}=na(),d=Lp({defaultTagName:"button",props:bi({className:Le(FK({variant:n,size:r}),s)},l),render:a?wK:e,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:r,active:t}});return a?(typeof a=="string"&&(a={children:a}),E.jsxs(xK,{children:[d,E.jsx(SK,{side:"right",align:"center",hidden:f!=="collapsed"||c,...a})]})):d}function HK({className:e,render:t,showOnHover:n=!1,...r}){return Lp({defaultTagName:"button",props:bi({className:Le("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 aspect-square w-5 rounded-md p-0 peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 focus-visible:ring-2 [&>svg]:size-4 flex items-center justify-center outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 md:after:hidden [&>svg]:shrink-0",n&&"peer-data-active/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 aria-expanded:opacity-100 md:opacity-0",e)},r),render:t,state:{slot:"sidebar-menu-action",sidebar:"menu-action"}})}function UK({className:e,...t}){return E.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:Le("border-sidebar-border mx-3.5 translate-x-px gap-1 border-l px-2.5 py-0.5 group-data-[collapsible=icon]:hidden flex min-w-0 flex-col",e),...t})}function VK({className:e,...t}){return E.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:Le("group/menu-sub-item relative",e),...t})}function qK({render:e,size:t="md",isActive:n=!1,className:r,...a}){return Lp({defaultTagName:"a",props:bi({className:Le("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground h-7 gap-2 rounded-md px-2 focus-visible:ring-2 data-[size=md]:text-sm data-[size=sm]:text-xs [&>svg]:size-4 flex min-w-0 -translate-x-px items-center overflow-hidden outline-hidden group-data-[collapsible=icon]:hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:shrink-0",r)},a),render:e,state:{slot:"sidebar-menu-sub-button",sidebar:"menu-sub-button",size:t,active:n}})}const yN=w.createContext(void 0);function bN(){const e=w.useContext(yN);if(e===void 0)throw new Error(Sn(64));return e}let $K=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const vN={tabActivationDirection:e=>({[$K.activationDirection]:e})},YK=w.forwardRef(function(t,n){const{className:r,defaultValue:a=0,onValueChange:s,orientation:l="horizontal",render:c,value:f,...d}=t,m=Su(),p=Object.hasOwn(t,"defaultValue"),y=w.useRef([]),[g,x]=w.useState(()=>new Map),[C,T]=au({controlled:f,default:a,name:"Tabs",state:"value"}),S=f!==void 0,[R,k]=w.useState(()=>new Map),[M,D]=w.useState("none"),O=Ve((z,H)=>{s==null||s(z,H),!H.isCanceled&&(T(z),D(H.activationDirection))}),N=Ve((z,H)=>{x(K=>{if(K.get(z)===H)return K;const P=new Map(K);return P.set(z,H),P})}),_=Ve((z,H)=>{x(K=>{if(!K.has(z)||K.get(z)!==H)return K;const P=new Map(K);return P.delete(z),P})}),$=w.useCallback(z=>g.get(z),[g]),F=w.useCallback(z=>{for(const H of R.values())if(z===(H==null?void 0:H.value))return H==null?void 0:H.id},[R]),W=w.useCallback(z=>{if(z===void 0)return null;for(const[H,K]of R.entries())if(K!=null&&z===(K.value??K.index))return H;return null},[R]),L=w.useMemo(()=>({direction:m,getTabElementBySelectedValue:W,getTabIdByPanelValue:F,getTabPanelIdByValue:$,onValueChange:O,orientation:l,registerMountedTabPanel:N,setTabMap:k,unregisterMountedTabPanel:_,tabActivationDirection:M,value:C}),[m,W,F,$,O,l,N,k,_,M,C]),V=w.useMemo(()=>{for(const z of R.values())if(z!=null&&z.value===C)return z},[R,C]),q=w.useMemo(()=>{for(const z of R.values())if(z!=null&&!z.disabled)return z.value},[R]);He(()=>{if(S||R.size===0)return;const z=V==null?void 0:V.disabled,H=V==null&&C!==null;if(p&&z&&C===a||!z&&!H)return;const P=q??null;C!==P&&(T(P),D("none"))},[a,q,p,S,V,D,T,R,C]);const j=Ct("div",t,{state:{orientation:l,tabActivationDirection:M},ref:n,props:d,stateAttributesMapping:vN});return E.jsx(yN.Provider,{value:L,children:E.jsx(Vp,{elementsRef:y,children:j})})}),xN="data-composite-item-active";function wN(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=ix(),{ref:a,index:s}=n0(e),l=n===s,c=w.useRef(null),f=Ni(a,c);return{compositeProps:w.useMemo(()=>({tabIndex:l?0:-1,onFocus(){r(s)},onMouseMove(){const m=c.current;if(!t||!m)return;const p=m.hasAttribute("disabled")||m.ariaDisabled==="true";!l&&!p&&m.focus()}}),[l,r,s,t]),compositeRef:f,index:s}}const SN=w.createContext(void 0);function WK(){const e=w.useContext(SN);if(e===void 0)throw new Error(Sn(65));return e}const KK=w.forwardRef(function(t,n){const{className:r,disabled:a=!1,render:s,value:l,id:c,nativeButton:f=!0,...d}=t,{value:m,getTabPanelIdByValue:p,orientation:y}=bN(),{activateOnFocus:g,highlightedTabIndex:x,onTabActivation:C,setHighlightedTabIndex:T,tabsListElement:S}=WK(),R=Pi(c),k=w.useMemo(()=>({disabled:a,id:R,value:l}),[a,R,l]),{compositeProps:M,compositeRef:D,index:O}=wN({metadata:k}),N=l===m,_=w.useRef(!1);He(()=>{if(_.current){_.current=!1;return}if(!(N&&O>-1&&x!==O))return;const K=S;if(K!=null){const P=Xr(Kt(K));if(P&&Et(K,P))return}a||T(O)},[N,O,x,T,a,S]);const{getButtonProps:$,buttonRef:F}=_a({disabled:a,native:f,focusableWhenDisabled:!0}),W=p(l),L=w.useRef(!1),V=w.useRef(!1);function q(K){N||a||C(l,pt(Di,K.nativeEvent,void 0,{activationDirection:"none"}))}function Y(K){N||(O>-1&&!a&&T(O),!a&&g&&(!L.current||L.current&&V.current)&&C(l,pt(Di,K.nativeEvent,void 0,{activationDirection:"none"})))}function j(K){if(N||a)return;L.current=!0;function P(){L.current=!1,V.current=!1}(!K.button||K.button===0)&&(V.current=!0,Kt(K.currentTarget).addEventListener("pointerup",P,{once:!0}))}return Ct("button",t,{state:{disabled:a,active:N,orientation:y},ref:[n,F,D],props:[M,{role:"tab","aria-controls":W,"aria-selected":N,id:R,onClick:q,onFocus:Y,onPointerDown:j,[xN]:N?"":void 0,onKeyDownCapture(){_.current=!0}},d,$]})});function GK(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const XK=[];function QK(e){const{itemSizes:t,cols:n=1,loopFocus:r=!0,dense:a=!1,orientation:s="both",direction:l,highlightedIndex:c,onHighlightedIndexChange:f,rootRef:d,enableHomeAndEndKeys:m=!1,stopEventPropagation:p=!1,disabledIndices:y,modifierKeys:g=XK}=e,[x,C]=w.useState(0),T=n>1,S=w.useRef(null),R=Ni(S,d),k=w.useRef([]),M=w.useRef(!1),D=c??x,O=Ve(($,F=!1)=>{if((f??C)($),F){const W=k.current[$];fR(S.current,W,l,s)}}),N=Ve($=>{if($.size===0||M.current)return;M.current=!0;const F=Array.from($.keys()),W=F.find(V=>V==null?void 0:V.hasAttribute(xN))??null,L=W?F.indexOf(W):-1;L!==-1&&O(L),fR(S.current,W,l,s)}),_=w.useMemo(()=>({"aria-orientation":s==="both"?void 0:s,ref:R,onFocus($){!S.current||!dR($.target)||$.target.setSelectionRange(0,$.target.value.length??0)},onKeyDown($){const F=m?sW:eN;if(!F.has($.key)||ZK($,g)||!S.current)return;const L=l==="rtl",V=L?sd:Vl,q={horizontal:V,vertical:bs,both:V}[s],Y=L?Vl:sd,j={horizontal:Y,vertical:Ul,both:Y}[s];if(dR($.target)&&!GK($.target)){const I=$.target.selectionStart,Q=$.target.selectionEnd,Z=$.target.value??"";if(I==null||$.shiftKey||I!==Q||$.key!==j&&I<Z.length||$.key!==q&&I>0)return}let z=D;const H=Ch(k,y),K=lv(k,y);if(T){const I=t||Array.from({length:k.current.length},()=>({width:1,height:1})),Q=JO(I,n,a),Z=Q.findIndex(ce=>ce!=null&&!Io(k,ce,y)),ie=Q.reduce((ce,ge,Ee)=>ge!=null&&!Io(k,ge,y)?Ee:ce,-1);z=Q[ZO({current:Q.map(ce=>ce?k.current[ce]:null)},{event:$,orientation:s,loopFocus:r,cols:n,disabledIndices:tA([...y||k.current.map((ce,ge)=>Io(k,ge)?ge:void 0),void 0],Q),minIndex:Z,maxIndex:ie,prevIndex:eA(D>K?H:D,I,Q,n,$.key===bs?"bl":$.key===Vl?"tr":"tl"),rtl:L})]}const P={horizontal:[V],vertical:[bs],both:[V,bs]}[s],B={horizontal:[Y],vertical:[Ul],both:[Y,Ul]}[s],G=T?F:{horizontal:m?aW:ZA,vertical:m?oW:JA,both:F}[s];m&&($.key===kd?z=H:$.key===Md&&(z=K)),z===D&&(P.includes($.key)||B.includes($.key))&&(r&&z===K&&P.includes($.key)?z=H:r&&z===H&&B.includes($.key)?z=K:z=ur(k,{startingIndex:z,decrement:B.includes($.key),disabledIndices:y})),z!==D&&!zl(k,z)&&(p&&$.stopPropagation(),G.has($.key)&&$.preventDefault(),O(z,!0),queueMicrotask(()=>{var I;(I=k.current[z])==null||I.focus()}))}}),[n,a,l,y,k,m,D,T,t,r,R,g,O,s,p]);return w.useMemo(()=>({props:_,highlightedIndex:D,onHighlightedIndexChange:O,elementsRef:k,disabledIndices:y,onMapChange:N,relayKeyboardEvent:_.onKeyDown}),[_,D,O,k,y,N])}function ZK(e,t){for(const n of fW.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function JK(e){const{render:t,className:n,refs:r=Lo,props:a=Lo,state:s=On,stateAttributesMapping:l,highlightedIndex:c,onHighlightedIndexChange:f,orientation:d,dense:m,itemSizes:p,loopFocus:y,cols:g,enableHomeAndEndKeys:x,onMapChange:C,stopEventPropagation:T=!0,rootRef:S,disabledIndices:R,modifierKeys:k,highlightItemOnHover:M=!1,tag:D="div",...O}=e,N=Su(),{props:_,highlightedIndex:$,onHighlightedIndexChange:F,elementsRef:W,onMapChange:L,relayKeyboardEvent:V}=QK({itemSizes:p,cols:g,loopFocus:y,dense:m,orientation:d,highlightedIndex:c,onHighlightedIndexChange:f,rootRef:S,stopEventPropagation:T,enableHomeAndEndKeys:x,direction:N,disabledIndices:R,modifierKeys:k}),q=Ct(D,e,{state:s,ref:r,props:[_,...a,O],stateAttributesMapping:l}),Y=w.useMemo(()=>({highlightedIndex:$,onHighlightedIndexChange:F,highlightItemOnHover:M,relayKeyboardEvent:V}),[$,F,M,V]);return E.jsx(tM.Provider,{value:Y,children:E.jsx(Vp,{elementsRef:W,onMapChange:j=>{C==null||C(j),L(j)},children:q})})}const eG=w.forwardRef(function(t,n){const{activateOnFocus:r=!1,className:a,loopFocus:s=!0,render:l,...c}=t,{getTabElementBySelectedValue:f,onValueChange:d,orientation:m,value:p,setTabMap:y,tabActivationDirection:g}=bN(),[x,C]=w.useState(0),[T,S]=w.useState(null),R=tG(p,m,T,f),k=Ve((N,_)=>{if(N!==p){const $=R(N);_.activationDirection=$,d(N,_)}}),M={orientation:m,tabActivationDirection:g},D={"aria-orientation":m==="vertical"?"vertical":void 0,role:"tablist"},O=w.useMemo(()=>({activateOnFocus:r,highlightedTabIndex:x,onTabActivation:k,setHighlightedTabIndex:C,tabsListElement:T,value:p}),[r,x,k,C,T,p]);return E.jsx(SN.Provider,{value:O,children:E.jsx(JK,{render:l,className:a,state:M,refs:[n,S],props:[D,c],stateAttributesMapping:vN,highlightedIndex:x,enableHomeAndEndKeys:!0,loopFocus:s,orientation:m,onHighlightedIndexChange:C,onMapChange:y,disabledIndices:Lo})})});function bR(e,t){const{left:n,top:r}=e.getBoundingClientRect(),{left:a,top:s}=t.getBoundingClientRect(),l=n-a,c=r-s;return{left:l,top:c}}function tG(e,t,n,r){const[a,s]=w.useState(null);return He(()=>{if(e==null||n==null){s(null);return}const l=r(e);if(l==null){s(null);return}const{left:c,top:f}=bR(l,n);s(t==="horizontal"?c:f)},[t,r,n,e]),w.useCallback(l=>{if(l===e)return"none";if(l==null)return s(null),"none";if(l!=null&&n!=null){const c=r(l);if(c!=null){const{left:f,top:d}=bR(c,n);if(a==null)return s(t==="horizontal"?f:d),"none";if(t==="horizontal"){if(f<a)return s(f),"left";if(f>a)return s(f),"right"}else{if(d<a)return s(d),"up";if(d>a)return s(d),"down"}}}return"none"},[r,t,a,n,e])}function nG({className:e,orientation:t="horizontal",...n}){return E.jsx(YK,{"data-slot":"tabs","data-orientation":t,className:Le("gap-2 group/tabs flex data-horizontal:flex-col",e),...n})}const rG=xp("rounded-lg p-[3px] group-data-horizontal/tabs:h-8 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function iG({className:e,variant:t="default",...n}){return E.jsx(eG,{"data-slot":"tabs-list","data-variant":t,className:Le(rG({variant:t}),e),...n})}function ob({className:e,...t}){return E.jsx(KK,{"data-slot":"tabs-trigger",className:Le("gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg:not([class*='size-'])]:size-4 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background dark:data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 data-active:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...t})}function ip({children:e,onClick:t,...n}){const{isMobile:r,setOpenMobile:a}=na(),s=l=>{r&&a(!1),t==null||t(l)};return E.jsx(Qv,{...n,onClick:s,children:e})}function aG({items:e}){const{t}=xn();return E.jsx(gN,{children:E.jsx(jK,{children:e.map(n=>{var r,a;return E.jsxs(Dp,{defaultOpen:n.isActive,render:E.jsx(zK,{}),children:[E.jsx(ip,{to:n.url,children:E.jsxs(BK,{tooltip:t(n.title),children:[E.jsx(n.icon,{}),E.jsx("span",{children:t(n.title)})]})}),(r=n.items)!=null&&r.length?E.jsxs(E.Fragment,{children:[E.jsxs(Ip,{render:E.jsx(HK,{className:"data-[state=open]:rotate-90"}),children:[E.jsx(hp,{}),E.jsx("span",{className:"sr-only",children:"Toggle"})]}),E.jsx(Pp,{children:E.jsx(UK,{children:(a=n.items)==null?void 0:a.map(s=>E.jsx(VK,{children:E.jsx(ip,{to:s.url,children:E.jsx(qK,{children:E.jsx("span",{children:t(s.title)})})})},s.title))})})]}):null]},n.title)})})})}const oG={auth_failed:"authFailed",agent_unavailable:"agentUnavailable",agent_no_identity:"agentNoIdentity",ssh_config_ref_not_supported:"configRefNotSupported",network_unreachable:"networkUnreachable",connection_refused:"connectionRefused",timeout:"timeout",host_not_found:"hostNotFound",handshake_failed:"handshakeFailed",tmux_unavailable:"tmuxUnavailable",connection_closed:"connectionClosed"};function sG({deviceId:e,className:t}){const{t:n}=xn(),r=Qn(s=>s.deviceReconnecting[e]),a=Qn(s=>s.deviceErrors[e]);if(r)return E.jsxs(Fs,{variant:"outline",title:r.message,className:Le("h-5 gap-1 border-amber-400/40 bg-amber-500/10 px-1.5 text-[10px] font-normal text-amber-700 dark:text-amber-300",t),children:[E.jsx(w5,{className:"h-3 w-3 animate-spin"}),E.jsx("span",{className:"truncate max-w-[120px]",children:r.message})]});if(a){const s=oG[a.type]??"unknown",l=n(`deviceStatus.errorBadge.${s}`),c=[l,a.message,a.rawMessage].filter(Boolean).join(`
385
+ `);return E.jsxs(Fs,{variant:"outline",title:c,className:Le("h-5 gap-1 border-red-400/40 bg-red-500/10 px-1.5 text-[10px] font-normal text-red-700 dark:text-red-300",t),children:[E.jsx(Fc,{className:"h-3 w-3"}),E.jsx("span",{className:"truncate max-w-[120px]",children:l})]})}return null}function lG(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:a,onOpenChangeComplete:s,actionsRef:l,handle:c,triggerId:f,defaultTriggerId:d=null}=e,m=qo(),p=!!m,y=Jn(()=>(c==null?void 0:c.store)??new uN({open:r,openProp:n,activeTriggerId:d,triggerIdProp:f,modal:!0,disablePointerDismissal:!0,nested:p,role:"alertdialog"})).current;y.useControlledProp("openProp",n),y.useControlledProp("triggerIdProp",f),y.useSyncedValue("nested",p),y.useContextCallback("onOpenChange",a),y.useContextCallback("onOpenChangeComplete",s);const g=y.useState("payload");lN({store:y,actionsRef:l,parentContext:m==null?void 0:m.store.context});const x=w.useMemo(()=>({store:y}),[y]);return E.jsx(i0.Provider,{value:x,children:typeof t=="function"?t({payload:g}):t})}function mv({...e}){return E.jsx(lG,{"data-slot":"alert-dialog",...e})}function uG({...e}){return E.jsx(l0,{"data-slot":"alert-dialog-portal",...e})}function cG({className:e,...t}){return E.jsx(a0,{"data-slot":"alert-dialog-overlay",className:Le("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",e),...t})}function gv({className:e,size:t="default",...n}){return E.jsxs(uG,{children:[E.jsx(cG,{}),E.jsx(s0,{"data-slot":"alert-dialog-content","data-size":t,className:Le("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-background ring-foreground/10 gap-4 rounded-xl p-4 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none",e),...n})]})}function yv({className:e,...t}){return E.jsx("div",{"data-slot":"alert-dialog-header",className:Le("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...t})}function bv({className:e,...t}){return E.jsx("div",{"data-slot":"alert-dialog-footer",className:Le("bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function vR({className:e,...t}){return E.jsx("div",{"data-slot":"alert-dialog-media",className:Le("bg-muted mb-2 inline-flex size-10 items-center justify-center rounded-md sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6",e),...t})}function vv({className:e,...t}){return E.jsx(u0,{"data-slot":"alert-dialog-title",className:Le("text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function xv({className:e,...t}){return E.jsx(o0,{"data-slot":"alert-dialog-description",className:Le("text-muted-foreground *:[a]:hover:text-foreground text-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3",e),...t})}function wv({className:e,...t}){return E.jsx(_t,{"data-slot":"alert-dialog-action",className:Le(e),...t})}function Sv({className:e,variant:t="outline",size:n="default",...r}){return E.jsx(qp,{"data-slot":"alert-dialog-cancel",className:Le(e),render:E.jsx(_t,{variant:t,size:n}),...r})}function Ev({...e}){return E.jsx(cN,{"data-slot":"dialog",...e})}function dG({...e}){return E.jsx(l0,{"data-slot":"dialog-portal",...e})}function fG({className:e,...t}){return E.jsx(a0,{"data-slot":"dialog-overlay",className:Le("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",e),...t})}function Tv({className:e,children:t,showCloseButton:n=!0,...r}){return E.jsxs(dG,{children:[E.jsx(fG,{}),E.jsxs(s0,{"data-slot":"dialog-content",className:Le("bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-sm ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none",e),...r,children:[t,n&&E.jsxs(qp,{"data-slot":"dialog-close",render:E.jsx(_t,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[E.jsx(Pa,{}),E.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Cv({className:e,...t}){return E.jsx("div",{"data-slot":"dialog-header",className:Le("gap-2 flex flex-col",e),...t})}function xR({className:e,showCloseButton:t=!1,children:n,...r}){return E.jsxs("div",{"data-slot":"dialog-footer",className:Le("bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[n,t&&E.jsx(qp,{render:E.jsx(_t,{variant:"outline"}),children:"Close"})]})}function Rv({className:e,...t}){return E.jsx(u0,{"data-slot":"dialog-title",className:Le("text-base leading-none font-medium",e),...t})}function EN({className:e,...t}){return E.jsx(o0,{"data-slot":"dialog-description",className:Le("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",e),...t})}const TN=w.createContext(void 0);function CN(e){const t=w.useContext(TN);if(t===void 0&&!e)throw new Error(Sn(33));return t}const RN=w.createContext(void 0);function $s(e){const t=w.useContext(RN);if(t===void 0&&!e)throw new Error(Sn(36));return t}const hG=w.createContext(void 0);function $p(e=!0){const t=w.useContext(hG);if(t===void 0&&!e)throw new Error(Sn(25));return t}function pG(e){const{closeOnClick:t,highlighted:n,id:r,nodeId:a,store:s,itemRef:l,itemMetadata:c}=e,{events:f}=s.useState("floatingTreeRoot"),d=$p(!0),m=d!==void 0;return w.useMemo(()=>({id:r,role:"menuitem",tabIndex:n?0:-1,onMouseMove(p){a&&f.emit("itemhover",{nodeId:a,target:p.currentTarget})},onClick(p){t&&f.emit("close",{domEvent:p,reason:Hc})},onMouseUp(p){if(d){const y=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,m&&y&&Math.abs(p.clientX-y.x)<=1&&Math.abs(p.clientY-y.y)<=1)return}l.current&&s.context.allowMouseUpTriggerRef.current&&(!m||p.button===2)&&(!c||c.type==="regular-item")&&l.current.click()}}),[t,n,r,f,a,s,l,d,m,c])}const mG={type:"regular-item"};function gG(e){const{closeOnClick:t,disabled:n=!1,highlighted:r,id:a,store:s,nativeButton:l,itemMetadata:c,nodeId:f}=e,d=w.useRef(null),{getButtonProps:m,buttonRef:p}=_a({disabled:n,focusableWhenDisabled:!0,native:l}),y=pG({closeOnClick:t,highlighted:r,id:a,nodeId:f,store:s,itemRef:d,itemMetadata:c}),g=w.useCallback(C=>bi(y,{onMouseEnter(){c.type==="submenu-trigger"&&c.setActive()},onKeyUp(T){T.key===" "&&s.context.typingRef.current&&T.preventBaseUIHandler()}},C,m),[y,m,s,c]),x=Ni(d,p);return w.useMemo(()=>({getItemProps:g,itemRef:x}),[g,x])}const yG=w.forwardRef(function(t,n){const{render:r,className:a,id:s,label:l,nativeButton:c=!1,disabled:f=!1,closeOnClick:d=!0,...m}=t,p=n0({label:l}),y=CN(!0),g=Pi(s),{store:x}=$s(),C=x.useState("isActive",p.index),T=x.useState("itemProps"),{getItemProps:S,itemRef:R}=gG({closeOnClick:d,disabled:f,highlighted:C,id:g,store:x,nativeButton:c,nodeId:y==null?void 0:y.nodeId,itemMetadata:mG});return Ct("div",t,{state:{disabled:f,highlighted:C},props:[T,m,S],ref:[R,n,p.ref]})}),bG={...Ba,...Ho},vG=w.forwardRef(function(t,n){const{render:r,className:a,finalFocus:s,...l}=t,{store:c}=$s(),{side:f,align:d}=CN(),m=QA()!=null,p=c.useState("open"),y=c.useState("transitionStatus"),g=c.useState("popupProps"),x=c.useState("mounted"),C=c.useState("instantType"),T=c.useState("activeTriggerElement"),S=c.useState("parent"),R=c.useState("lastOpenChangeReason"),k=c.useState("rootId"),M=c.useState("floatingRootContext"),D=c.useState("floatingTreeRoot"),O=c.useState("closeDelay"),N=c.useState("activeTriggerElement"),_=S.type==="context-menu";za({open:p,ref:c.context.popupRef,onComplete(){var q,Y;p&&((Y=(q=c.context).onOpenChangeComplete)==null||Y.call(q,!0))}}),w.useEffect(()=>{function q(Y){c.setOpen(!1,pt(Y.reason,Y.domEvent))}return D.events.on("close",q),()=>{D.events.off("close",q)}},[D.events,c]);const $=c.useState("hoverEnabled"),F=c.useState("disabled");IA(M,{enabled:$&&!F&&!_&&S.type!=="menubar",closeDelay:O});const W={transitionStatus:y,side:f,align:d,open:p,nested:S.type==="menu",instant:C},L=Ct("div",t,{state:W,ref:[n,c.context.popupRef],stateAttributesMapping:bG,props:[g,{onKeyDown(q){m&&t0.has(q.key)&&q.stopPropagation()}},Eu(y),l,{"data-rootownerid":k}]});let V=S.type===void 0||_;return(T||S.type==="menubar"&&R!==Tp)&&(V=!0),E.jsx(Bx,{context:M,modal:_,disabled:!x,returnFocus:s===void 0?V:s,initialFocus:S.type!=="menu",restoreFocus:!0,externalTree:S.type!=="menubar"?D:void 0,previousFocusableElement:N,nextFocusableElement:S.type===void 0?c.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:S.type===void 0?c.context.beforeContentFocusGuardRef:void 0,children:L})}),kN=w.createContext(void 0);function xG(){const e=w.useContext(kN);if(e===void 0)throw new Error(Sn(32));return e}const wG=w.forwardRef(function(t,n){const{keepMounted:r=!1,...a}=t,{store:s}=$s();return s.useState("mounted")||r?E.jsx(kN.Provider,{value:r,children:E.jsx(zx,{ref:n,...a})}):null}),SG=w.forwardRef(function(t,n){var Ie;const{anchor:r,positionMethod:a="absolute",className:s,render:l,side:c,align:f,sideOffset:d=0,alignOffset:m=0,collisionBoundary:p="clipping-ancestors",collisionPadding:y=5,arrowPadding:g=5,sticky:x=!1,disableAnchorTracking:C=!1,collisionAvoidance:T=iM,...S}=t,{store:R}=$s(),k=xG(),M=$p(!0),D=R.useState("parent"),O=R.useState("floatingRootContext"),N=R.useState("floatingTreeRoot"),_=R.useState("mounted"),$=R.useState("open"),F=R.useState("modal"),W=R.useState("activeTriggerElement"),L=R.useState("transitionStatus"),V=R.useState("lastOpenChangeReason"),q=R.useState("floatingNodeId"),Y=R.useState("floatingParentNodeId");let j=r,z=d,H=m,K=f,P=T;D.type==="context-menu"&&(j=r??((Ie=D.context)==null?void 0:Ie.anchor),K=K??"start",!c&&K!=="center"&&(H=t.alignOffset??2,z=t.sideOffset??-5));let B=c,G=K;D.type==="menu"?(B=B??"inline-end",G=G??"start",P=t.collisionAvoidance??aM):D.type==="menubar"&&(B=B??"bottom",G=G??"start");const I=D.type==="context-menu",Q=Zx({anchor:j,floatingRootContext:O,positionMethod:M?"fixed":a,mounted:_,side:B,sideOffset:z,align:G,alignOffset:H,arrowPadding:I?0:g,collisionBoundary:p,collisionPadding:y,sticky:x,nodeId:q,keepMounted:k,disableAnchorTracking:C,collisionAvoidance:P,shiftCrossAxis:I&&!("side"in P&&P.side==="flip"),externalTree:N}),Z=w.useMemo(()=>{const re={};return $||(re.pointerEvents="none"),{role:"presentation",hidden:!_,style:{...Q.positionerStyles,...re}}},[$,_,Q.positionerStyles]);w.useEffect(()=>{function re(he){he.open&&(he.parentNodeId===q&&R.set("hoverEnabled",!1),he.nodeId!==q&&he.parentNodeId===R.select("floatingParentNodeId")&&R.setOpen(!1,pt(Eh)))}return N.events.on("menuopenchange",re),()=>{N.events.off("menuopenchange",re)}},[R,N.events,q]),w.useEffect(()=>{if(R.select("floatingParentNodeId")==null)return;function re(he){if(he.open||he.nodeId!==R.select("floatingParentNodeId"))return;const be=he.reason??Eh;R.setOpen(!1,pt(be))}return N.events.on("menuopenchange",re),()=>{N.events.off("menuopenchange",re)}},[N.events,R]),w.useEffect(()=>{function re(he){!$||he.nodeId!==R.select("floatingParentNodeId")||he.target&&W&&W!==he.target&&R.setOpen(!1,pt(Eh))}return N.events.on("itemhover",re),()=>{N.events.off("itemhover",re)}},[N.events,$,W,R]),w.useEffect(()=>{const re={open:$,nodeId:q,parentNodeId:Y,reason:R.select("lastOpenChangeReason")};N.events.emit("menuopenchange",re)},[N.events,$,R,q,Y]);const ie={open:$,side:Q.side,align:Q.align,anchorHidden:Q.anchorHidden,nested:D.type==="menu"},ce=w.useMemo(()=>({side:Q.side,align:Q.align,arrowRef:Q.arrowRef,arrowUncentered:Q.arrowUncentered,arrowStyles:Q.arrowStyles,nodeId:Q.context.nodeId}),[Q.side,Q.align,Q.arrowRef,Q.arrowUncentered,Q.arrowStyles,Q.context.nodeId]),ge=Ct("div",t,{state:ie,stateAttributesMapping:Ba,ref:[n,R.useStateSetter("positionerElement")],props:[Z,Eu(L),S]}),Ee=_&&D.type!=="menu"&&(D.type!=="menubar"&&F&&V!==wr||D.type==="menubar"&&D.context.modal);let _e=null;return D.type==="menubar"?_e=D.context.contentElement:D.type===void 0&&(_e=W),E.jsxs(TN.Provider,{value:ce,children:[Ee&&E.jsx(e0,{ref:D.type==="context-menu"||D.type==="nested-context-menu"?D.context.internalBackdropRef:null,inert:Xx(!$),cutout:_e}),E.jsx(r$,{id:q,children:E.jsx(Vp,{elementsRef:R.context.itemDomElements,labelsRef:R.context.itemLabels,children:ge})})]})}),EG=w.createContext(null);function MN(e){return w.useContext(EG)}const TG={...Yx,disabled:Ye(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:Ye(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:Ye(e=>e.allowMouseEnter),stickIfOpen:Ye(e=>e.stickIfOpen),parent:Ye(e=>e.parent),rootId:Ye(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:Ye(e=>e.activeIndex),isActive:Ye((e,t)=>e.activeIndex===t),hoverEnabled:Ye(e=>e.hoverEnabled),instantType:Ye(e=>e.instantType),lastOpenChangeReason:Ye(e=>e.openChangeReason),floatingTreeRoot:Ye(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:Ye(e=>e.floatingNodeId),floatingParentNodeId:Ye(e=>e.floatingParentNodeId),itemProps:Ye(e=>e.itemProps),closeDelay:Ye(e=>e.closeDelay),keyboardEventRelay:Ye(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class d0 extends jp{constructor(n){super({...CG(),...n},{positionerRef:w.createRef(),popupRef:w.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:w.createRef(),beforeContentFocusGuardRef:w.createRef(),onOpenChangeComplete:void 0,triggerElements:new Cd},TG);tt(this,"unsubscribeParentListener",null);this.unsubscribeParentListener=this.observe("parent",r=>{var a;if((a=this.unsubscribeParentListener)==null||a.call(this),r.type==="menu"){this.unsubscribeParentListener=r.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=r.store.context.allowMouseUpTriggerRef;return}r.type!==void 0&&(this.context.allowMouseUpTriggerRef=r.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(n,r){this.state.floatingRootContext.context.events.emit("setOpen",{open:n,eventDetails:r})}static useStore(n,r){const a=Jn(()=>new d0(r)).current;return n??a}}function CG(){return{...$x(),disabled:!1,modal:!0,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new jx,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:On,keyboardEventRelay:void 0,closeDelay:0}}const RG=w.createContext(void 0);function kG(){return w.useContext(RG)}const MG=Nx(function(t){const{children:n,open:r,onOpenChange:a,onOpenChangeComplete:s,defaultOpen:l=!1,disabled:c=!1,modal:f,loopFocus:d=!0,orientation:m="vertical",actionsRef:p,closeParentOnEsc:y=!1,handle:g,triggerId:x,defaultTriggerId:C=null,highlightItemOnHover:T=!0}=t,S=$p(!0),R=$s(!0),k=MN(!0),M=kG(),D=w.useMemo(()=>M&&R?{type:"menu",store:R.store}:k?{type:"menubar",context:k}:S&&!R?{type:"context-menu",context:S}:{type:void 0},[S,R,k,M]),O=d0.useStore(g==null?void 0:g.store,{open:l,openProp:r,activeTriggerId:C,triggerIdProp:x,parent:D});_p(()=>{r===void 0&&O.state.open===!1&&l===!0&&O.update({open:!0,activeTriggerId:C})}),O.useControlledProp("openProp",r),O.useControlledProp("triggerIdProp",x),O.useContextCallback("onOpenChangeComplete",s);const N=O.useState("floatingTreeRoot"),_=mA(N),$=Fa();He(()=>{S&&!R?O.update({parent:{type:"context-menu",context:S},floatingNodeId:_,floatingParentNodeId:$}):R&&O.update({floatingNodeId:_,floatingParentNodeId:$})},[S,R,_,$,O]);const F=O.useState("open"),W=O.useState("activeTriggerElement"),L=O.useState("positionerElement"),V=O.useState("hoverEnabled"),q=O.useState("modal"),Y=O.useState("disabled"),j=O.useState("lastOpenChangeReason"),z=O.useState("parent"),H=O.useState("activeIndex"),K=O.useState("payload"),P=O.useState("floatingParentNodeId"),B=w.useRef(null),G=P!=null;let I;O.useSyncedValues({disabled:c,modal:z.type===void 0?f:void 0,rootId:Vs()});const{openMethod:Q,triggerProps:Z,reset:ie}=Gx(F);Vx(O);const{forceUnmount:ce}=qx(F,O,()=>{O.update({allowMouseEnter:!1,stickIfOpen:!0}),ie()}),ge=w.useRef(z.type!=="context-menu"),Ee=_n();w.useEffect(()=>{if(F||(B.current=null),z.type==="context-menu"){if(!F){Ee.clear(),ge.current=!1;return}Ee.start(500,()=>{ge.current=!0})}},[Ee,F,z.type]),Qx(F&&q&&j!==wr&&Q!=="touch",L),He(()=>{!F&&!V&&O.set("hoverEnabled",!0)},[F,V,O]);const _e=w.useRef(!0),Ie=_n(),re=Ve((We,ot)=>{var Ft;const st=ot.reason;if(F===We&&ot.trigger===W&&j===st||(ot.preventUnmountOnClose=()=>{O.set("preventUnmountingOnClose",!0)},!We&&ot.trigger==null&&(ot.trigger=W??void 0),a==null||a(We,ot),ot.isCanceled))return;const jt={open:We,nativeEvent:ot.event,reason:ot.reason,nested:G};I==null||I.emit("openchange",jt);const zt=ot.event;if(We===!1&&(zt==null?void 0:zt.type)==="click"&&zt.pointerType==="touch"&&!_e.current)return;if(!We&&H!==null){const Xe=O.context.itemDomElements.current[H];queueMicrotask(()=>{Xe==null||Xe.setAttribute("tabindex","-1")})}We&&st===_l?(_e.current=!1,Ie.start(300,()=>{_e.current=!0})):(_e.current=!0,Ie.clear());const gt=(st===Ls||st===Hc)&&zt.detail===0&&(zt==null?void 0:zt.isTrusted),Rt=!We&&(st===Cp||st==null),Je={open:We,openChangeReason:st};B.current=ot.event??null;const kt=((Ft=ot.trigger)==null?void 0:Ft.id)??null;(kt||We)&&(Je.activeTriggerId=kt,Je.activeTriggerElement=ot.trigger??null),O.update(Je),z.type==="menubar"&&(st===_l||st===_s||st===wr||st===Sh||st===Eh)?O.set("instantType","group"):gt||Rt?O.set("instantType",gt?"click":"dismiss"):O.set("instantType",void 0)}),he=w.useCallback(We=>{const ot=pt(We);return ot.preventUnmountOnClose=()=>{O.set("preventUnmountingOnClose",!0)},ot},[O]),be=w.useCallback(()=>{O.setOpen(!1,he(cx))},[O,he]);w.useImperativeHandle(p,()=>({unmount:ce,close:be}),[ce,be]);let Pe;z.type==="context-menu"&&(Pe=z.context),w.useImperativeHandle(Pe==null?void 0:Pe.positionerRef,()=>L,[L]),w.useImperativeHandle(Pe==null?void 0:Pe.actionsRef,()=>({setOpen:re}),[re]);const Ae=Wx({popupStore:O,onOpenChange:re});I=Ae.context.events,w.useEffect(()=>{const We=({open:ot,eventDetails:st})=>re(ot,st);return I.on("setOpen",We),()=>{I==null||I.off("setOpen",We)}},[I,re]);const Se=Hp(Ae,{enabled:!Y,bubbles:{escapeKey:y&&z.type==="menu"},outsidePress(){var We;return z.type!=="context-menu"||((We=B.current)==null?void 0:We.type)==="contextmenu"?!0:ge.current},externalTree:G?N:void 0}),Ce=_A(Ae,{role:"menu"}),J=Su(),Re=w.useCallback(We=>{O.select("activeIndex")!==We&&O.set("activeIndex",We)},[O]),xe=LA(Ae,{enabled:!Y,listRef:O.context.itemDomElements,activeIndex:H,nested:z.type!==void 0,loopFocus:d,orientation:m,parentOrientation:z.type==="menubar"?z.context.orientation:void 0,rtl:J==="rtl",disabledIndices:Lo,onNavigate:Re,openOnArrowKeyDown:z.type!=="context-menu",externalTree:G?N:void 0,focusItemOnHover:T}),Be=w.useCallback(We=>{O.context.typingRef.current=We},[O]),$e=jA(Ae,{listRef:O.context.itemLabels,activeIndex:H,resetMs:pF,onMatch:We=>{F&&We!==H&&O.set("activeIndex",We)},onTypingChange:Be}),{getReferenceProps:te,getFloatingProps:De,getItemProps:se,getTriggerProps:ye}=Rd([Se,Ce,xe,$e]),we=w.useMemo(()=>{const We=bi(te(),{onMouseMove(){O.set("allowMouseEnter",!0)}},Z);return delete We.role,We},[te,O,Z]),Me=w.useMemo(()=>{const We=ye();if(!We)return We;const ot=bi(We,Z);return delete ot.role,delete ot["aria-controls"],ot},[ye,Z]),Fe=w.useMemo(()=>De({onMouseMove(){O.set("allowMouseEnter",!0),z.type==="menu"&&O.set("hoverEnabled",!1)},onClick(){O.select("hoverEnabled")&&O.set("hoverEnabled",!1)},onKeyDown(We){const ot=O.select("keyboardEventRelay");ot&&!We.isPropagationStopped()&&ot(We)}}),[De,z.type,O]),ct=w.useMemo(()=>se(),[se]);O.useSyncedValues({floatingRootContext:Ae,activeTriggerProps:we,inactiveTriggerProps:Me,popupProps:Fe,itemProps:ct});const bt=w.useMemo(()=>({store:O,parent:D}),[O,D]),Ot=E.jsx(RN.Provider,{value:bt,children:typeof n=="function"?n({payload:K}):n});return z.type===void 0||z.type==="context-menu"?E.jsx(i$,{externalTree:N,children:Ot}):Ot});function OG(e){const{render:t,className:n,state:r=On,props:a=Lo,refs:s=Lo,metadata:l,stateAttributesMapping:c,tag:f="div",...d}=e,{compositeProps:m,compositeRef:p}=wN({metadata:l});return Ct(f,e,{state:r,ref:[...s,p],props:[m,...a,d],stateAttributesMapping:c})}function ON(e){if(Cn(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!Wi(e))return ON(Xi(e))}function AG(e){const{enabled:t=!0,mouseDownAction:n,open:r}=e,a=w.useRef(!1);return w.useMemo(()=>t?{onMouseDown:s=>{(n==="open"&&!r||n==="close"&&r)&&(a.current=!0,Kt(s.currentTarget).addEventListener("click",()=>{a.current=!1},{once:!0}))},onClick:s=>{a.current&&(a.current=!1,s.preventBaseUIHandler())}}:On,[t,n,r])}const ph=2,NG=zO(function(t,n){const{render:r,className:a,disabled:s=!1,nativeButton:l=!0,id:c,openOnHover:f,delay:d=100,closeDelay:m=0,handle:p,payload:y,...g}=t,x=$s(!0),C=(p==null?void 0:p.store)??(x==null?void 0:x.store);if(!C)throw new Error(Sn(85));const T=Pi(c),S=C.useState("isTriggerActive",T),R=C.useState("floatingRootContext"),k=C.useState("isOpenedByTrigger",T),M=w.useRef(null),D=IG(),O=ix(!0),N=Vo(),_=w.useMemo(()=>N??new jx,[N]),$=mA(_),F=Fa(),{registerTrigger:W,isMountedByThisTrigger:L}=OA(T,M,C,{payload:y,closeDelay:m,parent:D,floatingTreeRoot:_,floatingNodeId:$,floatingParentNodeId:F,keyboardEventRelay:O==null?void 0:O.relayKeyboardEvent}),V=D.type==="menubar",q=C.useState("disabled"),Y=s||q||V&&D.context.disabled,{getButtonProps:j,buttonRef:z}=_a({disabled:Y,native:l});w.useEffect(()=>{!k&&D.type===void 0&&(C.context.allowMouseUpTriggerRef.current=!1)},[C,k,D.type]);const H=w.useRef(null),K=_n(),P=Ve(Se=>{if(!H.current)return;K.clear(),C.context.allowMouseUpTriggerRef.current=!1;const Ce=Se.target;if(Et(H.current,Ce)||Et(C.select("positionerElement"),Ce)||Ce===H.current||Ce!=null&&ON(Ce)===C.select("rootId"))return;const J=$A(H.current);Se.clientX>=J.left-ph&&Se.clientX<=J.right+ph&&Se.clientY>=J.top-ph&&Se.clientY<=J.bottom+ph||_.events.emit("close",{domEvent:Se,reason:TM})});w.useEffect(()=>{k&&C.select("lastOpenChangeReason")===wr&&Kt(H.current).addEventListener("mouseup",P,{once:!0})},[k,P,C]);const B=V&&D.context.hasSubmenuOpen,I=PA(R,{enabled:(f??B)&&!Y&&D.type!=="context-menu"&&(!V||B&&!L),handleClose:zA({blockPointerEvents:!V}),mouseOnly:!0,move:!1,restMs:D.type===void 0?d:void 0,delay:{close:m},triggerElementRef:M,externalTree:_,isActiveTrigger:S}),Q=DG(k,C.select("lastOpenChangeReason")),Z=xA(R,{enabled:!Y&&D.type!=="context-menu",event:k&&V?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:D.type===void 0?Q:!1}),ie=NA(R,{enabled:!Y&&B}),ce=AG({open:k,enabled:V,mouseDownAction:"open"}),ge=Rd([Z,ie]),Ee={disabled:Y,open:k},_e=C.useState("triggerProps",L),Ie=[H,n,z,W,M],re=[ge.getReferenceProps(),I??On,_e,{"aria-haspopup":"menu",id:T,onMouseDown:Se=>{if(C.select("open"))return;K.start(200,()=>{C.context.allowMouseUpTriggerRef.current=!0}),Kt(Se.currentTarget).addEventListener("mouseup",P,{once:!0})}},V?{role:"menuitem"}:{},ce,g,j],he=w.useRef(null),be=Ve(Se=>{yi.flushSync(()=>{C.setOpen(!1,pt(_s,Se.nativeEvent,Se.currentTarget))});const Ce=t$(he.current);Ce==null||Ce.focus()}),Pe=Ve(Se=>{var J;const Ce=C.select("positionerElement");if(Ce&&Fl(Se,Ce))(J=C.context.beforeContentFocusGuardRef.current)==null||J.focus();else{yi.flushSync(()=>{C.setOpen(!1,pt(_s,Se.nativeEvent,Se.currentTarget))});let Re=e$(C.context.triggerFocusTargetRef.current||M.current);for(;Re!==null&&Et(Ce,Re);){const xe=Re;if(Re=_x(Re),Re===xe)break}Re==null||Re.focus()}}),Ae=Ct("button",t,{enabled:!V,stateAttributesMapping:hv,state:Ee,ref:Ie,props:re});return V?E.jsx(OG,{tag:"button",render:r,className:a,state:Ee,refs:Ie,props:re,stateAttributesMapping:hv}):k?E.jsxs(w.Fragment,{children:[E.jsx(du,{ref:he,onFocus:be},`${T}-pre-focus-guard`),E.jsx(w.Fragment,{children:Ae},T),E.jsx(du,{ref:C.context.triggerFocusTargetRef,onFocus:Pe},`${T}-post-focus-guard`)]}):E.jsx(w.Fragment,{children:Ae},T)});function DG(e,t){const n=_n(),[r,a]=w.useState(!1);return He(()=>{e&&t==="trigger-hover"?(a(!0),n.start(mF,()=>{a(!1)})):e||(n.clear(),a(!1))},[e,t,n]),r}function IG(){const e=$p(!0),t=$s(!0),n=MN();return w.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}function kv({...e}){return E.jsx(MG,{"data-slot":"dropdown-menu",...e})}function Mv({...e}){return E.jsx(NG,{"data-slot":"dropdown-menu-trigger",...e})}function Ov({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:r=4,className:a,...s}){return E.jsx(wG,{children:E.jsx(SG,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:r,children:E.jsx(vG,{"data-slot":"dropdown-menu-content",className:Le("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden",a),...s})})})}function Gc({className:e,inset:t,variant:n="default",...r}){return E.jsx(yG,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Le("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md px-1.5 py-1 text-sm data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...r})}function _X({className:e,...t}){return E.jsx(oN,{"data-slot":"dropdown-menu-separator",className:Le("bg-border -mx-1 my-1 h-px",e),...t})}const AN=w.createContext(void 0);function Yp(){const e=w.useContext(AN);if(e===void 0)throw new Error(Sn(53));return e}let ap=(function(e){return e.scrollAreaCornerHeight="--scroll-area-corner-height",e.scrollAreaCornerWidth="--scroll-area-corner-width",e})({});const mh=500,wR=16;function mi(e,t,n){if(!e)return 0;const r=getComputedStyle(e),a=n==="x"?"Inline":"Block";return n==="x"&&t==="margin"?parseFloat(r[`${t}InlineStart`])*2:parseFloat(r[`${t}${a}Start`])+parseFloat(r[`${t}${a}End`])}let PG=(function(e){return e.orientation="data-orientation",e.hovering="data-hovering",e.scrolling="data-scrolling",e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e})({}),Ol=(function(e){return e.scrolling="data-scrolling",e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e})({});const f0={hasOverflowX:e=>e?{[Ol.hasOverflowX]:""}:null,hasOverflowY:e=>e?{[Ol.hasOverflowY]:""}:null,overflowXStart:e=>e?{[Ol.overflowXStart]:""}:null,overflowXEnd:e=>e?{[Ol.overflowXEnd]:""}:null,overflowYStart:e=>e?{[Ol.overflowYStart]:""}:null,overflowYEnd:e=>e?{[Ol.overflowYEnd]:""}:null,cornerHidden:()=>null},LG={x:0,y:0},SR={width:0,height:0},_G={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},jG={x:!1,y:!1,corner:!1},zG=w.forwardRef(function(t,n){const{render:r,className:a,overflowEdgeThreshold:s,...l}=t,c=FG(s),f=Pi(),d=_n(),m=_n(),{nonce:p,disableStyleElements:y}=tN(),[g,x]=w.useState(!1),[C,T]=w.useState(!1),[S,R]=w.useState(!1),[k,M]=w.useState(!1),[D,O]=w.useState(SR),[N,_]=w.useState(SR),[$,F]=w.useState(_G),[W,L]=w.useState(jG),V=w.useRef(null),q=w.useRef(null),Y=w.useRef(null),j=w.useRef(null),z=w.useRef(null),H=w.useRef(null),K=w.useRef(null),P=w.useRef(!1),B=w.useRef(0),G=w.useRef(0),I=w.useRef(0),Q=w.useRef(0),Z=w.useRef("vertical"),ie=w.useRef(LG),ce=Ve(Se=>{const Ce=Se.x-ie.current.x,J=Se.y-ie.current.y;ie.current=Se,J!==0&&(R(!0),d.start(mh,()=>{R(!1)})),Ce!==0&&(T(!0),m.start(mh,()=>{T(!1)}))}),ge=Ve(Se=>{Se.button===0&&(P.current=!0,B.current=Se.clientY,G.current=Se.clientX,Z.current=Se.currentTarget.getAttribute(PG.orientation),q.current&&(I.current=q.current.scrollTop,Q.current=q.current.scrollLeft),z.current&&Z.current==="vertical"&&z.current.setPointerCapture(Se.pointerId),H.current&&Z.current==="horizontal"&&H.current.setPointerCapture(Se.pointerId))}),Ee=Ve(Se=>{if(!P.current)return;const Ce=Se.clientY-B.current,J=Se.clientX-G.current;if(q.current){const Re=q.current.scrollHeight,xe=q.current.clientHeight,Be=q.current.scrollWidth,$e=q.current.clientWidth;if(z.current&&Y.current&&Z.current==="vertical"){const te=mi(Y.current,"padding","y"),De=mi(z.current,"margin","y"),se=z.current.offsetHeight,ye=Y.current.offsetHeight-se-te-De,we=Ce/ye;q.current.scrollTop=I.current+we*(Re-xe),Se.preventDefault(),R(!0),d.start(mh,()=>{R(!1)})}if(H.current&&j.current&&Z.current==="horizontal"){const te=mi(j.current,"padding","x"),De=mi(H.current,"margin","x"),se=H.current.offsetWidth,ye=j.current.offsetWidth-se-te-De,we=J/ye;q.current.scrollLeft=Q.current+we*(Be-$e),Se.preventDefault(),T(!0),m.start(mh,()=>{T(!1)})}}}),_e=Ve(Se=>{P.current=!1,z.current&&Z.current==="vertical"&&z.current.releasePointerCapture(Se.pointerId),H.current&&Z.current==="horizontal"&&H.current.releasePointerCapture(Se.pointerId)});function Ie(Se){M(Se.pointerType==="touch")}function re(Se){if(Ie(Se),Se.pointerType!=="touch"){const Ce=Et(V.current,Se.target);x(Ce)}}const he=w.useMemo(()=>({scrolling:C||S,hasOverflowX:!W.x,hasOverflowY:!W.y,overflowXStart:$.xStart,overflowXEnd:$.xEnd,overflowYStart:$.yStart,overflowYEnd:$.yEnd,cornerHidden:W.corner}),[C,S,W.x,W.y,W.corner,$]),be={role:"presentation",onPointerEnter:re,onPointerMove:re,onPointerDown:Ie,onPointerLeave(){x(!1)},style:{position:"relative",[ap.scrollAreaCornerHeight]:`${D.height}px`,[ap.scrollAreaCornerWidth]:`${D.width}px`}},Pe=Ct("div",t,{state:he,ref:[n,V],props:[be,l],stateAttributesMapping:f0}),Ae=w.useMemo(()=>({handlePointerDown:ge,handlePointerMove:Ee,handlePointerUp:_e,handleScroll:ce,cornerSize:D,setCornerSize:O,thumbSize:N,setThumbSize:_,touchModality:k,cornerRef:K,scrollingX:C,setScrollingX:T,scrollingY:S,setScrollingY:R,hovering:g,setHovering:x,viewportRef:q,rootRef:V,scrollbarYRef:Y,scrollbarXRef:j,thumbYRef:z,thumbXRef:H,rootId:f,hiddenState:W,setHiddenState:L,overflowEdges:$,setOverflowEdges:F,viewportState:he,overflowEdgeThreshold:c}),[ge,Ee,_e,ce,D,N,k,C,T,S,R,g,x,f,W,$,he,c]);return E.jsxs(AN.Provider,{value:Ae,children:[!y&&od.getElement(p),Pe]})});function FG(e){if(typeof e=="number"){const t=Math.max(0,e);return{xStart:t,xEnd:t,yStart:t,yEnd:t}}return{xStart:Math.max(0,(e==null?void 0:e.xStart)||0),xEnd:Math.max(0,(e==null?void 0:e.xEnd)||0),yStart:Math.max(0,(e==null?void 0:e.yStart)||0),yEnd:Math.max(0,(e==null?void 0:e.yEnd)||0)}}const BG=w.createContext(void 0);function HG(e,t){if(typeof IntersectionObserver>"u")return()=>{};const n=new IntersectionObserver(r=>{r.forEach(a=>{a.intersectionRatio>0&&(t(),n.disconnect())})});return n.observe(e),()=>{n.disconnect()}}let Mo=(function(e){return e.scrollAreaOverflowXStart="--scroll-area-overflow-x-start",e.scrollAreaOverflowXEnd="--scroll-area-overflow-x-end",e.scrollAreaOverflowYStart="--scroll-area-overflow-y-start",e.scrollAreaOverflowYEnd="--scroll-area-overflow-y-end",e})({});const ER=1;function TR(e,t){if(t<=0)return 0;const n=Na(e,0,t),r=n,a=t-n,s=r<=ER,l=a<=ER;return s&&l?r<=a?0:t:s?0:l?t:n}let CR=!1;function UG(){CR||zp||(typeof CSS<"u"&&"registerProperty"in CSS&&[Mo.scrollAreaOverflowXStart,Mo.scrollAreaOverflowXEnd,Mo.scrollAreaOverflowYStart,Mo.scrollAreaOverflowYEnd].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),CR=!0)}const VG=w.forwardRef(function(t,n){const{render:r,className:a,...s}=t,{viewportRef:l,scrollbarYRef:c,scrollbarXRef:f,thumbYRef:d,thumbXRef:m,cornerRef:p,cornerSize:y,setCornerSize:g,setThumbSize:x,rootId:C,setHiddenState:T,hiddenState:S,handleScroll:R,setHovering:k,setOverflowEdges:M,overflowEdges:D,overflowEdgeThreshold:O,scrollingX:N,scrollingY:_}=Yp(),$=Su(),F=w.useRef(!0),W=_n(),L=_n(),V=Ve(()=>{const K=l.current,P=c.current,B=f.current,G=d.current,I=m.current,Q=p.current;if(!K)return;const Z=K.scrollHeight,ie=K.scrollWidth,ce=K.clientHeight,ge=K.clientWidth,Ee=K.scrollTop,_e=K.scrollLeft;if(Z===0||ie===0)return;const Ie=ce>=Z,re=ge>=ie,he=ge/ie,be=ce/Z,Pe=Math.max(0,ie-ge),Ae=Math.max(0,Z-ce);let Se=0,Ce=0;if(!re){let Je=0;$==="rtl"?Je=Na(-_e,0,Pe):Je=Na(_e,0,Pe),Se=TR(Je,Pe),Ce=Pe-Se}const J=Ie?0:Na(Ee,0,Ae),Re=Ie?0:TR(J,Ae),xe=Ie?0:Ae-Re,Be=re?0:ge,$e=Ie?0:ce;let te=0,De=0;!re&&!Ie&&(te=(P==null?void 0:P.offsetWidth)||0,De=(B==null?void 0:B.offsetHeight)||0);const se=y.width===0&&y.height===0,ye=se?te:0,we=se?De:0,Me=mi(B,"padding","x"),Fe=mi(P,"padding","y"),ct=mi(I,"margin","x"),bt=mi(G,"margin","y"),Ot=Be-Me-ct,We=$e-Fe-bt,ot=B?Math.min(B.offsetWidth-ye,Ot):Ot,st=P?Math.min(P.offsetHeight-we,We):We,jt=Math.max(wR,ot*he),zt=Math.max(wR,st*be);if(x(Je=>Je.height===zt&&Je.width===jt?Je:{width:jt,height:zt}),P&&G){const Je=P.offsetHeight-zt-Fe-bt,kt=Z-ce,Ft=kt===0?0:Ee/kt,Xe=Math.min(Je,Math.max(0,Ft*Je));G.style.transform=`translate3d(0,${Xe}px,0)`}if(B&&I){const Je=B.offsetWidth-jt-Me-ct,kt=ie-ge,Ft=kt===0?0:_e/kt,Xe=$==="rtl"?Na(Ft*Je,-Je,0):Na(Ft*Je,0,Je);I.style.transform=`translate3d(${Xe}px,0,0)`}const gt=[[Mo.scrollAreaOverflowXStart,Se],[Mo.scrollAreaOverflowXEnd,Ce],[Mo.scrollAreaOverflowYStart,Re],[Mo.scrollAreaOverflowYEnd,xe]];for(const[Je,kt]of gt)K.style.setProperty(Je,`${kt}px`);Q&&(re||Ie?g({width:0,height:0}):!re&&!Ie&&g({width:te,height:De})),T(Je=>{const kt=Ie||re;return Je.y===Ie&&Je.x===re&&Je.corner===kt?Je:{y:Ie,x:re,corner:kt}});const Rt={xStart:!re&&Se>O.xStart,xEnd:!re&&Ce>O.xEnd,yStart:!Ie&&Re>O.yStart,yEnd:!Ie&&xe>O.yEnd};M(Je=>Je.xStart===Rt.xStart&&Je.xEnd===Rt.xEnd&&Je.yStart===Rt.yStart&&Je.yEnd===Rt.yEnd?Je:Rt)});He(()=>{if(!l.current)return;UG();let K=!1;return HG(l.current,()=>{if(!K){K=!0;return}V()})},[V,l]),He(()=>{queueMicrotask(V)},[V,S,$]),He(()=>{var K;(K=l.current)!=null&&K.matches(":hover")&&k(!0)},[l,k]),w.useEffect(()=>{const K=l.current;if(typeof ResizeObserver>"u"||!K)return;let P=!1;const B=new ResizeObserver(()=>{if(!P){P=!0;return}V()});return B.observe(K),L.start(0,()=>{const G=K.getAnimations({subtree:!0});G.length!==0&&Promise.allSettled(G.map(I=>I.finished)).then(V).catch(()=>{})}),()=>{B.disconnect(),L.clear()}},[V,l,L]);function q(){F.current=!1}const Y={role:"presentation",...C&&{"data-id":`${C}-viewport`},...(!S.x||!S.y)&&{tabIndex:0},className:od.className,style:{overflow:"scroll"},onScroll(){l.current&&(V(),F.current||R({x:l.current.scrollLeft,y:l.current.scrollTop}),W.start(100,()=>{F.current=!0}))},onWheel:q,onTouchMove:q,onPointerMove:q,onPointerEnter:q,onKeyDown:q},j=w.useMemo(()=>({scrolling:N||_,hasOverflowX:!S.x,hasOverflowY:!S.y,overflowXStart:D.xStart,overflowXEnd:D.xEnd,overflowYStart:D.yStart,overflowYEnd:D.yEnd,cornerHidden:S.corner}),[N,_,S.x,S.y,S.corner,D]),z=Ct("div",t,{ref:[n,l],state:j,props:[Y,s],stateAttributesMapping:f0}),H=w.useMemo(()=>({computeThumbPosition:V}),[V]);return E.jsx(BG.Provider,{value:H,children:z})}),NN=w.createContext(void 0);function qG(){const e=w.useContext(NN);if(e===void 0)throw new Error(Sn(54));return e}let op=(function(e){return e.scrollAreaThumbHeight="--scroll-area-thumb-height",e.scrollAreaThumbWidth="--scroll-area-thumb-width",e})({});const $G=w.forwardRef(function(t,n){const{render:r,className:a,orientation:s="vertical",keepMounted:l=!1,...c}=t,{hovering:f,scrollingX:d,scrollingY:m,hiddenState:p,overflowEdges:y,scrollbarYRef:g,scrollbarXRef:x,viewportRef:C,thumbYRef:T,thumbXRef:S,handlePointerDown:R,handlePointerUp:k,rootId:M,thumbSize:D}=Yp(),O={hovering:f,scrolling:{horizontal:d,vertical:m}[s],orientation:s,hasOverflowX:!p.x,hasOverflowY:!p.y,overflowXStart:y.xStart,overflowXEnd:y.xEnd,overflowYStart:y.yStart,overflowYEnd:y.yEnd,cornerHidden:p.corner},N=Su();w.useEffect(()=>{const V=C.current,q=s==="vertical"?g.current:x.current;if(!q)return;function Y(j){if(!(!V||!q||j.ctrlKey)){if(j.preventDefault(),s==="vertical"){if(V.scrollTop===0&&j.deltaY<0)return}else if(V.scrollLeft===0&&j.deltaX<0)return;if(s==="vertical"){if(V.scrollTop===V.scrollHeight-V.clientHeight&&j.deltaY>0)return}else if(V.scrollLeft===V.scrollWidth-V.clientWidth&&j.deltaX>0)return;s==="vertical"?V.scrollTop+=j.deltaY:V.scrollLeft+=j.deltaX}}return q.addEventListener("wheel",Y,{passive:!1}),()=>{q.removeEventListener("wheel",Y)}},[s,x,g,C]);const _={...M&&{"data-id":`${M}-scrollbar`},onPointerDown(V){if(V.button===0&&V.currentTarget===V.target&&C.current){if(T.current&&g.current&&s==="vertical"){const q=mi(T.current,"margin","y"),Y=mi(g.current,"padding","y"),j=T.current.offsetHeight,z=g.current.getBoundingClientRect(),H=V.clientY-z.top-j/2-Y+q/2,K=C.current.scrollHeight,P=C.current.clientHeight,B=g.current.offsetHeight-j-Y-q,I=H/B*(K-P);C.current.scrollTop=I}if(S.current&&x.current&&s==="horizontal"){const q=mi(S.current,"margin","x"),Y=mi(x.current,"padding","x"),j=S.current.offsetWidth,z=x.current.getBoundingClientRect(),H=V.clientX-z.left-j/2-Y+q/2,K=C.current.scrollWidth,P=C.current.clientWidth,B=x.current.offsetWidth-j-Y-q,G=H/B;let I;N==="rtl"?(I=(1-G)*(K-P),C.current.scrollLeft<=0&&(I=-I)):I=G*(K-P),C.current.scrollLeft=I}R(V)}},onPointerUp:k,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",...s==="vertical"&&{top:0,bottom:`var(${ap.scrollAreaCornerHeight})`,insetInlineEnd:0,[op.scrollAreaThumbHeight]:`${D.height}px`},...s==="horizontal"&&{insetInlineStart:0,insetInlineEnd:`var(${ap.scrollAreaCornerWidth})`,bottom:0,[op.scrollAreaThumbWidth]:`${D.width}px`}}},$=Ct("div",t,{ref:[n,s==="vertical"?g:x],state:O,props:[_,c],stateAttributesMapping:f0}),F=w.useMemo(()=>({orientation:s}),[s]),W=s==="vertical"?p.y:p.x;return l||!W?E.jsx(NN.Provider,{value:F,children:$}):null}),YG=w.forwardRef(function(t,n){const{render:r,className:a,...s}=t,{thumbYRef:l,thumbXRef:c,handlePointerDown:f,handlePointerMove:d,handlePointerUp:m,setScrollingX:p,setScrollingY:y}=Yp(),{orientation:g}=qG();return Ct("div",t,{ref:[n,g==="vertical"?l:c],state:{orientation:g},props:[{onPointerDown:f,onPointerMove:d,onPointerUp(T){g==="vertical"&&y(!1),g==="horizontal"&&p(!1),m(T)},style:{...g==="vertical"&&{height:`var(${op.scrollAreaThumbHeight})`},...g==="horizontal"&&{width:`var(${op.scrollAreaThumbWidth})`}}},s]})}),WG=w.forwardRef(function(t,n){const{render:r,className:a,...s}=t,{cornerRef:l,cornerSize:c,hiddenState:f}=Yp(),d=Ct("div",t,{ref:[n,l],props:[{style:{position:"absolute",bottom:0,insetInlineEnd:0,width:c.width,height:c.height}},s]});return f.corner?null:d});function KG({className:e,children:t,...n}){return E.jsxs(zG,{"data-slot":"scroll-area",className:Le("relative",e),...n,children:[E.jsx(VG,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),E.jsx(GG,{}),E.jsx(WG,{})]})}function GG({className:e,orientation:t="vertical",...n}){return E.jsx($G,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:Le("data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none","[@media(any-pointer:coarse)]:hidden",e),...n,children:E.jsx(YG,{"data-slot":"scroll-area-thumb",className:"rounded-full bg-border relative flex-1"})})}const XG=(e,t)=>["watch-rules",e,t],DN=e=>["watch-rule-state",e];async function Tu(e,t){try{return(await e.json()).error??t}catch{return t}}async function QG(e,t){const n=new URLSearchParams({deviceId:e,paneId:t}),r=await fetch(`/api/watch/rules?${n}`);if(!r.ok)throw new Error(await Tu(r,"Failed to load watch rules"));return(await r.json()).rules}async function ZG(e){const t=await fetch("/api/watch/rules",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await Tu(t,"Failed to create watch rule"));return await t.json()}async function IN(e,t){const n=await fetch(`/api/watch/rules/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(await Tu(n,"Failed to update watch rule"));return await n.json()}async function JG(e){const t=await fetch(`/api/watch/rules/${e}`,{method:"DELETE"});if(!t.ok)throw new Error(await Tu(t,"Failed to delete watch rule"))}async function PN(e){const t=await fetch(`/api/watch/rules/${e}/state`);if(!t.ok)throw new Error(await Tu(t,"Failed to load watch rule state"));return await t.json()}async function eX(e){const t=await fetch("/api/watch/assist-regex",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await Tu(t,"Failed to generate regex"));return await t.json()}const tX=["match","unchanged","llm"],sb="__default__";function RR(e){return e==="llm"?30:5}function nX({deviceId:e,paneId:t,rule:n,onSaved:r,onCancel:a}){var Ce;const{t:s}=xn(),l=w.useId(),[c,f]=w.useState((n==null?void 0:n.name)??""),[d,m]=w.useState((n==null?void 0:n.triggerType)??"match"),[p,y]=w.useState((n==null?void 0:n.pattern)??""),[g,x]=w.useState((n==null?void 0:n.patternFlags)??""),[C,T]=w.useState((n==null?void 0:n.extractGroup)??0),[S,R]=w.useState((n==null?void 0:n.unchangedMinutes)??10),[k,M]=w.useState((n==null?void 0:n.noMatchBehavior)??"reset"),[D,O]=w.useState((n==null?void 0:n.conditionPrompt)??""),[N,_]=w.useState((n==null?void 0:n.providerId)??null),[$,F]=w.useState((n==null?void 0:n.modelId)??""),[W,L]=w.useState((n==null?void 0:n.confirmWithLlm)??!1),[V,q]=w.useState((n==null?void 0:n.summarizeWithLlm)??!1),[Y,j]=w.useState((n==null?void 0:n.intervalSeconds)??30),[z,H]=w.useState((n==null?void 0:n.fireMode)??"once"),[K,P]=w.useState((n==null?void 0:n.cooldownSeconds)??600),[B,G]=w.useState(""),[I,Q]=w.useState(null),ie=((Ce=Po({queryKey:["llm-providers"],queryFn:async()=>{const J=await fetch("/api/llm/providers");if(!J.ok)throw new Error("Failed to load providers");return await J.json()},throwOnError:!1}).data)==null?void 0:Ce.providers)??[],ce=ie.filter(J=>J.enabled),ge=ie.find(J=>J.id===N),Ee=(ge==null?void 0:ge.models)??[],_e=d==="match"||d==="unchanged",Ie=d==="llm"||W||V,re=RR(d),he=J=>{m(J);const Re=RR(J);j(xe=>xe<Re?J==="llm"?60:30:xe)},be=()=>{if(!c.trim())return s("watch.validation.nameRequired");if(_e){if(!p)return s("watch.validation.patternRequired");try{new RegExp(p,g.replace(/g/g,""))}catch(J){return s("watch.validation.patternInvalid",{detail:J instanceof Error?J.message:String(J)})}if(d==="unchanged"&&(!S||S<=0))return s("watch.validation.unchangedMinutesInvalid")}else if(!D.trim())return s("watch.validation.conditionPromptRequired");return!Number.isInteger(Y)||Y<re?s("watch.validation.intervalMin",{min:re}):null},Pe=Ph({mutationFn:async()=>{const J={name:c.trim(),triggerType:d,pattern:_e?p:null,patternFlags:_e?g:"",extractGroup:C,conditionPrompt:d==="llm"?D:null,providerId:N,modelId:N&&$.trim()||null,confirmWithLlm:_e?W:!1,summarizeWithLlm:_e?V:!1,intervalSeconds:Y,unchangedMinutes:d==="unchanged"?S:null,noMatchBehavior:k,fireMode:z,cooldownSeconds:K};if(n){const xe=J;return await IN(n.id,xe),!1}const Re={...J,deviceId:e,paneId:t,enabled:!0};return await ZG(Re),!0},onSuccess:J=>{gn.success(s(J?"watch.toast.created":"watch.toast.updated")),r(J)},onError:J=>{gn.error(J instanceof Error?J.message:String(J))}}),Ae=Ph({mutationFn:async()=>eX({description:B.trim(),deviceId:e,paneId:t,providerId:N,modelId:N&&$.trim()||null}),onSuccess:J=>{y(J.pattern),x(J.flags),T(J.extractGroup),Q(J)},onError:J=>{gn.error(J instanceof Error?J.message:String(J))}}),Se=()=>{const J=be();if(J){gn.error(J);return}Pe.mutate()};return E.jsxs("form",{"data-testid":"watch-rule-form",className:"space-y-4",onSubmit:J=>{J.preventDefault(),Se()},children:[E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-name`,children:s("watch.form.name")}),E.jsx(ki,{id:`${l}-name`,"data-testid":"watch-form-name",value:c,maxLength:120,onChange:J=>f(J.target.value),placeholder:s("watch.form.namePlaceholder")})]}),E.jsxs("div",{className:"space-y-2",children:[E.jsx("span",{className:"block text-sm font-medium",children:s("watch.form.triggerType")}),E.jsx("div",{className:"grid gap-2",children:tX.map(J=>E.jsxs("button",{type:"button","data-testid":`watch-form-type-${J}`,onClick:()=>he(J),className:Le("rounded-lg border px-3 py-2 text-left transition-colors",d===J?"border-primary/50 bg-primary/10":"border-border hover:bg-accent/40"),children:[E.jsx("span",{className:"block text-sm font-medium",children:s(`watch.type.${J}`)}),E.jsx("span",{className:"block text-xs text-muted-foreground",children:s(`watch.typeDesc.${J}`)})]},J))})]}),_e&&E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:"space-y-2 rounded-lg border border-dashed border-border p-3",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-assist`,children:s("watch.form.assistLabel")}),E.jsxs("div",{className:"flex gap-2",children:[E.jsx(ki,{id:`${l}-assist`,"data-testid":"watch-form-assist-input",value:B,onChange:J=>G(J.target.value),placeholder:s("watch.form.assistPlaceholder")}),E.jsxs(_t,{type:"button",variant:"secondary","data-testid":"watch-form-assist-generate",disabled:!B.trim()||Ae.isPending,onClick:()=>Ae.mutate(),children:[Ae.isPending?E.jsx(iu,{className:"h-4 w-4 animate-spin"}):E.jsx(M5,{className:"h-4 w-4"}),s("watch.form.assistButton")]})]}),I&&E.jsxs("div",{className:"space-y-1 text-xs","data-testid":"watch-form-assist-result",children:[E.jsxs("p",{className:"text-muted-foreground",children:[E.jsxs("span",{className:"font-medium text-foreground",children:[s("watch.form.assistExplanation"),":"]})," ",I.explanation]}),E.jsxs("p",{className:"font-medium text-foreground",children:[s("watch.form.assistPreview"),":"]}),I.preview.length===0?E.jsx("p",{className:"text-muted-foreground",children:s("watch.form.assistPreviewEmpty")}):E.jsx("ul",{className:"max-h-24 space-y-0.5 overflow-y-auto",children:I.preview.map((J,Re)=>E.jsx("li",{className:"truncate rounded bg-muted px-1.5 py-0.5 font-mono",children:J},Re))})]})]}),E.jsxs("div",{className:"grid grid-cols-[1fr_5rem] gap-2",children:[E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-pattern`,children:s("watch.form.pattern")}),E.jsx(ki,{id:`${l}-pattern`,"data-testid":"watch-form-pattern",value:p,onChange:J=>y(J.target.value),placeholder:s("watch.form.patternPlaceholder"),className:"font-mono"})]}),E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-flags`,children:s("watch.form.flags")}),E.jsx(ki,{id:`${l}-flags`,"data-testid":"watch-form-flags",value:g,onChange:J=>x(J.target.value),placeholder:s("watch.form.flagsPlaceholder"),className:"font-mono"})]})]})]}),d==="unchanged"&&E.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-extract-group`,children:s("watch.form.extractGroup")}),E.jsx(ki,{id:`${l}-extract-group`,"data-testid":"watch-form-extract-group",type:"number",min:0,step:1,value:C,onChange:J=>T(Math.max(0,Number(J.target.value)||0))}),E.jsx("p",{className:"text-xs text-muted-foreground",children:s("watch.form.extractGroupHint")})]}),E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-unchanged-minutes`,children:s("watch.form.unchangedMinutes")}),E.jsx(ki,{id:`${l}-unchanged-minutes`,"data-testid":"watch-form-unchanged-minutes",type:"number",min:1,step:1,value:S,onChange:J=>R(Math.max(1,Number(J.target.value)||1))})]}),E.jsxs("div",{className:"col-span-2 space-y-2",children:[E.jsx("span",{className:"block text-sm font-medium",children:s("watch.form.noMatchBehavior")}),E.jsxs(Oh,{value:k,onValueChange:J=>{(J==="reset"||J==="ignore")&&M(J)},children:[E.jsx(Ah,{className:"w-full","data-testid":"watch-form-no-match-behavior",children:E.jsx(nb,{children:s(k==="reset"?"watch.form.noMatchReset":"watch.form.noMatchIgnore")})}),E.jsxs(Nh,{children:[E.jsx(Ca,{value:"reset",children:s("watch.form.noMatchReset")}),E.jsx(Ca,{value:"ignore",children:s("watch.form.noMatchIgnore")})]})]})]})]}),d==="llm"&&E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-condition`,children:s("watch.form.conditionPrompt")}),E.jsx(dx,{id:`${l}-condition`,"data-testid":"watch-form-condition-prompt",value:D,onChange:J=>O(J.target.value),placeholder:s("watch.form.conditionPromptPlaceholder"),rows:3})]}),E.jsxs("div",{className:"space-y-2",children:[E.jsx("span",{className:"block text-sm font-medium",children:s("watch.form.model")}),E.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[E.jsxs(Oh,{value:N??sb,onValueChange:J=>{if(!J)return;const Re=J===sb?null:J;_(Re),Re===null&&F("")},children:[E.jsx(Ah,{className:"w-full","data-testid":"watch-form-provider",children:E.jsx(nb,{children:N?(ge==null?void 0:ge.name)??s("watch.form.providerUnavailable"):s("watch.form.followGlobalDefault")})}),E.jsxs(Nh,{children:[E.jsx(Ca,{value:sb,children:s("watch.form.followGlobalDefault")}),N&&!ce.some(J=>J.id===N)&&E.jsx(Ca,{value:N,children:ge?`${ge.name} (${s("watch.form.providerDisabled")})`:s("watch.form.providerUnavailable")}),ce.map(J=>E.jsx(Ca,{value:J.id,children:J.name},J.id))]})]}),E.jsx(ki,{"data-testid":"watch-form-model",list:`${l}-model-options`,value:$,disabled:!N,onChange:J=>F(J.target.value),placeholder:s("watch.form.modelPlaceholder")}),E.jsx("datalist",{id:`${l}-model-options`,children:Ee.map(J=>E.jsx("option",{value:J},J))})]}),Ie&&E.jsx("p",{className:"rounded-md bg-primary/10 px-2 py-1.5 text-xs text-primary","data-testid":"watch-form-model-hint",children:s("watch.form.modelRequiredHint")})]}),_e&&E.jsxs("div",{className:"space-y-3",children:[E.jsxs("div",{className:"flex items-center justify-between gap-2",children:[E.jsxs("div",{children:[E.jsx("span",{className:"block text-sm font-medium",children:s("watch.form.confirmWithLlm")}),E.jsx("span",{className:"block text-xs text-muted-foreground",children:s("watch.form.confirmWithLlmDesc")})]}),E.jsx(Bh,{checked:W,onCheckedChange:J=>L(!!J),"data-testid":"watch-form-confirm-llm"})]}),E.jsxs("div",{className:"flex items-center justify-between gap-2",children:[E.jsxs("div",{children:[E.jsx("span",{className:"block text-sm font-medium",children:s("watch.form.summarizeWithLlm")}),E.jsx("span",{className:"block text-xs text-muted-foreground",children:s("watch.form.summarizeWithLlmDesc")})]}),E.jsx(Bh,{checked:V,onCheckedChange:J=>q(!!J),"data-testid":"watch-form-summarize-llm"})]})]}),E.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-interval`,children:s("watch.form.intervalSeconds")}),E.jsx(ki,{id:`${l}-interval`,"data-testid":"watch-form-interval",type:"number",min:re,step:1,value:Y,onChange:J=>j(Number(J.target.value)||0)}),E.jsx("p",{className:"text-xs text-muted-foreground",children:s("watch.form.intervalHint",{min:re})})]}),E.jsxs("div",{className:"space-y-2",children:[E.jsx("span",{className:"block text-sm font-medium",children:s("watch.form.fireMode")}),E.jsxs(Oh,{value:z,onValueChange:J=>{(J==="once"||J==="repeat")&&H(J)},children:[E.jsx(Ah,{className:"w-full","data-testid":"watch-form-fire-mode",children:E.jsx(nb,{children:s(z==="once"?"watch.form.fireOnce":"watch.form.fireRepeat")})}),E.jsxs(Nh,{children:[E.jsx(Ca,{value:"once",children:s("watch.form.fireOnce")}),E.jsx(Ca,{value:"repeat",children:s("watch.form.fireRepeat")})]})]}),z==="repeat"&&E.jsx(ki,{"data-testid":"watch-form-cooldown",type:"number",min:0,step:1,value:K,onChange:J=>P(Math.max(0,Number(J.target.value)||0)),"aria-label":s("watch.form.cooldownSeconds"),placeholder:s("watch.form.cooldownSeconds")})]})]}),E.jsxs("div",{className:"flex justify-end gap-2",children:[E.jsx(_t,{type:"button",variant:"outline",onClick:a,"data-testid":"watch-form-cancel",children:s("common.cancel")}),E.jsxs(_t,{type:"submit",disabled:Pe.isPending,"data-testid":"watch-form-save",children:[Pe.isPending&&E.jsx(iu,{className:"h-4 w-4 animate-spin"}),s(n?"watch.form.save":"watch.form.create")]})]})]})}function Lc(e){if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t.toLocaleString()}function rX({open:e,onOpenChange:t,deviceId:n,paneId:r}){const{t:a}=xn(),s=lp(),[l,c]=w.useState({mode:"list"}),[f,d]=w.useState(null),[m,p]=w.useState(!1);w.useEffect(()=>{e||(c({mode:"list"}),d(null),p(!1))},[e]);const y=Po({queryKey:XG(n,r),queryFn:()=>QG(n,r),enabled:e,throwOnError:!1}),g=()=>{s.invalidateQueries({queryKey:["watch-rules"]})},x=Ph({mutationFn:async({rule:R,enabled:k})=>{await IN(R.id,{enabled:k})},onSuccess:g,onError:R=>{gn.error(R instanceof Error?R.message:String(R)),g()}}),C=Ph({mutationFn:async R=>{await JG(R.id)},onSuccess:()=>{gn.success(a("watch.toast.deleted")),g()},onError:R=>{gn.error(R instanceof Error?R.message:String(R))}}),T=R=>{g(),c({mode:"list"}),R&&typeof Notification<"u"&&Notification.permission==="default"&&p(!0)},S=y.data??[];return E.jsxs(E.Fragment,{children:[E.jsx(Ev,{open:e,onOpenChange:t,children:E.jsxs(Tv,{className:"sm:max-w-lg max-h-[85dvh] grid-rows-[auto_minmax(0,1fr)]","data-testid":"watch-dialog",children:[E.jsxs(Cv,{children:[E.jsxs(Rv,{children:[l.mode==="list"&&a("watch.title"),l.mode==="form"&&(l.rule?a("watch.form.editTitle"):a("watch.form.createTitle")),l.mode==="state"&&a("watch.state.title")]}),E.jsx(EN,{children:l.mode==="list"?a("watch.dialogDesc"):null})]}),E.jsxs("div",{className:"min-h-0 overflow-y-auto pr-1",children:[l.mode==="list"&&E.jsxs("div",{className:"space-y-3",children:[m&&E.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-primary/30 bg-primary/10 p-3","data-testid":"watch-notif-banner",children:[E.jsx(P4,{className:"mt-0.5 h-4 w-4 shrink-0 text-primary"}),E.jsxs("div",{className:"min-w-0 flex-1",children:[E.jsx("p",{className:"text-sm font-medium",children:a("watch.notifPermission.title")}),E.jsx("p",{className:"text-xs text-muted-foreground",children:a("watch.notifPermission.desc")}),E.jsxs("div",{className:"mt-2 flex gap-2",children:[E.jsx(_t,{size:"sm","data-testid":"watch-notif-enable",onClick:()=>{Notification.requestPermission().finally(()=>p(!1))},children:a("watch.notifPermission.enable")}),E.jsx(_t,{size:"sm",variant:"ghost",onClick:()=>p(!1),children:a("watch.notifPermission.dismiss")})]})]})]}),y.isLoading&&E.jsx("div",{className:"flex justify-center py-6",children:E.jsx(iu,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),!y.isLoading&&S.length===0&&E.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground","data-testid":"watch-rules-empty",children:a("watch.rules.empty")}),S.map(R=>E.jsx(iX,{rule:R,onToggle:k=>x.mutate({rule:R,enabled:k}),onEdit:()=>c({mode:"form",rule:R}),onViewState:()=>c({mode:"state",rule:R}),onDelete:()=>d(R)},R.id)),E.jsxs(_t,{variant:"outline",className:"w-full","data-testid":"watch-rule-add",onClick:()=>c({mode:"form",rule:null}),children:[E.jsx(mp,{className:"h-4 w-4"}),a("watch.rules.addRule")]})]}),l.mode==="form"&&E.jsx(nX,{deviceId:n,paneId:r,rule:l.rule,onSaved:T,onCancel:()=>c({mode:"list"})}),l.mode==="state"&&E.jsx(aX,{rule:l.rule,onBack:()=>c({mode:"list"})})]})]})}),E.jsx(mv,{open:f!==null,onOpenChange:R=>!R&&d(null),children:E.jsxs(gv,{"data-testid":"watch-rule-delete-dialog",children:[E.jsxs(yv,{children:[E.jsx(vv,{children:a("watch.rules.deleteTitle")}),E.jsx(xv,{children:a("watch.rules.deleteDesc",{name:(f==null?void 0:f.name)??""})})]}),E.jsxs(bv,{children:[E.jsx(Sv,{children:a("common.cancel")}),E.jsx(wv,{variant:"destructive","data-testid":"watch-rule-delete-confirm",onClick:()=>{f&&C.mutate(f),d(null)},children:a("watch.rules.deleteConfirm")})]})]})})]})}function iX({rule:e,onToggle:t,onEdit:n,onViewState:r,onDelete:a}){var f,d;const{t:s}=xn(),l=Po({queryKey:DN(e.id),queryFn:()=>PN(e.id),throwOnError:!1}),c=Lc((d=(f=l.data)==null?void 0:f.state)==null?void 0:d.lastTriggeredAt);return E.jsxs("div",{className:"rounded-lg border border-border p-3","data-testid":`watch-rule-item-${e.id}`,"data-rule-name":e.name,children:[E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:e.name}),E.jsx(Fs,{variant:"secondary",children:s(`watch.type.${e.triggerType}`)}),E.jsx(Bh,{checked:e.enabled,onCheckedChange:m=>t(!!m),"data-testid":`watch-rule-toggle-${e.id}`})]}),E.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2",children:[E.jsx("span",{className:"truncate text-xs text-muted-foreground",children:c?s("watch.rules.lastTriggered",{time:c}):s("watch.rules.neverTriggered")}),E.jsxs("div",{className:"flex shrink-0 gap-1",children:[E.jsx(_t,{variant:"ghost",size:"icon-xs",onClick:r,title:s("watch.rules.viewState"),"aria-label":s("watch.rules.viewState"),"data-testid":`watch-rule-state-${e.id}`,children:E.jsx(M4,{className:"h-3.5 w-3.5"})}),E.jsx(_t,{variant:"ghost",size:"icon-xs",onClick:n,title:s("watch.rules.edit"),"aria-label":s("watch.rules.edit"),"data-testid":`watch-rule-edit-${e.id}`,children:E.jsx(pp,{className:"h-3.5 w-3.5"})}),E.jsx(_t,{variant:"ghost",size:"icon-xs",onClick:a,title:s("watch.rules.delete"),"aria-label":s("watch.rules.delete"),"data-testid":`watch-rule-delete-${e.id}`,children:E.jsx(Xk,{className:"h-3.5 w-3.5 text-destructive"})})]})]})]})}function aX({rule:e,onBack:t}){var f,d;const{t:n}=xn(),r=Po({queryKey:DN(e.id),queryFn:()=>PN(e.id),refetchInterval:5e3,throwOnError:!1}),a=((f=r.data)==null?void 0:f.state)??null,s=((d=r.data)==null?void 0:d.samples)??[],l=n("watch.state.none"),c=[{label:n("watch.state.lastSampledAt"),value:Lc(a==null?void 0:a.lastSampledAt)??l},{label:n("watch.state.lastValue"),value:(a==null?void 0:a.lastValue)??l},{label:n("watch.state.lastValueChangedAt"),value:Lc(a==null?void 0:a.lastValueChangedAt)??l},{label:n("watch.state.lastTriggeredAt"),value:Lc(a==null?void 0:a.lastTriggeredAt)??l},{label:n("watch.state.consecutiveErrors"),value:a?String(a.consecutiveErrors):l},{label:n("watch.state.lastError"),value:(a==null?void 0:a.lastError)??l}];return E.jsxs("div",{className:"space-y-3","data-testid":"watch-rule-state-view",children:[E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx(_t,{variant:"ghost",size:"icon-sm",onClick:t,"aria-label":n("watch.state.back"),children:E.jsx(D4,{className:"h-4 w-4"})}),E.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:e.name}),E.jsx(Fs,{variant:"secondary",children:n(`watch.type.${e.triggerType}`)})]}),r.isLoading?E.jsx("div",{className:"flex justify-center py-6",children:E.jsx(iu,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):E.jsxs(E.Fragment,{children:[E.jsx("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 text-sm",children:c.map(m=>E.jsxs("div",{className:"contents",children:[E.jsx("dt",{className:"text-muted-foreground",children:m.label}),E.jsx("dd",{className:"min-w-0 break-all",children:m.value})]},m.label))}),E.jsxs("div",{className:"space-y-1.5",children:[E.jsx("p",{className:"text-sm font-medium",children:n("watch.state.samples")}),s.length===0?E.jsx("p",{className:"text-xs text-muted-foreground",children:n("watch.state.samplesEmpty")}):E.jsx("ul",{className:"max-h-48 space-y-0.5 overflow-y-auto text-xs",children:[...s].reverse().map(m=>E.jsxs("li",{className:"flex items-center gap-2 rounded bg-muted/60 px-2 py-1",children:[E.jsx("span",{className:"shrink-0 font-mono text-muted-foreground",children:Lc(m.at)??m.at}),E.jsx("span",{className:"min-w-0 flex-1 truncate font-mono",children:m.value??l}),m.hit&&E.jsx(Fs,{variant:"default",className:"h-4 px-1 text-[10px]",children:n("watch.state.hit")})]},m.at))})]})]})]})}function jX(e){return e}function LN(e){return encodeURIComponent(e)}function _N({status:e}){return E.jsx("span",{className:Le("size-2 shrink-0 rounded-full",e==="running"?"bg-emerald-500 animate-pulse":e==="error"?"bg-destructive":e==="waiting_confirmation"?"bg-amber-500":"bg-muted-foreground/40")})}function oX(){const{t:e}=xn(),t=Zi(),n=Yv(),{isMobile:r,setOpenMobile:a}=na(),{toggleDevice:s}=x4(),l=on(te=>te.sessions),c=on(te=>te.activeSessionId),f=Ia(te=>te.setSidebarTab);w.useEffect(()=>{const te=on.getState();te.ensureInitialized(),te.loadSessions()},[]);const d=nu("/devices/:deviceId/windows/:windowId/panes/:paneId",t.pathname),m=d==null?void 0:d.params.deviceId,p=d==null?void 0:d.params.windowId,y=d==null?void 0:d.params.paneId,g=Qn(te=>te.snapshots),x=Qn(te=>te.connectedDevices),C=Qn(te=>te.closeWindow),T=Qn(te=>te.closePane),S=Qn(te=>te.renameWindow),R=Ps(te=>{var De;return((De=te.settings)==null?void 0:De.language)??"en_US"}),{data:k}=Po({queryKey:["devices"],queryFn:async()=>{const te=await fetch("/api/devices");if(!te.ok)throw new Error("Failed to fetch devices");return te.json()},throwOnError:!1}),M=Qn(te=>te.hydrateDeviceErrors);w.useEffect(()=>{k!=null&&k.devices&&M(k.devices.map(te=>({deviceId:te.id,lastError:te.lastError??null,lastErrorType:te.lastErrorType??null})))},[k,M]);const D=w.useCallback((te,De)=>{n(te,{replace:(De==null?void 0:De.replace)??!0}),r&&!(De!=null&&De.keepSidebarOpen)&&a(!1)},[n,r,a]),O=w.useCallback((te,De,se,ye)=>{F.current=null,window.dispatchEvent(new CustomEvent("tmex:user-initiated-selection",{detail:{deviceId:te,windowId:De,paneId:se}})),D(`/devices/${te}/windows/${De}/panes/${LN(se)}`,{keepSidebarOpen:ye==null?void 0:ye.keepSidebarOpen})},[D]),N=w.useCallback(te=>{var De,se;if(on.getState().setActiveSession(te.id),f("agent"),te.deviceId&&te.paneId){const ye=(se=(De=Qn.getState().snapshots[te.deviceId])==null?void 0:De.session)==null?void 0:se.windows,we=ye==null?void 0:ye.find(Me=>Me.panes.some(Fe=>Fe.id===te.paneId));we&&O(te.deviceId,we.id,te.paneId,{keepSidebarOpen:!0})}},[f,O]),_=w.useCallback((te,De,se)=>{O(te,De,se.id),on.getState().startDraft(te,se.id,se.title??null),f("agent"),r&&a(!1)},[O,f,r,a]),$=Qn(te=>te.selectWindow),F=w.useRef(null);w.useEffect(()=>{var ct,bt;const te=F.current;if(!te)return;if(Date.now()-te.at>5e3){F.current=null;return}const{deviceId:De,windowId:se}=te,ye=g[De],we=(ct=ye==null?void 0:ye.session)==null?void 0:ct.windows;if(!we)return;const Me=we.find(Ot=>Ot.id===se);if(!((bt=Me==null?void 0:Me.panes)!=null&&bt.length))return;F.current=null;const Fe=Me.panes.find(Ot=>Ot.active)??Me.panes[0];O(De,se,Fe.id)},[g,O]);const W=w.useCallback((te,De,se)=>{$(te,De);const ye=se.find(we=>we.active)??se[0];ye?(O(te,De,ye.id),F.current=null):F.current={deviceId:te,windowId:De,at:Date.now()}},[O,$]),L=w.useCallback((te,De)=>{De?te===m&&D("/devices"):D(`/devices/${te}`),s(te,De)},[s,m,D]),V=w.useCallback((te,De)=>{te===m&&De===p&&D("/devices"),C(te,De)},[C,m,p,D]),[q,Y]=w.useState(null),j=w.useCallback((te,De)=>{var we,Me;const se=(Me=(we=Qn.getState().snapshots[te])==null?void 0:we.session)==null?void 0:Me.windows,ye=se==null?void 0:se.find(Fe=>Fe.id===De);Y({kind:"window",deviceId:te,windowId:De,name:ye?LB(ye):""})},[]),z=w.useCallback((te,De,se)=>{var Me,Fe,ct,bt;const ye=(Fe=(Me=Qn.getState().snapshots[te])==null?void 0:Me.session)==null?void 0:Fe.windows,we=(bt=(ct=ye==null?void 0:ye.find(Ot=>Ot.id===De))==null?void 0:ct.panes)==null?void 0:bt.find(Ot=>Ot.id===se);Y({kind:"pane",deviceId:te,paneId:se,name:(we==null?void 0:we.title)||`Pane ${(we==null?void 0:we.index)??""}`})},[]),H=w.useCallback(()=>{q&&(q.kind==="window"?V(q.deviceId,q.windowId):T(q.deviceId,q.paneId),Y(null))},[q,V,T]),[K,P]=w.useState(null),[B,G]=w.useState(""),I=w.useCallback((te,De)=>{var we,Me;const se=(Me=(we=Qn.getState().snapshots[te])==null?void 0:we.session)==null?void 0:Me.windows,ye=se==null?void 0:se.find(Fe=>Fe.id===De);ye&&(G(ye.customName??fx(ye).title),P({deviceId:te,windowId:De,hasCustomName:!!ye.customName}))},[]),Q=w.useCallback(()=>{if(!K)return;const te=B.trim();te&&(S(K.deviceId,K.windowId,te),P(null))},[K,B,S]),Z=w.useCallback(()=>{K&&(S(K.deviceId,K.windowId,""),P(null))},[K,S]),ie=w.useCallback(te=>{Qn.getState().createWindow(te)},[]),[ce,ge]=w.useState(null),Ee=w.useCallback((te,De)=>{ge({deviceId:te,paneId:De})},[]),[_e,Ie]=w.useState(null),[re,he]=w.useState(""),[be,Pe]=w.useState(null),Ae=w.useCallback(te=>{he(te.title),Ie(te)},[]),Se=w.useCallback(()=>{if(!_e)return;const te=re.trim();te&&(on.getState().renameSession(_e.id,te),Ie(null))},[_e,re]),Ce=w.useCallback(te=>{Pe(te)},[]),J=w.useCallback(()=>{be&&(on.getState().deleteSession(be.id),Pe(null))},[be]),Re=(k==null?void 0:k.devices)??[],xe=w.useMemo(()=>[...Re].sort((te,De)=>te.name.localeCompare(De.name,zk(R),{numeric:!0,sensitivity:"base"})),[Re,R]),{sessionsByPane:Be,orphanSessions:$e}=w.useMemo(()=>{const te=new Set(Re.map(we=>we.id)),De=new Map,se=[],ye=Object.values(l).filter(we=>!!we).sort((we,Me)=>we.updatedAt<Me.updatedAt?1:-1);for(const we of ye){if(!we.deviceId||!we.paneId||!te.has(we.deviceId)){se.push(we);continue}const Me=`${we.deviceId}:${we.paneId}`,Fe=De.get(Me);Fe?Fe.push(we):De.set(Me,[we])}return{sessionsByPane:De,orphanSessions:se}},[l,Re]);return E.jsxs(gN,{className:"flex flex-col flex-1 min-h-0 pt-0",children:[E.jsx(KG,{className:"flex-1 min-h-0",children:E.jsxs("div",{className:"space-y-1.5 pb-2 pt-1",children:[xe.map(te=>{var De,se;return E.jsx(sX,{device:te,windows:((se=(De=g[te.id])==null?void 0:De.session)==null?void 0:se.windows)??null,isConnected:x.has(te.id),isSelected:te.id===m,selectedWindowId:p,selectedPaneId:y,onConnectToggle:()=>L(te.id,x.has(te.id)),onCreateWindow:ie,onCloseWindow:j,onClosePane:z,onRenameWindow:I,onPaneClick:O,onWindowClick:W,onWatchPane:Ee,sessionsByPane:Be,activeSessionId:c,onSelectSession:N,onCreateSessionForPane:_,onRenameSession:Ae,onDeleteSession:Ce},te.id)}),xe.length===0&&E.jsx("div",{className:"text-center text-sm text-muted-foreground py-4",children:e("sidebar.noDevices")}),$e.length>0&&E.jsx(uX,{sessions:$e,activeSessionId:c,onSelectSession:N,onRenameSession:Ae,onDeleteSession:Ce})]})}),E.jsx(mv,{open:q!==null,onOpenChange:te=>!te&&Y(null),children:E.jsxs(gv,{children:[E.jsxs(yv,{children:[E.jsx(vR,{className:"bg-destructive/10",children:E.jsx(Pa,{className:"h-5 w-5 text-destructive"})}),E.jsx(vv,{children:(q==null?void 0:q.kind)==="pane"?e("window.closePaneConfirmTitle"):e("window.closeConfirmTitle")}),E.jsx(xv,{children:e("window.closeConfirmDesc",{name:(q==null?void 0:q.name)??""})})]}),E.jsxs(bv,{children:[E.jsx(Sv,{children:e("common.cancel")}),E.jsx(wv,{variant:"destructive",disabled:!q,onClick:H,children:e("common.close")})]})]})}),E.jsx(Ev,{open:K!==null,onOpenChange:te=>!te&&P(null),children:E.jsx(Tv,{"data-testid":"window-rename-dialog",children:E.jsxs("form",{onSubmit:te=>{te.preventDefault(),Q()},children:[E.jsxs(Cv,{children:[E.jsx(Rv,{children:e("window.rename")}),E.jsx(EN,{children:e("window.renameDesc")})]}),E.jsx("div",{className:"py-4",children:E.jsx(ki,{autoFocus:!0,maxLength:64,value:B,onChange:te=>G(te.target.value),placeholder:e("window.renamePlaceholder"),"data-testid":"window-rename-input"})}),E.jsxs(xR,{children:[(K==null?void 0:K.hasCustomName)&&E.jsx(_t,{type:"button",variant:"ghost",onClick:Z,"data-testid":"window-rename-reset",children:e("window.renameReset")}),E.jsx(_t,{type:"button",variant:"outline",onClick:()=>P(null),children:e("common.cancel")}),E.jsx(_t,{type:"submit",disabled:!B.trim(),"data-testid":"window-rename-save",children:e("common.save")})]})]})})}),E.jsx(Ev,{open:_e!==null,onOpenChange:te=>!te&&Ie(null),children:E.jsx(Tv,{"data-testid":"agent-session-rename-dialog",children:E.jsxs("form",{onSubmit:te=>{te.preventDefault(),Se()},children:[E.jsx(Cv,{children:E.jsx(Rv,{children:e("agent.session.renameTitle")})}),E.jsx("div",{className:"py-4",children:E.jsx(ki,{autoFocus:!0,maxLength:120,value:re,onChange:te=>he(te.target.value),placeholder:e("agent.session.renamePlaceholder"),"data-testid":"agent-session-rename-input"})}),E.jsxs(xR,{children:[E.jsx(_t,{type:"button",variant:"outline",onClick:()=>Ie(null),children:e("agent.session.cancel")}),E.jsx(_t,{type:"submit",disabled:!re.trim(),"data-testid":"agent-session-rename-save",children:e("agent.session.save")})]})]})})}),E.jsx(mv,{open:be!==null,onOpenChange:te=>!te&&Pe(null),children:E.jsxs(gv,{children:[E.jsxs(yv,{children:[E.jsx(vR,{className:"bg-destructive/10",children:E.jsx(Pa,{className:"h-5 w-5 text-destructive"})}),E.jsx(vv,{children:e("agent.session.deleteTitle")}),E.jsx(xv,{children:e("agent.session.deleteDesc",{title:(be==null?void 0:be.title)??""})})]}),E.jsxs(bv,{children:[E.jsx(Sv,{children:e("common.cancel")}),E.jsx(wv,{variant:"destructive",disabled:!be,onClick:J,"data-testid":"agent-session-delete-confirm",children:e("agent.session.deleteConfirm")})]})]})}),ce&&E.jsx(rX,{open:!0,onOpenChange:te=>!te&&ge(null),deviceId:ce.deviceId,paneId:ce.paneId})]})}function sX({device:e,windows:t,isConnected:n,isSelected:r,selectedWindowId:a,selectedPaneId:s,onConnectToggle:l,onCreateWindow:c,onCloseWindow:f,onClosePane:d,onRenameWindow:m,onPaneClick:p,onWindowClick:y,onWatchPane:g,sessionsByPane:x,activeSessionId:C,onSelectSession:T,onCreateSessionForPane:S,onRenameSession:R,onDeleteSession:k}){const{t:M}=xn(),D=e.type==="local"?tx:Gk;return E.jsxs("div",{"data-testid":`device-item-${e.id}`,className:Le("rounded-xl border border-border/60 overflow-hidden text-select-none",r?"bg-card":n?"bg-muted/40":"bg-muted/20"),onClick:n?void 0:l,children:[E.jsxs("div",{className:"relative px-3 py-1.5",children:[r&&E.jsx("span",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-muted-foreground/70"}),E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx(D,{className:"ml-1 h-4 w-4 text-muted-foreground shrink-0"}),E.jsx("span",{className:"flex-1 truncate text-xs font-medium text-select-none",children:e.name}),E.jsx(sG,{deviceId:e.id,className:"shrink-0"}),E.jsx("div",{className:Le("h-2 w-2 rounded-full shrink-0",n?"bg-emerald-500":"bg-gray-400")}),E.jsx(_t,{variant:"ghost",size:"icon-xs",onClick:O=>{O.stopPropagation(),l()},"data-testid":n?`device-disconnect-${e.id}`:`device-connect-${e.id}`,title:M(n?"device.disconnect":"device.connect"),children:n?E.jsx(m5,{className:"h-3.5 w-3.5 text-orange-500"}):E.jsx(y5,{className:"h-3.5 w-3.5 text-emerald-500"})})]})]}),n&&E.jsxs("div",{className:"p-1.5 space-y-1.5 [@media(any-pointer:coarse)]:space-y-2",children:[!t&&E.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1.5 text-center",children:M("device.connecting")}),(t==null?void 0:t.length)===0&&E.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1.5 text-center",children:M("window.noWindows")}),t==null?void 0:t.map(O=>E.jsx(lX,{deviceId:e.id,window:O,isSelected:O.id===a,selectedPaneId:s,onPaneClick:p,onWindowClick:y,onCloseWindow:f,onClosePane:d,onRenameWindow:m,onWatchPane:g,sessionsByPane:x,activeSessionId:C,onSelectSession:T,onCreateSessionForPane:S,onRenameSession:R,onDeleteSession:k},O.id)),E.jsxs("button",{type:"button","data-testid":`window-create-${e.id}`,onPointerDown:O=>O.stopPropagation(),onMouseDown:O=>O.stopPropagation(),onClick:()=>c(e.id),className:"w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left transition-colors text-muted-foreground hover:text-foreground hover:bg-accent/30 border border-dashed border-border/50 hover:border-border",children:[E.jsx(mp,{className:"h-3.5 w-3.5 shrink-0"}),E.jsx("span",{className:"text-xs",children:M("window.new")})]})]})]})}function lX({deviceId:e,window:t,isSelected:n,selectedPaneId:r,onPaneClick:a,onWindowClick:s,onCloseWindow:l,onClosePane:c,onRenameWindow:f,onWatchPane:d,sessionsByPane:m,activeSessionId:p,onSelectSession:y,onCreateSessionForPane:g,onRenameSession:x,onDeleteSession:C}){const{t:T}=xn(),{isMobile:S}=na(),R=t.panes.length>1,k=fx(t),M=t.panes.find(O=>O.id===r),D=n&&!!M;return E.jsxs("div",{className:"space-y-1",children:[E.jsxs("div",{className:"group relative",children:[E.jsxs("button",{type:"button",onClick:()=>s(e,t.id,t.panes),"data-testid":`window-item-${t.id}`,className:Le("w-full flex items-center gap-2 px-2 py-1.5 rounded-lg text-left transition-colors pr-7 [@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:pr-12",S&&"py-2.5 pr-13",D?"bg-primary/10 text-primary":t.active?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-foreground"),children:[E.jsx(Fs,{variant:D?"default":"outline",className:"h-5 text-[10px] px-1.5 shrink-0",children:t.index}),E.jsxs("span",{className:"flex-1 min-w-0",children:[E.jsx("span",{className:"font-mono text-[11px] leading-tight font-medium line-clamp-2 [overflow-wrap:break-word]",children:k.title}),k.processName&&E.jsx("span",{className:"font-mono text-[10.5px] leading-tight text-muted-foreground line-clamp-1 break-all",children:k.processName})]})]}),E.jsxs(kv,{children:[E.jsx(Mv,{"data-testid":`window-menu-${t.id}`,"aria-label":T("window.menu"),title:T("window.menu"),className:Le("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded text-muted-foreground hover:bg-background hover:text-foreground transition-opacity data-popup-open:opacity-100",S?"h-11 w-11 right-0 rounded-lg bg-background/40 opacity-100":"h-5 w-5 right-1.5 [@media(any-pointer:coarse)]:h-10 [@media(any-pointer:coarse)]:w-10 [@media(any-pointer:coarse)]:right-0.5 [@media(any-pointer:coarse)]:rounded-lg",D?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),children:E.jsx(CT,{className:Le(S?"h-5 w-5":"h-3.5 w-3.5 [@media(any-pointer:coarse)]:h-4.5 [@media(any-pointer:coarse)]:w-4.5")})}),E.jsxs(Ov,{align:"end",className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:[E.jsxs(Gc,{"data-testid":`window-menu-rename-${t.id}`,className:Le("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",S&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>f(e,t.id),children:[E.jsx(pp,{className:Le("h-4 w-4",S&&"h-5 w-5")}),T("window.rename")]}),E.jsxs(Gc,{variant:"destructive","data-testid":`window-menu-close-${t.id}`,className:Le("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",S&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>l(e,t.id),children:[E.jsx(Pa,{className:Le("h-4 w-4",S&&"h-5 w-5")}),T("window.close")]})]})]})]}),R&&E.jsx("div",{className:"ml-4 pl-2 border-l border-border/50 space-y-1 [@media(any-pointer:coarse)]:space-y-1.5",children:t.panes.map(O=>{const N=O.id===r;return E.jsxs("div",{className:"group relative",children:[E.jsxs("button",{type:"button",onClick:()=>a(e,t.id,O.id),"data-testid":`pane-item-${O.id}`,className:Le("w-full flex items-center gap-2 px-2 py-1 rounded-lg text-left transition-colors pr-13 [@media(any-pointer:coarse)]:py-2 [@media(any-pointer:coarse)]:pr-21",S&&"py-2.5 pr-24",N?"bg-primary/10 text-primary":O.active?"bg-accent text-accent-foreground":"hover:bg-accent/30 text-muted-foreground"),children:[E.jsx("span",{className:"text-[10px] font-mono opacity-60 w-4",children:O.index}),E.jsx("span",{className:"flex-1 text-xs line-clamp-2 break-all",children:O.title||`Pane ${O.index}`})]}),E.jsxs(kv,{children:[E.jsx(Mv,{"data-testid":`pane-menu-${O.id}`,"aria-label":T("watch.openMonitor"),className:Le("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded text-muted-foreground hover:bg-background hover:text-foreground transition-opacity data-popup-open:opacity-100",S?"h-11 w-11 right-11 rounded-lg bg-background/40 opacity-100":"h-5 w-5 right-7 [@media(any-pointer:coarse)]:h-10 [@media(any-pointer:coarse)]:w-10 [@media(any-pointer:coarse)]:right-10.5 [@media(any-pointer:coarse)]:rounded-lg",N?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),children:E.jsx(CT,{className:Le(S?"h-5 w-5":"h-3.5 w-3.5")})}),E.jsx(Ov,{align:"end",className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:E.jsxs(Gc,{"data-testid":`pane-watch-${O.id}`,className:Le("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",S&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>d(e,O.id),children:[E.jsx(v5,{className:Le("h-4 w-4",S&&"h-5 w-5")}),T("watch.openMonitor")]})})]}),E.jsx("button",{type:"button",onClick:_=>{_.stopPropagation(),c(e,t.id,O.id)},"data-testid":`pane-close-${O.id}`,className:Le("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded text-muted-foreground hover:bg-background hover:text-foreground transition-opacity",S?"h-11 w-11 right-0 rounded-lg bg-background/40 opacity-100":"h-5 w-5 right-1.5 [@media(any-pointer:coarse)]:h-10 [@media(any-pointer:coarse)]:w-10 [@media(any-pointer:coarse)]:right-0.5 [@media(any-pointer:coarse)]:rounded-lg",N?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),title:T("window.closePane"),children:E.jsx("span",{className:Le("leading-none",S?"text-base":"text-xs"),children:"×"})}),E.jsx(kR,{sessions:m.get(`${e}:${O.id}`),activeSessionId:p,onSelectSession:y,onCreateSession:()=>g(e,t.id,O),onRenameSession:x,onDeleteSession:C})]},O.id)})}),!R&&t.panes[0]&&E.jsx("div",{className:"ml-4 pl-2 border-l border-border/50",children:E.jsx(kR,{sessions:m.get(`${e}:${t.panes[0].id}`),activeSessionId:p,onSelectSession:y,onCreateSession:()=>g(e,t.id,t.panes[0]),onRenameSession:x,onDeleteSession:C})})]})}function jN({session:e,onRenameSession:t,onDeleteSession:n,className:r,enlargeOnTouch:a=!1}){const{t:s}=xn(),{isMobile:l}=na(),c=a&&l;return E.jsxs(kv,{children:[E.jsx(Mv,{render:E.jsx(_t,{variant:"ghost",size:"icon-sm","data-testid":`agent-session-menu-${e.id}`,"aria-label":s("agent.session.rename"),onClick:f=>f.stopPropagation(),className:Le("size-5 shrink-0 text-muted-foreground transition-opacity data-popup-open:opacity-100",l?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100",c&&"size-9",r)}),children:E.jsx(Y4,{className:Le("size-3.5",c&&"size-5")})}),E.jsxs(Ov,{align:"end",className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:[E.jsxs(Gc,{"data-testid":"agent-session-rename",className:Le("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",l&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>t(e),children:[E.jsx(pp,{className:Le("h-4 w-4",l&&"h-5 w-5")}),s("agent.session.rename")]}),E.jsxs(Gc,{variant:"destructive","data-testid":"agent-session-delete",className:Le("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",l&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>n(e),children:[E.jsx(Xk,{className:Le("h-4 w-4",l&&"h-5 w-5")}),s("agent.session.delete")]})]})]})}function kR({sessions:e,activeSessionId:t,onSelectSession:n,onCreateSession:r,onRenameSession:a,onDeleteSession:s}){const{t:l}=xn(),{isMobile:c}=na();return E.jsxs("div",{className:"mt-1 space-y-0.5 [@media(any-pointer:coarse)]:space-y-1",children:[e==null?void 0:e.map(f=>{const d=f.id===t;return E.jsxs("div",{className:"group relative",children:[E.jsxs("button",{type:"button","data-testid":`agent-session-item-${f.id}`,onClick:()=>n(f),className:Le("w-full flex items-center gap-1.5 px-2 py-1 pr-7 rounded-md text-left transition-colors [@media(any-pointer:coarse)]:min-h-11 [@media(any-pointer:coarse)]:py-2 [@media(any-pointer:coarse)]:pr-12",c&&"min-h-11 py-2 pr-12",d?"bg-primary/10 text-primary":"hover:bg-accent/30 text-muted-foreground"),children:[E.jsx(ex,{className:"size-3 shrink-0 opacity-70"}),E.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px]",children:f.title}),E.jsx(_N,{status:f.status})]}),E.jsx("div",{className:"absolute right-0.5 top-1/2 -translate-y-1/2",children:E.jsx(jN,{session:f,onRenameSession:a,onDeleteSession:s,enlargeOnTouch:!0})})]},f.id)}),E.jsxs("button",{type:"button","data-testid":"agent-session-create-inline",onClick:r,className:"w-full flex items-center gap-1.5 px-2 py-1 rounded-md text-left transition-colors text-muted-foreground/70 hover:text-foreground hover:bg-accent/20",children:[E.jsx(mp,{className:"size-3 shrink-0"}),E.jsx("span",{className:"text-[11px]",children:l("agent.session.new")})]})]})}function uX({sessions:e,activeSessionId:t,onSelectSession:n,onRenameSession:r,onDeleteSession:a}){const{t:s}=xn(),[l,c]=w.useState(!1),f=Ps(d=>{var m;return((m=d.settings)==null?void 0:m.language)??"en_US"});return E.jsxs(Dp,{open:l,onOpenChange:c,className:"rounded-xl border border-border/60 bg-muted/20",children:[E.jsxs(Ip,{"data-testid":"agent-orphan-sessions-trigger",className:"flex w-full items-center gap-2 px-3 py-1.5 text-left",children:[E.jsx(J4,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),E.jsx("span",{className:"flex-1 truncate text-xs font-medium text-muted-foreground",children:s("agent.orphan.title",{count:e.length})}),E.jsx(hp,{className:Le("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform",l&&"rotate-90")})]}),E.jsx(Pp,{className:"space-y-0.5 px-1.5 pb-1.5",children:e.map(d=>{const m=d.id===t,p=[d.originPaneTitle,d.originProcessName,d.createdAt?new Date(d.createdAt).toLocaleString(zk(f)):null].filter(y=>!!y);return E.jsxs("div",{className:"group relative",children:[E.jsxs("button",{type:"button","data-testid":`agent-orphan-session-${d.id}`,onClick:()=>n(d),className:Le("w-full flex flex-col gap-0.5 px-2 py-1.5 pr-7 rounded-lg text-left transition-colors",m?"bg-primary/10 text-primary":"hover:bg-accent/30"),children:[E.jsxs("span",{className:"flex items-center gap-1.5",children:[E.jsx(ex,{className:"size-3 shrink-0 opacity-70"}),E.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px]",children:d.title}),E.jsx(_N,{status:d.status})]}),p.length>0&&E.jsx("span",{className:"truncate pl-[18px] text-[10px] text-muted-foreground",children:p.join(" · ")})]}),E.jsx("div",{className:"absolute right-0.5 top-1.5",children:E.jsx(jN,{session:d,onRenameSession:r,onDeleteSession:a})})]},d.id)})})]})}function cX(){const{t:e}=xn(),{isMobile:t,setOpenMobile:n}=na(),r=Ps(m=>{var p;return(p=m.settings)==null?void 0:p.siteName}),a=Ps(m=>m.fetchSettings);w.useEffect(()=>{a()},[a]);const s=r??"tmex",l=Ia(m=>m.theme),c=Ia(m=>m.setTheme),f=l==="dark",d=()=>{const m=f?"light":"dark";c(m),document.documentElement.classList.toggle("dark",m==="dark")};return E.jsxs("div",{className:"flex items-center gap-2 px-2",children:[t&&E.jsx("button",{type:"button","data-testid":"mobile-sidebar-close",onClick:()=>n(!1),className:"inline-flex h-8 w-8 ml-[-8px] shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent hover:text-foreground","aria-label":e("nav.closeSidebar"),title:e("nav.closeSidebar"),children:E.jsx(Pa,{className:"h-4 w-4"})}),E.jsxs(ip,{to:"/",className:"flex flex-1 items-center gap-3 overflow-hidden",children:[E.jsx("div",{className:"h-8 w-8 shrink-0 overflow-hidden rounded-lg border-2 border-black",children:E.jsx("img",{src:"/logo.png",alt:s,className:"h-full w-full object-cover"})}),E.jsx("span",{className:"truncate text-sm font-semibold tracking-tight",children:s})]}),E.jsx("button",{type:"button",onClick:d,className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent hover:text-foreground","aria-label":e(f?"settings.themeLight":"settings.themeDark"),title:e(f?"settings.themeLight":"settings.themeDark"),children:f?E.jsx(D5,{className:"h-4 w-4"}):E.jsx(s5,{className:"h-4 w-4"})}),E.jsx(ip,{to:"/settings",className:"inline-flex h-8 w-8 mr-[-8px] shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent hover:text-foreground","aria-label":e("sidebar.settings"),title:e("sidebar.settings"),children:E.jsx(R5,{className:"h-4 w-4"})})]})}const lb="rounded-lg data-active:bg-background data-active:text-foreground data-active:border-transparent group-data-[variant=default]/tabs-list:data-active:shadow-none dark:data-active:bg-input/60 dark:data-active:border-transparent text-[13px] transition-colors duration-200 [&_svg:not([class*='size-'])]:size-[15px]",dX=[{title:"nav.manageDevices",url:"/devices",icon:tx}];function fX({...e}){const{t}=xn(),n=Ia(a=>a.sidebarTab),r=Ia(a=>a.setSidebarTab);return E.jsxs(AK,{variant:"inset",...e,children:[E.jsx("div",{className:"h-[var(--tmex-safe-area-top)]"}),E.jsxs(PK,{className:"gap-5 pt-3 pb-0",children:[E.jsx(cX,{}),E.jsx(nG,{className:"mb-2.5",value:n,onValueChange:a=>r(a),children:E.jsxs(iG,{className:"w-full p-1 rounded-xl border border-border/60 group-data-horizontal/tabs:h-11",children:[E.jsxs(ob,{value:"panes","data-testid":"sidebar-tab-panes",className:lb,children:[E.jsx(d5,{}),t("sidebar.tab.panes")]}),E.jsxs(ob,{value:"agent","data-testid":"sidebar-tab-agent",className:lb,children:[E.jsx(ex,{}),t("sidebar.tab.agent")]}),E.jsxs(ob,{value:"files","data-testid":"sidebar-tab-files",className:lb,children:[E.jsx(K4,{}),t("sidebar.tab.files")]})]})})]}),E.jsxs(_K,{className:"flex min-h-0 flex-col overflow-hidden",children:[n==="panes"&&E.jsx(oX,{}),n==="agent"&&E.jsx(zW,{}),n==="files"&&E.jsx(FW,{})]}),n==="panes"&&E.jsxs(LK,{children:[E.jsx(aG,{items:dX}),E.jsx("div",{className:"h-[var(--tmex-safe-area-bottom)]"})]})]})}let MR=!1;function hX(e,t,n){var a,s,l;let r=n;if(!r){const c=(s=(a=Qn.getState().snapshots[e])==null?void 0:a.session)==null?void 0:s.windows;r=(l=c==null?void 0:c.find(f=>f.panes.some(d=>d.id===t)))==null?void 0:l.id}return r?`/devices/${e}/windows/${r}/panes/${LN(t)}`:`/devices/${e}`}function pX(e,t){const n=e.getQueriesData({queryKey:["watch-rules"]});for(const[,r]of n){const a=r==null?void 0:r.find(s=>s.id===t);if(a)return a.name}return null}async function mX(e,t){var r;const n=pX(e,t);if(n)return n;try{const a=await fetch(`/api/watch/rules/${t}`);return a.ok?((r=(await a.json()).rule)==null?void 0:r.name)??null:null}catch{return null}}function gX(e,t,n){if(!(typeof Notification>"u"||Notification.permission!=="granted"))try{const r=new Notification(e,{body:t});r.onclick=()=>{window.focus(),window.location.href=n}}catch{}}function yX(e,t){e.invalidateQueries({queryKey:["watch-rules"]}),e.invalidateQueries({queryKey:["watch-rule-state",t]})}async function bX(e,t,n,r,a){const l=await mX(e,t)??wn.t("watch.toast.triggeredTitle"),c=a.summary||a.matchedText||"",f=c.length>200?`${c.slice(0,200)}…`:c,d=hX(n,r,a.windowId);gn(l,{description:f,action:{label:wn.t("watch.toast.openTerminal"),onClick:()=>{window.location.href=d}}}),gX(l,f,d)}function vX(e){if(MR)return;MR=!0,Hn().onMessage(n=>{if(n.kind!==sz)return;let r;try{r=Ra(f3,n.payload)}catch(s){console.error("[watch] failed to decode WATCH_EVENT:",s);return}let a;try{a=JSON.parse(new TextDecoder().decode(r.payload))}catch(s){console.error("[watch] failed to parse WATCH_EVENT payload:",s);return}switch(yX(e,r.ruleId),r.eventType){case wz:bX(e,r.ruleId,r.deviceId,r.paneId,a);return;case Sz:{const s=a;gn.warning(wn.t("watch.toast.modelUnavailableTitle"),{description:`${s.message} ${wn.t("watch.toast.modelUnavailableHint")}`});return}case Ez:{const s=a;gn.error(wn.t("watch.toast.ruleErrorTitle"),{description:s.message});return}default:return}})}function xX(){const e=lp();return w.useEffect(()=>{vX(e),Hn().connect()},[e]),null}const wX=60,SX=.02;function EX(e){if(Math.abs(e.viewportScale-1)>SX)return 0;const t=Math.round(e.windowInnerHeight-e.viewportHeight-e.viewportOffsetTop);return t>=wX?t:0}function zX(){if(typeof navigator>"u")return!1;const e=navigator.userAgent,t=/iPad|iPhone|iPod/.test(e),n=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;return t||n}function TX(){return typeof window>"u"||typeof navigator>"u"?!1:"ontouchstart"in window||navigator.maxTouchPoints>0}function CX(){const[e,t]=w.useState(0);return w.useEffect(()=>{if(!TX())return;const n=window.visualViewport;if(!n)return;let r=null;const a=()=>{const l=document.activeElement;if(!(l instanceof Element&&l.closest("[data-virtual-keyboard-avoid]")!==null)){t(0);return}t(EX({windowInnerHeight:window.innerHeight,viewportHeight:n.height,viewportOffsetTop:n.offsetTop,viewportScale:n.scale}))},s=()=>{r===null&&(r=window.requestAnimationFrame(()=>{r=null,a()}))};return a(),n.addEventListener("resize",s),n.addEventListener("scroll",s),window.addEventListener("resize",s),document.addEventListener("focusin",s),document.addEventListener("focusout",s),()=>{n.removeEventListener("resize",s),n.removeEventListener("scroll",s),window.removeEventListener("resize",s),document.removeEventListener("focusin",s),document.removeEventListener("focusout",s),r!==null&&window.cancelAnimationFrame(r)}},[]),e}function RX(){var e;try{const t=localStorage.getItem("tmex-ui");if(!t){document.documentElement.classList.add("dark");return}const n=JSON.parse(t),r=(e=n==null?void 0:n.state)==null?void 0:e.theme,a=r==="dark"||r===void 0;document.documentElement.classList.toggle("dark",a)}catch{document.documentElement.classList.add("dark")}}RX();const kX=new wI({defaultOptions:{queries:{staleTime:5e3,retry:1}}});function MX(){const e=CX();return E.jsxs(w4,{children:[E.jsx(xX,{}),E.jsxs(OK,{children:[E.jsx(fX,{}),E.jsxs(IK,{className:"h-dvh overflow-hidden md:h-[calc(100dvh-1rem)]",style:e>0?{transform:`translateY(-${e}px)`,transition:"transform 0.12s ease-out"}:void 0,children:[E.jsx("div",{className:"h-[var(--tmex-safe-area-top)]"}),E.jsx(AL,{}),E.jsx("div",{style:{height:e>0?0:"var(--tmex-safe-area-bottom)",transition:"height 0.12s ease-out"}})]})]})]})}function Oc({moduleLoader:e}){const[t,n]=w.useState(null),r=lL();w.useEffect(()=>{e().then(n)},[e]);const a=t==null?void 0:t.default,s=t==null?void 0:t.PageTitle,l=t==null?void 0:t.PageActions;return E.jsxs(E.Fragment,{children:[E.jsxs("header",{className:"sticky top-0 z-10 flex h-12 md:h-16 shrink-0 items-center justify-between gap-2 bg-background/95 backdrop-blur-sm","data-testid":"mobile-topbar",children:[E.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-4",children:[E.jsx(DK,{className:"-ml-1 shrink-0","data-testid":"mobile-sidebar-open"}),E.jsx(VW,{orientation:"vertical",className:"mr-2 shrink-0 data-[orientation=vertical]:h-4"}),E.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:s?E.jsx(s,{...r}):""})]}),E.jsx("div",{className:"flex shrink-0 items-center gap-1 px-4",children:l&&E.jsx(l,{...r})})]}),E.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-4 !pt-0 p-2 md:p-4",children:E.jsx("div",{className:"bg-muted/50 min-h-0 flex-1 overflow-auto overscroll-auto rounded-xl [-webkit-overflow-scrolling:touch]",children:a?E.jsx(a,{}):null})})]})}const OX=()=>Nv(()=>import("./SettingsPage-D-ttUVSw.js"),__vite__mapDeps([0,1,2])),OR=()=>Nv(()=>import("./DevicesPage-JZ_FB4Hs.js"),__vite__mapDeps([3,1])),AR=()=>Nv(()=>import("./DevicePage-BXgCF7q_.js"),__vite__mapDeps([4,2])),AX=t_([{path:"/",Component:MX,children:[{index:!0,element:E.jsx(Oc,{moduleLoader:OR})},{path:"devices",element:E.jsx(Oc,{moduleLoader:OR})},{path:"devices/:deviceId",element:E.jsx(Oc,{moduleLoader:AR})},{path:"devices/:deviceId/windows/:windowId/panes/:paneId",element:E.jsx(Oc,{moduleLoader:AR})},{path:"settings",element:E.jsx(Oc,{moduleLoader:OX})}]}]),zN=document.getElementById("root");if(!zN)throw new Error("Root element not found");BI.createRoot(zN).render(E.jsx(w.StrictMode,{children:E.jsxs(EI,{client:kX,children:[E.jsx(kL,{router:AX}),E.jsx(B_,{richColors:!0,position:"top-right",closeButton:!0,offset:{top:"calc(16px + var(--tmex-safe-area-top))",right:"16px",bottom:"16px",left:"16px"},mobileOffset:{top:"calc(12px + var(--tmex-safe-area-top))",right:"12px",bottom:"12px",left:"12px"},toastOptions:{duration:6e3}})]})}));export{sG as $,mv as A,_t as B,Po as C,Ev as D,Ps as E,Ia as F,IX as G,zk as H,ki as I,wn as J,RT as K,iu as L,Qn as M,tx as N,vR as O,mp as P,Gk as Q,kv as R,Oh as S,Xk as T,Mv as U,Y4 as V,Ov as W,Pa as X,Gc as Y,Qk as Z,_X as _,lp as a,VW as a0,Qv as a1,fB as a2,dx as a3,Le as a4,U3 as a5,H3 as a6,nd as a7,PX as a8,lL as a9,Yv as aa,jX as ab,zX as ac,PB as ad,LN as ae,LX as af,t5 as ag,v5 as ah,rX as ai,QG as aj,XG as ak,Ph as b,Dt as c,Tv as d,Cv as e,Rv as f,EN as g,Ah as h,nb as i,E as j,Nh as k,Ca as l,xR as m,Bh as n,Fs as o,pp as p,gv as q,w as r,yv as s,gn as t,xn as u,vv as v,xv as w,bv as x,Sv as y,wv as z};
386
+ //# sourceMappingURL=index-DPqBlAbb.js.map