tmex-cli 0.15.2 → 0.16.1
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.
- package/CHANGELOG.md +64 -8
- package/dist/runtime/server.js +891 -165
- package/package.json +1 -1
- package/resources/fe-dist/assets/DevicePage-Ccz8gNji.js +24 -0
- package/resources/fe-dist/assets/{DevicesPage-DVAiqqAb.js → DevicesPage-sJHXbS_f.js} +1 -1
- package/resources/fe-dist/assets/{FilePage-DzKIB_pN.js → FilePage-7FFd1YcW.js} +1 -1
- package/resources/fe-dist/assets/{SettingsPage-BTLab-Z3.js → SettingsPage-FrEtqZyI.js} +1 -1
- package/resources/fe-dist/assets/{agent-tab-DRxXq67W.js → agent-tab-9THUj7Cf.js} +4 -4
- package/resources/fe-dist/assets/{api-B_pG5Lrn.js → api-DV7-9Pvt.js} +1 -1
- package/resources/fe-dist/assets/{arc-Bct5uFHQ.js → arc-PDHKfnGP.js} +1 -1
- package/resources/fe-dist/assets/{architectureDiagram-3BPJPVTR-BRDZ_iL7.js → architectureDiagram-3BPJPVTR-BiPHTh1e.js} +1 -1
- package/resources/fe-dist/assets/{blockDiagram-GPEHLZMM-COe9KyYv.js → blockDiagram-GPEHLZMM-DP_BRHKg.js} +1 -1
- package/resources/fe-dist/assets/{c4Diagram-AAUBKEIU-DtQTgbwo.js → c4Diagram-AAUBKEIU-D16QYgyT.js} +1 -1
- package/resources/fe-dist/assets/{card-DAJtOO99.js → card-DmfNw0hd.js} +1 -1
- package/resources/fe-dist/assets/channel-Dzz9b4fW.js +1 -0
- package/resources/fe-dist/assets/{chunk-2J33WTMH-D4_zLlF4.js → chunk-2J33WTMH-DOjtL7ww.js} +1 -1
- package/resources/fe-dist/assets/{chunk-4BX2VUAB-C3M9MnUk.js → chunk-4BX2VUAB-BbT67ZXa.js} +1 -1
- package/resources/fe-dist/assets/{chunk-55IACEB6-D5BgUYDW.js → chunk-55IACEB6-CnnXwmY_.js} +1 -1
- package/resources/fe-dist/assets/{chunk-727SXJPM-C03K3kUu.js → chunk-727SXJPM-TyUdLEW5.js} +1 -1
- package/resources/fe-dist/assets/{chunk-AQP2D5EJ-DLv4_X-p.js → chunk-AQP2D5EJ-BMpK4dqa.js} +1 -1
- package/resources/fe-dist/assets/{chunk-FMBD7UC4-CXm-3D35.js → chunk-FMBD7UC4-Dx0HVCZZ.js} +1 -1
- package/resources/fe-dist/assets/{chunk-ND2GUHAM-DH_J0yjP.js → chunk-ND2GUHAM-BQCoMEti.js} +1 -1
- package/resources/fe-dist/assets/{chunk-QZHKN3VN-D5HtoYCj.js → chunk-QZHKN3VN-ilmf5OgK.js} +1 -1
- package/resources/fe-dist/assets/classDiagram-4FO5ZUOK-BB9_4XLL.js +1 -0
- package/resources/fe-dist/assets/classDiagram-v2-Q7XG4LA2-BB9_4XLL.js +1 -0
- package/resources/fe-dist/assets/{copy-BfLwocwm.js → copy-Ct5TNzGp.js} +1 -1
- package/resources/fe-dist/assets/{cose-bilkent-S5V4N54A-be9ShD_r.js → cose-bilkent-S5V4N54A-CpWhM7Za.js} +1 -1
- package/resources/fe-dist/assets/{dagre-BM42HDAG-CC-KfeHH.js → dagre-BM42HDAG-CWJttTzC.js} +1 -1
- package/resources/fe-dist/assets/{diagram-2AECGRRQ-BwKHXV4n.js → diagram-2AECGRRQ-BD8ny_Yg.js} +1 -1
- package/resources/fe-dist/assets/{diagram-5GNKFQAL-Bqwpz1fr.js → diagram-5GNKFQAL-CeHcPWRz.js} +1 -1
- package/resources/fe-dist/assets/{diagram-KO2AKTUF-CeMGb0yy.js → diagram-KO2AKTUF-tVlrBE8C.js} +1 -1
- package/resources/fe-dist/assets/{diagram-LMA3HP47-Bsi1wTvw.js → diagram-LMA3HP47-DGUn-oQn.js} +1 -1
- package/resources/fe-dist/assets/{diagram-OG6HWLK6-B4t3XGFO.js → diagram-OG6HWLK6-xKCd1kwA.js} +1 -1
- package/resources/fe-dist/assets/{en_US-Cf2EOKiI.js → en_US-CjVU4anP.js} +1 -1
- package/resources/fe-dist/assets/{erDiagram-TEJ5UH35-3Mvka2ky.js → erDiagram-TEJ5UH35-C6M5qkGl.js} +1 -1
- package/resources/fe-dist/assets/{files-tab-CozXv_f8.js → files-tab-BWkYfaye.js} +5 -5
- package/resources/fe-dist/assets/{flowDiagram-I6XJVG4X-DkGA4Ke1.js → flowDiagram-I6XJVG4X-D0MZDHnB.js} +1 -1
- package/resources/fe-dist/assets/{ganttDiagram-6RSMTGT7-3vhFpRP7.js → ganttDiagram-6RSMTGT7-YeduSSa_.js} +1 -1
- package/resources/fe-dist/assets/{gitGraphDiagram-PVQCEYII-CQV7XGpo.js → gitGraphDiagram-PVQCEYII-Nem1Mvvg.js} +1 -1
- package/resources/fe-dist/assets/index-B3ddLSja.js +314 -0
- package/resources/fe-dist/assets/index-CuFTSN9i.css +1 -0
- package/resources/fe-dist/assets/{index-CxrkvaQh.js → index-iee3U_rD.js} +1 -1
- package/resources/fe-dist/assets/{infoDiagram-5YYISTIA-Do4YMzZB.js → infoDiagram-5YYISTIA-Bh6bbh_V.js} +1 -1
- package/resources/fe-dist/assets/{ishikawaDiagram-YF4QCWOH-D0s__l6a.js → ishikawaDiagram-YF4QCWOH-CsZHu48j.js} +1 -1
- package/resources/fe-dist/assets/{ja_JP-s3e_OwvM.js → ja_JP-Bq-BwOH_.js} +1 -1
- package/resources/fe-dist/assets/{journeyDiagram-JHISSGLW-DZWnugOc.js → journeyDiagram-JHISSGLW-CPgnovXt.js} +1 -1
- package/resources/fe-dist/assets/{kanban-definition-UN3LZRKU-BgRtdsFS.js → kanban-definition-UN3LZRKU-D4OAuDsS.js} +1 -1
- package/resources/fe-dist/assets/{linear-yx1vNDZX.js → linear-CcA4wV7f.js} +1 -1
- package/resources/fe-dist/assets/{markdown-preview-BE4zuZfN.js → markdown-preview-CBGlxpTs.js} +3 -3
- package/resources/fe-dist/assets/{mermaid.core-DE3GlZm2.js → mermaid.core-D-CshtYr.js} +5 -5
- package/resources/fe-dist/assets/{mindmap-definition-RKZ34NQL-25O7ch2Y.js → mindmap-definition-RKZ34NQL-DBpI1nMC.js} +1 -1
- package/resources/fe-dist/assets/{pieDiagram-4H26LBE5-Nsg0nJjf.js → pieDiagram-4H26LBE5-D4kh0_Y0.js} +1 -1
- package/resources/fe-dist/assets/{quadrantDiagram-W4KKPZXB-vf_qGk-r.js → quadrantDiagram-W4KKPZXB-DNw3oGHQ.js} +1 -1
- package/resources/fe-dist/assets/{requirementDiagram-4Y6WPE33-BFfrHVO7.js → requirementDiagram-4Y6WPE33-DqtMaND0.js} +1 -1
- package/resources/fe-dist/assets/{sankeyDiagram-5OEKKPKP-Ce_HayCK.js → sankeyDiagram-5OEKKPKP-D-m9Pyie.js} +1 -1
- package/resources/fe-dist/assets/{selection-clipboard-Dq6Zemfd.js → selection-clipboard-D3gUQQ7L.js} +1 -1
- package/resources/fe-dist/assets/{send-CKtMOmLP.js → send-DaOB9hLq.js} +1 -1
- package/resources/fe-dist/assets/{sequenceDiagram-3UESZ5HK-C2vovJ8X.js → sequenceDiagram-3UESZ5HK-CjrimNJf.js} +1 -1
- package/resources/fe-dist/assets/{stateDiagram-AJRCARHV-CLu4laAA.js → stateDiagram-AJRCARHV-BT5d8Z8W.js} +1 -1
- package/resources/fe-dist/assets/stateDiagram-v2-BHNVJYJU-kSh9IuUW.js +1 -0
- package/resources/fe-dist/assets/terminal-settings-panel-DDhlnbRH.js +25 -0
- package/resources/fe-dist/assets/{timeline-definition-PNZ67QCA-DkWMKmAT.js → timeline-definition-PNZ67QCA-BeocAFDX.js} +1 -1
- package/resources/fe-dist/assets/{transfer-toast-CHZr1a7O.js → transfer-toast-DXl4RHsV.js} +1 -1
- package/resources/fe-dist/assets/{triangle-alert-03d4TB5d.js → triangle-alert-FQRTtbTP.js} +1 -1
- package/resources/fe-dist/assets/{vennDiagram-CIIHVFJN-BBlcBoH2.js → vennDiagram-CIIHVFJN-CYlmUB5_.js} +1 -1
- package/resources/fe-dist/assets/{wardley-L42UT6IY-BnzmzjjA.js → wardley-L42UT6IY-CTyaodt9.js} +1 -1
- package/resources/fe-dist/assets/{wardleyDiagram-YWT4CUSO-B3u1V3qc.js → wardleyDiagram-YWT4CUSO-DNlEcEwQ.js} +1 -1
- package/resources/fe-dist/assets/{xychartDiagram-2RQKCTM6-BTm5HZXX.js → xychartDiagram-2RQKCTM6-7Zi-6P-I.js} +1 -1
- package/resources/fe-dist/assets/{zap-CBeeCQFr.js → zap-BFIAXPXd.js} +1 -1
- package/resources/fe-dist/assets/{zh_CN-6UyMkvZM.js → zh_CN-BuxyXhCT.js} +1 -1
- package/resources/fe-dist/index.html +2 -2
- package/resources/fe-dist/assets/DevicePage-BvwXdfhK.js +0 -19
- package/resources/fe-dist/assets/channel-CIG-CxyN.js +0 -1
- package/resources/fe-dist/assets/classDiagram-4FO5ZUOK-CNRZMNkk.js +0 -1
- package/resources/fe-dist/assets/classDiagram-v2-Q7XG4LA2-CNRZMNkk.js +0 -1
- package/resources/fe-dist/assets/index-CEPc0i5O.js +0 -304
- package/resources/fe-dist/assets/index-CHeveVji.css +0 -1
- package/resources/fe-dist/assets/stateDiagram-v2-BHNVJYJU-CIfUS4rj.js +0 -1
- package/resources/fe-dist/assets/terminal-settings-panel-DAWL48fe.js +0 -25
|
@@ -1,304 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agent-tab-DRxXq67W.js","assets/index-CxrkvaQh.js","assets/send-CKtMOmLP.js","assets/zap-CBeeCQFr.js","assets/files-tab-CozXv_f8.js","assets/selection-clipboard-Dq6Zemfd.js","assets/api-B_pG5Lrn.js","assets/transfer-toast-CHZr1a7O.js","assets/copy-BfLwocwm.js","assets/triangle-alert-03d4TB5d.js","assets/SettingsPage-BTLab-Z3.js","assets/card-DAJtOO99.js","assets/terminal-settings-panel-DAWL48fe.js","assets/markdown-preview-BE4zuZfN.js","assets/markdown-preview-Bf_6UH9R.css","assets/DevicesPage-DVAiqqAb.js","assets/DevicePage-BvwXdfhK.js","assets/FilePage-DzKIB_pN.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var QA=Object.defineProperty;var ZS=e=>{throw TypeError(e)};var ZA=(e,t,n)=>t in e?QA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var We=(e,t,n)=>ZA(e,typeof t!="symbol"?t+"":t,n),xg=(e,t,n)=>t.has(e)||ZS("Cannot "+n);var te=(e,t,n)=>(xg(e,t,"read from private field"),n?n.call(e):t.get(e)),ut=(e,t,n)=>t.has(e)?ZS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ge=(e,t,n,a)=>(xg(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n),_t=(e,t,n)=>(xg(e,t,"access private method"),n);var Rf=(e,t,n,a)=>({set _(i){Ge(e,t,i,n)},get _(){return te(e,t,a)}});function JA(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const i in a)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(a,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>a[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))a(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();const eD="modulepreload",tD=function(e){return"/"+e},JS={},So=function(t,n,a){let i=Promise.resolve();if(n&&n.length>0){let c=function(f){return Promise.all(f.map(g=>Promise.resolve(g).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),h=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));i=c(n.map(f=>{if(f=tD(f),f in JS)return;JS[f]=!0;const g=f.endsWith(".css"),m=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${m}`))return;const b=document.createElement("link");if(b.rel=g?"stylesheet":eD,g||(b.as="script"),b.crossOrigin="",b.href=f,h&&b.setAttribute("nonce",h),document.head.appendChild(b),g)return new Promise((x,w)=>{b.addEventListener("load",x),b.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${f}`)))})}))}function s(c){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=c,window.dispatchEvent(d),!d.defaultPrevented)throw c}return i.then(c=>{for(const d of c||[])d.status==="rejected"&&s(d.reason);return t().catch(s)})};function mT(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wg={exports:{}},Xc={};/**
|
|
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 eE;function nD(){if(eE)return Xc;eE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,i,s){var c=null;if(s!==void 0&&(c=""+s),i.key!==void 0&&(c=""+i.key),"key"in i){s={};for(var d in i)d!=="key"&&(s[d]=i[d])}else s=i;return i=s.ref,{$$typeof:e,type:a,key:c,ref:i!==void 0?i:null,props:s}}return Xc.Fragment=t,Xc.jsx=n,Xc.jsxs=n,Xc}var tE;function rD(){return tE||(tE=1,wg.exports=nD()),wg.exports}var R=rD(),Gl=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(){}},aD={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ai,jv,rT,oD=(rT=class{constructor(){ut(this,ai,aD);ut(this,jv,!1)}setTimeoutProvider(e){Ge(this,ai,e)}setTimeout(e,t){return te(this,ai).setTimeout(e,t)}clearTimeout(e){te(this,ai).clearTimeout(e)}setInterval(e,t){return te(this,ai).setInterval(e,t)}clearInterval(e){te(this,ai).clearInterval(e)}},ai=new WeakMap,jv=new WeakMap,rT),ts=new oD;function iD(e){setTimeout(e,0)}var gs=typeof window>"u"||"Deno"in globalThis;function mr(){}function sD(e,t){return typeof e=="function"?e(t):e}function Sy(e){return typeof e=="number"&&e>=0&&e!==1/0}function pT(e,t){return Math.max(e+(t||0)-Date.now(),0)}function yi(e,t){return typeof e=="function"?e(t):e}function ra(e,t){return typeof e=="function"?e(t):e}function nE(e,t){const{type:n="all",exact:a,fetchStatus:i,predicate:s,queryKey:c,stale:d}=e;if(c){if(a){if(t.queryHash!==Lv(c,t.options))return!1}else if(!Tu(t.queryKey,c))return!1}if(n!=="all"){const h=t.isActive();if(n==="active"&&!h||n==="inactive"&&h)return!1}return!(typeof d=="boolean"&&t.isStale()!==d||i&&i!==t.state.fetchStatus||s&&!s(t))}function rE(e,t){const{exact:n,status:a,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(ys(t.options.mutationKey)!==ys(s))return!1}else if(!Tu(t.options.mutationKey,s))return!1}return!(a&&t.state.status!==a||i&&!i(t))}function Lv(e,t){return((t==null?void 0:t.queryKeyHashFn)||ys)(e)}function ys(e){return JSON.stringify(e,(t,n)=>Ey(n)?Object.keys(n).sort().reduce((a,i)=>(a[i]=n[i],a),{}):n)}function Tu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Tu(e[n],t[n])):!1}var lD=Object.prototype.hasOwnProperty;function gT(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=aE(e)&&aE(t);if(!a&&!(Ey(e)&&Ey(t)))return t;const s=(a?e:Object.keys(e)).length,c=a?t:Object.keys(t),d=c.length,h=a?new Array(d):{};let f=0;for(let g=0;g<d;g++){const m=a?g:c[g],b=e[m],x=t[m];if(b===x){h[m]=b,(a?g<s:lD.call(e,m))&&f++;continue}if(b===null||x===null||typeof b!="object"||typeof x!="object"){h[m]=x;continue}const w=gT(b,x,n+1);h[m]=w,w===b&&f++}return s===d&&f===s?e:h}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 aE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ey(e){if(!oE(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!oE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function oE(e){return Object.prototype.toString.call(e)==="[object Object]"}function cD(e){return new Promise(t=>{ts.setTimeout(t,e)})}function Ry(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?gT(e,t):t}function uD(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function dD(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var _v=Symbol();function yT(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===_v?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Iv(e,t){return typeof e=="function"?e(...t):!!e}function fD(e,t,n){let a=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),a||(a=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var os,oi,Tl,aT,hD=(aT=class extends Gl{constructor(){super();ut(this,os);ut(this,oi);ut(this,Tl);Ge(this,Tl,t=>{if(!gs&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){te(this,oi)||this.setEventListener(te(this,Tl))}onUnsubscribe(){var t;this.hasListeners()||((t=te(this,oi))==null||t.call(this),Ge(this,oi,void 0))}setEventListener(t){var n;Ge(this,Tl,t),(n=te(this,oi))==null||n.call(this),Ge(this,oi,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){te(this,os)!==t&&(Ge(this,os,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof te(this,os)=="boolean"?te(this,os):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},os=new WeakMap,oi=new WeakMap,Tl=new WeakMap,aT),zv=new hD;function Ty(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function a(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{a({status:"fulfilled",value:i}),e(i)},n.reject=i=>{a({status:"rejected",reason:i}),t(i)},n}var mD=iD;function pD(){let e=[],t=0,n=d=>{d()},a=d=>{d()},i=mD;const s=d=>{t?e.push(d):i(()=>{n(d)})},c=()=>{const d=e;e=[],d.length&&i(()=>{a(()=>{d.forEach(h=>{n(h)})})})};return{batch:d=>{let h;t++;try{h=d()}finally{t--,t||c()}return h},batchCalls:d=>(...h)=>{s(()=>{d(...h)})},schedule:s,setNotifyFunction:d=>{n=d},setBatchNotifyFunction:d=>{a=d},setScheduler:d=>{i=d}}}var qn=pD(),Cl,ii,Ol,oT,gD=(oT=class extends Gl{constructor(){super();ut(this,Cl,!0);ut(this,ii);ut(this,Ol);Ge(this,Ol,t=>{if(!gs&&window.addEventListener){const n=()=>t(!0),a=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",a)}}})}onSubscribe(){te(this,ii)||this.setEventListener(te(this,Ol))}onUnsubscribe(){var t;this.hasListeners()||((t=te(this,ii))==null||t.call(this),Ge(this,ii,void 0))}setEventListener(t){var n;Ge(this,Ol,t),(n=te(this,ii))==null||n.call(this),Ge(this,ii,t(this.setOnline.bind(this)))}setOnline(t){te(this,Cl)!==t&&(Ge(this,Cl,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return te(this,Cl)}},Cl=new WeakMap,ii=new WeakMap,Ol=new WeakMap,oT),fh=new gD;function yD(e){return Math.min(1e3*2**e,3e4)}function vT(e){return(e??"online")==="online"?fh.isOnline():!0}var Cy=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function bT(e){let t=!1,n=0,a;const i=Ty(),s=()=>i.status!=="pending",c=S=>{var E;if(!s()){const T=new Cy(S);b(T),(E=e.onCancel)==null||E.call(e,T)}},d=()=>{t=!0},h=()=>{t=!1},f=()=>zv.isFocused()&&(e.networkMode==="always"||fh.isOnline())&&e.canRun(),g=()=>vT(e.networkMode)&&e.canRun(),m=S=>{s()||(a==null||a(),i.resolve(S))},b=S=>{s()||(a==null||a(),i.reject(S))},x=()=>new Promise(S=>{var E;a=T=>{(s()||f())&&S(T)},(E=e.onPause)==null||E.call(e)}).then(()=>{var S;a=void 0,s()||(S=e.onContinue)==null||S.call(e)}),w=()=>{if(s())return;let S;const E=n===0?e.initialPromise:void 0;try{S=E??e.fn()}catch(T){S=Promise.reject(T)}Promise.resolve(S).then(m).catch(T=>{var k;if(s())return;const C=e.retry??(gs?0:3),M=e.retryDelay??yD,O=typeof M=="function"?M(n,T):M,D=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,T);if(t||!D){b(T);return}n++,(k=e.onFail)==null||k.call(e,n,T),cD(O).then(()=>f()?void 0:x()).then(()=>{t?b(T):w()})})};return{promise:i,status:()=>i.status,cancel:c,continue:()=>(a==null||a(),i),cancelRetry:d,continueRetry:h,canStart:g,start:()=>(g()?w():x().then(w),i)}}var is,iT,xT=(iT=class{constructor(){ut(this,is)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Sy(this.gcTime)&&Ge(this,is,ts.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(gs?1/0:300*1e3))}clearGcTimeout(){te(this,is)&&(ts.clearTimeout(te(this,is)),Ge(this,is,void 0))}},is=new WeakMap,iT),ss,Ml,ta,ls,Wn,Hu,cs,va,ho,sT,vD=(sT=class extends xT{constructor(t){super();ut(this,va);ut(this,ss);ut(this,Ml);ut(this,ta);ut(this,ls);ut(this,Wn);ut(this,Hu);ut(this,cs);Ge(this,cs,!1),Ge(this,Hu,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ge(this,ls,t.client),Ge(this,ta,te(this,ls).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ge(this,ss,sE(this.options)),this.state=t.state??te(this,ss),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=te(this,Wn))==null?void 0:t.promise}setOptions(t){if(this.options={...te(this,Hu),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=sE(this.options);n.data!==void 0&&(this.setState(iE(n.data,n.dataUpdatedAt)),Ge(this,ss,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&te(this,ta).remove(this)}setData(t,n){const a=Ry(this.state.data,t,this.options);return _t(this,va,ho).call(this,{data:a,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),a}setState(t,n){_t(this,va,ho).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var a,i;const n=(a=te(this,Wn))==null?void 0:a.promise;return(i=te(this,Wn))==null||i.cancel(t),n?n.then(mr).catch(mr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(te(this,ss))}isActive(){return this.observers.some(t=>ra(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===_v||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>yi(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:!pT(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=te(this,Wn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=te(this,Wn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),te(this,ta).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(te(this,Wn)&&(te(this,cs)?te(this,Wn).cancel({revert:!0}):te(this,Wn).cancelRetry()),this.scheduleGc()),te(this,ta).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||_t(this,va,ho).call(this,{type:"invalidate"})}async fetch(t,n){var h,f,g,m,b,x,w,S,E,T,C,M;if(this.state.fetchStatus!=="idle"&&((h=te(this,Wn))==null?void 0:h.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(te(this,Wn))return te(this,Wn).continueRetry(),te(this,Wn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const O=this.observers.find(D=>D.options.queryFn);O&&this.setOptions(O.options)}const a=new AbortController,i=O=>{Object.defineProperty(O,"signal",{enumerable:!0,get:()=>(Ge(this,cs,!0),a.signal)})},s=()=>{const O=yT(this.options,n),k=(()=>{const A={client:te(this,ls),queryKey:this.queryKey,meta:this.meta};return i(A),A})();return Ge(this,cs,!1),this.options.persister?this.options.persister(O,k,this):O(k)},d=(()=>{const O={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:te(this,ls),state:this.state,fetchFn:s};return i(O),O})();(f=this.options.behavior)==null||f.onFetch(d,this),Ge(this,Ml,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=d.fetchOptions)==null?void 0:g.meta))&&_t(this,va,ho).call(this,{type:"fetch",meta:(m=d.fetchOptions)==null?void 0:m.meta}),Ge(this,Wn,bT({initialPromise:n==null?void 0:n.initialPromise,fn:d.fetchFn,onCancel:O=>{O instanceof Cy&&O.revert&&this.setState({...te(this,Ml),fetchStatus:"idle"}),a.abort()},onFail:(O,D)=>{_t(this,va,ho).call(this,{type:"failed",failureCount:O,error:D})},onPause:()=>{_t(this,va,ho).call(this,{type:"pause"})},onContinue:()=>{_t(this,va,ho).call(this,{type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0}));try{const O=await te(this,Wn).start();if(O===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(O),(x=(b=te(this,ta).config).onSuccess)==null||x.call(b,O,this),(S=(w=te(this,ta).config).onSettled)==null||S.call(w,O,this.state.error,this),O}catch(O){if(O instanceof Cy){if(O.silent)return te(this,Wn).promise;if(O.revert){if(this.state.data===void 0)throw O;return this.state.data}}throw _t(this,va,ho).call(this,{type:"error",error:O}),(T=(E=te(this,ta).config).onError)==null||T.call(E,O,this),(M=(C=te(this,ta).config).onSettled)==null||M.call(C,this.state.data,O,this),O}finally{this.scheduleGc()}}},ss=new WeakMap,Ml=new WeakMap,ta=new WeakMap,ls=new WeakMap,Wn=new WeakMap,Hu=new WeakMap,cs=new WeakMap,va=new WeakSet,ho=function(t){const n=a=>{switch(t.type){case"failed":return{...a,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...wT(a.data,this.options),fetchMeta:t.meta??null};case"success":const i={...a,...iE(t.data,t.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ge(this,Ml,t.manual?i:void 0),i;case"error":const s=t.error;return{...a,error:s,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...t.state}}};this.state=n(this.state),qn.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),te(this,ta).notify({query:this,type:"updated",action:t})})},sT);function wT(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:vT(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function iE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function sE(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,a=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Rr,Wt,Bu,hr,us,Nl,go,si,Fu,Al,Dl,ds,fs,li,kl,on,su,Oy,My,Ny,Ay,Dy,ky,jy,ST,lT,bD=(lT=class extends Gl{constructor(t,n){super();ut(this,on);ut(this,Rr);ut(this,Wt);ut(this,Bu);ut(this,hr);ut(this,us);ut(this,Nl);ut(this,go);ut(this,si);ut(this,Fu);ut(this,Al);ut(this,Dl);ut(this,ds);ut(this,fs);ut(this,li);ut(this,kl,new Set);this.options=n,Ge(this,Rr,t),Ge(this,si,null),Ge(this,go,Ty()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(te(this,Wt).addObserver(this),lE(te(this,Wt),this.options)?_t(this,on,su).call(this):this.updateResult(),_t(this,on,Ay).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ly(te(this,Wt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ly(te(this,Wt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,_t(this,on,Dy).call(this),_t(this,on,ky).call(this),te(this,Wt).removeObserver(this)}setOptions(t){const n=this.options,a=te(this,Wt);if(this.options=te(this,Rr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ra(this.options.enabled,te(this,Wt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");_t(this,on,jy).call(this),te(this,Wt).setOptions(this.options),n._defaulted&&!dh(this.options,n)&&te(this,Rr).getQueryCache().notify({type:"observerOptionsUpdated",query:te(this,Wt),observer:this});const i=this.hasListeners();i&&cE(te(this,Wt),a,this.options,n)&&_t(this,on,su).call(this),this.updateResult(),i&&(te(this,Wt)!==a||ra(this.options.enabled,te(this,Wt))!==ra(n.enabled,te(this,Wt))||yi(this.options.staleTime,te(this,Wt))!==yi(n.staleTime,te(this,Wt)))&&_t(this,on,Oy).call(this);const s=_t(this,on,My).call(this);i&&(te(this,Wt)!==a||ra(this.options.enabled,te(this,Wt))!==ra(n.enabled,te(this,Wt))||s!==te(this,li))&&_t(this,on,Ny).call(this,s)}getOptimisticResult(t){const n=te(this,Rr).getQueryCache().build(te(this,Rr),t),a=this.createResult(n,t);return wD(this,a)&&(Ge(this,hr,a),Ge(this,Nl,this.options),Ge(this,us,te(this,Wt).state)),a}getCurrentResult(){return te(this,hr)}trackResult(t,n){return new Proxy(t,{get:(a,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&te(this,go).status==="pending"&&te(this,go).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,i))})}trackProp(t){te(this,kl).add(t)}getCurrentQuery(){return te(this,Wt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=te(this,Rr).defaultQueryOptions(t),a=te(this,Rr).getQueryCache().build(te(this,Rr),n);return a.fetch().then(()=>this.createResult(a,n))}fetch(t){return _t(this,on,su).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),te(this,hr)))}createResult(t,n){var B;const a=te(this,Wt),i=this.options,s=te(this,hr),c=te(this,us),d=te(this,Nl),f=t!==a?t.state:te(this,Bu),{state:g}=t;let m={...g},b=!1,x;if(n._optimisticResults){const G=this.hasListeners(),K=!G&&lE(t,n),I=G&&cE(t,a,n,i);(K||I)&&(m={...m,...wT(g.data,t.options)}),n._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:w,errorUpdatedAt:S,status:E}=m;x=m.data;let T=!1;if(n.placeholderData!==void 0&&x===void 0&&E==="pending"){let G;s!=null&&s.isPlaceholderData&&n.placeholderData===(d==null?void 0:d.placeholderData)?(G=s.data,T=!0):G=typeof n.placeholderData=="function"?n.placeholderData((B=te(this,Dl))==null?void 0:B.state.data,te(this,Dl)):n.placeholderData,G!==void 0&&(E="success",x=Ry(s==null?void 0:s.data,G,n),b=!0)}if(n.select&&x!==void 0&&!T)if(s&&x===(c==null?void 0:c.data)&&n.select===te(this,Fu))x=te(this,Al);else try{Ge(this,Fu,n.select),x=n.select(x),x=Ry(s==null?void 0:s.data,x,n),Ge(this,Al,x),Ge(this,si,null)}catch(G){Ge(this,si,G)}te(this,si)&&(w=te(this,si),x=te(this,Al),S=Date.now(),E="error");const C=m.fetchStatus==="fetching",M=E==="pending",O=E==="error",D=M&&C,k=x!==void 0,j={status:E,fetchStatus:m.fetchStatus,isPending:M,isSuccess:E==="success",isError:O,isInitialLoading:D,isLoading:D,data:x,dataUpdatedAt:m.dataUpdatedAt,error:w,errorUpdatedAt:S,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>f.dataUpdateCount||m.errorUpdateCount>f.errorUpdateCount,isFetching:C,isRefetching:C&&!M,isLoadingError:O&&!k,isPaused:m.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:O&&k,isStale:Pv(t,n),refetch:this.refetch,promise:te(this,go),isEnabled:ra(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const G=j.data!==void 0,K=j.status==="error"&&!G,I=Y=>{K?Y.reject(j.error):G&&Y.resolve(j.data)},H=()=>{const Y=Ge(this,go,j.promise=Ty());I(Y)},F=te(this,go);switch(F.status){case"pending":t.queryHash===a.queryHash&&I(F);break;case"fulfilled":(K||j.data!==F.value)&&H();break;case"rejected":(!K||j.error!==F.reason)&&H();break}}return j}updateResult(){const t=te(this,hr),n=this.createResult(te(this,Wt),this.options);if(Ge(this,us,te(this,Wt).state),Ge(this,Nl,this.options),te(this,us).data!==void 0&&Ge(this,Dl,te(this,Wt)),dh(n,t))return;Ge(this,hr,n);const a=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!te(this,kl).size)return!0;const c=new Set(s??te(this,kl));return this.options.throwOnError&&c.add("error"),Object.keys(te(this,hr)).some(d=>{const h=d;return te(this,hr)[h]!==t[h]&&c.has(h)})};_t(this,on,ST).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&_t(this,on,Ay).call(this)}},Rr=new WeakMap,Wt=new WeakMap,Bu=new WeakMap,hr=new WeakMap,us=new WeakMap,Nl=new WeakMap,go=new WeakMap,si=new WeakMap,Fu=new WeakMap,Al=new WeakMap,Dl=new WeakMap,ds=new WeakMap,fs=new WeakMap,li=new WeakMap,kl=new WeakMap,on=new WeakSet,su=function(t){_t(this,on,jy).call(this);let n=te(this,Wt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(mr)),n},Oy=function(){_t(this,on,Dy).call(this);const t=yi(this.options.staleTime,te(this,Wt));if(gs||te(this,hr).isStale||!Sy(t))return;const a=pT(te(this,hr).dataUpdatedAt,t)+1;Ge(this,ds,ts.setTimeout(()=>{te(this,hr).isStale||this.updateResult()},a))},My=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(te(this,Wt)):this.options.refetchInterval)??!1},Ny=function(t){_t(this,on,ky).call(this),Ge(this,li,t),!(gs||ra(this.options.enabled,te(this,Wt))===!1||!Sy(te(this,li))||te(this,li)===0)&&Ge(this,fs,ts.setInterval(()=>{(this.options.refetchIntervalInBackground||zv.isFocused())&&_t(this,on,su).call(this)},te(this,li)))},Ay=function(){_t(this,on,Oy).call(this),_t(this,on,Ny).call(this,_t(this,on,My).call(this))},Dy=function(){te(this,ds)&&(ts.clearTimeout(te(this,ds)),Ge(this,ds,void 0))},ky=function(){te(this,fs)&&(ts.clearInterval(te(this,fs)),Ge(this,fs,void 0))},jy=function(){const t=te(this,Rr).getQueryCache().build(te(this,Rr),this.options);if(t===te(this,Wt))return;const n=te(this,Wt);Ge(this,Wt,t),Ge(this,Bu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},ST=function(t){qn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(te(this,hr))}),te(this,Rr).getQueryCache().notify({query:te(this,Wt),type:"observerResultsUpdated"})})},lT);function xD(e,t){return ra(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function lE(e,t){return xD(e,t)||e.state.data!==void 0&&Ly(e,t,t.refetchOnMount)}function Ly(e,t,n){if(ra(t.enabled,e)!==!1&&yi(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&Pv(e,t)}return!1}function cE(e,t,n,a){return(e!==t||ra(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Pv(e,n)}function Pv(e,t){return ra(t.enabled,e)!==!1&&e.isStaleByTime(yi(t.staleTime,e))}function wD(e,t){return!dh(e.getCurrentResult(),t)}function uE(e){return{onFetch:(t,n)=>{var g,m,b,x,w;const a=t.options,i=(b=(m=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:m.fetchMore)==null?void 0:b.direction,s=((x=t.state.data)==null?void 0:x.pages)||[],c=((w=t.state.data)==null?void 0:w.pageParams)||[];let d={pages:[],pageParams:[]},h=0;const f=async()=>{let S=!1;const E=M=>{fD(M,()=>t.signal,()=>S=!0)},T=yT(t.options,t.fetchOptions),C=async(M,O,D)=>{if(S)return Promise.reject();if(O==null&&M.pages.length)return Promise.resolve(M);const A=(()=>{const K={client:t.client,queryKey:t.queryKey,pageParam:O,direction:D?"backward":"forward",meta:t.options.meta};return E(K),K})(),j=await T(A),{maxPages:B}=t.options,G=D?dD:uD;return{pages:G(M.pages,j,B),pageParams:G(M.pageParams,O,B)}};if(i&&s.length){const M=i==="backward",O=M?SD:dE,D={pages:s,pageParams:c},k=O(a,D);d=await C(D,k,M)}else{const M=e??s.length;do{const O=h===0?c[0]??a.initialPageParam:dE(a,d);if(h>0&&O==null)break;d=await C(d,O),h++}while(h<M)}return d};t.options.persister?t.fetchFn=()=>{var S,E;return(E=(S=t.options).persister)==null?void 0:E.call(S,f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=f}}}function dE(e,{pages:t,pageParams:n}){const a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,n[a],n):void 0}function SD(e,{pages:t,pageParams:n}){var a;return t.length>0?(a=e.getPreviousPageParam)==null?void 0:a.call(e,t[0],t,n[0],n):void 0}var Vu,Da,sr,hs,ka,Jo,cT,ED=(cT=class extends xT{constructor(t){super();ut(this,ka);ut(this,Vu);ut(this,Da);ut(this,sr);ut(this,hs);Ge(this,Vu,t.client),this.mutationId=t.mutationId,Ge(this,sr,t.mutationCache),Ge(this,Da,[]),this.state=t.state||ET(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){te(this,Da).includes(t)||(te(this,Da).push(t),this.clearGcTimeout(),te(this,sr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ge(this,Da,te(this,Da).filter(n=>n!==t)),this.scheduleGc(),te(this,sr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){te(this,Da).length||(this.state.status==="pending"?this.scheduleGc():te(this,sr).remove(this))}continue(){var t;return((t=te(this,hs))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var c,d,h,f,g,m,b,x,w,S,E,T,C,M,O,D,k,A;const n=()=>{_t(this,ka,Jo).call(this,{type:"continue"})},a={client:te(this,Vu),meta:this.options.meta,mutationKey:this.options.mutationKey};Ge(this,hs,bT({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(new Error("No mutationFn found")),onFail:(j,B)=>{_t(this,ka,Jo).call(this,{type:"failed",failureCount:j,error:B})},onPause:()=>{_t(this,ka,Jo).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>te(this,sr).canRun(this)}));const i=this.state.status==="pending",s=!te(this,hs).canStart();try{if(i)n();else{_t(this,ka,Jo).call(this,{type:"pending",variables:t,isPaused:s}),te(this,sr).config.onMutate&&await te(this,sr).config.onMutate(t,this,a);const B=await((d=(c=this.options).onMutate)==null?void 0:d.call(c,t,a));B!==this.state.context&&_t(this,ka,Jo).call(this,{type:"pending",context:B,variables:t,isPaused:s})}const j=await te(this,hs).start();return await((f=(h=te(this,sr).config).onSuccess)==null?void 0:f.call(h,j,t,this.state.context,this,a)),await((m=(g=this.options).onSuccess)==null?void 0:m.call(g,j,t,this.state.context,a)),await((x=(b=te(this,sr).config).onSettled)==null?void 0:x.call(b,j,null,this.state.variables,this.state.context,this,a)),await((S=(w=this.options).onSettled)==null?void 0:S.call(w,j,null,t,this.state.context,a)),_t(this,ka,Jo).call(this,{type:"success",data:j}),j}catch(j){try{await((T=(E=te(this,sr).config).onError)==null?void 0:T.call(E,j,t,this.state.context,this,a))}catch(B){Promise.reject(B)}try{await((M=(C=this.options).onError)==null?void 0:M.call(C,j,t,this.state.context,a))}catch(B){Promise.reject(B)}try{await((D=(O=te(this,sr).config).onSettled)==null?void 0:D.call(O,void 0,j,this.state.variables,this.state.context,this,a))}catch(B){Promise.reject(B)}try{await((A=(k=this.options).onSettled)==null?void 0:A.call(k,void 0,j,t,this.state.context,a))}catch(B){Promise.reject(B)}throw _t(this,ka,Jo).call(this,{type:"error",error:j}),j}finally{te(this,sr).runNext(this)}}},Vu=new WeakMap,Da=new WeakMap,sr=new WeakMap,hs=new WeakMap,ka=new WeakSet,Jo=function(t){const n=a=>{switch(t.type){case"failed":return{...a,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,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{...a,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:t.error,failureCount:a.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),qn.batch(()=>{te(this,Da).forEach(a=>{a.onMutationUpdate(t)}),te(this,sr).notify({mutation:this,type:"updated",action:t})})},cT);function ET(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var yo,ba,Yu,uT,RD=(uT=class extends Gl{constructor(t={}){super();ut(this,yo);ut(this,ba);ut(this,Yu);this.config=t,Ge(this,yo,new Set),Ge(this,ba,new Map),Ge(this,Yu,0)}build(t,n,a){const i=new ED({client:t,mutationCache:this,mutationId:++Rf(this,Yu)._,options:t.defaultMutationOptions(n),state:a});return this.add(i),i}add(t){te(this,yo).add(t);const n=Tf(t);if(typeof n=="string"){const a=te(this,ba).get(n);a?a.push(t):te(this,ba).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(te(this,yo).delete(t)){const n=Tf(t);if(typeof n=="string"){const a=te(this,ba).get(n);if(a)if(a.length>1){const i=a.indexOf(t);i!==-1&&a.splice(i,1)}else a[0]===t&&te(this,ba).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Tf(t);if(typeof n=="string"){const a=te(this,ba).get(n),i=a==null?void 0:a.find(s=>s.state.status==="pending");return!i||i===t}else return!0}runNext(t){var a;const n=Tf(t);if(typeof n=="string"){const i=(a=te(this,ba).get(n))==null?void 0:a.find(s=>s!==t&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){qn.batch(()=>{te(this,yo).forEach(t=>{this.notify({type:"removed",mutation:t})}),te(this,yo).clear(),te(this,ba).clear()})}getAll(){return Array.from(te(this,yo))}find(t){const n={exact:!0,...t};return this.getAll().find(a=>rE(n,a))}findAll(t={}){return this.getAll().filter(n=>rE(t,n))}notify(t){qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return qn.batch(()=>Promise.all(t.map(n=>n.continue().catch(mr))))}},yo=new WeakMap,ba=new WeakMap,Yu=new WeakMap,uT);function Tf(e){var t;return(t=e.options.scope)==null?void 0:t.id}var vo,ci,Tr,bo,Eo,Qf,_y,dT,TD=(dT=class extends Gl{constructor(n,a){super();ut(this,Eo);ut(this,vo);ut(this,ci);ut(this,Tr);ut(this,bo);Ge(this,vo,n),this.setOptions(a),this.bindMethods(),_t(this,Eo,Qf).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const a=this.options;this.options=te(this,vo).defaultMutationOptions(n),dh(this.options,a)||te(this,vo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:te(this,Tr),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&ys(a.mutationKey)!==ys(this.options.mutationKey)?this.reset():((i=te(this,Tr))==null?void 0:i.state.status)==="pending"&&te(this,Tr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=te(this,Tr))==null||n.removeObserver(this)}onMutationUpdate(n){_t(this,Eo,Qf).call(this),_t(this,Eo,_y).call(this,n)}getCurrentResult(){return te(this,ci)}reset(){var n;(n=te(this,Tr))==null||n.removeObserver(this),Ge(this,Tr,void 0),_t(this,Eo,Qf).call(this),_t(this,Eo,_y).call(this)}mutate(n,a){var i;return Ge(this,bo,a),(i=te(this,Tr))==null||i.removeObserver(this),Ge(this,Tr,te(this,vo).getMutationCache().build(te(this,vo),this.options)),te(this,Tr).addObserver(this),te(this,Tr).execute(n)}},vo=new WeakMap,ci=new WeakMap,Tr=new WeakMap,bo=new WeakMap,Eo=new WeakSet,Qf=function(){var a;const n=((a=te(this,Tr))==null?void 0:a.state)??ET();Ge(this,ci,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},_y=function(n){qn.batch(()=>{var a,i,s,c,d,h,f,g;if(te(this,bo)&&this.hasListeners()){const m=te(this,ci).variables,b=te(this,ci).context,x={client:te(this,vo),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(a=te(this,bo)).onSuccess)==null||i.call(a,n.data,m,b,x)}catch(w){Promise.reject(w)}try{(c=(s=te(this,bo)).onSettled)==null||c.call(s,n.data,null,m,b,x)}catch(w){Promise.reject(w)}}else if((n==null?void 0:n.type)==="error"){try{(h=(d=te(this,bo)).onError)==null||h.call(d,n.error,m,b,x)}catch(w){Promise.reject(w)}try{(g=(f=te(this,bo)).onSettled)==null||g.call(f,void 0,n.error,m,b,x)}catch(w){Promise.reject(w)}}}this.listeners.forEach(m=>{m(te(this,ci))})})},dT),ja,fT,CD=(fT=class extends Gl{constructor(t={}){super();ut(this,ja);this.config=t,Ge(this,ja,new Map)}build(t,n,a){const i=n.queryKey,s=n.queryHash??Lv(i,n);let c=this.get(s);return c||(c=new vD({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:a,defaultOptions:t.getQueryDefaults(i)}),this.add(c)),c}add(t){te(this,ja).has(t.queryHash)||(te(this,ja).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=te(this,ja).get(t.queryHash);n&&(t.destroy(),n===t&&te(this,ja).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){qn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return te(this,ja).get(t)}getAll(){return[...te(this,ja).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(a=>nE(n,a))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(a=>nE(t,a)):n}notify(t){qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){qn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){qn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ja=new WeakMap,fT),Nn,ui,di,jl,Ll,fi,_l,Il,hT,OD=(hT=class{constructor(e={}){ut(this,Nn);ut(this,ui);ut(this,di);ut(this,jl);ut(this,Ll);ut(this,fi);ut(this,_l);ut(this,Il);Ge(this,Nn,e.queryCache||new CD),Ge(this,ui,e.mutationCache||new RD),Ge(this,di,e.defaultOptions||{}),Ge(this,jl,new Map),Ge(this,Ll,new Map),Ge(this,fi,0)}mount(){Rf(this,fi)._++,te(this,fi)===1&&(Ge(this,_l,zv.subscribe(async e=>{e&&(await this.resumePausedMutations(),te(this,Nn).onFocus())})),Ge(this,Il,fh.subscribe(async e=>{e&&(await this.resumePausedMutations(),te(this,Nn).onOnline())})))}unmount(){var e,t;Rf(this,fi)._--,te(this,fi)===0&&((e=te(this,_l))==null||e.call(this),Ge(this,_l,void 0),(t=te(this,Il))==null||t.call(this),Ge(this,Il,void 0))}isFetching(e){return te(this,Nn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return te(this,ui).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=te(this,Nn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=te(this,Nn).build(this,t),a=n.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(yi(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return te(this,Nn).findAll(e).map(({queryKey:t,state:n})=>{const a=n.data;return[t,a]})}setQueryData(e,t,n){const a=this.defaultQueryOptions({queryKey:e}),i=te(this,Nn).get(a.queryHash),s=i==null?void 0:i.state.data,c=sD(t,s);if(c!==void 0)return te(this,Nn).build(this,a).setData(c,{...n,manual:!0})}setQueriesData(e,t,n){return qn.batch(()=>te(this,Nn).findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=te(this,Nn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=te(this,Nn);qn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=te(this,Nn);return qn.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=qn.batch(()=>te(this,Nn).findAll(e).map(i=>i.cancel(n)));return Promise.all(a).then(mr).catch(mr)}invalidateQueries(e,t={}){return qn.batch(()=>(te(this,Nn).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},a=qn.batch(()=>te(this,Nn).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(mr)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(a).then(mr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=te(this,Nn).build(this,t);return n.isStaleByTime(yi(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(mr).catch(mr)}fetchInfiniteQuery(e){return e.behavior=uE(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(mr).catch(mr)}ensureInfiniteQueryData(e){return e.behavior=uE(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return fh.isOnline()?te(this,ui).resumePausedMutations():Promise.resolve()}getQueryCache(){return te(this,Nn)}getMutationCache(){return te(this,ui)}getDefaultOptions(){return te(this,di)}setDefaultOptions(e){Ge(this,di,e)}setQueryDefaults(e,t){te(this,jl).set(ys(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...te(this,jl).values()],n={};return t.forEach(a=>{Tu(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){te(this,Ll).set(ys(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...te(this,Ll).values()],n={};return t.forEach(a=>{Tu(e,a.mutationKey)&&Object.assign(n,a.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...te(this,di).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Lv(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===_v&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...te(this,di).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){te(this,Nn).clear(),te(this,ui).clear()}},Nn=new WeakMap,ui=new WeakMap,di=new WeakMap,jl=new WeakMap,Ll=new WeakMap,fi=new WeakMap,_l=new WeakMap,Il=new WeakMap,hT),Sg={exports:{}},Nt={};/**
|
|
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 fE;function MD(){if(fE)return Nt;fE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),b=Symbol.iterator;function x(P){return P===null||typeof P!="object"?null:(P=b&&P[b]||P["@@iterator"],typeof P=="function"?P:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,E={};function T(P,q,X){this.props=P,this.context=q,this.refs=E,this.updater=X||w}T.prototype.isReactComponent={},T.prototype.setState=function(P,q){if(typeof P!="object"&&typeof P!="function"&&P!=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,P,q,"setState")},T.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function C(){}C.prototype=T.prototype;function M(P,q,X){this.props=P,this.context=q,this.refs=E,this.updater=X||w}var O=M.prototype=new C;O.constructor=M,S(O,T.prototype),O.isPureReactComponent=!0;var D=Array.isArray;function k(){}var A={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function B(P,q,X){var W=X.ref;return{$$typeof:e,type:P,key:q,ref:W!==void 0?W:null,props:X}}function G(P,q){return B(P.type,q,P.props)}function K(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function I(P){var q={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(X){return q[X]})}var H=/\/+/g;function F(P,q){return typeof P=="object"&&P!==null&&P.key!=null?I(""+P.key):q.toString(36)}function Y(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(k,k):(P.status="pending",P.then(function(q){P.status==="pending"&&(P.status="fulfilled",P.value=q)},function(q){P.status==="pending"&&(P.status="rejected",P.reason=q)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function _(P,q,X,W,ce){var ie=typeof P;(ie==="undefined"||ie==="boolean")&&(P=null);var de=!1;if(P===null)de=!0;else switch(ie){case"bigint":case"string":case"number":de=!0;break;case"object":switch(P.$$typeof){case e:case t:de=!0;break;case g:return de=P._init,_(de(P._payload),q,X,W,ce)}}if(de)return ce=ce(P),de=W===""?"."+F(P,0):W,D(ce)?(X="",de!=null&&(X=de.replace(H,"$&/")+"/"),_(ce,q,X,"",function(Me){return Me})):ce!=null&&(K(ce)&&(ce=G(ce,X+(ce.key==null||P&&P.key===ce.key?"":(""+ce.key).replace(H,"$&/")+"/")+de)),q.push(ce)),1;de=0;var ve=W===""?".":W+":";if(D(P))for(var Se=0;Se<P.length;Se++)W=P[Se],ie=ve+F(W,Se),de+=_(W,q,X,ie,ce);else if(Se=x(P),typeof Se=="function")for(P=Se.call(P),Se=0;!(W=P.next()).done;)W=W.value,ie=ve+F(W,Se++),de+=_(W,q,X,ie,ce);else if(ie==="object"){if(typeof P.then=="function")return _(Y(P),q,X,W,ce);throw q=String(P),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return de}function L(P,q,X){if(P==null)return P;var W=[],ce=0;return _(P,W,"","",function(ie){return q.call(X,ie,ce++)}),W}function z(P){if(P._status===-1){var q=P._result;q=q(),q.then(function(X){(P._status===0||P._status===-1)&&(P._status=1,P._result=X)},function(X){(P._status===0||P._status===-1)&&(P._status=2,P._result=X)}),P._status===-1&&(P._status=0,P._result=q)}if(P._status===1)return P._result.default;throw P._result}var V=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},Q={map:L,forEach:function(P,q,X){L(P,function(){q.apply(this,arguments)},X)},count:function(P){var q=0;return L(P,function(){q++}),q},toArray:function(P){return L(P,function(q){return q})||[]},only:function(P){if(!K(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return Nt.Activity=m,Nt.Children=Q,Nt.Component=T,Nt.Fragment=n,Nt.Profiler=i,Nt.PureComponent=M,Nt.StrictMode=a,Nt.Suspense=h,Nt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,Nt.__COMPILER_RUNTIME={__proto__:null,c:function(P){return A.H.useMemoCache(P)}},Nt.cache=function(P){return function(){return P.apply(null,arguments)}},Nt.cacheSignal=function(){return null},Nt.cloneElement=function(P,q,X){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var W=S({},P.props),ce=P.key;if(q!=null)for(ie in q.key!==void 0&&(ce=""+q.key),q)!j.call(q,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&q.ref===void 0||(W[ie]=q[ie]);var ie=arguments.length-2;if(ie===1)W.children=X;else if(1<ie){for(var de=Array(ie),ve=0;ve<ie;ve++)de[ve]=arguments[ve+2];W.children=de}return B(P.type,ce,W)},Nt.createContext=function(P){return P={$$typeof:c,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:s,_context:P},P},Nt.createElement=function(P,q,X){var W,ce={},ie=null;if(q!=null)for(W in q.key!==void 0&&(ie=""+q.key),q)j.call(q,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(ce[W]=q[W]);var de=arguments.length-2;if(de===1)ce.children=X;else if(1<de){for(var ve=Array(de),Se=0;Se<de;Se++)ve[Se]=arguments[Se+2];ce.children=ve}if(P&&P.defaultProps)for(W in de=P.defaultProps,de)ce[W]===void 0&&(ce[W]=de[W]);return B(P,ie,ce)},Nt.createRef=function(){return{current:null}},Nt.forwardRef=function(P){return{$$typeof:d,render:P}},Nt.isValidElement=K,Nt.lazy=function(P){return{$$typeof:g,_payload:{_status:-1,_result:P},_init:z}},Nt.memo=function(P,q){return{$$typeof:f,type:P,compare:q===void 0?null:q}},Nt.startTransition=function(P){var q=A.T,X={};A.T=X;try{var W=P(),ce=A.S;ce!==null&&ce(X,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(k,V)}catch(ie){V(ie)}finally{q!==null&&X.types!==null&&(q.types=X.types),A.T=q}},Nt.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},Nt.use=function(P){return A.H.use(P)},Nt.useActionState=function(P,q,X){return A.H.useActionState(P,q,X)},Nt.useCallback=function(P,q){return A.H.useCallback(P,q)},Nt.useContext=function(P){return A.H.useContext(P)},Nt.useDebugValue=function(){},Nt.useDeferredValue=function(P,q){return A.H.useDeferredValue(P,q)},Nt.useEffect=function(P,q){return A.H.useEffect(P,q)},Nt.useEffectEvent=function(P){return A.H.useEffectEvent(P)},Nt.useId=function(){return A.H.useId()},Nt.useImperativeHandle=function(P,q,X){return A.H.useImperativeHandle(P,q,X)},Nt.useInsertionEffect=function(P,q){return A.H.useInsertionEffect(P,q)},Nt.useLayoutEffect=function(P,q){return A.H.useLayoutEffect(P,q)},Nt.useMemo=function(P,q){return A.H.useMemo(P,q)},Nt.useOptimistic=function(P,q){return A.H.useOptimistic(P,q)},Nt.useReducer=function(P,q,X){return A.H.useReducer(P,q,X)},Nt.useRef=function(P){return A.H.useRef(P)},Nt.useState=function(P){return A.H.useState(P)},Nt.useSyncExternalStore=function(P,q,X){return A.H.useSyncExternalStore(P,q,X)},Nt.useTransition=function(){return A.H.useTransition()},Nt.version="19.2.4",Nt}var hE;function qu(){return hE||(hE=1,Sg.exports=MD()),Sg.exports}var y=qu();const _e=mT(y),Uv=JA({__proto__:null,default:_e},[y]);var RT=y.createContext(void 0),$u=e=>{const t=y.useContext(RT);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ND=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),R.jsx(RT.Provider,{value:e,children:t})),TT=y.createContext(!1),AD=()=>y.useContext(TT);TT.Provider;function DD(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var kD=y.createContext(DD()),jD=()=>y.useContext(kD),LD=(e,t,n)=>{const a=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Iv(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},_D=e=>{y.useEffect(()=>{e.clearReset()},[e])},ID=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(i&&e.data===void 0||Iv(n,[e.error,a])),zD=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...i)=>n(a(...i)):n(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},PD=(e,t)=>e.isLoading&&e.isFetching&&!t,UD=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,mE=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function HD(e,t,n){var b,x,w,S;const a=AD(),i=jD(),s=$u(),c=s.defaultQueryOptions(e);(x=(b=s.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||x.call(b,c);const d=s.getQueryCache().get(c.queryHash);c._optimisticResults=a?"isRestoring":"optimistic",zD(c),LD(c,i,d),_D(i);const h=!s.getQueryCache().get(c.queryHash),[f]=y.useState(()=>new t(s,c)),g=f.getOptimisticResult(c),m=!a&&e.subscribed!==!1;if(y.useSyncExternalStore(y.useCallback(E=>{const T=m?f.subscribe(qn.batchCalls(E)):mr;return f.updateResult(),T},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),y.useEffect(()=>{f.setOptions(c)},[c,f]),UD(c,g))throw mE(c,f,i);if(ID({result:g,errorResetBoundary:i,throwOnError:c.throwOnError,query:d,suspense:c.suspense}))throw g.error;if((S=(w=s.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||S.call(w,c,g),c.experimental_prefetchInRender&&!gs&&PD(g,a)){const E=h?mE(c,f,i):d==null?void 0:d.promise;E==null||E.catch(mr).finally(()=>{f.updateResult()})}return c.notifyOnChangeProps?g:f.trackResult(g)}function Ku(e,t){return HD(e,bD)}function Cu(e,t){const n=$u(),[a]=y.useState(()=>new TD(n,e));y.useEffect(()=>{a.setOptions(e)},[a,e]);const i=y.useSyncExternalStore(y.useCallback(c=>a.subscribe(qn.batchCalls(c)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),s=y.useCallback((c,d)=>{a.mutate(c,d).catch(mr)},[a]);if(i.error&&Iv(a.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}const Hv="en_US",H7={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 CT(e){return e.replace("_","-")}function BD(e,t){const n=(e==null?void 0:e.trim())||"unknown";return t?n:`${n}_dev`}var Eg={},Xi={},Wi={},pE;function FD(){if(pE)return Wi;pE=1,Object.defineProperty(Wi,"__esModule",{value:!0}),Wi.BinaryReader=Wi.BinaryWriter=void 0;class e{constructor(a=1024){We(this,"buffer");We(this,"view");We(this,"offset",0);this.buffer=new Uint8Array(a),this.view=new DataView(this.buffer.buffer)}ensureCapacity(a){const i=this.offset+a;if(i<=this.buffer.length)return;let s=this.buffer.length;for(;s<i;)s*=2;const c=new Uint8Array(s);c.set(this.buffer),this.buffer=c,this.view=new DataView(this.buffer.buffer)}writeUint8(a){this.ensureCapacity(1),this.view.setUint8(this.offset,a),this.offset+=1}writeUint16(a){this.ensureCapacity(2),this.view.setUint16(this.offset,a,!0),this.offset+=2}writeUint32(a){this.ensureCapacity(4),this.view.setUint32(this.offset,a,!0),this.offset+=4}writeUint64(a){this.ensureCapacity(8),this.view.setBigUint64(this.offset,a,!0),this.offset+=8}writeUint128(a){this.ensureCapacity(16);const i=a&BigInt("0xFFFFFFFFFFFFFFFF"),s=a>>BigInt(64);this.writeUint64(i),this.writeUint64(s)}writeInt8(a){this.ensureCapacity(1),this.view.setInt8(this.offset,a),this.offset+=1}writeInt16(a){this.ensureCapacity(2),this.view.setInt16(this.offset,a,!0),this.offset+=2}writeInt32(a){this.ensureCapacity(4),this.view.setInt32(this.offset,a,!0),this.offset+=4}writeInt64(a){this.ensureCapacity(8),this.view.setBigInt64(this.offset,a,!0),this.offset+=8}writeInt128(a){this.ensureCapacity(16);const i=a&BigInt("0xFFFFFFFFFFFFFFFF"),s=a>>BigInt(64);this.writeInt64(i),this.writeInt64(s)}writeFloat32(a){this.ensureCapacity(4),this.view.setFloat32(this.offset,a,!0),this.offset+=4}writeFloat64(a){this.ensureCapacity(8),this.view.setFloat64(this.offset,a,!0),this.offset+=8}writeBool(a){this.writeUint8(a?1:0)}writeString(a){const i=new TextEncoder().encode(a);this.writeUint32(i.length),this.ensureCapacity(i.length),this.buffer.set(i,this.offset),this.offset+=i.length}getBuffer(){return this.buffer.slice(0,this.offset)}}Wi.BinaryWriter=e;class t{constructor(a){We(this,"buffer");We(this,"view");We(this,"offset",0);this.buffer=a,this.view=new DataView(a.buffer,a.byteOffset,a.byteLength)}readUint8(){const a=this.view.getUint8(this.offset);return this.offset+=1,a}readUint16(){const a=this.view.getUint16(this.offset,!0);return this.offset+=2,a}readUint32(){const a=this.view.getUint32(this.offset,!0);return this.offset+=4,a}readUint64(){const a=this.view.getBigUint64(this.offset,!0);return this.offset+=8,a}readUint128(){const a=this.readUint64();return this.readUint64()<<BigInt(64)|a}readInt8(){const a=this.view.getInt8(this.offset);return this.offset+=1,a}readInt16(){const a=this.view.getInt16(this.offset,!0);return this.offset+=2,a}readInt32(){const a=this.view.getInt32(this.offset,!0);return this.offset+=4,a}readInt64(){const a=this.view.getBigInt64(this.offset,!0);return this.offset+=8,a}readInt128(){const a=this.readUint64();return this.readInt64()<<BigInt(64)|a}readFloat32(){const a=this.view.getFloat32(this.offset,!0);return this.offset+=4,a}readFloat64(){const a=this.view.getFloat64(this.offset,!0);return this.offset+=8,a}readBool(){return!!this.readUint8()}readString(){const a=this.readUint32(),i=this.buffer.slice(this.offset,this.offset+a);return this.offset+=a,new TextDecoder().decode(i)}getOffset(){return this.offset}}return Wi.BinaryReader=t,Wi}var Rg={},gE;function VD(){return gE||(gE=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registry=e.TypeRegistry=void 0;class t{constructor(){We(this,"handlers",new Map)}register(a,i){this.handlers.set(a,i)}getHandler(a){const i=this.handlers.get(a);if(!i)throw new Error(`No handler registered for type: ${a}`);return i}}e.TypeRegistry=t,e.registry=new t,e.registry.register("u8",{write:(n,a)=>{if(a<0||a>255||!Number.isInteger(a))throw new Error("Value out of range for u8");n.writeUint8(a)},read:n=>n.readUint8()}),e.registry.register("u16",{write:(n,a)=>{if(a<0||a>65535||!Number.isInteger(a))throw new Error("Value out of range for u16");n.writeUint16(a)},read:n=>n.readUint16()}),e.registry.register("u32",{write:(n,a)=>{if(a<0||a>4294967295||!Number.isInteger(a))throw new Error("Value out of range for u32");n.writeUint32(a)},read:n=>n.readUint32()}),e.registry.register("u64",{write:(n,a)=>{if(a<0n||a>18446744073709551615n)throw new Error("Value out of range for u64");n.writeUint64(a)},read:n=>n.readUint64()}),e.registry.register("u128",{write:(n,a)=>{if(a<0n||a>340282366920938463463374607431768211455n)throw new Error("Value out of range for u128");n.writeUint128(a)},read:n=>n.readUint128()}),e.registry.register("i8",{write:(n,a)=>{if(a<-128||a>127||!Number.isInteger(a))throw new Error("Value out of range for i8");n.writeInt8(a)},read:n=>n.readInt8()}),e.registry.register("i16",{write:(n,a)=>{if(a<-32768||a>32767||!Number.isInteger(a))throw new Error("Value out of range for i16");n.writeInt16(a)},read:n=>n.readInt16()}),e.registry.register("i32",{write:(n,a)=>{if(a<-2147483648||a>2147483647||!Number.isInteger(a))throw new Error("Value out of range for i32");n.writeInt32(a)},read:n=>n.readInt32()}),e.registry.register("i64",{write:(n,a)=>{if(a<-9223372036854775808n||a>9223372036854775807n)throw new Error("Value out of range for i64");n.writeInt64(a)},read:n=>n.readInt64()}),e.registry.register("i128",{write:(n,a)=>{if(a<-170141183460469231731687303715884105728n||a>170141183460469231731687303715884105727n)throw new Error("Value out of range for i128");n.writeInt128(a)},read:n=>n.readInt128()}),e.registry.register("f32",{write:(n,a)=>n.writeFloat32(a),read:n=>n.readFloat32()}),e.registry.register("f64",{write:(n,a)=>{if(Number.isNaN(a))throw new Error("For portability reasons we do not allow serializing NaN values.");n.writeFloat64(a)},read:n=>n.readFloat64()}),e.registry.register("bool",{write:(n,a)=>n.writeBool(a),read:n=>n.readBool()}),e.registry.register("string",{write:(n,a)=>n.writeString(a),read:n=>n.readString()}),e.registry.register("unit",{write:()=>{},read:()=>({})}),e.registry.register("struct",{write:(n,a,i)=>{if(i)for(const[s,c]of Object.entries(i))e.registry.getHandler(c.type).write(n,a[s],c.options)},read:(n,a)=>{if(!a)return{};const i={};for(const[s,c]of Object.entries(a)){const d=e.registry.getHandler(c.type);i[s]=d.read(n,c.options)}return i}}),e.registry.register("vec",{write:(n,a,i)=>{if(!i)return;const{elementType:s,elementOptions:c}=i,d=(ArrayBuffer.isView(a),a.length);n.writeUint32(d);const h=e.registry.getHandler(s);if(ArrayBuffer.isView(a))for(let f=0;f<d;f++)h.write(n,a[f],c);else for(const f of a)h.write(n,f,c)},read:(n,a)=>{if(!a)return[];const{elementType:i,elementOptions:s}=a,c=n.readUint32(),d=e.registry.getHandler(i),h=Array.from({length:c},()=>d.read(n,s));switch(i){case"u8":return new Uint8Array(h);case"u16":return new Uint16Array(h);case"u32":return new Uint32Array(h);case"i8":return new Int8Array(h);case"i16":return new Int16Array(h);case"i32":return new Int32Array(h);case"i64":return new BigInt64Array(h);case"f32":return new Float32Array(h);case"f64":return new Float64Array(h);default:return h}}}),e.registry.register("set",{write:(n,a,i)=>{if(!i)return;const{elementType:s,elementOptions:c}=i,d=Array.from(a).sort();n.writeUint32(d.length);const h=e.registry.getHandler(s);for(const f of d)h.write(n,f,c)},read:(n,a)=>{if(!a)return new Set;const{elementType:i,elementOptions:s}=a,c=n.readUint32(),d=e.registry.getHandler(i),h=Array.from({length:c},()=>d.read(n,s));return new Set(h)}}),e.registry.register("map",{write:(n,a,i)=>{if(!i)return;const{keyType:s,keyOptions:c,valueType:d,valueOptions:h}=i,f=Array.from(a.entries()).sort();n.writeUint32(f.length);const g=e.registry.getHandler(s),m=e.registry.getHandler(d);for(const[b,x]of f)g.write(n,b,c),m.write(n,x,h)},read:(n,a)=>{if(!a)return new Map;const{keyType:i,keyOptions:s,valueType:c,valueOptions:d}=a,h=n.readUint32(),f=e.registry.getHandler(i),g=e.registry.getHandler(c),m=Array.from({length:h},()=>{const b=f.read(n,s),x=g.read(n,d);return[b,x]});return new Map(m)}}),e.registry.register("option",{write:(n,a,i)=>{if(!i)return;const{valueType:s,valueOptions:c}=i,d=a!==null;n.writeUint8(d?1:0),d&&e.registry.getHandler(s).write(n,a,c)},read:(n,a)=>{if(!a)return null;const{valueType:i,valueOptions:s}=a;return n.readUint8()===1?e.registry.getHandler(i).read(n,s):null}}),e.registry.register("enum",{write:(n,a,i)=>{if(!i)return;const s=Object.keys(a)[0],c=a[s],d=i.variants.find(h=>h.name===s);if(!d)throw new Error(`Unknown enum variant: ${s}`);n.writeUint8(d.index),d.type!=="unit"&&e.registry.getHandler(d.type).write(n,c,d.options)},read:(n,a)=>{if(!a)return{};const i=n.readUint8(),s=a.variants.find(h=>h.index===i);if(!s)throw new Error(`Unknown enum variant index: ${i}`);if(s.type==="unit")return{[s.name]:{}};const d=e.registry.getHandler(s.type).read(n,s.options);return{[s.name]:d}}}),e.registry.register("tuple",{write:(n,a,i)=>{if(i){if(a.length!==i.length)throw new Error(`Tuple length mismatch: expected ${i.length}, got ${a.length}`);for(let s=0;s<i.length;s++){const c=i[s];if(!c)throw new Error(`Missing type information for tuple element at index ${s}`);e.registry.getHandler(c.type).write(n,a[s],c.options)}}},read:(n,a)=>{if(!a)return[];const i=[];for(const s of a){const c=e.registry.getHandler(s.type);i.push(c.read(n,s.options))}return i}}),e.registry.register("array",{write:(n,a,i)=>{if(!i)return;const{elementType:s,elementOptions:c,length:d}=i;if(a.length!==d)throw new Error(`Array length mismatch: expected ${d}, got ${a.length}`);const h=e.registry.getHandler(s);for(const f of a)h.write(n,f,c)},read:(n,a)=>{if(!a)return[];const{elementType:i,elementOptions:s,length:c}=a,d=e.registry.getHandler(i);return Array.from({length:c},()=>d.read(n,s))}}),e.registry.register("bytes",{write:(n,a,i)=>{const s=a.length;if((i==null?void 0:i.length)!=null){if(s!==i.length)throw new Error(`Bytes length mismatch: expected ${i.length}, got ${s}`);for(let c=0;c<s;c++)n.writeUint8(a[c])}else{n.writeUint32(s);for(let c=0;c<s;c++)n.writeUint8(a[c])}},read:(n,a)=>{const i=(a==null?void 0:a.length)!=null?a.length:n.readUint32(),s=new Uint8Array(i);for(let c=0;c<i;c++)s[c]=n.readUint8();return s}}),e.registry.register("nativeEnum",{write:(n,a,i)=>{if(!i)return;const{valueToIndexMap:s}=i,c=a,d=s.get(c);if(d===void 0)throw new Error(`Invalid enum value: ${String(a)}`);n.writeUint8(d)},read:(n,a)=>{if(!a)return null;const{indexToValueMap:i}=a,s=n.readUint8(),c=i.get(s);if(c===void 0)throw new Error(`Invalid enum index: ${s}`);return c}})})(Rg)),Rg}var yE;function YD(){if(yE)return Xi;yE=1,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.b=Xi.Schema=void 0;const e=FD(),t=VD();class n{constructor(i,s,c){We(this,"type");We(this,"options");We(this,"registry");this.type=i,this.options=s,this.registry=c}serialize(i){const s=new e.BinaryWriter;return this.registry.getHandler(this.type).write(s,i,this.options),s.getBuffer()}deserialize(i){const s=new e.BinaryReader(i);return this.registry.getHandler(this.type).read(s,this.options)}}return Xi.Schema=n,Xi.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:a=>new n("vec",{elementType:a.type,elementOptions:a.options},t.registry),hashSet:a=>new n("set",{elementType:a.type,elementOptions:a.options},t.registry),hashMap:(a,i)=>new n("map",{keyType:a.type,keyOptions:a.options,valueType:i.type,valueOptions:i.options},t.registry),option:a=>new n("option",{valueType:a.type,valueOptions:a.options},t.registry),array:(a,i)=>new n("array",{elementType:a.type,elementOptions:a.options,length:i},t.registry),bytes:a=>new n("bytes",a!=null?{length:a}:{},t.registry),enum:a=>{const i=Object.entries(a).map(([s,c],d)=>({index:d,name:s,type:c.type,options:c.options}));return new n("enum",{variants:i},t.registry)},struct:a=>{const i=Object.fromEntries(Object.entries(a).map(([s,c])=>[s,{type:c.type,options:c.options}]));return new n("struct",i,t.registry)},tuple:(...a)=>{const i=a.map(s=>({type:s.type,options:s.options}));return new n("tuple",i,t.registry)},nativeEnum:a=>{const i=Object.entries(a).filter(([g])=>typeof g=="string"&&Number.isNaN(Number(g))),s=i.map(([g,m])=>m),c=s.some(g=>typeof g=="string"),d=s.some(g=>typeof g=="number");if(c&&d)throw new Error("Mixed string/numeric enums are not supported");const h=new Map,f=new Map;if(i.forEach(([g,m],b)=>{h.set(m,b),f.set(b,m)}),i.length>255)throw new Error("Borsh only supports enums with up to 255 variants");return new n("nativeEnum",{enumObj:a,valueToIndexMap:h,indexToValueMap:f},t.registry)}},Xi}var vE;function qD(){return vE||(vE=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Schema=e.b=void 0;var t=YD();Object.defineProperty(e,"b",{enumerable:!0,get:function(){return t.b}}),Object.defineProperty(e,"Schema",{enumerable:!0,get:function(){return t.Schema}})})(Eg)),Eg}var ae=qD();const $D=1,KD=2,GD=3,XD=4,WD=5,QD=257,ZD=258,JD=259,ek=260,tk=261,nk=513,rk=514,ak=515,ok=516,ik=517,sk=518,lk=519,ck=520,uk=522,dk=523,fk=524,hk=769,mk=770,pk=771,gk=772,yk=773,vk=774,bk=775,xk=1025,wk=1026,Sk=1281,Ek=1537,Rk=1538,Tk=1539,Ck=1793,Ok=1,Mk=2,Nk=3,Ak=4,Dk=5,kk=6,jk=7,Lk=8,_k=9,Ik=10,zk=11,Pk=12,Uk=13,Hk=1,Bk=2,Fk=3,Vk=1001,La=1002,Yk=1003,OT=1004,Zf=1005,qk=1101,$k=1102,Kk=1201,Gk=1202,Xk=1301,Wk=1302,Qk=1401,Zk={[Vk]:"Unsupported protocol version",[La]:"Invalid frame format",[Yk]:"Unknown message kind",[OT]:"Failed to decode payload",[Zf]:"Frame exceeds maximum size",[qk]:"Device not found",[$k]:"Failed to connect device",[Kk]:"Tmux target not found",[Gk]:"Tmux not ready",[Xk]:"Select conflict",[Wk]:"Select token mismatch",[Qk]:"Internal server error"};function Jk(e){return Zk[e]??`Unknown error code: ${e}`}class Ur extends Error{constructor(t,n=!1,a){super(a??Jk(t)),this.code=t,this.retryable=n,this.name="WsBorshError"}}const MT=ae.b.struct({magic:ae.b.bytes(2),version:ae.b.u16(),kind:ae.b.u16(),flags:ae.b.u16(),seq:ae.b.u32(),payload:ae.b.bytes()}),ej=ae.b.option(ae.b.u32()),zl=ae.b.option(ae.b.u16()),In=ae.b.option(ae.b.string()),tj=ae.b.struct({clientImpl:ae.b.string(),clientVersion:ae.b.string(),maxFrameBytes:ae.b.u32(),supportsCompression:ae.b.bool(),supportsDiffSnapshot:ae.b.bool()}),nj=ae.b.struct({serverImpl:ae.b.string(),serverVersion:ae.b.string(),selectedVersion:ae.b.u16(),maxFrameBytes:ae.b.u32(),heartbeatIntervalMs:ae.b.u32(),capabilities:ae.b.vec(ae.b.string())}),rj=ae.b.struct({nonce:ae.b.u32(),timeMs:ae.b.u64()});ae.b.struct({refSeq:ej,code:ae.b.u16(),message:ae.b.string(),retryable:ae.b.bool()});const aj=ae.b.struct({deviceId:ae.b.string()}),oj=ae.b.struct({deviceId:ae.b.string()}),ij=ae.b.struct({deviceId:ae.b.string()}),sj=ae.b.struct({deviceId:ae.b.string()}),lj=ae.b.struct({deviceId:ae.b.string(),eventType:ae.b.u8(),errorType:In,message:In,rawMessage:In}),cj=ae.b.struct({deviceId:ae.b.string(),windowId:In,paneId:In,selectToken:ae.b.bytes(16),wantHistory:ae.b.bool(),cols:zl,rows:zl}),uj=ae.b.struct({deviceId:ae.b.string(),windowId:ae.b.string()}),dj=ae.b.struct({deviceId:ae.b.string(),name:In,cwd:In}),fj=ae.b.struct({deviceId:ae.b.string(),windowId:ae.b.string()}),hj=ae.b.struct({deviceId:ae.b.string(),paneId:ae.b.string()}),mj=ae.b.struct({deviceId:ae.b.string(),windowId:ae.b.string(),name:ae.b.string()}),pj=ae.b.struct({deviceId:ae.b.string(),style:ae.b.string()}),gj=ae.b.struct({deviceId:ae.b.string(),windowIds:ae.b.vec(ae.b.string())}),yj=ae.b.struct({deviceId:ae.b.string(),windowId:ae.b.string(),paneIds:ae.b.vec(ae.b.string())}),vj=ae.b.struct({deviceId:ae.b.string(),eventType:ae.b.u8(),eventData:ae.b.bytes()}),bj=ae.b.struct({deviceId:ae.b.string(),paneId:ae.b.string(),encoding:ae.b.u8(),data:ae.b.bytes(),isComposing:ae.b.bool()}),xj=ae.b.struct({deviceId:ae.b.string(),paneId:ae.b.string(),encoding:ae.b.u8(),data:ae.b.bytes(),isComposing:ae.b.bool()}),NT=ae.b.struct({deviceId:ae.b.string(),paneId:ae.b.string(),cols:ae.b.u16(),rows:ae.b.u16()}),wj=NT,Sj=ae.b.struct({deviceId:ae.b.string(),paneId:ae.b.string(),encoding:ae.b.u8(),data:ae.b.bytes()}),Ej=ae.b.struct({deviceId:ae.b.string(),paneId:ae.b.string(),selectToken:ae.b.bytes(16),encoding:ae.b.u8(),alternateScreen:ae.b.bool(),data:ae.b.bytes()}),Rj=ae.b.struct({deviceId:ae.b.string(),paneId:ae.b.string(),text:ae.b.string()}),Tj=ae.b.struct({deviceId:ae.b.string(),windowId:ae.b.string(),paneId:ae.b.string(),selectToken:ae.b.bytes(16)}),Cj=ae.b.struct({deviceId:ae.b.string(),paneId:ae.b.string(),selectToken:ae.b.bytes(16)}),AT=ae.b.struct({chunkStreamId:ae.b.u32(),originalKind:ae.b.u16(),originalSeq:ae.b.u32(),totalChunks:ae.b.u16(),chunkIndex:ae.b.u16(),data:ae.b.bytes()}),Oj=ae.b.struct({id:ae.b.string(),windowId:ae.b.string(),index:ae.b.u16(),title:In,active:ae.b.bool(),width:ae.b.u16(),height:ae.b.u16(),currentPath:In}),Mj=ae.b.struct({id:ae.b.string(),name:ae.b.string(),customName:In,index:ae.b.u16(),active:ae.b.bool(),panes:ae.b.vec(Oj)}),Nj=ae.b.struct({id:ae.b.string(),name:ae.b.string(),windows:ae.b.vec(Mj)}),Aj=ae.b.struct({deviceId:ae.b.string(),session:ae.b.option(Nj)});ae.b.struct({deviceId:ae.b.string(),baseRevision:ae.b.u32(),revision:ae.b.u32(),diffFormat:ae.b.u8(),diffBytes:ae.b.bytes()});const Dj=ae.b.struct({sessionId:ae.b.string()}),kj=ae.b.struct({sessionId:ae.b.string()}),jj=ae.b.struct({sessionId:ae.b.string(),seq:ae.b.u32(),eventType:ae.b.u8(),payload:ae.b.bytes()}),Lj=ae.b.struct({ruleId:ae.b.string(),deviceId:ae.b.string(),paneId:ae.b.string(),eventType:ae.b.u8(),payload:ae.b.bytes()}),_j=ae.b.struct({windowId:ae.b.string()}),Ij=ae.b.struct({windowId:ae.b.string()}),zj=ae.b.struct({windowId:ae.b.string(),name:ae.b.string()}),Pj=ae.b.struct({windowId:ae.b.string()}),Uj=ae.b.struct({paneId:ae.b.string(),windowId:ae.b.string()}),Hj=ae.b.struct({paneId:ae.b.string()}),Bj=ae.b.struct({windowId:ae.b.string(),paneId:ae.b.string()}),Fj=ae.b.struct({windowId:ae.b.string(),layout:ae.b.string()}),Vj=ae.b.struct({windowId:In,paneId:In,windowIndex:zl,paneIndex:zl,paneUrl:In,paneTitle:In,paneCurrentCommand:In}),Yj=ae.b.struct({source:ae.b.u8(),title:In,body:ae.b.string(),windowId:In,paneId:In,windowIndex:zl,paneIndex:zl,paneUrl:In,paneTitle:In,paneCurrentCommand:In}),Ou=new Uint8Array([84,88]),qj=1;function Jf(e,t,n,a=0,i=qj){const s={magic:Ou,version:i,kind:e,flags:a,seq:n,payload:t};return MT.serialize(s)}function $n(e,t){return e.serialize(t)}function $j(e){if(e.length<12)throw new Ur(La,!1,"Envelope too small");if(e[0]!==Ou[0]||e[1]!==Ou[1])throw new Ur(La,!1,"Invalid magic bytes");try{return MT.deserialize(e)}catch(t){throw new Ur(La,!1,t instanceof Error?t.message:"Failed to decode envelope")}}function Aa(e,t){try{return e.deserialize(t)}catch(n){throw new Ur(OT,!1,n instanceof Error?n.message:"Failed to decode payload")}}function Kj(e,t){const n=AT.serialize(e);return Jf(1281,n,t)}function Gj(e){return AT.deserialize(e)}function Xj(e){return e.length>=2&&e[0]===Ou[0]&&e[1]===Ou[1]}const Wj=5e3,bE=100,Iy=1e3;class Qj{constructor(){We(this,"streams",new Map);We(this,"lastCleanup",Date.now())}addChunk(t){if(this.cleanup(),t.totalChunks>Iy)throw new Ur(La,!1,`Too many chunks: ${t.totalChunks} > ${Iy}`);if(t.chunkIndex>=t.totalChunks)throw new Ur(La,!1,`Chunk index out of bounds: ${t.chunkIndex} >= ${t.totalChunks}`);let n=this.streams.get(t.chunkStreamId);if(!n){if(this.streams.size>=bE&&(this.cleanup(!0),this.streams.size>=bE))throw new Ur(La,!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 Ur(La,!1,"Chunk total count mismatch");if(n.chunks.has(t.chunkIndex))throw new Ur(La,!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 a=[];let i=0;for(let d=0;d<n.totalChunks;d++){const h=n.chunks.get(d);if(!h)throw this.streams.delete(t),new Ur(La,!1,`Missing chunk index: ${d}`);a.push(h.data),i+=h.data.length}const s=new Uint8Array(i);let c=0;for(const d of a)s.set(d,c),c+=d.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 a=n-Wj;for(const[i,s]of this.streams)s.createdAt<a&&this.streams.delete(i)}getActiveStreamCount(){return this.streams.size}clear(){this.streams.clear()}}function Zj(e,t,n,a){const{maxFrameBytes:i,chunkStreamId:s}=a,c=16,d=18,h=i-c;if(h<=0)throw new Ur(Zf,!1,`maxFrameBytes too small: ${i}`);if(e.length<=h)return{chunks:[],totalChunks:0};const f=i-c-d;if(f<=0)throw new Ur(Zf,!1,`maxFrameBytes too small for chunking: ${i}`);const g=Math.ceil(e.length/f);if(g>Iy)throw new Ur(Zf,!1,`Too many chunks: ${g}`);const m=[];for(let b=0;b<g;b++){const x=b*f,w=Math.min(x+f,e.length);m.push({chunkStreamId:s,originalKind:t,originalSeq:n,totalChunks:g,chunkIndex:b,data:e.slice(x,w)})}return{chunks:m,totalChunks:g}}let Tg=1;function Jj(){const e=Tg;return Tg=Tg%4294967295+1,e}const eL={1:"osc9",2:"osc777",3:"osc1337",4:"osc99"};function tL(e){const t=lj.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 nL(e){const t=vj.deserialize(e),a={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(!a)throw new Error(`Unknown tmux event type: ${t.eventType}`);return{deviceId:t.deviceId,type:a,data:rL(a,t.eventData)}}function rL(e,t){if(t.length===0)return{};try{switch(e){case"window-add":return _j.deserialize(t);case"window-close":return Ij.deserialize(t);case"window-renamed":return zj.deserialize(t);case"window-active":return Pj.deserialize(t);case"pane-add":return Uj.deserialize(t);case"pane-close":return Hj.deserialize(t);case"pane-active":return Bj.deserialize(t);case"layout-change":return Fj.deserialize(t);case"bell":{const n=Vj.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,paneTitle:n.paneTitle??void 0,paneCurrentCommand:n.paneCurrentCommand??void 0}}case"notification":{const n=Yj.deserialize(t);return{source:eL[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,paneTitle:n.paneTitle??void 0,paneCurrentCommand:n.paneCurrentCommand??void 0}}default:return{}}}catch{return{}}}function aL(e){const t=Aj.deserialize(e);return{deviceId:t.deviceId,session:t.session?oL(t.session):null}}function oL(e){return{id:e.id,name:e.name,windows:e.windows.map(iL)}}function iL(e){return{id:e.id,name:e.name,customName:e.customName??void 0,index:e.index,active:e.active,panes:e.panes.map(sL)}}function sL(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,currentPath:e.currentPath??void 0}}var Cg={exports:{}},Wc={},Og={exports:{}},Mg={};/**
|
|
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 xE;function lL(){return xE||(xE=1,(function(e){function t(_,L){var z=_.length;_.push(L);e:for(;0<z;){var V=z-1>>>1,Q=_[V];if(0<i(Q,L))_[V]=L,_[z]=Q,z=V;else break e}}function n(_){return _.length===0?null:_[0]}function a(_){if(_.length===0)return null;var L=_[0],z=_.pop();if(z!==L){_[0]=z;e:for(var V=0,Q=_.length,P=Q>>>1;V<P;){var q=2*(V+1)-1,X=_[q],W=q+1,ce=_[W];if(0>i(X,z))W<Q&&0>i(ce,X)?(_[V]=ce,_[W]=z,V=W):(_[V]=X,_[q]=z,V=q);else if(W<Q&&0>i(ce,z))_[V]=ce,_[W]=z,V=W;else break e}}return L}function i(_,L){var z=_.sortIndex-L.sortIndex;return z!==0?z:_.id-L.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 c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var h=[],f=[],g=1,m=null,b=3,x=!1,w=!1,S=!1,E=!1,T=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function O(_){for(var L=n(f);L!==null;){if(L.callback===null)a(f);else if(L.startTime<=_)a(f),L.sortIndex=L.expirationTime,t(h,L);else break;L=n(f)}}function D(_){if(S=!1,O(_),!w)if(n(h)!==null)w=!0,k||(k=!0,I());else{var L=n(f);L!==null&&Y(D,L.startTime-_)}}var k=!1,A=-1,j=5,B=-1;function G(){return E?!0:!(e.unstable_now()-B<j)}function K(){if(E=!1,k){var _=e.unstable_now();B=_;var L=!0;try{e:{w=!1,S&&(S=!1,C(A),A=-1),x=!0;var z=b;try{t:{for(O(_),m=n(h);m!==null&&!(m.expirationTime>_&&G());){var V=m.callback;if(typeof V=="function"){m.callback=null,b=m.priorityLevel;var Q=V(m.expirationTime<=_);if(_=e.unstable_now(),typeof Q=="function"){m.callback=Q,O(_),L=!0;break t}m===n(h)&&a(h),O(_)}else a(h);m=n(h)}if(m!==null)L=!0;else{var P=n(f);P!==null&&Y(D,P.startTime-_),L=!1}}break e}finally{m=null,b=z,x=!1}L=void 0}}finally{L?I():k=!1}}}var I;if(typeof M=="function")I=function(){M(K)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,F=H.port2;H.port1.onmessage=K,I=function(){F.postMessage(null)}}else I=function(){T(K,0)};function Y(_,L){A=T(function(){_(e.unstable_now())},L)}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(_){_.callback=null},e.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(_){switch(b){case 1:case 2:case 3:var L=3;break;default:L=b}var z=b;b=L;try{return _()}finally{b=z}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(_,L){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var z=b;b=_;try{return L()}finally{b=z}},e.unstable_scheduleCallback=function(_,L,z){var V=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?V+z:V):z=V,_){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=z+Q,_={id:g++,callback:L,priorityLevel:_,startTime:z,expirationTime:Q,sortIndex:-1},z>V?(_.sortIndex=z,t(f,_),n(h)===null&&_===n(f)&&(S?(C(A),A=-1):S=!0,Y(D,z-V))):(_.sortIndex=Q,t(h,_),w||x||(w=!0,k||(k=!0,I()))),_},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(_){var L=b;return function(){var z=b;b=L;try{return _.apply(this,arguments)}finally{b=z}}}})(Mg)),Mg}var wE;function cL(){return wE||(wE=1,Og.exports=lL()),Og.exports}var Ng={exports:{}},ir={};/**
|
|
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 SE;function uL(){if(SE)return ir;SE=1;var e=qu();function t(h){var f="https://react.dev/errors/"+h;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)f+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+h+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(h,f,g){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:m==null?null:""+m,children:h,containerInfo:f,implementation:g}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,f){if(h==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return ir.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,ir.createPortal=function(h,f){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return s(h,f,null,g)},ir.flushSync=function(h){var f=c.T,g=a.p;try{if(c.T=null,a.p=2,h)return h()}finally{c.T=f,a.p=g,a.d.f()}},ir.preconnect=function(h,f){typeof h=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,a.d.C(h,f))},ir.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},ir.preinit=function(h,f){if(typeof h=="string"&&f&&typeof f.as=="string"){var g=f.as,m=d(g,f.crossOrigin),b=typeof f.integrity=="string"?f.integrity:void 0,x=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;g==="style"?a.d.S(h,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:m,integrity:b,fetchPriority:x}):g==="script"&&a.d.X(h,{crossOrigin:m,integrity:b,fetchPriority:x,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},ir.preinitModule=function(h,f){if(typeof h=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var g=d(f.as,f.crossOrigin);a.d.M(h,{crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&a.d.M(h)},ir.preload=function(h,f){if(typeof h=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var g=f.as,m=d(g,f.crossOrigin);a.d.L(h,g,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},ir.preloadModule=function(h,f){if(typeof h=="string")if(f){var g=d(f.as,f.crossOrigin);a.d.m(h,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else a.d.m(h)},ir.requestFormReset=function(h){a.d.r(h)},ir.unstable_batchedUpdates=function(h,f){return h(f)},ir.useFormState=function(h,f,g){return c.H.useFormState(h,f,g)},ir.useFormStatus=function(){return c.H.useHostTransitionStatus()},ir.version="19.2.4",ir}var EE;function DT(){if(EE)return Ng.exports;EE=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(),Ng.exports=uL(),Ng.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 RE;function dL(){if(RE)return Wc;RE=1;var e=cL(),t=qu(),n=DT();function a(r){var o="https://react.dev/errors/"+r;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)o+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+r+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function s(r){var o=r,l=r;if(r.alternate)for(;o.return;)o=o.return;else{r=o;do o=r,(o.flags&4098)!==0&&(l=o.return),r=o.return;while(r)}return o.tag===3?l:null}function c(r){if(r.tag===13){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function d(r){if(r.tag===31){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function h(r){if(s(r)!==r)throw Error(a(188))}function f(r){var o=r.alternate;if(!o){if(o=s(r),o===null)throw Error(a(188));return o!==r?null:r}for(var l=r,u=o;;){var p=l.return;if(p===null)break;var v=p.alternate;if(v===null){if(u=p.return,u!==null){l=u;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===l)return h(p),r;if(v===u)return h(p),o;v=v.sibling}throw Error(a(188))}if(l.return!==u.return)l=p,u=v;else{for(var N=!1,U=p.child;U;){if(U===l){N=!0,l=p,u=v;break}if(U===u){N=!0,u=p,l=v;break}U=U.sibling}if(!N){for(U=v.child;U;){if(U===l){N=!0,l=v,u=p;break}if(U===u){N=!0,u=v,l=p;break}U=U.sibling}if(!N)throw Error(a(189))}}if(l.alternate!==u)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?r:o}function g(r){var o=r.tag;if(o===5||o===26||o===27||o===6)return r;for(r=r.child;r!==null;){if(o=g(r),o!==null)return o;r=r.sibling}return null}var m=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),M=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),G=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function I(r){return r===null||typeof r!="object"?null:(r=K&&r[K]||r["@@iterator"],typeof r=="function"?r:null)}var H=Symbol.for("react.client.reference");function F(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===H?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case S:return"Fragment";case T:return"Profiler";case E:return"StrictMode";case D:return"Suspense";case k:return"SuspenseList";case B:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case w:return"Portal";case M:return r.displayName||"Context";case C:return(r._context.displayName||"Context")+".Consumer";case O:var o=r.render;return r=r.displayName,r||(r=o.displayName||o.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case A:return o=r.displayName||null,o!==null?o:F(r.type)||"Memo";case j:o=r._payload,r=r._init;try{return F(r(o))}catch{}}return null}var Y=Array.isArray,_=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},V=[],Q=-1;function P(r){return{current:r}}function q(r){0>Q||(r.current=V[Q],V[Q]=null,Q--)}function X(r,o){Q++,V[Q]=r.current,r.current=o}var W=P(null),ce=P(null),ie=P(null),de=P(null);function ve(r,o){switch(X(ie,o),X(ce,r),X(W,null),o.nodeType){case 9:case 11:r=(r=o.documentElement)&&(r=r.namespaceURI)?wS(r):0;break;default:if(r=o.tagName,o=o.namespaceURI)o=wS(o),r=SS(o,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}q(W),X(W,r)}function Se(){q(W),q(ce),q(ie)}function Me(r){r.memoizedState!==null&&X(de,r);var o=W.current,l=SS(o,r.type);o!==l&&(X(ce,r),X(W,l))}function ke(r){ce.current===r&&(q(W),q(ce)),de.current===r&&(q(de),qc._currentValue=z)}var J,ue;function pe(r){if(J===void 0)try{throw Error()}catch(l){var o=l.stack.trim().match(/\n( *(at )?)/);J=o&&o[1]||"",ue=-1<l.stack.indexOf(`
|
|
43
|
-
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
-
`+J+r+ue}var De=!1;function Ce(r,o){if(!r||De)return"";De=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={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(ye){var me=ye}Reflect.construct(r,[],Ne)}else{try{Ne.call()}catch(ye){me=ye}r.call(Ne.prototype)}}else{try{throw Error()}catch(ye){me=ye}(Ne=r())&&typeof Ne.catch=="function"&&Ne.catch(function(){})}}catch(ye){if(ye&&me&&typeof ye.stack=="string")return[ye.stack,me.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=u.DetermineComponentFrameRoot(),N=v[0],U=v[1];if(N&&U){var ee=N.split(`
|
|
45
|
-
`),he=U.split(`
|
|
46
|
-
`);for(p=u=0;u<ee.length&&!ee[u].includes("DetermineComponentFrameRoot");)u++;for(;p<he.length&&!he[p].includes("DetermineComponentFrameRoot");)p++;if(u===ee.length||p===he.length)for(u=ee.length-1,p=he.length-1;1<=u&&0<=p&&ee[u]!==he[p];)p--;for(;1<=u&&0<=p;u--,p--)if(ee[u]!==he[p]){if(u!==1||p!==1)do if(u--,p--,0>p||ee[u]!==he[p]){var Re=`
|
|
47
|
-
`+ee[u].replace(" at new "," at ");return r.displayName&&Re.includes("<anonymous>")&&(Re=Re.replace("<anonymous>",r.displayName)),Re}while(1<=u&&0<=p);break}}}finally{De=!1,Error.prepareStackTrace=l}return(l=r?r.displayName||r.name:"")?pe(l):""}function we(r,o){switch(r.tag){case 26:case 27:case 5:return pe(r.type);case 16:return pe("Lazy");case 13:return r.child!==o&&o!==null?pe("Suspense Fallback"):pe("Suspense");case 19:return pe("SuspenseList");case 0:case 15:return Ce(r.type,!1);case 11:return Ce(r.type.render,!1);case 1:return Ce(r.type,!0);case 31:return pe("Activity");default:return""}}function Te(r){try{var o="",l=null;do o+=we(r,l),l=r,r=r.return;while(r);return o}catch(u){return`
|
|
48
|
-
Error generating stack: `+u.message+`
|
|
49
|
-
`+u.stack}}var Z=Object.prototype.hasOwnProperty,be=e.unstable_scheduleCallback,ge=e.unstable_cancelCallback,Pe=e.unstable_shouldYield,Be=e.unstable_requestPaint,Ae=e.unstable_now,it=e.unstable_getCurrentPriorityLevel,wt=e.unstable_ImmediatePriority,xt=e.unstable_UserBlockingPriority,oe=e.unstable_NormalPriority,xe=e.unstable_LowPriority,Ie=e.unstable_IdlePriority,qe=e.log,Ke=e.unstable_setDisableYieldValue,st=null,ze=null;function Je(r){if(typeof qe=="function"&&Ke(r),ze&&typeof ze.setStrictMode=="function")try{ze.setStrictMode(st,r)}catch{}}var ft=Math.clz32?Math.clz32:ht,jt=Math.log,nn=Math.LN2;function ht(r){return r>>>=0,r===0?32:31-(jt(r)/nn|0)|0}var Ct=256,et=262144,lt=4194304;function mt(r){var o=r&42;if(o!==0)return o;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Ve(r,o,l){var u=r.pendingLanes;if(u===0)return 0;var p=0,v=r.suspendedLanes,N=r.pingedLanes;r=r.warmLanes;var U=u&134217727;return U!==0?(u=U&~v,u!==0?p=mt(u):(N&=U,N!==0?p=mt(N):l||(l=U&~r,l!==0&&(p=mt(l))))):(U=u&~v,U!==0?p=mt(U):N!==0?p=mt(N):l||(l=u&~r,l!==0&&(p=mt(l)))),p===0?0:o!==0&&o!==p&&(o&v)===0&&(v=p&-p,l=o&-o,v>=l||v===32&&(l&4194048)!==0)?o:p}function Et(r,o){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&o)===0}function Dt(r,o){switch(r){case 1:case 2:case 4:case 8:case 64:return o+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function St(){var r=lt;return lt<<=1,(lt&62914560)===0&&(lt=4194304),r}function rn(r){for(var o=[],l=0;31>l;l++)o.push(r);return o}function It(r,o){r.pendingLanes|=o,o!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Xe(r,o,l,u,p,v){var N=r.pendingLanes;r.pendingLanes=l,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=l,r.entangledLanes&=l,r.errorRecoveryDisabledLanes&=l,r.shellSuspendCounter=0;var U=r.entanglements,ee=r.expirationTimes,he=r.hiddenUpdates;for(l=N&~l;0<l;){var Re=31-ft(l),Ne=1<<Re;U[Re]=0,ee[Re]=-1;var me=he[Re];if(me!==null)for(he[Re]=null,Re=0;Re<me.length;Re++){var ye=me[Re];ye!==null&&(ye.lane&=-536870913)}l&=~Ne}u!==0&&Rt(r,u,0),v!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=v&~(N&~o))}function Rt(r,o,l){r.pendingLanes|=o,r.suspendedLanes&=~o;var u=31-ft(o);r.entangledLanes|=o,r.entanglements[u]=r.entanglements[u]|1073741824|l&261930}function $(r,o){var l=r.entangledLanes|=o;for(r=r.entanglements;l;){var u=31-ft(l),p=1<<u;p&o|r[u]&o&&(r[u]|=o),l&=~p}}function ne(r,o){var l=o&-o;return l=(l&42)!==0?1:le(l),(l&(r.suspendedLanes|o))!==0?0:l}function le(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Ee(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function je(){var r=L.p;return r!==0?r:(r=window.event,r===void 0?32:qS(r.type))}function Ze(r,o){var l=L.p;try{return L.p=r,o()}finally{L.p=l}}var Qe=Math.random().toString(36).slice(2),Fe="__reactFiber$"+Qe,$e="__reactProps$"+Qe,tt="__reactContainer$"+Qe,vt="__reactEvents$"+Qe,ct="__reactListeners$"+Qe,At="__reactHandles$"+Qe,Ut="__reactResources$"+Qe,wn="__reactMarker$"+Qe;function Tn(r){delete r[Fe],delete r[$e],delete r[vt],delete r[ct],delete r[At]}function Cn(r){var o=r[Fe];if(o)return o;for(var l=r.parentNode;l;){if(o=l[tt]||l[Fe]){if(l=o.alternate,o.child!==null||l!==null&&l.child!==null)for(r=NS(r);r!==null;){if(l=r[Fe])return l;r=NS(r)}return o}r=l,l=r.parentNode}return null}function $t(r){if(r=r[Fe]||r[tt]){var o=r.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return r}return null}function Gn(r){var o=r.tag;if(o===5||o===26||o===27||o===6)return r.stateNode;throw Error(a(33))}function yr(r){var o=r[Ut];return o||(o=r[Ut]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function bn(r){r[wn]=!0}var ua=new Set,Ar={};function da(r,o){qr(r,o),qr(r+"Capture",o)}function qr(r,o){for(Ar[r]=o,r=0;r<o.length;r++)ua.add(o[r])}var Ka=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]*$"),Ai={},Di={};function Kt(r){return Z.call(Di,r)?!0:Z.call(Ai,r)?!1:Ka.test(r)?Di[r]=!0:(Ai[r]=!0,!1)}function jn(r,o,l){if(Kt(o))if(l===null)r.removeAttribute(o);else{switch(typeof l){case"undefined":case"function":case"symbol":r.removeAttribute(o);return;case"boolean":var u=o.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){r.removeAttribute(o);return}}r.setAttribute(o,""+l)}}function fa(r,o,l){if(l===null)r.removeAttribute(o);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(o);return}r.setAttribute(o,""+l)}}function Jn(r,o,l,u){if(u===null)r.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(l);return}r.setAttributeNS(o,l,""+u)}}function Gt(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function ki(r){var o=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function fd(r,o,l){var u=Object.getOwnPropertyDescriptor(r.constructor.prototype,o);if(!r.hasOwnProperty(o)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var p=u.get,v=u.set;return Object.defineProperty(r,o,{configurable:!0,get:function(){return p.call(this)},set:function(N){l=""+N,v.call(this,N)}}),Object.defineProperty(r,o,{enumerable:u.enumerable}),{getValue:function(){return l},setValue:function(N){l=""+N},stopTracking:function(){r._valueTracker=null,delete r[o]}}}}function sc(r){if(!r._valueTracker){var o=ki(r)?"checked":"value";r._valueTracker=fd(r,o,""+r[o])}}function m0(r){if(!r)return!1;var o=r._valueTracker;if(!o)return!0;var l=o.getValue(),u="";return r&&(u=ki(r)?r.checked?"true":"false":r.value),r=u,r!==l?(o.setValue(r),!0):!1}function hd(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var q2=/[\n"\\]/g;function $r(r){return r.replace(q2,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function mm(r,o,l,u,p,v,N,U){r.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?r.type=N:r.removeAttribute("type"),o!=null?N==="number"?(o===0&&r.value===""||r.value!=o)&&(r.value=""+Gt(o)):r.value!==""+Gt(o)&&(r.value=""+Gt(o)):N!=="submit"&&N!=="reset"||r.removeAttribute("value"),o!=null?pm(r,N,Gt(o)):l!=null?pm(r,N,Gt(l)):u!=null&&r.removeAttribute("value"),p==null&&v!=null&&(r.defaultChecked=!!v),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?r.name=""+Gt(U):r.removeAttribute("name")}function p0(r,o,l,u,p,v,N,U){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),o!=null||l!=null){if(!(v!=="submit"&&v!=="reset"||o!=null)){sc(r);return}l=l!=null?""+Gt(l):"",o=o!=null?""+Gt(o):l,U||o===r.value||(r.value=o),r.defaultValue=o}u=u??p,u=typeof u!="function"&&typeof u!="symbol"&&!!u,r.checked=U?r.checked:!!u,r.defaultChecked=!!u,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(r.name=N),sc(r)}function pm(r,o,l){o==="number"&&hd(r.ownerDocument)===r||r.defaultValue===""+l||(r.defaultValue=""+l)}function Ms(r,o,l,u){if(r=r.options,o){o={};for(var p=0;p<l.length;p++)o["$"+l[p]]=!0;for(l=0;l<r.length;l++)p=o.hasOwnProperty("$"+r[l].value),r[l].selected!==p&&(r[l].selected=p),p&&u&&(r[l].defaultSelected=!0)}else{for(l=""+Gt(l),o=null,p=0;p<r.length;p++){if(r[p].value===l){r[p].selected=!0,u&&(r[p].defaultSelected=!0);return}o!==null||r[p].disabled||(o=r[p])}o!==null&&(o.selected=!0)}}function g0(r,o,l){if(o!=null&&(o=""+Gt(o),o!==r.value&&(r.value=o),l==null)){r.defaultValue!==o&&(r.defaultValue=o);return}r.defaultValue=l!=null?""+Gt(l):""}function y0(r,o,l,u){if(o==null){if(u!=null){if(l!=null)throw Error(a(92));if(Y(u)){if(1<u.length)throw Error(a(93));u=u[0]}l=u}l==null&&(l=""),o=l}l=Gt(o),r.defaultValue=l,u=r.textContent,u===l&&u!==""&&u!==null&&(r.value=u),sc(r)}function Ns(r,o){if(o){var l=r.firstChild;if(l&&l===r.lastChild&&l.nodeType===3){l.nodeValue=o;return}}r.textContent=o}var $2=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 v0(r,o,l){var u=o.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?u?r.setProperty(o,""):o==="float"?r.cssFloat="":r[o]="":u?r.setProperty(o,l):typeof l!="number"||l===0||$2.has(o)?o==="float"?r.cssFloat=l:r[o]=(""+l).trim():r[o]=l+"px"}function b0(r,o,l){if(o!=null&&typeof o!="object")throw Error(a(62));if(r=r.style,l!=null){for(var u in l)!l.hasOwnProperty(u)||o!=null&&o.hasOwnProperty(u)||(u.indexOf("--")===0?r.setProperty(u,""):u==="float"?r.cssFloat="":r[u]="");for(var p in o)u=o[p],o.hasOwnProperty(p)&&l[p]!==u&&v0(r,p,u)}else for(var v in o)o.hasOwnProperty(v)&&v0(r,v,o[v])}function gm(r){if(r.indexOf("-")===-1)return!1;switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var K2=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"]]),G2=/^[\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 md(r){return G2.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Ga(){}var ym=null;function vm(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var As=null,Ds=null;function x0(r){var o=$t(r);if(o&&(r=o.stateNode)){var l=r[$e]||null;e:switch(r=o.stateNode,o.type){case"input":if(mm(r,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),o=l.name,l.type==="radio"&&o!=null){for(l=r;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+$r(""+o)+'"][type="radio"]'),o=0;o<l.length;o++){var u=l[o];if(u!==r&&u.form===r.form){var p=u[$e]||null;if(!p)throw Error(a(90));mm(u,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(o=0;o<l.length;o++)u=l[o],u.form===r.form&&m0(u)}break e;case"textarea":g0(r,l.value,l.defaultValue);break e;case"select":o=l.value,o!=null&&Ms(r,!!l.multiple,o,!1)}}}var bm=!1;function w0(r,o,l){if(bm)return r(o,l);bm=!0;try{var u=r(o);return u}finally{if(bm=!1,(As!==null||Ds!==null)&&(tf(),As&&(o=As,r=Ds,Ds=As=null,x0(o),r)))for(o=0;o<r.length;o++)x0(r[o])}}function lc(r,o){var l=r.stateNode;if(l===null)return null;var u=l[$e]||null;if(u===null)return null;l=u[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(r=r.type,u=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!u;break e;default:r=!1}if(r)return null;if(l&&typeof l!="function")throw Error(a(231,o,typeof l));return l}var Xa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xm=!1;if(Xa)try{var cc={};Object.defineProperty(cc,"passive",{get:function(){xm=!0}}),window.addEventListener("test",cc,cc),window.removeEventListener("test",cc,cc)}catch{xm=!1}var No=null,wm=null,pd=null;function S0(){if(pd)return pd;var r,o=wm,l=o.length,u,p="value"in No?No.value:No.textContent,v=p.length;for(r=0;r<l&&o[r]===p[r];r++);var N=l-r;for(u=1;u<=N&&o[l-u]===p[v-u];u++);return pd=p.slice(r,1<u?1-u:void 0)}function gd(r){var o=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&o===13&&(r=13)):r=o,r===10&&(r=13),32<=r||r===13?r:0}function yd(){return!0}function E0(){return!1}function vr(r){function o(l,u,p,v,N){this._reactName=l,this._targetInst=p,this.type=u,this.nativeEvent=v,this.target=N,this.currentTarget=null;for(var U in r)r.hasOwnProperty(U)&&(l=r[U],this[U]=l?l(v):v[U]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?yd:E0,this.isPropagationStopped=E0,this}return m(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=yd)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=yd)},persist:function(){},isPersistent:yd}),o}var ji={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vd=vr(ji),uc=m({},ji,{view:0,detail:0}),X2=vr(uc),Sm,Em,dc,bd=m({},uc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Tm,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==dc&&(dc&&r.type==="mousemove"?(Sm=r.screenX-dc.screenX,Em=r.screenY-dc.screenY):Em=Sm=0,dc=r),Sm)},movementY:function(r){return"movementY"in r?r.movementY:Em}}),R0=vr(bd),W2=m({},bd,{dataTransfer:0}),Q2=vr(W2),Z2=m({},uc,{relatedTarget:0}),Rm=vr(Z2),J2=m({},ji,{animationName:0,elapsedTime:0,pseudoElement:0}),eN=vr(J2),tN=m({},ji,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),nN=vr(tN),rN=m({},ji,{data:0}),T0=vr(rN),aN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},oN={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"},iN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function sN(r){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(r):(r=iN[r])?!!o[r]:!1}function Tm(){return sN}var lN=m({},uc,{key:function(r){if(r.key){var o=aN[r.key]||r.key;if(o!=="Unidentified")return o}return r.type==="keypress"?(r=gd(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?oN[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Tm,charCode:function(r){return r.type==="keypress"?gd(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?gd(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),cN=vr(lN),uN=m({},bd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),C0=vr(uN),dN=m({},uc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Tm}),fN=vr(dN),hN=m({},ji,{propertyName:0,elapsedTime:0,pseudoElement:0}),mN=vr(hN),pN=m({},bd,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),gN=vr(pN),yN=m({},ji,{newState:0,oldState:0}),vN=vr(yN),bN=[9,13,27,32],Cm=Xa&&"CompositionEvent"in window,fc=null;Xa&&"documentMode"in document&&(fc=document.documentMode);var xN=Xa&&"TextEvent"in window&&!fc,O0=Xa&&(!Cm||fc&&8<fc&&11>=fc),M0=" ",N0=!1;function A0(r,o){switch(r){case"keyup":return bN.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function D0(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var ks=!1;function wN(r,o){switch(r){case"compositionend":return D0(o);case"keypress":return o.which!==32?null:(N0=!0,M0);case"textInput":return r=o.data,r===M0&&N0?null:r;default:return null}}function SN(r,o){if(ks)return r==="compositionend"||!Cm&&A0(r,o)?(r=S0(),pd=wm=No=null,ks=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return O0&&o.locale!=="ko"?null:o.data;default:return null}}var EN={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 k0(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o==="input"?!!EN[r.type]:o==="textarea"}function j0(r,o,l,u){As?Ds?Ds.push(u):Ds=[u]:As=u,o=cf(o,"onChange"),0<o.length&&(l=new vd("onChange","change",null,l,u),r.push({event:l,listeners:o}))}var hc=null,mc=null;function RN(r){pS(r,0)}function xd(r){var o=Gn(r);if(m0(o))return r}function L0(r,o){if(r==="change")return o}var _0=!1;if(Xa){var Om;if(Xa){var Mm="oninput"in document;if(!Mm){var I0=document.createElement("div");I0.setAttribute("oninput","return;"),Mm=typeof I0.oninput=="function"}Om=Mm}else Om=!1;_0=Om&&(!document.documentMode||9<document.documentMode)}function z0(){hc&&(hc.detachEvent("onpropertychange",P0),mc=hc=null)}function P0(r){if(r.propertyName==="value"&&xd(mc)){var o=[];j0(o,mc,r,vm(r)),w0(RN,o)}}function TN(r,o,l){r==="focusin"?(z0(),hc=o,mc=l,hc.attachEvent("onpropertychange",P0)):r==="focusout"&&z0()}function CN(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return xd(mc)}function ON(r,o){if(r==="click")return xd(o)}function MN(r,o){if(r==="input"||r==="change")return xd(o)}function NN(r,o){return r===o&&(r!==0||1/r===1/o)||r!==r&&o!==o}var Dr=typeof Object.is=="function"?Object.is:NN;function pc(r,o){if(Dr(r,o))return!0;if(typeof r!="object"||r===null||typeof o!="object"||o===null)return!1;var l=Object.keys(r),u=Object.keys(o);if(l.length!==u.length)return!1;for(u=0;u<l.length;u++){var p=l[u];if(!Z.call(o,p)||!Dr(r[p],o[p]))return!1}return!0}function U0(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function H0(r,o){var l=U0(r);r=0;for(var u;l;){if(l.nodeType===3){if(u=r+l.textContent.length,r<=o&&u>=o)return{node:l,offset:o-r};r=u}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=U0(l)}}function B0(r,o){return r&&o?r===o?!0:r&&r.nodeType===3?!1:o&&o.nodeType===3?B0(r,o.parentNode):"contains"in r?r.contains(o):r.compareDocumentPosition?!!(r.compareDocumentPosition(o)&16):!1:!1}function F0(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var o=hd(r.document);o instanceof r.HTMLIFrameElement;){try{var l=typeof o.contentWindow.location.href=="string"}catch{l=!1}if(l)r=o.contentWindow;else break;o=hd(r.document)}return o}function Nm(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o&&(o==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||o==="textarea"||r.contentEditable==="true")}var AN=Xa&&"documentMode"in document&&11>=document.documentMode,js=null,Am=null,gc=null,Dm=!1;function V0(r,o,l){var u=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Dm||js==null||js!==hd(u)||(u=js,"selectionStart"in u&&Nm(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),gc&&pc(gc,u)||(gc=u,u=cf(Am,"onSelect"),0<u.length&&(o=new vd("onSelect","select",null,o,l),r.push({event:o,listeners:u}),o.target=js)))}function Li(r,o){var l={};return l[r.toLowerCase()]=o.toLowerCase(),l["Webkit"+r]="webkit"+o,l["Moz"+r]="moz"+o,l}var Ls={animationend:Li("Animation","AnimationEnd"),animationiteration:Li("Animation","AnimationIteration"),animationstart:Li("Animation","AnimationStart"),transitionrun:Li("Transition","TransitionRun"),transitionstart:Li("Transition","TransitionStart"),transitioncancel:Li("Transition","TransitionCancel"),transitionend:Li("Transition","TransitionEnd")},km={},Y0={};Xa&&(Y0=document.createElement("div").style,"AnimationEvent"in window||(delete Ls.animationend.animation,delete Ls.animationiteration.animation,delete Ls.animationstart.animation),"TransitionEvent"in window||delete Ls.transitionend.transition);function _i(r){if(km[r])return km[r];if(!Ls[r])return r;var o=Ls[r],l;for(l in o)if(o.hasOwnProperty(l)&&l in Y0)return km[r]=o[l];return r}var q0=_i("animationend"),$0=_i("animationiteration"),K0=_i("animationstart"),DN=_i("transitionrun"),kN=_i("transitionstart"),jN=_i("transitioncancel"),G0=_i("transitionend"),X0=new Map,jm="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(" ");jm.push("scrollEnd");function ha(r,o){X0.set(r,o),da(o,[r])}var wd=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Kr=[],_s=0,Lm=0;function Sd(){for(var r=_s,o=Lm=_s=0;o<r;){var l=Kr[o];Kr[o++]=null;var u=Kr[o];Kr[o++]=null;var p=Kr[o];Kr[o++]=null;var v=Kr[o];if(Kr[o++]=null,u!==null&&p!==null){var N=u.pending;N===null?p.next=p:(p.next=N.next,N.next=p),u.pending=p}v!==0&&W0(l,p,v)}}function Ed(r,o,l,u){Kr[_s++]=r,Kr[_s++]=o,Kr[_s++]=l,Kr[_s++]=u,Lm|=u,r.lanes|=u,r=r.alternate,r!==null&&(r.lanes|=u)}function _m(r,o,l,u){return Ed(r,o,l,u),Rd(r)}function Ii(r,o){return Ed(r,null,null,o),Rd(r)}function W0(r,o,l){r.lanes|=l;var u=r.alternate;u!==null&&(u.lanes|=l);for(var p=!1,v=r.return;v!==null;)v.childLanes|=l,u=v.alternate,u!==null&&(u.childLanes|=l),v.tag===22&&(r=v.stateNode,r===null||r._visibility&1||(p=!0)),r=v,v=v.return;return r.tag===3?(v=r.stateNode,p&&o!==null&&(p=31-ft(l),r=v.hiddenUpdates,u=r[p],u===null?r[p]=[o]:u.push(o),o.lane=l|536870912),v):null}function Rd(r){if(50<Pc)throw Pc=0,Yp=null,Error(a(185));for(var o=r.return;o!==null;)r=o,o=r.return;return r.tag===3?r.stateNode:null}var Is={};function LN(r,o,l,u){this.tag=r,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kr(r,o,l,u){return new LN(r,o,l,u)}function Im(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Wa(r,o){var l=r.alternate;return l===null?(l=kr(r.tag,o,r.key,r.mode),l.elementType=r.elementType,l.type=r.type,l.stateNode=r.stateNode,l.alternate=r,r.alternate=l):(l.pendingProps=o,l.type=r.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=r.flags&65011712,l.childLanes=r.childLanes,l.lanes=r.lanes,l.child=r.child,l.memoizedProps=r.memoizedProps,l.memoizedState=r.memoizedState,l.updateQueue=r.updateQueue,o=r.dependencies,l.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},l.sibling=r.sibling,l.index=r.index,l.ref=r.ref,l.refCleanup=r.refCleanup,l}function Q0(r,o){r.flags&=65011714;var l=r.alternate;return l===null?(r.childLanes=0,r.lanes=o,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=l.childLanes,r.lanes=l.lanes,r.child=l.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=l.memoizedProps,r.memoizedState=l.memoizedState,r.updateQueue=l.updateQueue,r.type=l.type,o=l.dependencies,r.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),r}function Td(r,o,l,u,p,v){var N=0;if(u=r,typeof r=="function")Im(r)&&(N=1);else if(typeof r=="string")N=UA(r,l,W.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case B:return r=kr(31,l,o,p),r.elementType=B,r.lanes=v,r;case S:return zi(l.children,p,v,o);case E:N=8,p|=24;break;case T:return r=kr(12,l,o,p|2),r.elementType=T,r.lanes=v,r;case D:return r=kr(13,l,o,p),r.elementType=D,r.lanes=v,r;case k:return r=kr(19,l,o,p),r.elementType=k,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case M:N=10;break e;case C:N=9;break e;case O:N=11;break e;case A:N=14;break e;case j:N=16,u=null;break e}N=29,l=Error(a(130,r===null?"null":typeof r,"")),u=null}return o=kr(N,l,o,p),o.elementType=r,o.type=u,o.lanes=v,o}function zi(r,o,l,u){return r=kr(7,r,u,o),r.lanes=l,r}function zm(r,o,l){return r=kr(6,r,null,o),r.lanes=l,r}function Z0(r){var o=kr(18,null,null,0);return o.stateNode=r,o}function Pm(r,o,l){return o=kr(4,r.children!==null?r.children:[],r.key,o),o.lanes=l,o.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},o}var J0=new WeakMap;function Gr(r,o){if(typeof r=="object"&&r!==null){var l=J0.get(r);return l!==void 0?l:(o={value:r,source:o,stack:Te(o)},J0.set(r,o),o)}return{value:r,source:o,stack:Te(o)}}var zs=[],Ps=0,Cd=null,yc=0,Xr=[],Wr=0,Ao=null,Ta=1,Ca="";function Qa(r,o){zs[Ps++]=yc,zs[Ps++]=Cd,Cd=r,yc=o}function ex(r,o,l){Xr[Wr++]=Ta,Xr[Wr++]=Ca,Xr[Wr++]=Ao,Ao=r;var u=Ta;r=Ca;var p=32-ft(u)-1;u&=~(1<<p),l+=1;var v=32-ft(o)+p;if(30<v){var N=p-p%5;v=(u&(1<<N)-1).toString(32),u>>=N,p-=N,Ta=1<<32-ft(o)+p|l<<p|u,Ca=v+r}else Ta=1<<v|l<<p|u,Ca=r}function Um(r){r.return!==null&&(Qa(r,1),ex(r,1,0))}function Hm(r){for(;r===Cd;)Cd=zs[--Ps],zs[Ps]=null,yc=zs[--Ps],zs[Ps]=null;for(;r===Ao;)Ao=Xr[--Wr],Xr[Wr]=null,Ca=Xr[--Wr],Xr[Wr]=null,Ta=Xr[--Wr],Xr[Wr]=null}function tx(r,o){Xr[Wr++]=Ta,Xr[Wr++]=Ca,Xr[Wr++]=Ao,Ta=o.id,Ca=o.overflow,Ao=r}var er=null,gn=null,Xt=!1,Do=null,Qr=!1,Bm=Error(a(519));function ko(r){var o=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw vc(Gr(o,r)),Bm}function nx(r){var o=r.stateNode,l=r.type,u=r.memoizedProps;switch(o[Fe]=r,o[$e]=u,l){case"dialog":Bt("cancel",o),Bt("close",o);break;case"iframe":case"object":case"embed":Bt("load",o);break;case"video":case"audio":for(l=0;l<Hc.length;l++)Bt(Hc[l],o);break;case"source":Bt("error",o);break;case"img":case"image":case"link":Bt("error",o),Bt("load",o);break;case"details":Bt("toggle",o);break;case"input":Bt("invalid",o),p0(o,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Bt("invalid",o);break;case"textarea":Bt("invalid",o),y0(o,u.value,u.defaultValue,u.children)}l=u.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||o.textContent===""+l||u.suppressHydrationWarning===!0||bS(o.textContent,l)?(u.popover!=null&&(Bt("beforetoggle",o),Bt("toggle",o)),u.onScroll!=null&&Bt("scroll",o),u.onScrollEnd!=null&&Bt("scrollend",o),u.onClick!=null&&(o.onclick=Ga),o=!0):o=!1,o||ko(r,!0)}function rx(r){for(er=r.return;er;)switch(er.tag){case 5:case 31:case 13:Qr=!1;return;case 27:case 3:Qr=!0;return;default:er=er.return}}function Us(r){if(r!==er)return!1;if(!Xt)return rx(r),Xt=!0,!1;var o=r.tag,l;if((l=o!==3&&o!==27)&&((l=o===5)&&(l=r.type,l=!(l!=="form"&&l!=="button")||og(r.type,r.memoizedProps)),l=!l),l&&gn&&ko(r),rx(r),o===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));gn=MS(r)}else if(o===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));gn=MS(r)}else o===27?(o=gn,$o(r.type)?(r=ug,ug=null,gn=r):gn=o):gn=er?Jr(r.stateNode.nextSibling):null;return!0}function Pi(){gn=er=null,Xt=!1}function Fm(){var r=Do;return r!==null&&(Sr===null?Sr=r:Sr.push.apply(Sr,r),Do=null),r}function vc(r){Do===null?Do=[r]:Do.push(r)}var Vm=P(null),Ui=null,Za=null;function jo(r,o,l){X(Vm,o._currentValue),o._currentValue=l}function Ja(r){r._currentValue=Vm.current,q(Vm)}function Ym(r,o,l){for(;r!==null;){var u=r.alternate;if((r.childLanes&o)!==o?(r.childLanes|=o,u!==null&&(u.childLanes|=o)):u!==null&&(u.childLanes&o)!==o&&(u.childLanes|=o),r===l)break;r=r.return}}function qm(r,o,l,u){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var v=p.dependencies;if(v!==null){var N=p.child;v=v.firstContext;e:for(;v!==null;){var U=v;v=p;for(var ee=0;ee<o.length;ee++)if(U.context===o[ee]){v.lanes|=l,U=v.alternate,U!==null&&(U.lanes|=l),Ym(v.return,l,r),u||(N=null);break e}v=U.next}}else if(p.tag===18){if(N=p.return,N===null)throw Error(a(341));N.lanes|=l,v=N.alternate,v!==null&&(v.lanes|=l),Ym(N,l,r),N=null}else N=p.child;if(N!==null)N.return=p;else for(N=p;N!==null;){if(N===r){N=null;break}if(p=N.sibling,p!==null){p.return=N.return,N=p;break}N=N.return}p=N}}function Hs(r,o,l,u){r=null;for(var p=o,v=!1;p!==null;){if(!v){if((p.flags&524288)!==0)v=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var N=p.alternate;if(N===null)throw Error(a(387));if(N=N.memoizedProps,N!==null){var U=p.type;Dr(p.pendingProps.value,N.value)||(r!==null?r.push(U):r=[U])}}else if(p===de.current){if(N=p.alternate,N===null)throw Error(a(387));N.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(qc):r=[qc])}p=p.return}r!==null&&qm(o,r,l,u),o.flags|=262144}function Od(r){for(r=r.firstContext;r!==null;){if(!Dr(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Hi(r){Ui=r,Za=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function tr(r){return ax(Ui,r)}function Md(r,o){return Ui===null&&Hi(r),ax(r,o)}function ax(r,o){var l=o._currentValue;if(o={context:o,memoizedValue:l,next:null},Za===null){if(r===null)throw Error(a(308));Za=o,r.dependencies={lanes:0,firstContext:o},r.flags|=524288}else Za=Za.next=o;return l}var _N=typeof AbortController<"u"?AbortController:function(){var r=[],o=this.signal={aborted:!1,addEventListener:function(l,u){r.push(u)}};this.abort=function(){o.aborted=!0,r.forEach(function(l){return l()})}},IN=e.unstable_scheduleCallback,zN=e.unstable_NormalPriority,zn={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function $m(){return{controller:new _N,data:new Map,refCount:0}}function bc(r){r.refCount--,r.refCount===0&&IN(zN,function(){r.controller.abort()})}var xc=null,Km=0,Bs=0,Fs=null;function PN(r,o){if(xc===null){var l=xc=[];Km=0,Bs=Wp(),Fs={status:"pending",value:void 0,then:function(u){l.push(u)}}}return Km++,o.then(ox,ox),o}function ox(){if(--Km===0&&xc!==null){Fs!==null&&(Fs.status="fulfilled");var r=xc;xc=null,Bs=0,Fs=null;for(var o=0;o<r.length;o++)(0,r[o])()}}function UN(r,o){var l=[],u={status:"pending",value:null,reason:null,then:function(p){l.push(p)}};return r.then(function(){u.status="fulfilled",u.value=o;for(var p=0;p<l.length;p++)(0,l[p])(o)},function(p){for(u.status="rejected",u.reason=p,p=0;p<l.length;p++)(0,l[p])(void 0)}),u}var ix=_.S;_.S=function(r,o){Vw=Ae(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&PN(r,o),ix!==null&&ix(r,o)};var Bi=P(null);function Gm(){var r=Bi.current;return r!==null?r:hn.pooledCache}function Nd(r,o){o===null?X(Bi,Bi.current):X(Bi,o.pool)}function sx(){var r=Gm();return r===null?null:{parent:zn._currentValue,pool:r}}var Vs=Error(a(460)),Xm=Error(a(474)),Ad=Error(a(542)),Dd={then:function(){}};function lx(r){return r=r.status,r==="fulfilled"||r==="rejected"}function cx(r,o,l){switch(l=r[l],l===void 0?r.push(o):l!==o&&(o.then(Ga,Ga),o=l),o.status){case"fulfilled":return o.value;case"rejected":throw r=o.reason,dx(r),r;default:if(typeof o.status=="string")o.then(Ga,Ga);else{if(r=hn,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=o,r.status="pending",r.then(function(u){if(o.status==="pending"){var p=o;p.status="fulfilled",p.value=u}},function(u){if(o.status==="pending"){var p=o;p.status="rejected",p.reason=u}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw r=o.reason,dx(r),r}throw Vi=o,Vs}}function Fi(r){try{var o=r._init;return o(r._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Vi=l,Vs):l}}var Vi=null;function ux(){if(Vi===null)throw Error(a(459));var r=Vi;return Vi=null,r}function dx(r){if(r===Vs||r===Ad)throw Error(a(483))}var Ys=null,wc=0;function kd(r){var o=wc;return wc+=1,Ys===null&&(Ys=[]),cx(Ys,r,o)}function Sc(r,o){o=o.props.ref,r.ref=o!==void 0?o:null}function jd(r,o){throw o.$$typeof===b?Error(a(525)):(r=Object.prototype.toString.call(o),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":r)))}function fx(r){function o(se,re){if(r){var fe=se.deletions;fe===null?(se.deletions=[re],se.flags|=16):fe.push(re)}}function l(se,re){if(!r)return null;for(;re!==null;)o(se,re),re=re.sibling;return null}function u(se){for(var re=new Map;se!==null;)se.key!==null?re.set(se.key,se):re.set(se.index,se),se=se.sibling;return re}function p(se,re){return se=Wa(se,re),se.index=0,se.sibling=null,se}function v(se,re,fe){return se.index=fe,r?(fe=se.alternate,fe!==null?(fe=fe.index,fe<re?(se.flags|=67108866,re):fe):(se.flags|=67108866,re)):(se.flags|=1048576,re)}function N(se){return r&&se.alternate===null&&(se.flags|=67108866),se}function U(se,re,fe,Oe){return re===null||re.tag!==6?(re=zm(fe,se.mode,Oe),re.return=se,re):(re=p(re,fe),re.return=se,re)}function ee(se,re,fe,Oe){var dt=fe.type;return dt===S?Re(se,re,fe.props.children,Oe,fe.key):re!==null&&(re.elementType===dt||typeof dt=="object"&&dt!==null&&dt.$$typeof===j&&Fi(dt)===re.type)?(re=p(re,fe.props),Sc(re,fe),re.return=se,re):(re=Td(fe.type,fe.key,fe.props,null,se.mode,Oe),Sc(re,fe),re.return=se,re)}function he(se,re,fe,Oe){return re===null||re.tag!==4||re.stateNode.containerInfo!==fe.containerInfo||re.stateNode.implementation!==fe.implementation?(re=Pm(fe,se.mode,Oe),re.return=se,re):(re=p(re,fe.children||[]),re.return=se,re)}function Re(se,re,fe,Oe,dt){return re===null||re.tag!==7?(re=zi(fe,se.mode,Oe,dt),re.return=se,re):(re=p(re,fe),re.return=se,re)}function Ne(se,re,fe){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return re=zm(""+re,se.mode,fe),re.return=se,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case x:return fe=Td(re.type,re.key,re.props,null,se.mode,fe),Sc(fe,re),fe.return=se,fe;case w:return re=Pm(re,se.mode,fe),re.return=se,re;case j:return re=Fi(re),Ne(se,re,fe)}if(Y(re)||I(re))return re=zi(re,se.mode,fe,null),re.return=se,re;if(typeof re.then=="function")return Ne(se,kd(re),fe);if(re.$$typeof===M)return Ne(se,Md(se,re),fe);jd(se,re)}return null}function me(se,re,fe,Oe){var dt=re!==null?re.key:null;if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return dt!==null?null:U(se,re,""+fe,Oe);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case x:return fe.key===dt?ee(se,re,fe,Oe):null;case w:return fe.key===dt?he(se,re,fe,Oe):null;case j:return fe=Fi(fe),me(se,re,fe,Oe)}if(Y(fe)||I(fe))return dt!==null?null:Re(se,re,fe,Oe,null);if(typeof fe.then=="function")return me(se,re,kd(fe),Oe);if(fe.$$typeof===M)return me(se,re,Md(se,fe),Oe);jd(se,fe)}return null}function ye(se,re,fe,Oe,dt){if(typeof Oe=="string"&&Oe!==""||typeof Oe=="number"||typeof Oe=="bigint")return se=se.get(fe)||null,U(re,se,""+Oe,dt);if(typeof Oe=="object"&&Oe!==null){switch(Oe.$$typeof){case x:return se=se.get(Oe.key===null?fe:Oe.key)||null,ee(re,se,Oe,dt);case w:return se=se.get(Oe.key===null?fe:Oe.key)||null,he(re,se,Oe,dt);case j:return Oe=Fi(Oe),ye(se,re,fe,Oe,dt)}if(Y(Oe)||I(Oe))return se=se.get(fe)||null,Re(re,se,Oe,dt,null);if(typeof Oe.then=="function")return ye(se,re,fe,kd(Oe),dt);if(Oe.$$typeof===M)return ye(se,re,fe,Md(re,Oe),dt);jd(re,Oe)}return null}function nt(se,re,fe,Oe){for(var dt=null,Jt=null,ot=re,Lt=re=0,Vt=null;ot!==null&&Lt<fe.length;Lt++){ot.index>Lt?(Vt=ot,ot=null):Vt=ot.sibling;var en=me(se,ot,fe[Lt],Oe);if(en===null){ot===null&&(ot=Vt);break}r&&ot&&en.alternate===null&&o(se,ot),re=v(en,re,Lt),Jt===null?dt=en:Jt.sibling=en,Jt=en,ot=Vt}if(Lt===fe.length)return l(se,ot),Xt&&Qa(se,Lt),dt;if(ot===null){for(;Lt<fe.length;Lt++)ot=Ne(se,fe[Lt],Oe),ot!==null&&(re=v(ot,re,Lt),Jt===null?dt=ot:Jt.sibling=ot,Jt=ot);return Xt&&Qa(se,Lt),dt}for(ot=u(ot);Lt<fe.length;Lt++)Vt=ye(ot,se,Lt,fe[Lt],Oe),Vt!==null&&(r&&Vt.alternate!==null&&ot.delete(Vt.key===null?Lt:Vt.key),re=v(Vt,re,Lt),Jt===null?dt=Vt:Jt.sibling=Vt,Jt=Vt);return r&&ot.forEach(function(Qo){return o(se,Qo)}),Xt&&Qa(se,Lt),dt}function gt(se,re,fe,Oe){if(fe==null)throw Error(a(151));for(var dt=null,Jt=null,ot=re,Lt=re=0,Vt=null,en=fe.next();ot!==null&&!en.done;Lt++,en=fe.next()){ot.index>Lt?(Vt=ot,ot=null):Vt=ot.sibling;var Qo=me(se,ot,en.value,Oe);if(Qo===null){ot===null&&(ot=Vt);break}r&&ot&&Qo.alternate===null&&o(se,ot),re=v(Qo,re,Lt),Jt===null?dt=Qo:Jt.sibling=Qo,Jt=Qo,ot=Vt}if(en.done)return l(se,ot),Xt&&Qa(se,Lt),dt;if(ot===null){for(;!en.done;Lt++,en=fe.next())en=Ne(se,en.value,Oe),en!==null&&(re=v(en,re,Lt),Jt===null?dt=en:Jt.sibling=en,Jt=en);return Xt&&Qa(se,Lt),dt}for(ot=u(ot);!en.done;Lt++,en=fe.next())en=ye(ot,se,Lt,en.value,Oe),en!==null&&(r&&en.alternate!==null&&ot.delete(en.key===null?Lt:en.key),re=v(en,re,Lt),Jt===null?dt=en:Jt.sibling=en,Jt=en);return r&&ot.forEach(function(WA){return o(se,WA)}),Xt&&Qa(se,Lt),dt}function fn(se,re,fe,Oe){if(typeof fe=="object"&&fe!==null&&fe.type===S&&fe.key===null&&(fe=fe.props.children),typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case x:e:{for(var dt=fe.key;re!==null;){if(re.key===dt){if(dt=fe.type,dt===S){if(re.tag===7){l(se,re.sibling),Oe=p(re,fe.props.children),Oe.return=se,se=Oe;break e}}else if(re.elementType===dt||typeof dt=="object"&&dt!==null&&dt.$$typeof===j&&Fi(dt)===re.type){l(se,re.sibling),Oe=p(re,fe.props),Sc(Oe,fe),Oe.return=se,se=Oe;break e}l(se,re);break}else o(se,re);re=re.sibling}fe.type===S?(Oe=zi(fe.props.children,se.mode,Oe,fe.key),Oe.return=se,se=Oe):(Oe=Td(fe.type,fe.key,fe.props,null,se.mode,Oe),Sc(Oe,fe),Oe.return=se,se=Oe)}return N(se);case w:e:{for(dt=fe.key;re!==null;){if(re.key===dt)if(re.tag===4&&re.stateNode.containerInfo===fe.containerInfo&&re.stateNode.implementation===fe.implementation){l(se,re.sibling),Oe=p(re,fe.children||[]),Oe.return=se,se=Oe;break e}else{l(se,re);break}else o(se,re);re=re.sibling}Oe=Pm(fe,se.mode,Oe),Oe.return=se,se=Oe}return N(se);case j:return fe=Fi(fe),fn(se,re,fe,Oe)}if(Y(fe))return nt(se,re,fe,Oe);if(I(fe)){if(dt=I(fe),typeof dt!="function")throw Error(a(150));return fe=dt.call(fe),gt(se,re,fe,Oe)}if(typeof fe.then=="function")return fn(se,re,kd(fe),Oe);if(fe.$$typeof===M)return fn(se,re,Md(se,fe),Oe);jd(se,fe)}return typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint"?(fe=""+fe,re!==null&&re.tag===6?(l(se,re.sibling),Oe=p(re,fe),Oe.return=se,se=Oe):(l(se,re),Oe=zm(fe,se.mode,Oe),Oe.return=se,se=Oe),N(se)):l(se,re)}return function(se,re,fe,Oe){try{wc=0;var dt=fn(se,re,fe,Oe);return Ys=null,dt}catch(ot){if(ot===Vs||ot===Ad)throw ot;var Jt=kr(29,ot,null,se.mode);return Jt.lanes=Oe,Jt.return=se,Jt}finally{}}}var Yi=fx(!0),hx=fx(!1),Lo=!1;function Wm(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qm(r,o){r=r.updateQueue,o.updateQueue===r&&(o.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function _o(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Io(r,o,l){var u=r.updateQueue;if(u===null)return null;if(u=u.shared,(an&2)!==0){var p=u.pending;return p===null?o.next=o:(o.next=p.next,p.next=o),u.pending=o,o=Rd(r),W0(r,null,l),o}return Ed(r,u,o,l),Rd(r)}function Ec(r,o,l){if(o=o.updateQueue,o!==null&&(o=o.shared,(l&4194048)!==0)){var u=o.lanes;u&=r.pendingLanes,l|=u,o.lanes=l,$(r,l)}}function Zm(r,o){var l=r.updateQueue,u=r.alternate;if(u!==null&&(u=u.updateQueue,l===u)){var p=null,v=null;if(l=l.firstBaseUpdate,l!==null){do{var N={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};v===null?p=v=N:v=v.next=N,l=l.next}while(l!==null);v===null?p=v=o:v=v.next=o}else p=v=o;l={baseState:u.baseState,firstBaseUpdate:p,lastBaseUpdate:v,shared:u.shared,callbacks:u.callbacks},r.updateQueue=l;return}r=l.lastBaseUpdate,r===null?l.firstBaseUpdate=o:r.next=o,l.lastBaseUpdate=o}var Jm=!1;function Rc(){if(Jm){var r=Fs;if(r!==null)throw r}}function Tc(r,o,l,u){Jm=!1;var p=r.updateQueue;Lo=!1;var v=p.firstBaseUpdate,N=p.lastBaseUpdate,U=p.shared.pending;if(U!==null){p.shared.pending=null;var ee=U,he=ee.next;ee.next=null,N===null?v=he:N.next=he,N=ee;var Re=r.alternate;Re!==null&&(Re=Re.updateQueue,U=Re.lastBaseUpdate,U!==N&&(U===null?Re.firstBaseUpdate=he:U.next=he,Re.lastBaseUpdate=ee))}if(v!==null){var Ne=p.baseState;N=0,Re=he=ee=null,U=v;do{var me=U.lane&-536870913,ye=me!==U.lane;if(ye?(Ft&me)===me:(u&me)===me){me!==0&&me===Bs&&(Jm=!0),Re!==null&&(Re=Re.next={lane:0,tag:U.tag,payload:U.payload,callback:null,next:null});e:{var nt=r,gt=U;me=o;var fn=l;switch(gt.tag){case 1:if(nt=gt.payload,typeof nt=="function"){Ne=nt.call(fn,Ne,me);break e}Ne=nt;break e;case 3:nt.flags=nt.flags&-65537|128;case 0:if(nt=gt.payload,me=typeof nt=="function"?nt.call(fn,Ne,me):nt,me==null)break e;Ne=m({},Ne,me);break e;case 2:Lo=!0}}me=U.callback,me!==null&&(r.flags|=64,ye&&(r.flags|=8192),ye=p.callbacks,ye===null?p.callbacks=[me]:ye.push(me))}else ye={lane:me,tag:U.tag,payload:U.payload,callback:U.callback,next:null},Re===null?(he=Re=ye,ee=Ne):Re=Re.next=ye,N|=me;if(U=U.next,U===null){if(U=p.shared.pending,U===null)break;ye=U,U=ye.next,ye.next=null,p.lastBaseUpdate=ye,p.shared.pending=null}}while(!0);Re===null&&(ee=Ne),p.baseState=ee,p.firstBaseUpdate=he,p.lastBaseUpdate=Re,v===null&&(p.shared.lanes=0),Bo|=N,r.lanes=N,r.memoizedState=Ne}}function mx(r,o){if(typeof r!="function")throw Error(a(191,r));r.call(o)}function px(r,o){var l=r.callbacks;if(l!==null)for(r.callbacks=null,r=0;r<l.length;r++)mx(l[r],o)}var qs=P(null),Ld=P(0);function gx(r,o){r=lo,X(Ld,r),X(qs,o),lo=r|o.baseLanes}function ep(){X(Ld,lo),X(qs,qs.current)}function tp(){lo=Ld.current,q(qs),q(Ld)}var jr=P(null),Zr=null;function zo(r){var o=r.alternate;X(Ln,Ln.current&1),X(jr,r),Zr===null&&(o===null||qs.current!==null||o.memoizedState!==null)&&(Zr=r)}function np(r){X(Ln,Ln.current),X(jr,r),Zr===null&&(Zr=r)}function yx(r){r.tag===22?(X(Ln,Ln.current),X(jr,r),Zr===null&&(Zr=r)):Po()}function Po(){X(Ln,Ln.current),X(jr,jr.current)}function Lr(r){q(jr),Zr===r&&(Zr=null),q(Ln)}var Ln=P(0);function _d(r){for(var o=r;o!==null;){if(o.tag===13){var l=o.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||lg(l)||cg(l)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var eo=0,kt=null,un=null,Pn=null,Id=!1,$s=!1,qi=!1,zd=0,Cc=0,Ks=null,HN=0;function On(){throw Error(a(321))}function rp(r,o){if(o===null)return!1;for(var l=0;l<o.length&&l<r.length;l++)if(!Dr(r[l],o[l]))return!1;return!0}function ap(r,o,l,u,p,v){return eo=v,kt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,_.H=r===null||r.memoizedState===null?ew:bp,qi=!1,v=l(u,p),qi=!1,$s&&(v=bx(o,l,u,p)),vx(r),v}function vx(r){_.H=Nc;var o=un!==null&&un.next!==null;if(eo=0,Pn=un=kt=null,Id=!1,Cc=0,Ks=null,o)throw Error(a(300));r===null||Un||(r=r.dependencies,r!==null&&Od(r)&&(Un=!0))}function bx(r,o,l,u){kt=r;var p=0;do{if($s&&(Ks=null),Cc=0,$s=!1,25<=p)throw Error(a(301));if(p+=1,Pn=un=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}_.H=tw,v=o(l,u)}while($s);return v}function BN(){var r=_.H,o=r.useState()[0];return o=typeof o.then=="function"?Oc(o):o,r=r.useState()[0],(un!==null?un.memoizedState:null)!==r&&(kt.flags|=1024),o}function op(){var r=zd!==0;return zd=0,r}function ip(r,o,l){o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~l}function sp(r){if(Id){for(r=r.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Id=!1}eo=0,Pn=un=kt=null,$s=!1,Cc=zd=0,Ks=null}function dr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pn===null?kt.memoizedState=Pn=r:Pn=Pn.next=r,Pn}function _n(){if(un===null){var r=kt.alternate;r=r!==null?r.memoizedState:null}else r=un.next;var o=Pn===null?kt.memoizedState:Pn.next;if(o!==null)Pn=o,un=r;else{if(r===null)throw kt.alternate===null?Error(a(467)):Error(a(310));un=r,r={memoizedState:un.memoizedState,baseState:un.baseState,baseQueue:un.baseQueue,queue:un.queue,next:null},Pn===null?kt.memoizedState=Pn=r:Pn=Pn.next=r}return Pn}function Pd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Oc(r){var o=Cc;return Cc+=1,Ks===null&&(Ks=[]),r=cx(Ks,r,o),o=kt,(Pn===null?o.memoizedState:Pn.next)===null&&(o=o.alternate,_.H=o===null||o.memoizedState===null?ew:bp),r}function Ud(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Oc(r);if(r.$$typeof===M)return tr(r)}throw Error(a(438,String(r)))}function lp(r){var o=null,l=kt.updateQueue;if(l!==null&&(o=l.memoCache),o==null){var u=kt.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(o={data:u.data.map(function(p){return p.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),l===null&&(l=Pd(),kt.updateQueue=l),l.memoCache=o,l=o.data[o.index],l===void 0)for(l=o.data[o.index]=Array(r),u=0;u<r;u++)l[u]=G;return o.index++,l}function to(r,o){return typeof o=="function"?o(r):o}function Hd(r){var o=_n();return cp(o,un,r)}function cp(r,o,l){var u=r.queue;if(u===null)throw Error(a(311));u.lastRenderedReducer=l;var p=r.baseQueue,v=u.pending;if(v!==null){if(p!==null){var N=p.next;p.next=v.next,v.next=N}o.baseQueue=p=v,u.pending=null}if(v=r.baseState,p===null)r.memoizedState=v;else{o=p.next;var U=N=null,ee=null,he=o,Re=!1;do{var Ne=he.lane&-536870913;if(Ne!==he.lane?(Ft&Ne)===Ne:(eo&Ne)===Ne){var me=he.revertLane;if(me===0)ee!==null&&(ee=ee.next={lane:0,revertLane:0,gesture:null,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null}),Ne===Bs&&(Re=!0);else if((eo&me)===me){he=he.next,me===Bs&&(Re=!0);continue}else Ne={lane:0,revertLane:he.revertLane,gesture:null,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null},ee===null?(U=ee=Ne,N=v):ee=ee.next=Ne,kt.lanes|=me,Bo|=me;Ne=he.action,qi&&l(v,Ne),v=he.hasEagerState?he.eagerState:l(v,Ne)}else me={lane:Ne,revertLane:he.revertLane,gesture:he.gesture,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null},ee===null?(U=ee=me,N=v):ee=ee.next=me,kt.lanes|=Ne,Bo|=Ne;he=he.next}while(he!==null&&he!==o);if(ee===null?N=v:ee.next=U,!Dr(v,r.memoizedState)&&(Un=!0,Re&&(l=Fs,l!==null)))throw l;r.memoizedState=v,r.baseState=N,r.baseQueue=ee,u.lastRenderedState=v}return p===null&&(u.lanes=0),[r.memoizedState,u.dispatch]}function up(r){var o=_n(),l=o.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=r;var u=l.dispatch,p=l.pending,v=o.memoizedState;if(p!==null){l.pending=null;var N=p=p.next;do v=r(v,N.action),N=N.next;while(N!==p);Dr(v,o.memoizedState)||(Un=!0),o.memoizedState=v,o.baseQueue===null&&(o.baseState=v),l.lastRenderedState=v}return[v,u]}function xx(r,o,l){var u=kt,p=_n(),v=Xt;if(v){if(l===void 0)throw Error(a(407));l=l()}else l=o();var N=!Dr((un||p).memoizedState,l);if(N&&(p.memoizedState=l,Un=!0),p=p.queue,hp(Ex.bind(null,u,p,r),[r]),p.getSnapshot!==o||N||Pn!==null&&Pn.memoizedState.tag&1){if(u.flags|=2048,Gs(9,{destroy:void 0},Sx.bind(null,u,p,l,o),null),hn===null)throw Error(a(349));v||(eo&127)!==0||wx(u,o,l)}return l}function wx(r,o,l){r.flags|=16384,r={getSnapshot:o,value:l},o=kt.updateQueue,o===null?(o=Pd(),kt.updateQueue=o,o.stores=[r]):(l=o.stores,l===null?o.stores=[r]:l.push(r))}function Sx(r,o,l,u){o.value=l,o.getSnapshot=u,Rx(o)&&Tx(r)}function Ex(r,o,l){return l(function(){Rx(o)&&Tx(r)})}function Rx(r){var o=r.getSnapshot;r=r.value;try{var l=o();return!Dr(r,l)}catch{return!0}}function Tx(r){var o=Ii(r,2);o!==null&&Er(o,r,2)}function dp(r){var o=dr();if(typeof r=="function"){var l=r;if(r=l(),qi){Je(!0);try{l()}finally{Je(!1)}}}return o.memoizedState=o.baseState=r,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:to,lastRenderedState:r},o}function Cx(r,o,l,u){return r.baseState=l,cp(r,un,typeof u=="function"?u:to)}function FN(r,o,l,u,p){if(Vd(r))throw Error(a(485));if(r=o.action,r!==null){var v={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){v.listeners.push(N)}};_.T!==null?l(!0):v.isTransition=!1,u(v),l=o.pending,l===null?(v.next=o.pending=v,Ox(o,v)):(v.next=l.next,o.pending=l.next=v)}}function Ox(r,o){var l=o.action,u=o.payload,p=r.state;if(o.isTransition){var v=_.T,N={};_.T=N;try{var U=l(p,u),ee=_.S;ee!==null&&ee(N,U),Mx(r,o,U)}catch(he){fp(r,o,he)}finally{v!==null&&N.types!==null&&(v.types=N.types),_.T=v}}else try{v=l(p,u),Mx(r,o,v)}catch(he){fp(r,o,he)}}function Mx(r,o,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(u){Nx(r,o,u)},function(u){return fp(r,o,u)}):Nx(r,o,l)}function Nx(r,o,l){o.status="fulfilled",o.value=l,Ax(o),r.state=l,o=r.pending,o!==null&&(l=o.next,l===o?r.pending=null:(l=l.next,o.next=l,Ox(r,l)))}function fp(r,o,l){var u=r.pending;if(r.pending=null,u!==null){u=u.next;do o.status="rejected",o.reason=l,Ax(o),o=o.next;while(o!==u)}r.action=null}function Ax(r){r=r.listeners;for(var o=0;o<r.length;o++)(0,r[o])()}function Dx(r,o){return o}function kx(r,o){if(Xt){var l=hn.formState;if(l!==null){e:{var u=kt;if(Xt){if(gn){t:{for(var p=gn,v=Qr;p.nodeType!==8;){if(!v){p=null;break t}if(p=Jr(p.nextSibling),p===null){p=null;break t}}v=p.data,p=v==="F!"||v==="F"?p:null}if(p){gn=Jr(p.nextSibling),u=p.data==="F!";break e}}ko(u)}u=!1}u&&(o=l[0])}}return l=dr(),l.memoizedState=l.baseState=o,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dx,lastRenderedState:o},l.queue=u,l=Qx.bind(null,kt,u),u.dispatch=l,u=dp(!1),v=vp.bind(null,kt,!1,u.queue),u=dr(),p={state:o,dispatch:null,action:r,pending:null},u.queue=p,l=FN.bind(null,kt,p,v,l),p.dispatch=l,u.memoizedState=r,[o,l,!1]}function jx(r){var o=_n();return Lx(o,un,r)}function Lx(r,o,l){if(o=cp(r,o,Dx)[0],r=Hd(to)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var u=Oc(o)}catch(N){throw N===Vs?Ad:N}else u=o;o=_n();var p=o.queue,v=p.dispatch;return l!==o.memoizedState&&(kt.flags|=2048,Gs(9,{destroy:void 0},VN.bind(null,p,l),null)),[u,v,r]}function VN(r,o){r.action=o}function _x(r){var o=_n(),l=un;if(l!==null)return Lx(o,l,r);_n(),o=o.memoizedState,l=_n();var u=l.queue.dispatch;return l.memoizedState=r,[o,u,!1]}function Gs(r,o,l,u){return r={tag:r,create:l,deps:u,inst:o,next:null},o=kt.updateQueue,o===null&&(o=Pd(),kt.updateQueue=o),l=o.lastEffect,l===null?o.lastEffect=r.next=r:(u=l.next,l.next=r,r.next=u,o.lastEffect=r),r}function Ix(){return _n().memoizedState}function Bd(r,o,l,u){var p=dr();kt.flags|=r,p.memoizedState=Gs(1|o,{destroy:void 0},l,u===void 0?null:u)}function Fd(r,o,l,u){var p=_n();u=u===void 0?null:u;var v=p.memoizedState.inst;un!==null&&u!==null&&rp(u,un.memoizedState.deps)?p.memoizedState=Gs(o,v,l,u):(kt.flags|=r,p.memoizedState=Gs(1|o,v,l,u))}function zx(r,o){Bd(8390656,8,r,o)}function hp(r,o){Fd(2048,8,r,o)}function YN(r){kt.flags|=4;var o=kt.updateQueue;if(o===null)o=Pd(),kt.updateQueue=o,o.events=[r];else{var l=o.events;l===null?o.events=[r]:l.push(r)}}function Px(r){var o=_n().memoizedState;return YN({ref:o,nextImpl:r}),function(){if((an&2)!==0)throw Error(a(440));return o.impl.apply(void 0,arguments)}}function Ux(r,o){return Fd(4,2,r,o)}function Hx(r,o){return Fd(4,4,r,o)}function Bx(r,o){if(typeof o=="function"){r=r();var l=o(r);return function(){typeof l=="function"?l():o(null)}}if(o!=null)return r=r(),o.current=r,function(){o.current=null}}function Fx(r,o,l){l=l!=null?l.concat([r]):null,Fd(4,4,Bx.bind(null,o,r),l)}function mp(){}function Vx(r,o){var l=_n();o=o===void 0?null:o;var u=l.memoizedState;return o!==null&&rp(o,u[1])?u[0]:(l.memoizedState=[r,o],r)}function Yx(r,o){var l=_n();o=o===void 0?null:o;var u=l.memoizedState;if(o!==null&&rp(o,u[1]))return u[0];if(u=r(),qi){Je(!0);try{r()}finally{Je(!1)}}return l.memoizedState=[u,o],u}function pp(r,o,l){return l===void 0||(eo&1073741824)!==0&&(Ft&261930)===0?r.memoizedState=o:(r.memoizedState=l,r=qw(),kt.lanes|=r,Bo|=r,l)}function qx(r,o,l,u){return Dr(l,o)?l:qs.current!==null?(r=pp(r,l,u),Dr(r,o)||(Un=!0),r):(eo&42)===0||(eo&1073741824)!==0&&(Ft&261930)===0?(Un=!0,r.memoizedState=l):(r=qw(),kt.lanes|=r,Bo|=r,o)}function $x(r,o,l,u,p){var v=L.p;L.p=v!==0&&8>v?v:8;var N=_.T,U={};_.T=U,vp(r,!1,o,l);try{var ee=p(),he=_.S;if(he!==null&&he(U,ee),ee!==null&&typeof ee=="object"&&typeof ee.then=="function"){var Re=UN(ee,u);Mc(r,o,Re,zr(r))}else Mc(r,o,u,zr(r))}catch(Ne){Mc(r,o,{then:function(){},status:"rejected",reason:Ne},zr())}finally{L.p=v,N!==null&&U.types!==null&&(N.types=U.types),_.T=N}}function qN(){}function gp(r,o,l,u){if(r.tag!==5)throw Error(a(476));var p=Kx(r).queue;$x(r,p,o,z,l===null?qN:function(){return Gx(r),l(u)})}function Kx(r){var o=r.memoizedState;if(o!==null)return o;o={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:to,lastRenderedState:z},next:null};var l={};return o.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:to,lastRenderedState:l},next:null},r.memoizedState=o,r=r.alternate,r!==null&&(r.memoizedState=o),o}function Gx(r){var o=Kx(r);o.next===null&&(o=r.alternate.memoizedState),Mc(r,o.next.queue,{},zr())}function yp(){return tr(qc)}function Xx(){return _n().memoizedState}function Wx(){return _n().memoizedState}function $N(r){for(var o=r.return;o!==null;){switch(o.tag){case 24:case 3:var l=zr();r=_o(l);var u=Io(o,r,l);u!==null&&(Er(u,o,l),Ec(u,o,l)),o={cache:$m()},r.payload=o;return}o=o.return}}function KN(r,o,l){var u=zr();l={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Vd(r)?Zx(o,l):(l=_m(r,o,l,u),l!==null&&(Er(l,r,u),Jx(l,o,u)))}function Qx(r,o,l){var u=zr();Mc(r,o,l,u)}function Mc(r,o,l,u){var p={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Vd(r))Zx(o,p);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=o.lastRenderedReducer,v!==null))try{var N=o.lastRenderedState,U=v(N,l);if(p.hasEagerState=!0,p.eagerState=U,Dr(U,N))return Ed(r,o,p,0),hn===null&&Sd(),!1}catch{}finally{}if(l=_m(r,o,p,u),l!==null)return Er(l,r,u),Jx(l,o,u),!0}return!1}function vp(r,o,l,u){if(u={lane:2,revertLane:Wp(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Vd(r)){if(o)throw Error(a(479))}else o=_m(r,l,u,2),o!==null&&Er(o,r,2)}function Vd(r){var o=r.alternate;return r===kt||o!==null&&o===kt}function Zx(r,o){$s=Id=!0;var l=r.pending;l===null?o.next=o:(o.next=l.next,l.next=o),r.pending=o}function Jx(r,o,l){if((l&4194048)!==0){var u=o.lanes;u&=r.pendingLanes,l|=u,o.lanes=l,$(r,l)}}var Nc={readContext:tr,use:Ud,useCallback:On,useContext:On,useEffect:On,useImperativeHandle:On,useLayoutEffect:On,useInsertionEffect:On,useMemo:On,useReducer:On,useRef:On,useState:On,useDebugValue:On,useDeferredValue:On,useTransition:On,useSyncExternalStore:On,useId:On,useHostTransitionStatus:On,useFormState:On,useActionState:On,useOptimistic:On,useMemoCache:On,useCacheRefresh:On};Nc.useEffectEvent=On;var ew={readContext:tr,use:Ud,useCallback:function(r,o){return dr().memoizedState=[r,o===void 0?null:o],r},useContext:tr,useEffect:zx,useImperativeHandle:function(r,o,l){l=l!=null?l.concat([r]):null,Bd(4194308,4,Bx.bind(null,o,r),l)},useLayoutEffect:function(r,o){return Bd(4194308,4,r,o)},useInsertionEffect:function(r,o){Bd(4,2,r,o)},useMemo:function(r,o){var l=dr();o=o===void 0?null:o;var u=r();if(qi){Je(!0);try{r()}finally{Je(!1)}}return l.memoizedState=[u,o],u},useReducer:function(r,o,l){var u=dr();if(l!==void 0){var p=l(o);if(qi){Je(!0);try{l(o)}finally{Je(!1)}}}else p=o;return u.memoizedState=u.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},u.queue=r,r=r.dispatch=KN.bind(null,kt,r),[u.memoizedState,r]},useRef:function(r){var o=dr();return r={current:r},o.memoizedState=r},useState:function(r){r=dp(r);var o=r.queue,l=Qx.bind(null,kt,o);return o.dispatch=l,[r.memoizedState,l]},useDebugValue:mp,useDeferredValue:function(r,o){var l=dr();return pp(l,r,o)},useTransition:function(){var r=dp(!1);return r=$x.bind(null,kt,r.queue,!0,!1),dr().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,o,l){var u=kt,p=dr();if(Xt){if(l===void 0)throw Error(a(407));l=l()}else{if(l=o(),hn===null)throw Error(a(349));(Ft&127)!==0||wx(u,o,l)}p.memoizedState=l;var v={value:l,getSnapshot:o};return p.queue=v,zx(Ex.bind(null,u,v,r),[r]),u.flags|=2048,Gs(9,{destroy:void 0},Sx.bind(null,u,v,l,o),null),l},useId:function(){var r=dr(),o=hn.identifierPrefix;if(Xt){var l=Ca,u=Ta;l=(u&~(1<<32-ft(u)-1)).toString(32)+l,o="_"+o+"R_"+l,l=zd++,0<l&&(o+="H"+l.toString(32)),o+="_"}else l=HN++,o="_"+o+"r_"+l.toString(32)+"_";return r.memoizedState=o},useHostTransitionStatus:yp,useFormState:kx,useActionState:kx,useOptimistic:function(r){var o=dr();o.memoizedState=o.baseState=r;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=l,o=vp.bind(null,kt,!0,l),l.dispatch=o,[r,o]},useMemoCache:lp,useCacheRefresh:function(){return dr().memoizedState=$N.bind(null,kt)},useEffectEvent:function(r){var o=dr(),l={impl:r};return o.memoizedState=l,function(){if((an&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},bp={readContext:tr,use:Ud,useCallback:Vx,useContext:tr,useEffect:hp,useImperativeHandle:Fx,useInsertionEffect:Ux,useLayoutEffect:Hx,useMemo:Yx,useReducer:Hd,useRef:Ix,useState:function(){return Hd(to)},useDebugValue:mp,useDeferredValue:function(r,o){var l=_n();return qx(l,un.memoizedState,r,o)},useTransition:function(){var r=Hd(to)[0],o=_n().memoizedState;return[typeof r=="boolean"?r:Oc(r),o]},useSyncExternalStore:xx,useId:Xx,useHostTransitionStatus:yp,useFormState:jx,useActionState:jx,useOptimistic:function(r,o){var l=_n();return Cx(l,un,r,o)},useMemoCache:lp,useCacheRefresh:Wx};bp.useEffectEvent=Px;var tw={readContext:tr,use:Ud,useCallback:Vx,useContext:tr,useEffect:hp,useImperativeHandle:Fx,useInsertionEffect:Ux,useLayoutEffect:Hx,useMemo:Yx,useReducer:up,useRef:Ix,useState:function(){return up(to)},useDebugValue:mp,useDeferredValue:function(r,o){var l=_n();return un===null?pp(l,r,o):qx(l,un.memoizedState,r,o)},useTransition:function(){var r=up(to)[0],o=_n().memoizedState;return[typeof r=="boolean"?r:Oc(r),o]},useSyncExternalStore:xx,useId:Xx,useHostTransitionStatus:yp,useFormState:_x,useActionState:_x,useOptimistic:function(r,o){var l=_n();return un!==null?Cx(l,un,r,o):(l.baseState=r,[r,l.queue.dispatch])},useMemoCache:lp,useCacheRefresh:Wx};tw.useEffectEvent=Px;function xp(r,o,l,u){o=r.memoizedState,l=l(u,o),l=l==null?o:m({},o,l),r.memoizedState=l,r.lanes===0&&(r.updateQueue.baseState=l)}var wp={enqueueSetState:function(r,o,l){r=r._reactInternals;var u=zr(),p=_o(u);p.payload=o,l!=null&&(p.callback=l),o=Io(r,p,u),o!==null&&(Er(o,r,u),Ec(o,r,u))},enqueueReplaceState:function(r,o,l){r=r._reactInternals;var u=zr(),p=_o(u);p.tag=1,p.payload=o,l!=null&&(p.callback=l),o=Io(r,p,u),o!==null&&(Er(o,r,u),Ec(o,r,u))},enqueueForceUpdate:function(r,o){r=r._reactInternals;var l=zr(),u=_o(l);u.tag=2,o!=null&&(u.callback=o),o=Io(r,u,l),o!==null&&(Er(o,r,l),Ec(o,r,l))}};function nw(r,o,l,u,p,v,N){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(u,v,N):o.prototype&&o.prototype.isPureReactComponent?!pc(l,u)||!pc(p,v):!0}function rw(r,o,l,u){r=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(l,u),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(l,u),o.state!==r&&wp.enqueueReplaceState(o,o.state,null)}function $i(r,o){var l=o;if("ref"in o){l={};for(var u in o)u!=="ref"&&(l[u]=o[u])}if(r=r.defaultProps){l===o&&(l=m({},l));for(var p in r)l[p]===void 0&&(l[p]=r[p])}return l}function aw(r){wd(r)}function ow(r){console.error(r)}function iw(r){wd(r)}function Yd(r,o){try{var l=r.onUncaughtError;l(o.value,{componentStack:o.stack})}catch(u){setTimeout(function(){throw u})}}function sw(r,o,l){try{var u=r.onCaughtError;u(l.value,{componentStack:l.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Sp(r,o,l){return l=_o(l),l.tag=3,l.payload={element:null},l.callback=function(){Yd(r,o)},l}function lw(r){return r=_o(r),r.tag=3,r}function cw(r,o,l,u){var p=l.type.getDerivedStateFromError;if(typeof p=="function"){var v=u.value;r.payload=function(){return p(v)},r.callback=function(){sw(o,l,u)}}var N=l.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(r.callback=function(){sw(o,l,u),typeof p!="function"&&(Fo===null?Fo=new Set([this]):Fo.add(this));var U=u.stack;this.componentDidCatch(u.value,{componentStack:U!==null?U:""})})}function GN(r,o,l,u,p){if(l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(o=l.alternate,o!==null&&Hs(o,l,p,!0),l=jr.current,l!==null){switch(l.tag){case 31:case 13:return Zr===null?nf():l.alternate===null&&Mn===0&&(Mn=3),l.flags&=-257,l.flags|=65536,l.lanes=p,u===Dd?l.flags|=16384:(o=l.updateQueue,o===null?l.updateQueue=new Set([u]):o.add(u),Kp(r,u,p)),!1;case 22:return l.flags|=65536,u===Dd?l.flags|=16384:(o=l.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([u])},l.updateQueue=o):(l=o.retryQueue,l===null?o.retryQueue=new Set([u]):l.add(u)),Kp(r,u,p)),!1}throw Error(a(435,l.tag))}return Kp(r,u,p),nf(),!1}if(Xt)return o=jr.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=p,u!==Bm&&(r=Error(a(422),{cause:u}),vc(Gr(r,l)))):(u!==Bm&&(o=Error(a(423),{cause:u}),vc(Gr(o,l))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,u=Gr(u,l),p=Sp(r.stateNode,u,p),Zm(r,p),Mn!==4&&(Mn=2)),!1;var v=Error(a(520),{cause:u});if(v=Gr(v,l),zc===null?zc=[v]:zc.push(v),Mn!==4&&(Mn=2),o===null)return!0;u=Gr(u,l),l=o;do{switch(l.tag){case 3:return l.flags|=65536,r=p&-p,l.lanes|=r,r=Sp(l.stateNode,u,r),Zm(l,r),!1;case 1:if(o=l.type,v=l.stateNode,(l.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Fo===null||!Fo.has(v))))return l.flags|=65536,p&=-p,l.lanes|=p,p=lw(p),cw(p,r,l,u),Zm(l,p),!1}l=l.return}while(l!==null);return!1}var Ep=Error(a(461)),Un=!1;function nr(r,o,l,u){o.child=r===null?hx(o,null,l,u):Yi(o,r.child,l,u)}function uw(r,o,l,u,p){l=l.render;var v=o.ref;if("ref"in u){var N={};for(var U in u)U!=="ref"&&(N[U]=u[U])}else N=u;return Hi(o),u=ap(r,o,l,N,v,p),U=op(),r!==null&&!Un?(ip(r,o,p),no(r,o,p)):(Xt&&U&&Um(o),o.flags|=1,nr(r,o,u,p),o.child)}function dw(r,o,l,u,p){if(r===null){var v=l.type;return typeof v=="function"&&!Im(v)&&v.defaultProps===void 0&&l.compare===null?(o.tag=15,o.type=v,fw(r,o,v,u,p)):(r=Td(l.type,null,u,o,o.mode,p),r.ref=o.ref,r.return=o,o.child=r)}if(v=r.child,!Dp(r,p)){var N=v.memoizedProps;if(l=l.compare,l=l!==null?l:pc,l(N,u)&&r.ref===o.ref)return no(r,o,p)}return o.flags|=1,r=Wa(v,u),r.ref=o.ref,r.return=o,o.child=r}function fw(r,o,l,u,p){if(r!==null){var v=r.memoizedProps;if(pc(v,u)&&r.ref===o.ref)if(Un=!1,o.pendingProps=u=v,Dp(r,p))(r.flags&131072)!==0&&(Un=!0);else return o.lanes=r.lanes,no(r,o,p)}return Rp(r,o,l,u,p)}function hw(r,o,l,u){var p=u.children,v=r!==null?r.memoizedState:null;if(r===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((o.flags&128)!==0){if(v=v!==null?v.baseLanes|l:l,r!==null){for(u=o.child=r.child,p=0;u!==null;)p=p|u.lanes|u.childLanes,u=u.sibling;u=p&~v}else u=0,o.child=null;return mw(r,o,v,l,u)}if((l&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},r!==null&&Nd(o,v!==null?v.cachePool:null),v!==null?gx(o,v):ep(),yx(o);else return u=o.lanes=536870912,mw(r,o,v!==null?v.baseLanes|l:l,l,u)}else v!==null?(Nd(o,v.cachePool),gx(o,v),Po(),o.memoizedState=null):(r!==null&&Nd(o,null),ep(),Po());return nr(r,o,p,l),o.child}function Ac(r,o){return r!==null&&r.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function mw(r,o,l,u,p){var v=Gm();return v=v===null?null:{parent:zn._currentValue,pool:v},o.memoizedState={baseLanes:l,cachePool:v},r!==null&&Nd(o,null),ep(),yx(o),r!==null&&Hs(r,o,u,!0),o.childLanes=p,null}function qd(r,o){return o=Kd({mode:o.mode,children:o.children},r.mode),o.ref=r.ref,r.child=o,o.return=r,o}function pw(r,o,l){return Yi(o,r.child,null,l),r=qd(o,o.pendingProps),r.flags|=2,Lr(o),o.memoizedState=null,r}function XN(r,o,l){var u=o.pendingProps,p=(o.flags&128)!==0;if(o.flags&=-129,r===null){if(Xt){if(u.mode==="hidden")return r=qd(o,u),o.lanes=536870912,Ac(null,r);if(np(o),(r=gn)?(r=OS(r,Qr),r=r!==null&&r.data==="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:Ao!==null?{id:Ta,overflow:Ca}:null,retryLane:536870912,hydrationErrors:null},l=Z0(r),l.return=o,o.child=l,er=o,gn=null)):r=null,r===null)throw ko(o);return o.lanes=536870912,null}return qd(o,u)}var v=r.memoizedState;if(v!==null){var N=v.dehydrated;if(np(o),p)if(o.flags&256)o.flags&=-257,o=pw(r,o,l);else if(o.memoizedState!==null)o.child=r.child,o.flags|=128,o=null;else throw Error(a(558));else if(Un||Hs(r,o,l,!1),p=(l&r.childLanes)!==0,Un||p){if(u=hn,u!==null&&(N=ne(u,l),N!==0&&N!==v.retryLane))throw v.retryLane=N,Ii(r,N),Er(u,r,N),Ep;nf(),o=pw(r,o,l)}else r=v.treeContext,gn=Jr(N.nextSibling),er=o,Xt=!0,Do=null,Qr=!1,r!==null&&tx(o,r),o=qd(o,u),o.flags|=4096;return o}return r=Wa(r.child,{mode:u.mode,children:u.children}),r.ref=o.ref,o.child=r,r.return=o,r}function $d(r,o){var l=o.ref;if(l===null)r!==null&&r.ref!==null&&(o.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(r===null||r.ref!==l)&&(o.flags|=4194816)}}function Rp(r,o,l,u,p){return Hi(o),l=ap(r,o,l,u,void 0,p),u=op(),r!==null&&!Un?(ip(r,o,p),no(r,o,p)):(Xt&&u&&Um(o),o.flags|=1,nr(r,o,l,p),o.child)}function gw(r,o,l,u,p,v){return Hi(o),o.updateQueue=null,l=bx(o,u,l,p),vx(r),u=op(),r!==null&&!Un?(ip(r,o,v),no(r,o,v)):(Xt&&u&&Um(o),o.flags|=1,nr(r,o,l,v),o.child)}function yw(r,o,l,u,p){if(Hi(o),o.stateNode===null){var v=Is,N=l.contextType;typeof N=="object"&&N!==null&&(v=tr(N)),v=new l(u,v),o.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=wp,o.stateNode=v,v._reactInternals=o,v=o.stateNode,v.props=u,v.state=o.memoizedState,v.refs={},Wm(o),N=l.contextType,v.context=typeof N=="object"&&N!==null?tr(N):Is,v.state=o.memoizedState,N=l.getDerivedStateFromProps,typeof N=="function"&&(xp(o,l,N,u),v.state=o.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(N=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),N!==v.state&&wp.enqueueReplaceState(v,v.state,null),Tc(o,u,v,p),Rc(),v.state=o.memoizedState),typeof v.componentDidMount=="function"&&(o.flags|=4194308),u=!0}else if(r===null){v=o.stateNode;var U=o.memoizedProps,ee=$i(l,U);v.props=ee;var he=v.context,Re=l.contextType;N=Is,typeof Re=="object"&&Re!==null&&(N=tr(Re));var Ne=l.getDerivedStateFromProps;Re=typeof Ne=="function"||typeof v.getSnapshotBeforeUpdate=="function",U=o.pendingProps!==U,Re||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(U||he!==N)&&rw(o,v,u,N),Lo=!1;var me=o.memoizedState;v.state=me,Tc(o,u,v,p),Rc(),he=o.memoizedState,U||me!==he||Lo?(typeof Ne=="function"&&(xp(o,l,Ne,u),he=o.memoizedState),(ee=Lo||nw(o,l,ee,u,me,he,N))?(Re||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(o.flags|=4194308)):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=u,o.memoizedState=he),v.props=u,v.state=he,v.context=N,u=ee):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),u=!1)}else{v=o.stateNode,Qm(r,o),N=o.memoizedProps,Re=$i(l,N),v.props=Re,Ne=o.pendingProps,me=v.context,he=l.contextType,ee=Is,typeof he=="object"&&he!==null&&(ee=tr(he)),U=l.getDerivedStateFromProps,(he=typeof U=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(N!==Ne||me!==ee)&&rw(o,v,u,ee),Lo=!1,me=o.memoizedState,v.state=me,Tc(o,u,v,p),Rc();var ye=o.memoizedState;N!==Ne||me!==ye||Lo||r!==null&&r.dependencies!==null&&Od(r.dependencies)?(typeof U=="function"&&(xp(o,l,U,u),ye=o.memoizedState),(Re=Lo||nw(o,l,Re,u,me,ye,ee)||r!==null&&r.dependencies!==null&&Od(r.dependencies))?(he||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(u,ye,ee),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(u,ye,ee)),typeof v.componentDidUpdate=="function"&&(o.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof v.componentDidUpdate!="function"||N===r.memoizedProps&&me===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||N===r.memoizedProps&&me===r.memoizedState||(o.flags|=1024),o.memoizedProps=u,o.memoizedState=ye),v.props=u,v.state=ye,v.context=ee,u=Re):(typeof v.componentDidUpdate!="function"||N===r.memoizedProps&&me===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||N===r.memoizedProps&&me===r.memoizedState||(o.flags|=1024),u=!1)}return v=u,$d(r,o),u=(o.flags&128)!==0,v||u?(v=o.stateNode,l=u&&typeof l.getDerivedStateFromError!="function"?null:v.render(),o.flags|=1,r!==null&&u?(o.child=Yi(o,r.child,null,p),o.child=Yi(o,null,l,p)):nr(r,o,l,p),o.memoizedState=v.state,r=o.child):r=no(r,o,p),r}function vw(r,o,l,u){return Pi(),o.flags|=256,nr(r,o,l,u),o.child}var Tp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cp(r){return{baseLanes:r,cachePool:sx()}}function Op(r,o,l){return r=r!==null?r.childLanes&~l:0,o&&(r|=Ir),r}function bw(r,o,l){var u=o.pendingProps,p=!1,v=(o.flags&128)!==0,N;if((N=v)||(N=r!==null&&r.memoizedState===null?!1:(Ln.current&2)!==0),N&&(p=!0,o.flags&=-129),N=(o.flags&32)!==0,o.flags&=-33,r===null){if(Xt){if(p?zo(o):Po(),(r=gn)?(r=OS(r,Qr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:Ao!==null?{id:Ta,overflow:Ca}:null,retryLane:536870912,hydrationErrors:null},l=Z0(r),l.return=o,o.child=l,er=o,gn=null)):r=null,r===null)throw ko(o);return cg(r)?o.lanes=32:o.lanes=536870912,null}var U=u.children;return u=u.fallback,p?(Po(),p=o.mode,U=Kd({mode:"hidden",children:U},p),u=zi(u,p,l,null),U.return=o,u.return=o,U.sibling=u,o.child=U,u=o.child,u.memoizedState=Cp(l),u.childLanes=Op(r,N,l),o.memoizedState=Tp,Ac(null,u)):(zo(o),Mp(o,U))}var ee=r.memoizedState;if(ee!==null&&(U=ee.dehydrated,U!==null)){if(v)o.flags&256?(zo(o),o.flags&=-257,o=Np(r,o,l)):o.memoizedState!==null?(Po(),o.child=r.child,o.flags|=128,o=null):(Po(),U=u.fallback,p=o.mode,u=Kd({mode:"visible",children:u.children},p),U=zi(U,p,l,null),U.flags|=2,u.return=o,U.return=o,u.sibling=U,o.child=u,Yi(o,r.child,null,l),u=o.child,u.memoizedState=Cp(l),u.childLanes=Op(r,N,l),o.memoizedState=Tp,o=Ac(null,u));else if(zo(o),cg(U)){if(N=U.nextSibling&&U.nextSibling.dataset,N)var he=N.dgst;N=he,u=Error(a(419)),u.stack="",u.digest=N,vc({value:u,source:null,stack:null}),o=Np(r,o,l)}else if(Un||Hs(r,o,l,!1),N=(l&r.childLanes)!==0,Un||N){if(N=hn,N!==null&&(u=ne(N,l),u!==0&&u!==ee.retryLane))throw ee.retryLane=u,Ii(r,u),Er(N,r,u),Ep;lg(U)||nf(),o=Np(r,o,l)}else lg(U)?(o.flags|=192,o.child=r.child,o=null):(r=ee.treeContext,gn=Jr(U.nextSibling),er=o,Xt=!0,Do=null,Qr=!1,r!==null&&tx(o,r),o=Mp(o,u.children),o.flags|=4096);return o}return p?(Po(),U=u.fallback,p=o.mode,ee=r.child,he=ee.sibling,u=Wa(ee,{mode:"hidden",children:u.children}),u.subtreeFlags=ee.subtreeFlags&65011712,he!==null?U=Wa(he,U):(U=zi(U,p,l,null),U.flags|=2),U.return=o,u.return=o,u.sibling=U,o.child=u,Ac(null,u),u=o.child,U=r.child.memoizedState,U===null?U=Cp(l):(p=U.cachePool,p!==null?(ee=zn._currentValue,p=p.parent!==ee?{parent:ee,pool:ee}:p):p=sx(),U={baseLanes:U.baseLanes|l,cachePool:p}),u.memoizedState=U,u.childLanes=Op(r,N,l),o.memoizedState=Tp,Ac(r.child,u)):(zo(o),l=r.child,r=l.sibling,l=Wa(l,{mode:"visible",children:u.children}),l.return=o,l.sibling=null,r!==null&&(N=o.deletions,N===null?(o.deletions=[r],o.flags|=16):N.push(r)),o.child=l,o.memoizedState=null,l)}function Mp(r,o){return o=Kd({mode:"visible",children:o},r.mode),o.return=r,r.child=o}function Kd(r,o){return r=kr(22,r,null,o),r.lanes=0,r}function Np(r,o,l){return Yi(o,r.child,null,l),r=Mp(o,o.pendingProps.children),r.flags|=2,o.memoizedState=null,r}function xw(r,o,l){r.lanes|=o;var u=r.alternate;u!==null&&(u.lanes|=o),Ym(r.return,o,l)}function Ap(r,o,l,u,p,v){var N=r.memoizedState;N===null?r.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:u,tail:l,tailMode:p,treeForkCount:v}:(N.isBackwards=o,N.rendering=null,N.renderingStartTime=0,N.last=u,N.tail=l,N.tailMode=p,N.treeForkCount=v)}function ww(r,o,l){var u=o.pendingProps,p=u.revealOrder,v=u.tail;u=u.children;var N=Ln.current,U=(N&2)!==0;if(U?(N=N&1|2,o.flags|=128):N&=1,X(Ln,N),nr(r,o,u,l),u=Xt?yc:0,!U&&r!==null&&(r.flags&128)!==0)e:for(r=o.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&xw(r,l,o);else if(r.tag===19)xw(r,l,o);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===o)break e;for(;r.sibling===null;){if(r.return===null||r.return===o)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(p){case"forwards":for(l=o.child,p=null;l!==null;)r=l.alternate,r!==null&&_d(r)===null&&(p=l),l=l.sibling;l=p,l===null?(p=o.child,o.child=null):(p=l.sibling,l.sibling=null),Ap(o,!1,p,l,v,u);break;case"backwards":case"unstable_legacy-backwards":for(l=null,p=o.child,o.child=null;p!==null;){if(r=p.alternate,r!==null&&_d(r)===null){o.child=p;break}r=p.sibling,p.sibling=l,l=p,p=r}Ap(o,!0,l,null,v,u);break;case"together":Ap(o,!1,null,null,void 0,u);break;default:o.memoizedState=null}return o.child}function no(r,o,l){if(r!==null&&(o.dependencies=r.dependencies),Bo|=o.lanes,(l&o.childLanes)===0)if(r!==null){if(Hs(r,o,l,!1),(l&o.childLanes)===0)return null}else return null;if(r!==null&&o.child!==r.child)throw Error(a(153));if(o.child!==null){for(r=o.child,l=Wa(r,r.pendingProps),o.child=l,l.return=o;r.sibling!==null;)r=r.sibling,l=l.sibling=Wa(r,r.pendingProps),l.return=o;l.sibling=null}return o.child}function Dp(r,o){return(r.lanes&o)!==0?!0:(r=r.dependencies,!!(r!==null&&Od(r)))}function WN(r,o,l){switch(o.tag){case 3:ve(o,o.stateNode.containerInfo),jo(o,zn,r.memoizedState.cache),Pi();break;case 27:case 5:Me(o);break;case 4:ve(o,o.stateNode.containerInfo);break;case 10:jo(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,np(o),null;break;case 13:var u=o.memoizedState;if(u!==null)return u.dehydrated!==null?(zo(o),o.flags|=128,null):(l&o.child.childLanes)!==0?bw(r,o,l):(zo(o),r=no(r,o,l),r!==null?r.sibling:null);zo(o);break;case 19:var p=(r.flags&128)!==0;if(u=(l&o.childLanes)!==0,u||(Hs(r,o,l,!1),u=(l&o.childLanes)!==0),p){if(u)return ww(r,o,l);o.flags|=128}if(p=o.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),X(Ln,Ln.current),u)break;return null;case 22:return o.lanes=0,hw(r,o,l,o.pendingProps);case 24:jo(o,zn,r.memoizedState.cache)}return no(r,o,l)}function Sw(r,o,l){if(r!==null)if(r.memoizedProps!==o.pendingProps)Un=!0;else{if(!Dp(r,l)&&(o.flags&128)===0)return Un=!1,WN(r,o,l);Un=(r.flags&131072)!==0}else Un=!1,Xt&&(o.flags&1048576)!==0&&ex(o,yc,o.index);switch(o.lanes=0,o.tag){case 16:e:{var u=o.pendingProps;if(r=Fi(o.elementType),o.type=r,typeof r=="function")Im(r)?(u=$i(r,u),o.tag=1,o=yw(null,o,r,u,l)):(o.tag=0,o=Rp(null,o,r,u,l));else{if(r!=null){var p=r.$$typeof;if(p===O){o.tag=11,o=uw(null,o,r,u,l);break e}else if(p===A){o.tag=14,o=dw(null,o,r,u,l);break e}}throw o=F(r)||r,Error(a(306,o,""))}}return o;case 0:return Rp(r,o,o.type,o.pendingProps,l);case 1:return u=o.type,p=$i(u,o.pendingProps),yw(r,o,u,p,l);case 3:e:{if(ve(o,o.stateNode.containerInfo),r===null)throw Error(a(387));u=o.pendingProps;var v=o.memoizedState;p=v.element,Qm(r,o),Tc(o,u,null,l);var N=o.memoizedState;if(u=N.cache,jo(o,zn,u),u!==v.cache&&qm(o,[zn],l,!0),Rc(),u=N.element,v.isDehydrated)if(v={element:u,isDehydrated:!1,cache:N.cache},o.updateQueue.baseState=v,o.memoizedState=v,o.flags&256){o=vw(r,o,u,l);break e}else if(u!==p){p=Gr(Error(a(424)),o),vc(p),o=vw(r,o,u,l);break e}else{switch(r=o.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(gn=Jr(r.firstChild),er=o,Xt=!0,Do=null,Qr=!0,l=hx(o,null,u,l),o.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Pi(),u===p){o=no(r,o,l);break e}nr(r,o,u,l)}o=o.child}return o;case 26:return $d(r,o),r===null?(l=jS(o.type,null,o.pendingProps,null))?o.memoizedState=l:Xt||(l=o.type,r=o.pendingProps,u=uf(ie.current).createElement(l),u[Fe]=o,u[$e]=r,rr(u,l,r),bn(u),o.stateNode=u):o.memoizedState=jS(o.type,r.memoizedProps,o.pendingProps,r.memoizedState),null;case 27:return Me(o),r===null&&Xt&&(u=o.stateNode=AS(o.type,o.pendingProps,ie.current),er=o,Qr=!0,p=gn,$o(o.type)?(ug=p,gn=Jr(u.firstChild)):gn=p),nr(r,o,o.pendingProps.children,l),$d(r,o),r===null&&(o.flags|=4194304),o.child;case 5:return r===null&&Xt&&((p=u=gn)&&(u=CA(u,o.type,o.pendingProps,Qr),u!==null?(o.stateNode=u,er=o,gn=Jr(u.firstChild),Qr=!1,p=!0):p=!1),p||ko(o)),Me(o),p=o.type,v=o.pendingProps,N=r!==null?r.memoizedProps:null,u=v.children,og(p,v)?u=null:N!==null&&og(p,N)&&(o.flags|=32),o.memoizedState!==null&&(p=ap(r,o,BN,null,null,l),qc._currentValue=p),$d(r,o),nr(r,o,u,l),o.child;case 6:return r===null&&Xt&&((r=l=gn)&&(l=OA(l,o.pendingProps,Qr),l!==null?(o.stateNode=l,er=o,gn=null,r=!0):r=!1),r||ko(o)),null;case 13:return bw(r,o,l);case 4:return ve(o,o.stateNode.containerInfo),u=o.pendingProps,r===null?o.child=Yi(o,null,u,l):nr(r,o,u,l),o.child;case 11:return uw(r,o,o.type,o.pendingProps,l);case 7:return nr(r,o,o.pendingProps,l),o.child;case 8:return nr(r,o,o.pendingProps.children,l),o.child;case 12:return nr(r,o,o.pendingProps.children,l),o.child;case 10:return u=o.pendingProps,jo(o,o.type,u.value),nr(r,o,u.children,l),o.child;case 9:return p=o.type._context,u=o.pendingProps.children,Hi(o),p=tr(p),u=u(p),o.flags|=1,nr(r,o,u,l),o.child;case 14:return dw(r,o,o.type,o.pendingProps,l);case 15:return fw(r,o,o.type,o.pendingProps,l);case 19:return ww(r,o,l);case 31:return XN(r,o,l);case 22:return hw(r,o,l,o.pendingProps);case 24:return Hi(o),u=tr(zn),r===null?(p=Gm(),p===null&&(p=hn,v=$m(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=l),p=v),o.memoizedState={parent:u,cache:p},Wm(o),jo(o,zn,p)):((r.lanes&l)!==0&&(Qm(r,o),Tc(o,null,null,l),Rc()),p=r.memoizedState,v=o.memoizedState,p.parent!==u?(p={parent:u,cache:u},o.memoizedState=p,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=p),jo(o,zn,u)):(u=v.cache,jo(o,zn,u),u!==p.cache&&qm(o,[zn],l,!0))),nr(r,o,o.pendingProps.children,l),o.child;case 29:throw o.pendingProps}throw Error(a(156,o.tag))}function ro(r){r.flags|=4}function kp(r,o,l,u,p){if((o=(r.mode&32)!==0)&&(o=!1),o){if(r.flags|=16777216,(p&335544128)===p)if(r.stateNode.complete)r.flags|=8192;else if(Xw())r.flags|=8192;else throw Vi=Dd,Xm}else r.flags&=-16777217}function Ew(r,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!PS(o))if(Xw())r.flags|=8192;else throw Vi=Dd,Xm}function Gd(r,o){o!==null&&(r.flags|=4),r.flags&16384&&(o=r.tag!==22?St():536870912,r.lanes|=o,Zs|=o)}function Dc(r,o){if(!Xt)switch(r.tailMode){case"hidden":o=r.tail;for(var l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?r.tail=null:l.sibling=null;break;case"collapsed":l=r.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?o||r.tail===null?r.tail=null:r.tail.sibling=null:u.sibling=null}}function yn(r){var o=r.alternate!==null&&r.alternate.child===r.child,l=0,u=0;if(o)for(var p=r.child;p!==null;)l|=p.lanes|p.childLanes,u|=p.subtreeFlags&65011712,u|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)l|=p.lanes|p.childLanes,u|=p.subtreeFlags,u|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=u,r.childLanes=l,o}function QN(r,o,l){var u=o.pendingProps;switch(Hm(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yn(o),null;case 1:return yn(o),null;case 3:return l=o.stateNode,u=null,r!==null&&(u=r.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),Ja(zn),Se(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(r===null||r.child===null)&&(Us(o)?ro(o):r===null||r.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Fm())),yn(o),null;case 26:var p=o.type,v=o.memoizedState;return r===null?(ro(o),v!==null?(yn(o),Ew(o,v)):(yn(o),kp(o,p,null,u,l))):v?v!==r.memoizedState?(ro(o),yn(o),Ew(o,v)):(yn(o),o.flags&=-16777217):(r=r.memoizedProps,r!==u&&ro(o),yn(o),kp(o,p,r,u,l)),null;case 27:if(ke(o),l=ie.current,p=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==u&&ro(o);else{if(!u){if(o.stateNode===null)throw Error(a(166));return yn(o),null}r=W.current,Us(o)?nx(o):(r=AS(p,u,l),o.stateNode=r,ro(o))}return yn(o),null;case 5:if(ke(o),p=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==u&&ro(o);else{if(!u){if(o.stateNode===null)throw Error(a(166));return yn(o),null}if(v=W.current,Us(o))nx(o);else{var N=uf(ie.current);switch(v){case 1:v=N.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:v=N.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":v=N.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":v=N.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":v=N.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof u.is=="string"?N.createElement("select",{is:u.is}):N.createElement("select"),u.multiple?v.multiple=!0:u.size&&(v.size=u.size);break;default:v=typeof u.is=="string"?N.createElement(p,{is:u.is}):N.createElement(p)}}v[Fe]=o,v[$e]=u;e:for(N=o.child;N!==null;){if(N.tag===5||N.tag===6)v.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===o)break e;for(;N.sibling===null;){if(N.return===null||N.return===o)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}o.stateNode=v;e:switch(rr(v,p,u),p){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&ro(o)}}return yn(o),kp(o,o.type,r===null?null:r.memoizedProps,o.pendingProps,l),null;case 6:if(r&&o.stateNode!=null)r.memoizedProps!==u&&ro(o);else{if(typeof u!="string"&&o.stateNode===null)throw Error(a(166));if(r=ie.current,Us(o)){if(r=o.stateNode,l=o.memoizedProps,u=null,p=er,p!==null)switch(p.tag){case 27:case 5:u=p.memoizedProps}r[Fe]=o,r=!!(r.nodeValue===l||u!==null&&u.suppressHydrationWarning===!0||bS(r.nodeValue,l)),r||ko(o,!0)}else r=uf(r).createTextNode(u),r[Fe]=o,o.stateNode=r}return yn(o),null;case 31:if(l=o.memoizedState,r===null||r.memoizedState!==null){if(u=Us(o),l!==null){if(r===null){if(!u)throw Error(a(318));if(r=o.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[Fe]=o}else Pi(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;yn(o),r=!1}else l=Fm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=l),r=!0;if(!r)return o.flags&256?(Lr(o),o):(Lr(o),null);if((o.flags&128)!==0)throw Error(a(558))}return yn(o),null;case 13:if(u=o.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Us(o),u!==null&&u.dehydrated!==null){if(r===null){if(!p)throw Error(a(318));if(p=o.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[Fe]=o}else Pi(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;yn(o),p=!1}else p=Fm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return o.flags&256?(Lr(o),o):(Lr(o),null)}return Lr(o),(o.flags&128)!==0?(o.lanes=l,o):(l=u!==null,r=r!==null&&r.memoizedState!==null,l&&(u=o.child,p=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(p=u.alternate.memoizedState.cachePool.pool),v=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(v=u.memoizedState.cachePool.pool),v!==p&&(u.flags|=2048)),l!==r&&l&&(o.child.flags|=8192),Gd(o,o.updateQueue),yn(o),null);case 4:return Se(),r===null&&eg(o.stateNode.containerInfo),yn(o),null;case 10:return Ja(o.type),yn(o),null;case 19:if(q(Ln),u=o.memoizedState,u===null)return yn(o),null;if(p=(o.flags&128)!==0,v=u.rendering,v===null)if(p)Dc(u,!1);else{if(Mn!==0||r!==null&&(r.flags&128)!==0)for(r=o.child;r!==null;){if(v=_d(r),v!==null){for(o.flags|=128,Dc(u,!1),r=v.updateQueue,o.updateQueue=r,Gd(o,r),o.subtreeFlags=0,r=l,l=o.child;l!==null;)Q0(l,r),l=l.sibling;return X(Ln,Ln.current&1|2),Xt&&Qa(o,u.treeForkCount),o.child}r=r.sibling}u.tail!==null&&Ae()>Jd&&(o.flags|=128,p=!0,Dc(u,!1),o.lanes=4194304)}else{if(!p)if(r=_d(v),r!==null){if(o.flags|=128,p=!0,r=r.updateQueue,o.updateQueue=r,Gd(o,r),Dc(u,!0),u.tail===null&&u.tailMode==="hidden"&&!v.alternate&&!Xt)return yn(o),null}else 2*Ae()-u.renderingStartTime>Jd&&l!==536870912&&(o.flags|=128,p=!0,Dc(u,!1),o.lanes=4194304);u.isBackwards?(v.sibling=o.child,o.child=v):(r=u.last,r!==null?r.sibling=v:o.child=v,u.last=v)}return u.tail!==null?(r=u.tail,u.rendering=r,u.tail=r.sibling,u.renderingStartTime=Ae(),r.sibling=null,l=Ln.current,X(Ln,p?l&1|2:l&1),Xt&&Qa(o,u.treeForkCount),r):(yn(o),null);case 22:case 23:return Lr(o),tp(),u=o.memoizedState!==null,r!==null?r.memoizedState!==null!==u&&(o.flags|=8192):u&&(o.flags|=8192),u?(l&536870912)!==0&&(o.flags&128)===0&&(yn(o),o.subtreeFlags&6&&(o.flags|=8192)):yn(o),l=o.updateQueue,l!==null&&Gd(o,l.retryQueue),l=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),u=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(u=o.memoizedState.cachePool.pool),u!==l&&(o.flags|=2048),r!==null&&q(Bi),null;case 24:return l=null,r!==null&&(l=r.memoizedState.cache),o.memoizedState.cache!==l&&(o.flags|=2048),Ja(zn),yn(o),null;case 25:return null;case 30:return null}throw Error(a(156,o.tag))}function ZN(r,o){switch(Hm(o),o.tag){case 1:return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 3:return Ja(zn),Se(),r=o.flags,(r&65536)!==0&&(r&128)===0?(o.flags=r&-65537|128,o):null;case 26:case 27:case 5:return ke(o),null;case 31:if(o.memoizedState!==null){if(Lr(o),o.alternate===null)throw Error(a(340));Pi()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 13:if(Lr(o),r=o.memoizedState,r!==null&&r.dehydrated!==null){if(o.alternate===null)throw Error(a(340));Pi()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 19:return q(Ln),null;case 4:return Se(),null;case 10:return Ja(o.type),null;case 22:case 23:return Lr(o),tp(),r!==null&&q(Bi),r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 24:return Ja(zn),null;case 25:return null;default:return null}}function Rw(r,o){switch(Hm(o),o.tag){case 3:Ja(zn),Se();break;case 26:case 27:case 5:ke(o);break;case 4:Se();break;case 31:o.memoizedState!==null&&Lr(o);break;case 13:Lr(o);break;case 19:q(Ln);break;case 10:Ja(o.type);break;case 22:case 23:Lr(o),tp(),r!==null&&q(Bi);break;case 24:Ja(zn)}}function kc(r,o){try{var l=o.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var p=u.next;l=p;do{if((l.tag&r)===r){u=void 0;var v=l.create,N=l.inst;u=v(),N.destroy=u}l=l.next}while(l!==p)}}catch(U){ln(o,o.return,U)}}function Uo(r,o,l){try{var u=o.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var v=p.next;u=v;do{if((u.tag&r)===r){var N=u.inst,U=N.destroy;if(U!==void 0){N.destroy=void 0,p=o;var ee=l,he=U;try{he()}catch(Re){ln(p,ee,Re)}}}u=u.next}while(u!==v)}}catch(Re){ln(o,o.return,Re)}}function Tw(r){var o=r.updateQueue;if(o!==null){var l=r.stateNode;try{px(o,l)}catch(u){ln(r,r.return,u)}}}function Cw(r,o,l){l.props=$i(r.type,r.memoizedProps),l.state=r.memoizedState;try{l.componentWillUnmount()}catch(u){ln(r,o,u)}}function jc(r,o){try{var l=r.ref;if(l!==null){switch(r.tag){case 26:case 27:case 5:var u=r.stateNode;break;case 30:u=r.stateNode;break;default:u=r.stateNode}typeof l=="function"?r.refCleanup=l(u):l.current=u}}catch(p){ln(r,o,p)}}function Oa(r,o){var l=r.ref,u=r.refCleanup;if(l!==null)if(typeof u=="function")try{u()}catch(p){ln(r,o,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(p){ln(r,o,p)}else l.current=null}function Ow(r){var o=r.type,l=r.memoizedProps,u=r.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":l.autoFocus&&u.focus();break e;case"img":l.src?u.src=l.src:l.srcSet&&(u.srcset=l.srcSet)}}catch(p){ln(r,r.return,p)}}function jp(r,o,l){try{var u=r.stateNode;xA(u,r.type,l,o),u[$e]=o}catch(p){ln(r,r.return,p)}}function Mw(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&$o(r.type)||r.tag===4}function Lp(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Mw(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&$o(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function _p(r,o,l){var u=r.tag;if(u===5||u===6)r=r.stateNode,o?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(r,o):(o=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,o.appendChild(r),l=l._reactRootContainer,l!=null||o.onclick!==null||(o.onclick=Ga));else if(u!==4&&(u===27&&$o(r.type)&&(l=r.stateNode,o=null),r=r.child,r!==null))for(_p(r,o,l),r=r.sibling;r!==null;)_p(r,o,l),r=r.sibling}function Xd(r,o,l){var u=r.tag;if(u===5||u===6)r=r.stateNode,o?l.insertBefore(r,o):l.appendChild(r);else if(u!==4&&(u===27&&$o(r.type)&&(l=r.stateNode),r=r.child,r!==null))for(Xd(r,o,l),r=r.sibling;r!==null;)Xd(r,o,l),r=r.sibling}function Nw(r){var o=r.stateNode,l=r.memoizedProps;try{for(var u=r.type,p=o.attributes;p.length;)o.removeAttributeNode(p[0]);rr(o,u,l),o[Fe]=r,o[$e]=l}catch(v){ln(r,r.return,v)}}var ao=!1,Hn=!1,Ip=!1,Aw=typeof WeakSet=="function"?WeakSet:Set,Xn=null;function JN(r,o){if(r=r.containerInfo,rg=yf,r=F0(r),Nm(r)){if("selectionStart"in r)var l={start:r.selectionStart,end:r.selectionEnd};else e:{l=(l=r.ownerDocument)&&l.defaultView||window;var u=l.getSelection&&l.getSelection();if(u&&u.rangeCount!==0){l=u.anchorNode;var p=u.anchorOffset,v=u.focusNode;u=u.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var N=0,U=-1,ee=-1,he=0,Re=0,Ne=r,me=null;t:for(;;){for(var ye;Ne!==l||p!==0&&Ne.nodeType!==3||(U=N+p),Ne!==v||u!==0&&Ne.nodeType!==3||(ee=N+u),Ne.nodeType===3&&(N+=Ne.nodeValue.length),(ye=Ne.firstChild)!==null;)me=Ne,Ne=ye;for(;;){if(Ne===r)break t;if(me===l&&++he===p&&(U=N),me===v&&++Re===u&&(ee=N),(ye=Ne.nextSibling)!==null)break;Ne=me,me=Ne.parentNode}Ne=ye}l=U===-1||ee===-1?null:{start:U,end:ee}}else l=null}l=l||{start:0,end:0}}else l=null;for(ag={focusedElem:r,selectionRange:l},yf=!1,Xn=o;Xn!==null;)if(o=Xn,r=o.child,(o.subtreeFlags&1028)!==0&&r!==null)r.return=o,Xn=r;else for(;Xn!==null;){switch(o=Xn,v=o.alternate,r=o.flags,o.tag){case 0:if((r&4)!==0&&(r=o.updateQueue,r=r!==null?r.events:null,r!==null))for(l=0;l<r.length;l++)p=r[l],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&v!==null){r=void 0,l=o,p=v.memoizedProps,v=v.memoizedState,u=l.stateNode;try{var nt=$i(l.type,p);r=u.getSnapshotBeforeUpdate(nt,v),u.__reactInternalSnapshotBeforeUpdate=r}catch(gt){ln(l,l.return,gt)}}break;case 3:if((r&1024)!==0){if(r=o.stateNode.containerInfo,l=r.nodeType,l===9)sg(r);else if(l===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":sg(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(a(163))}if(r=o.sibling,r!==null){r.return=o.return,Xn=r;break}Xn=o.return}}function Dw(r,o,l){var u=l.flags;switch(l.tag){case 0:case 11:case 15:io(r,l),u&4&&kc(5,l);break;case 1:if(io(r,l),u&4)if(r=l.stateNode,o===null)try{r.componentDidMount()}catch(N){ln(l,l.return,N)}else{var p=$i(l.type,o.memoizedProps);o=o.memoizedState;try{r.componentDidUpdate(p,o,r.__reactInternalSnapshotBeforeUpdate)}catch(N){ln(l,l.return,N)}}u&64&&Tw(l),u&512&&jc(l,l.return);break;case 3:if(io(r,l),u&64&&(r=l.updateQueue,r!==null)){if(o=null,l.child!==null)switch(l.child.tag){case 27:case 5:o=l.child.stateNode;break;case 1:o=l.child.stateNode}try{px(r,o)}catch(N){ln(l,l.return,N)}}break;case 27:o===null&&u&4&&Nw(l);case 26:case 5:io(r,l),o===null&&u&4&&Ow(l),u&512&&jc(l,l.return);break;case 12:io(r,l);break;case 31:io(r,l),u&4&&Lw(r,l);break;case 13:io(r,l),u&4&&_w(r,l),u&64&&(r=l.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(l=lA.bind(null,l),MA(r,l))));break;case 22:if(u=l.memoizedState!==null||ao,!u){o=o!==null&&o.memoizedState!==null||Hn,p=ao;var v=Hn;ao=u,(Hn=o)&&!v?so(r,l,(l.subtreeFlags&8772)!==0):io(r,l),ao=p,Hn=v}break;case 30:break;default:io(r,l)}}function kw(r){var o=r.alternate;o!==null&&(r.alternate=null,kw(o)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(o=r.stateNode,o!==null&&Tn(o)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var xn=null,br=!1;function oo(r,o,l){for(l=l.child;l!==null;)jw(r,o,l),l=l.sibling}function jw(r,o,l){if(ze&&typeof ze.onCommitFiberUnmount=="function")try{ze.onCommitFiberUnmount(st,l)}catch{}switch(l.tag){case 26:Hn||Oa(l,o),oo(r,o,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Hn||Oa(l,o);var u=xn,p=br;$o(l.type)&&(xn=l.stateNode,br=!1),oo(r,o,l),Fc(l.stateNode),xn=u,br=p;break;case 5:Hn||Oa(l,o);case 6:if(u=xn,p=br,xn=null,oo(r,o,l),xn=u,br=p,xn!==null)if(br)try{(xn.nodeType===9?xn.body:xn.nodeName==="HTML"?xn.ownerDocument.body:xn).removeChild(l.stateNode)}catch(v){ln(l,o,v)}else try{xn.removeChild(l.stateNode)}catch(v){ln(l,o,v)}break;case 18:xn!==null&&(br?(r=xn,TS(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,l.stateNode),il(r)):TS(xn,l.stateNode));break;case 4:u=xn,p=br,xn=l.stateNode.containerInfo,br=!0,oo(r,o,l),xn=u,br=p;break;case 0:case 11:case 14:case 15:Uo(2,l,o),Hn||Uo(4,l,o),oo(r,o,l);break;case 1:Hn||(Oa(l,o),u=l.stateNode,typeof u.componentWillUnmount=="function"&&Cw(l,o,u)),oo(r,o,l);break;case 21:oo(r,o,l);break;case 22:Hn=(u=Hn)||l.memoizedState!==null,oo(r,o,l),Hn=u;break;default:oo(r,o,l)}}function Lw(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{il(r)}catch(l){ln(o,o.return,l)}}}function _w(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{il(r)}catch(l){ln(o,o.return,l)}}function eA(r){switch(r.tag){case 31:case 13:case 19:var o=r.stateNode;return o===null&&(o=r.stateNode=new Aw),o;case 22:return r=r.stateNode,o=r._retryCache,o===null&&(o=r._retryCache=new Aw),o;default:throw Error(a(435,r.tag))}}function Wd(r,o){var l=eA(r);o.forEach(function(u){if(!l.has(u)){l.add(u);var p=cA.bind(null,r,u);u.then(p,p)}})}function xr(r,o){var l=o.deletions;if(l!==null)for(var u=0;u<l.length;u++){var p=l[u],v=r,N=o,U=N;e:for(;U!==null;){switch(U.tag){case 27:if($o(U.type)){xn=U.stateNode,br=!1;break e}break;case 5:xn=U.stateNode,br=!1;break e;case 3:case 4:xn=U.stateNode.containerInfo,br=!0;break e}U=U.return}if(xn===null)throw Error(a(160));jw(v,N,p),xn=null,br=!1,v=p.alternate,v!==null&&(v.return=null),p.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)Iw(o,r),o=o.sibling}var ma=null;function Iw(r,o){var l=r.alternate,u=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:xr(o,r),wr(r),u&4&&(Uo(3,r,r.return),kc(3,r),Uo(5,r,r.return));break;case 1:xr(o,r),wr(r),u&512&&(Hn||l===null||Oa(l,l.return)),u&64&&ao&&(r=r.updateQueue,r!==null&&(u=r.callbacks,u!==null&&(l=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=l===null?u:l.concat(u))));break;case 26:var p=ma;if(xr(o,r),wr(r),u&512&&(Hn||l===null||Oa(l,l.return)),u&4){var v=l!==null?l.memoizedState:null;if(u=r.memoizedState,l===null)if(u===null)if(r.stateNode===null){e:{u=r.type,l=r.memoizedProps,p=p.ownerDocument||p;t:switch(u){case"title":v=p.getElementsByTagName("title")[0],(!v||v[wn]||v[Fe]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=p.createElement(u),p.head.insertBefore(v,p.querySelector("head > title"))),rr(v,u,l),v[Fe]=r,bn(v),u=v;break e;case"link":var N=IS("link","href",p).get(u+(l.href||""));if(N){for(var U=0;U<N.length;U++)if(v=N[U],v.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&v.getAttribute("rel")===(l.rel==null?null:l.rel)&&v.getAttribute("title")===(l.title==null?null:l.title)&&v.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){N.splice(U,1);break t}}v=p.createElement(u),rr(v,u,l),p.head.appendChild(v);break;case"meta":if(N=IS("meta","content",p).get(u+(l.content||""))){for(U=0;U<N.length;U++)if(v=N[U],v.getAttribute("content")===(l.content==null?null:""+l.content)&&v.getAttribute("name")===(l.name==null?null:l.name)&&v.getAttribute("property")===(l.property==null?null:l.property)&&v.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&v.getAttribute("charset")===(l.charSet==null?null:l.charSet)){N.splice(U,1);break t}}v=p.createElement(u),rr(v,u,l),p.head.appendChild(v);break;default:throw Error(a(468,u))}v[Fe]=r,bn(v),u=v}r.stateNode=u}else zS(p,r.type,r.stateNode);else r.stateNode=_S(p,u,r.memoizedProps);else v!==u?(v===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):v.count--,u===null?zS(p,r.type,r.stateNode):_S(p,u,r.memoizedProps)):u===null&&r.stateNode!==null&&jp(r,r.memoizedProps,l.memoizedProps)}break;case 27:xr(o,r),wr(r),u&512&&(Hn||l===null||Oa(l,l.return)),l!==null&&u&4&&jp(r,r.memoizedProps,l.memoizedProps);break;case 5:if(xr(o,r),wr(r),u&512&&(Hn||l===null||Oa(l,l.return)),r.flags&32){p=r.stateNode;try{Ns(p,"")}catch(nt){ln(r,r.return,nt)}}u&4&&r.stateNode!=null&&(p=r.memoizedProps,jp(r,p,l!==null?l.memoizedProps:p)),u&1024&&(Ip=!0);break;case 6:if(xr(o,r),wr(r),u&4){if(r.stateNode===null)throw Error(a(162));u=r.memoizedProps,l=r.stateNode;try{l.nodeValue=u}catch(nt){ln(r,r.return,nt)}}break;case 3:if(hf=null,p=ma,ma=df(o.containerInfo),xr(o,r),ma=p,wr(r),u&4&&l!==null&&l.memoizedState.isDehydrated)try{il(o.containerInfo)}catch(nt){ln(r,r.return,nt)}Ip&&(Ip=!1,zw(r));break;case 4:u=ma,ma=df(r.stateNode.containerInfo),xr(o,r),wr(r),ma=u;break;case 12:xr(o,r),wr(r);break;case 31:xr(o,r),wr(r),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,Wd(r,u)));break;case 13:xr(o,r),wr(r),r.child.flags&8192&&r.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Zd=Ae()),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,Wd(r,u)));break;case 22:p=r.memoizedState!==null;var ee=l!==null&&l.memoizedState!==null,he=ao,Re=Hn;if(ao=he||p,Hn=Re||ee,xr(o,r),Hn=Re,ao=he,wr(r),u&8192)e:for(o=r.stateNode,o._visibility=p?o._visibility&-2:o._visibility|1,p&&(l===null||ee||ao||Hn||Ki(r)),l=null,o=r;;){if(o.tag===5||o.tag===26){if(l===null){ee=l=o;try{if(v=ee.stateNode,p)N=v.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.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(nt){ln(ee,ee.return,nt)}}}else if(o.tag===6){if(l===null){ee=o;try{ee.stateNode.nodeValue=p?"":ee.memoizedProps}catch(nt){ln(ee,ee.return,nt)}}}else if(o.tag===18){if(l===null){ee=o;try{var ye=ee.stateNode;p?CS(ye,!0):CS(ee.stateNode,!1)}catch(nt){ln(ee,ee.return,nt)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===r)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break e;for(;o.sibling===null;){if(o.return===null||o.return===r)break e;l===o&&(l=null),o=o.return}l===o&&(l=null),o.sibling.return=o.return,o=o.sibling}u&4&&(u=r.updateQueue,u!==null&&(l=u.retryQueue,l!==null&&(u.retryQueue=null,Wd(r,l))));break;case 19:xr(o,r),wr(r),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,Wd(r,u)));break;case 30:break;case 21:break;default:xr(o,r),wr(r)}}function wr(r){var o=r.flags;if(o&2){try{for(var l,u=r.return;u!==null;){if(Mw(u)){l=u;break}u=u.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var p=l.stateNode,v=Lp(r);Xd(r,v,p);break;case 5:var N=l.stateNode;l.flags&32&&(Ns(N,""),l.flags&=-33);var U=Lp(r);Xd(r,U,N);break;case 3:case 4:var ee=l.stateNode.containerInfo,he=Lp(r);_p(r,he,ee);break;default:throw Error(a(161))}}catch(Re){ln(r,r.return,Re)}r.flags&=-3}o&4096&&(r.flags&=-4097)}function zw(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var o=r;zw(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),r=r.sibling}}function io(r,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)Dw(r,o.alternate,o),o=o.sibling}function Ki(r){for(r=r.child;r!==null;){var o=r;switch(o.tag){case 0:case 11:case 14:case 15:Uo(4,o,o.return),Ki(o);break;case 1:Oa(o,o.return);var l=o.stateNode;typeof l.componentWillUnmount=="function"&&Cw(o,o.return,l),Ki(o);break;case 27:Fc(o.stateNode);case 26:case 5:Oa(o,o.return),Ki(o);break;case 22:o.memoizedState===null&&Ki(o);break;case 30:Ki(o);break;default:Ki(o)}r=r.sibling}}function so(r,o,l){for(l=l&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var u=o.alternate,p=r,v=o,N=v.flags;switch(v.tag){case 0:case 11:case 15:so(p,v,l),kc(4,v);break;case 1:if(so(p,v,l),u=v,p=u.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(he){ln(u,u.return,he)}if(u=v,p=u.updateQueue,p!==null){var U=u.stateNode;try{var ee=p.shared.hiddenCallbacks;if(ee!==null)for(p.shared.hiddenCallbacks=null,p=0;p<ee.length;p++)mx(ee[p],U)}catch(he){ln(u,u.return,he)}}l&&N&64&&Tw(v),jc(v,v.return);break;case 27:Nw(v);case 26:case 5:so(p,v,l),l&&u===null&&N&4&&Ow(v),jc(v,v.return);break;case 12:so(p,v,l);break;case 31:so(p,v,l),l&&N&4&&Lw(p,v);break;case 13:so(p,v,l),l&&N&4&&_w(p,v);break;case 22:v.memoizedState===null&&so(p,v,l),jc(v,v.return);break;case 30:break;default:so(p,v,l)}o=o.sibling}}function zp(r,o){var l=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),r=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(r=o.memoizedState.cachePool.pool),r!==l&&(r!=null&&r.refCount++,l!=null&&bc(l))}function Pp(r,o){r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&bc(r))}function pa(r,o,l,u){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)Pw(r,o,l,u),o=o.sibling}function Pw(r,o,l,u){var p=o.flags;switch(o.tag){case 0:case 11:case 15:pa(r,o,l,u),p&2048&&kc(9,o);break;case 1:pa(r,o,l,u);break;case 3:pa(r,o,l,u),p&2048&&(r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&bc(r)));break;case 12:if(p&2048){pa(r,o,l,u),r=o.stateNode;try{var v=o.memoizedProps,N=v.id,U=v.onPostCommit;typeof U=="function"&&U(N,o.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(ee){ln(o,o.return,ee)}}else pa(r,o,l,u);break;case 31:pa(r,o,l,u);break;case 13:pa(r,o,l,u);break;case 23:break;case 22:v=o.stateNode,N=o.alternate,o.memoizedState!==null?v._visibility&2?pa(r,o,l,u):Lc(r,o):v._visibility&2?pa(r,o,l,u):(v._visibility|=2,Xs(r,o,l,u,(o.subtreeFlags&10256)!==0||!1)),p&2048&&zp(N,o);break;case 24:pa(r,o,l,u),p&2048&&Pp(o.alternate,o);break;default:pa(r,o,l,u)}}function Xs(r,o,l,u,p){for(p=p&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var v=r,N=o,U=l,ee=u,he=N.flags;switch(N.tag){case 0:case 11:case 15:Xs(v,N,U,ee,p),kc(8,N);break;case 23:break;case 22:var Re=N.stateNode;N.memoizedState!==null?Re._visibility&2?Xs(v,N,U,ee,p):Lc(v,N):(Re._visibility|=2,Xs(v,N,U,ee,p)),p&&he&2048&&zp(N.alternate,N);break;case 24:Xs(v,N,U,ee,p),p&&he&2048&&Pp(N.alternate,N);break;default:Xs(v,N,U,ee,p)}o=o.sibling}}function Lc(r,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var l=r,u=o,p=u.flags;switch(u.tag){case 22:Lc(l,u),p&2048&&zp(u.alternate,u);break;case 24:Lc(l,u),p&2048&&Pp(u.alternate,u);break;default:Lc(l,u)}o=o.sibling}}var _c=8192;function Ws(r,o,l){if(r.subtreeFlags&_c)for(r=r.child;r!==null;)Uw(r,o,l),r=r.sibling}function Uw(r,o,l){switch(r.tag){case 26:Ws(r,o,l),r.flags&_c&&r.memoizedState!==null&&HA(l,ma,r.memoizedState,r.memoizedProps);break;case 5:Ws(r,o,l);break;case 3:case 4:var u=ma;ma=df(r.stateNode.containerInfo),Ws(r,o,l),ma=u;break;case 22:r.memoizedState===null&&(u=r.alternate,u!==null&&u.memoizedState!==null?(u=_c,_c=16777216,Ws(r,o,l),_c=u):Ws(r,o,l));break;default:Ws(r,o,l)}}function Hw(r){var o=r.alternate;if(o!==null&&(r=o.child,r!==null)){o.child=null;do o=r.sibling,r.sibling=null,r=o;while(r!==null)}}function Ic(r){var o=r.deletions;if((r.flags&16)!==0){if(o!==null)for(var l=0;l<o.length;l++){var u=o[l];Xn=u,Fw(u,r)}Hw(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Bw(r),r=r.sibling}function Bw(r){switch(r.tag){case 0:case 11:case 15:Ic(r),r.flags&2048&&Uo(9,r,r.return);break;case 3:Ic(r);break;case 12:Ic(r);break;case 22:var o=r.stateNode;r.memoizedState!==null&&o._visibility&2&&(r.return===null||r.return.tag!==13)?(o._visibility&=-3,Qd(r)):Ic(r);break;default:Ic(r)}}function Qd(r){var o=r.deletions;if((r.flags&16)!==0){if(o!==null)for(var l=0;l<o.length;l++){var u=o[l];Xn=u,Fw(u,r)}Hw(r)}for(r=r.child;r!==null;){switch(o=r,o.tag){case 0:case 11:case 15:Uo(8,o,o.return),Qd(o);break;case 22:l=o.stateNode,l._visibility&2&&(l._visibility&=-3,Qd(o));break;default:Qd(o)}r=r.sibling}}function Fw(r,o){for(;Xn!==null;){var l=Xn;switch(l.tag){case 0:case 11:case 15:Uo(8,l,o);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var u=l.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:bc(l.memoizedState.cache)}if(u=l.child,u!==null)u.return=l,Xn=u;else e:for(l=r;Xn!==null;){u=Xn;var p=u.sibling,v=u.return;if(kw(u),u===l){Xn=null;break e}if(p!==null){p.return=v,Xn=p;break e}Xn=v}}}var tA={getCacheForType:function(r){var o=tr(zn),l=o.data.get(r);return l===void 0&&(l=r(),o.data.set(r,l)),l},cacheSignal:function(){return tr(zn).controller.signal}},nA=typeof WeakMap=="function"?WeakMap:Map,an=0,hn=null,Ht=null,Ft=0,sn=0,_r=null,Ho=!1,Qs=!1,Up=!1,lo=0,Mn=0,Bo=0,Gi=0,Hp=0,Ir=0,Zs=0,zc=null,Sr=null,Bp=!1,Zd=0,Vw=0,Jd=1/0,ef=null,Fo=null,Fn=0,Vo=null,Js=null,co=0,Fp=0,Vp=null,Yw=null,Pc=0,Yp=null;function zr(){return(an&2)!==0&&Ft!==0?Ft&-Ft:_.T!==null?Wp():je()}function qw(){if(Ir===0)if((Ft&536870912)===0||Xt){var r=et;et<<=1,(et&3932160)===0&&(et=262144),Ir=r}else Ir=536870912;return r=jr.current,r!==null&&(r.flags|=32),Ir}function Er(r,o,l){(r===hn&&(sn===2||sn===9)||r.cancelPendingCommit!==null)&&(el(r,0),Yo(r,Ft,Ir,!1)),It(r,l),((an&2)===0||r!==hn)&&(r===hn&&((an&2)===0&&(Gi|=l),Mn===4&&Yo(r,Ft,Ir,!1)),Ma(r))}function $w(r,o,l){if((an&6)!==0)throw Error(a(327));var u=!l&&(o&127)===0&&(o&r.expiredLanes)===0||Et(r,o),p=u?oA(r,o):$p(r,o,!0),v=u;do{if(p===0){Qs&&!u&&Yo(r,o,0,!1);break}else{if(l=r.current.alternate,v&&!rA(l)){p=$p(r,o,!1),v=!1;continue}if(p===2){if(v=o,r.errorRecoveryDisabledLanes&v)var N=0;else N=r.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){o=N;e:{var U=r;p=zc;var ee=U.current.memoizedState.isDehydrated;if(ee&&(el(U,N).flags|=256),N=$p(U,N,!1),N!==2){if(Up&&!ee){U.errorRecoveryDisabledLanes|=v,Gi|=v,p=4;break e}v=Sr,Sr=p,v!==null&&(Sr===null?Sr=v:Sr.push.apply(Sr,v))}p=N}if(v=!1,p!==2)continue}}if(p===1){el(r,0),Yo(r,o,0,!0);break}e:{switch(u=r,v=p,v){case 0:case 1:throw Error(a(345));case 4:if((o&4194048)!==o)break;case 6:Yo(u,o,Ir,!Ho);break e;case 2:Sr=null;break;case 3:case 5:break;default:throw Error(a(329))}if((o&62914560)===o&&(p=Zd+300-Ae(),10<p)){if(Yo(u,o,Ir,!Ho),Ve(u,0,!0)!==0)break e;co=o,u.timeoutHandle=ES(Kw.bind(null,u,l,Sr,ef,Bp,o,Ir,Gi,Zs,Ho,v,"Throttled",-0,0),p);break e}Kw(u,l,Sr,ef,Bp,o,Ir,Gi,Zs,Ho,v,null,-0,0)}}break}while(!0);Ma(r)}function Kw(r,o,l,u,p,v,N,U,ee,he,Re,Ne,me,ye){if(r.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:Ga},Uw(o,v,Ne);var nt=(v&62914560)===v?Zd-Ae():(v&4194048)===v?Vw-Ae():0;if(nt=BA(Ne,nt),nt!==null){co=v,r.cancelPendingCommit=nt(tS.bind(null,r,o,v,l,u,p,N,U,ee,Re,Ne,null,me,ye)),Yo(r,v,N,!he);return}}tS(r,o,v,l,u,p,N,U,ee)}function rA(r){for(var o=r;;){var l=o.tag;if((l===0||l===11||l===15)&&o.flags&16384&&(l=o.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var u=0;u<l.length;u++){var p=l[u],v=p.getSnapshot;p=p.value;try{if(!Dr(v(),p))return!1}catch{return!1}}if(l=o.child,o.subtreeFlags&16384&&l!==null)l.return=o,o=l;else{if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Yo(r,o,l,u){o&=~Hp,o&=~Gi,r.suspendedLanes|=o,r.pingedLanes&=~o,u&&(r.warmLanes|=o),u=r.expirationTimes;for(var p=o;0<p;){var v=31-ft(p),N=1<<v;u[v]=-1,p&=~N}l!==0&&Rt(r,l,o)}function tf(){return(an&6)===0?(Uc(0),!1):!0}function qp(){if(Ht!==null){if(sn===0)var r=Ht.return;else r=Ht,Za=Ui=null,sp(r),Ys=null,wc=0,r=Ht;for(;r!==null;)Rw(r.alternate,r),r=r.return;Ht=null}}function el(r,o){var l=r.timeoutHandle;l!==-1&&(r.timeoutHandle=-1,EA(l)),l=r.cancelPendingCommit,l!==null&&(r.cancelPendingCommit=null,l()),co=0,qp(),hn=r,Ht=l=Wa(r.current,null),Ft=o,sn=0,_r=null,Ho=!1,Qs=Et(r,o),Up=!1,Zs=Ir=Hp=Gi=Bo=Mn=0,Sr=zc=null,Bp=!1,(o&8)!==0&&(o|=o&32);var u=r.entangledLanes;if(u!==0)for(r=r.entanglements,u&=o;0<u;){var p=31-ft(u),v=1<<p;o|=r[p],u&=~v}return lo=o,Sd(),l}function Gw(r,o){kt=null,_.H=Nc,o===Vs||o===Ad?(o=ux(),sn=3):o===Xm?(o=ux(),sn=4):sn=o===Ep?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,_r=o,Ht===null&&(Mn=1,Yd(r,Gr(o,r.current)))}function Xw(){var r=jr.current;return r===null?!0:(Ft&4194048)===Ft?Zr===null:(Ft&62914560)===Ft||(Ft&536870912)!==0?r===Zr:!1}function Ww(){var r=_.H;return _.H=Nc,r===null?Nc:r}function Qw(){var r=_.A;return _.A=tA,r}function nf(){Mn=4,Ho||(Ft&4194048)!==Ft&&jr.current!==null||(Qs=!0),(Bo&134217727)===0&&(Gi&134217727)===0||hn===null||Yo(hn,Ft,Ir,!1)}function $p(r,o,l){var u=an;an|=2;var p=Ww(),v=Qw();(hn!==r||Ft!==o)&&(ef=null,el(r,o)),o=!1;var N=Mn;e:do try{if(sn!==0&&Ht!==null){var U=Ht,ee=_r;switch(sn){case 8:qp(),N=6;break e;case 3:case 2:case 9:case 6:jr.current===null&&(o=!0);var he=sn;if(sn=0,_r=null,tl(r,U,ee,he),l&&Qs){N=0;break e}break;default:he=sn,sn=0,_r=null,tl(r,U,ee,he)}}aA(),N=Mn;break}catch(Re){Gw(r,Re)}while(!0);return o&&r.shellSuspendCounter++,Za=Ui=null,an=u,_.H=p,_.A=v,Ht===null&&(hn=null,Ft=0,Sd()),N}function aA(){for(;Ht!==null;)Zw(Ht)}function oA(r,o){var l=an;an|=2;var u=Ww(),p=Qw();hn!==r||Ft!==o?(ef=null,Jd=Ae()+500,el(r,o)):Qs=Et(r,o);e:do try{if(sn!==0&&Ht!==null){o=Ht;var v=_r;t:switch(sn){case 1:sn=0,_r=null,tl(r,o,v,1);break;case 2:case 9:if(lx(v)){sn=0,_r=null,Jw(o);break}o=function(){sn!==2&&sn!==9||hn!==r||(sn=7),Ma(r)},v.then(o,o);break e;case 3:sn=7;break e;case 4:sn=5;break e;case 7:lx(v)?(sn=0,_r=null,Jw(o)):(sn=0,_r=null,tl(r,o,v,7));break;case 5:var N=null;switch(Ht.tag){case 26:N=Ht.memoizedState;case 5:case 27:var U=Ht;if(N?PS(N):U.stateNode.complete){sn=0,_r=null;var ee=U.sibling;if(ee!==null)Ht=ee;else{var he=U.return;he!==null?(Ht=he,rf(he)):Ht=null}break t}}sn=0,_r=null,tl(r,o,v,5);break;case 6:sn=0,_r=null,tl(r,o,v,6);break;case 8:qp(),Mn=6;break e;default:throw Error(a(462))}}iA();break}catch(Re){Gw(r,Re)}while(!0);return Za=Ui=null,_.H=u,_.A=p,an=l,Ht!==null?0:(hn=null,Ft=0,Sd(),Mn)}function iA(){for(;Ht!==null&&!Pe();)Zw(Ht)}function Zw(r){var o=Sw(r.alternate,r,lo);r.memoizedProps=r.pendingProps,o===null?rf(r):Ht=o}function Jw(r){var o=r,l=o.alternate;switch(o.tag){case 15:case 0:o=gw(l,o,o.pendingProps,o.type,void 0,Ft);break;case 11:o=gw(l,o,o.pendingProps,o.type.render,o.ref,Ft);break;case 5:sp(o);default:Rw(l,o),o=Ht=Q0(o,lo),o=Sw(l,o,lo)}r.memoizedProps=r.pendingProps,o===null?rf(r):Ht=o}function tl(r,o,l,u){Za=Ui=null,sp(o),Ys=null,wc=0;var p=o.return;try{if(GN(r,p,o,l,Ft)){Mn=1,Yd(r,Gr(l,r.current)),Ht=null;return}}catch(v){if(p!==null)throw Ht=p,v;Mn=1,Yd(r,Gr(l,r.current)),Ht=null;return}o.flags&32768?(Xt||u===1?r=!0:Qs||(Ft&536870912)!==0?r=!1:(Ho=r=!0,(u===2||u===9||u===3||u===6)&&(u=jr.current,u!==null&&u.tag===13&&(u.flags|=16384))),eS(o,r)):rf(o)}function rf(r){var o=r;do{if((o.flags&32768)!==0){eS(o,Ho);return}r=o.return;var l=QN(o.alternate,o,lo);if(l!==null){Ht=l;return}if(o=o.sibling,o!==null){Ht=o;return}Ht=o=r}while(o!==null);Mn===0&&(Mn=5)}function eS(r,o){do{var l=ZN(r.alternate,r);if(l!==null){l.flags&=32767,Ht=l;return}if(l=r.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!o&&(r=r.sibling,r!==null)){Ht=r;return}Ht=r=l}while(r!==null);Mn=6,Ht=null}function tS(r,o,l,u,p,v,N,U,ee){r.cancelPendingCommit=null;do af();while(Fn!==0);if((an&6)!==0)throw Error(a(327));if(o!==null){if(o===r.current)throw Error(a(177));if(v=o.lanes|o.childLanes,v|=Lm,Xe(r,l,v,N,U,ee),r===hn&&(Ht=hn=null,Ft=0),Js=o,Vo=r,co=l,Fp=v,Vp=p,Yw=u,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,uA(oe,function(){return iS(),null})):(r.callbackNode=null,r.callbackPriority=0),u=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||u){u=_.T,_.T=null,p=L.p,L.p=2,N=an,an|=4;try{JN(r,o,l)}finally{an=N,L.p=p,_.T=u}}Fn=1,nS(),rS(),aS()}}function nS(){if(Fn===1){Fn=0;var r=Vo,o=Js,l=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||l){l=_.T,_.T=null;var u=L.p;L.p=2;var p=an;an|=4;try{Iw(o,r);var v=ag,N=F0(r.containerInfo),U=v.focusedElem,ee=v.selectionRange;if(N!==U&&U&&U.ownerDocument&&B0(U.ownerDocument.documentElement,U)){if(ee!==null&&Nm(U)){var he=ee.start,Re=ee.end;if(Re===void 0&&(Re=he),"selectionStart"in U)U.selectionStart=he,U.selectionEnd=Math.min(Re,U.value.length);else{var Ne=U.ownerDocument||document,me=Ne&&Ne.defaultView||window;if(me.getSelection){var ye=me.getSelection(),nt=U.textContent.length,gt=Math.min(ee.start,nt),fn=ee.end===void 0?gt:Math.min(ee.end,nt);!ye.extend&>>fn&&(N=fn,fn=gt,gt=N);var se=H0(U,gt),re=H0(U,fn);if(se&&re&&(ye.rangeCount!==1||ye.anchorNode!==se.node||ye.anchorOffset!==se.offset||ye.focusNode!==re.node||ye.focusOffset!==re.offset)){var fe=Ne.createRange();fe.setStart(se.node,se.offset),ye.removeAllRanges(),gt>fn?(ye.addRange(fe),ye.extend(re.node,re.offset)):(fe.setEnd(re.node,re.offset),ye.addRange(fe))}}}}for(Ne=[],ye=U;ye=ye.parentNode;)ye.nodeType===1&&Ne.push({element:ye,left:ye.scrollLeft,top:ye.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}}yf=!!rg,ag=rg=null}finally{an=p,L.p=u,_.T=l}}r.current=o,Fn=2}}function rS(){if(Fn===2){Fn=0;var r=Vo,o=Js,l=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||l){l=_.T,_.T=null;var u=L.p;L.p=2;var p=an;an|=4;try{Dw(r,o.alternate,o)}finally{an=p,L.p=u,_.T=l}}Fn=3}}function aS(){if(Fn===4||Fn===3){Fn=0,Be();var r=Vo,o=Js,l=co,u=Yw;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?Fn=5:(Fn=0,Js=Vo=null,oS(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Fo=null),Ee(l),o=o.stateNode,ze&&typeof ze.onCommitFiberRoot=="function")try{ze.onCommitFiberRoot(st,o,void 0,(o.current.flags&128)===128)}catch{}if(u!==null){o=_.T,p=L.p,L.p=2,_.T=null;try{for(var v=r.onRecoverableError,N=0;N<u.length;N++){var U=u[N];v(U.value,{componentStack:U.stack})}}finally{_.T=o,L.p=p}}(co&3)!==0&&af(),Ma(r),p=r.pendingLanes,(l&261930)!==0&&(p&42)!==0?r===Yp?Pc++:(Pc=0,Yp=r):Pc=0,Uc(0)}}function oS(r,o){(r.pooledCacheLanes&=o)===0&&(o=r.pooledCache,o!=null&&(r.pooledCache=null,bc(o)))}function af(){return nS(),rS(),aS(),iS()}function iS(){if(Fn!==5)return!1;var r=Vo,o=Fp;Fp=0;var l=Ee(co),u=_.T,p=L.p;try{L.p=32>l?32:l,_.T=null,l=Vp,Vp=null;var v=Vo,N=co;if(Fn=0,Js=Vo=null,co=0,(an&6)!==0)throw Error(a(331));var U=an;if(an|=4,Bw(v.current),Pw(v,v.current,N,l),an=U,Uc(0,!1),ze&&typeof ze.onPostCommitFiberRoot=="function")try{ze.onPostCommitFiberRoot(st,v)}catch{}return!0}finally{L.p=p,_.T=u,oS(r,o)}}function sS(r,o,l){o=Gr(l,o),o=Sp(r.stateNode,o,2),r=Io(r,o,2),r!==null&&(It(r,2),Ma(r))}function ln(r,o,l){if(r.tag===3)sS(r,r,l);else for(;o!==null;){if(o.tag===3){sS(o,r,l);break}else if(o.tag===1){var u=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Fo===null||!Fo.has(u))){r=Gr(l,r),l=lw(2),u=Io(o,l,2),u!==null&&(cw(l,u,o,r),It(u,2),Ma(u));break}}o=o.return}}function Kp(r,o,l){var u=r.pingCache;if(u===null){u=r.pingCache=new nA;var p=new Set;u.set(o,p)}else p=u.get(o),p===void 0&&(p=new Set,u.set(o,p));p.has(l)||(Up=!0,p.add(l),r=sA.bind(null,r,o,l),o.then(r,r))}function sA(r,o,l){var u=r.pingCache;u!==null&&u.delete(o),r.pingedLanes|=r.suspendedLanes&l,r.warmLanes&=~l,hn===r&&(Ft&l)===l&&(Mn===4||Mn===3&&(Ft&62914560)===Ft&&300>Ae()-Zd?(an&2)===0&&el(r,0):Hp|=l,Zs===Ft&&(Zs=0)),Ma(r)}function lS(r,o){o===0&&(o=St()),r=Ii(r,o),r!==null&&(It(r,o),Ma(r))}function lA(r){var o=r.memoizedState,l=0;o!==null&&(l=o.retryLane),lS(r,l)}function cA(r,o){var l=0;switch(r.tag){case 31:case 13:var u=r.stateNode,p=r.memoizedState;p!==null&&(l=p.retryLane);break;case 19:u=r.stateNode;break;case 22:u=r.stateNode._retryCache;break;default:throw Error(a(314))}u!==null&&u.delete(o),lS(r,l)}function uA(r,o){return be(r,o)}var of=null,nl=null,Gp=!1,sf=!1,Xp=!1,qo=0;function Ma(r){r!==nl&&r.next===null&&(nl===null?of=nl=r:nl=nl.next=r),sf=!0,Gp||(Gp=!0,fA())}function Uc(r,o){if(!Xp&&sf){Xp=!0;do for(var l=!1,u=of;u!==null;){if(r!==0){var p=u.pendingLanes;if(p===0)var v=0;else{var N=u.suspendedLanes,U=u.pingedLanes;v=(1<<31-ft(42|r)+1)-1,v&=p&~(N&~U),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(l=!0,fS(u,v))}else v=Ft,v=Ve(u,u===hn?v:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(v&3)===0||Et(u,v)||(l=!0,fS(u,v));u=u.next}while(l);Xp=!1}}function dA(){cS()}function cS(){sf=Gp=!1;var r=0;qo!==0&&SA()&&(r=qo);for(var o=Ae(),l=null,u=of;u!==null;){var p=u.next,v=uS(u,o);v===0?(u.next=null,l===null?of=p:l.next=p,p===null&&(nl=l)):(l=u,(r!==0||(v&3)!==0)&&(sf=!0)),u=p}Fn!==0&&Fn!==5||Uc(r),qo!==0&&(qo=0)}function uS(r,o){for(var l=r.suspendedLanes,u=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var N=31-ft(v),U=1<<N,ee=p[N];ee===-1?((U&l)===0||(U&u)!==0)&&(p[N]=Dt(U,o)):ee<=o&&(r.expiredLanes|=U),v&=~U}if(o=hn,l=Ft,l=Ve(r,r===o?l:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),u=r.callbackNode,l===0||r===o&&(sn===2||sn===9)||r.cancelPendingCommit!==null)return u!==null&&u!==null&&ge(u),r.callbackNode=null,r.callbackPriority=0;if((l&3)===0||Et(r,l)){if(o=l&-l,o===r.callbackPriority)return o;switch(u!==null&&ge(u),Ee(l)){case 2:case 8:l=xt;break;case 32:l=oe;break;case 268435456:l=Ie;break;default:l=oe}return u=dS.bind(null,r),l=be(l,u),r.callbackPriority=o,r.callbackNode=l,o}return u!==null&&u!==null&&ge(u),r.callbackPriority=2,r.callbackNode=null,2}function dS(r,o){if(Fn!==0&&Fn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var l=r.callbackNode;if(af()&&r.callbackNode!==l)return null;var u=Ft;return u=Ve(r,r===hn?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),u===0?null:($w(r,u,o),uS(r,Ae()),r.callbackNode!=null&&r.callbackNode===l?dS.bind(null,r):null)}function fS(r,o){if(af())return null;$w(r,o,!0)}function fA(){RA(function(){(an&6)!==0?be(wt,dA):cS()})}function Wp(){if(qo===0){var r=Bs;r===0&&(r=Ct,Ct<<=1,(Ct&261888)===0&&(Ct=256)),qo=r}return qo}function hS(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:md(""+r)}function mS(r,o){var l=o.ownerDocument.createElement("input");return l.name=o.name,l.value=o.value,r.id&&l.setAttribute("form",r.id),o.parentNode.insertBefore(l,o),r=new FormData(r),l.parentNode.removeChild(l),r}function hA(r,o,l,u,p){if(o==="submit"&&l&&l.stateNode===p){var v=hS((p[$e]||null).action),N=u.submitter;N&&(o=(o=N[$e]||null)?hS(o.formAction):N.getAttribute("formAction"),o!==null&&(v=o,N=null));var U=new vd("action","action",null,u,p);r.push({event:U,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(qo!==0){var ee=N?mS(p,N):new FormData(p);gp(l,{pending:!0,data:ee,method:p.method,action:v},null,ee)}}else typeof v=="function"&&(U.preventDefault(),ee=N?mS(p,N):new FormData(p),gp(l,{pending:!0,data:ee,method:p.method,action:v},v,ee))},currentTarget:p}]})}}for(var Qp=0;Qp<jm.length;Qp++){var Zp=jm[Qp],mA=Zp.toLowerCase(),pA=Zp[0].toUpperCase()+Zp.slice(1);ha(mA,"on"+pA)}ha(q0,"onAnimationEnd"),ha($0,"onAnimationIteration"),ha(K0,"onAnimationStart"),ha("dblclick","onDoubleClick"),ha("focusin","onFocus"),ha("focusout","onBlur"),ha(DN,"onTransitionRun"),ha(kN,"onTransitionStart"),ha(jN,"onTransitionCancel"),ha(G0,"onTransitionEnd"),qr("onMouseEnter",["mouseout","mouseover"]),qr("onMouseLeave",["mouseout","mouseover"]),qr("onPointerEnter",["pointerout","pointerover"]),qr("onPointerLeave",["pointerout","pointerover"]),da("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),da("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),da("onBeforeInput",["compositionend","keypress","textInput","paste"]),da("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),da("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),da("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hc="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(" "),gA=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Hc));function pS(r,o){o=(o&4)!==0;for(var l=0;l<r.length;l++){var u=r[l],p=u.event;u=u.listeners;e:{var v=void 0;if(o)for(var N=u.length-1;0<=N;N--){var U=u[N],ee=U.instance,he=U.currentTarget;if(U=U.listener,ee!==v&&p.isPropagationStopped())break e;v=U,p.currentTarget=he;try{v(p)}catch(Re){wd(Re)}p.currentTarget=null,v=ee}else for(N=0;N<u.length;N++){if(U=u[N],ee=U.instance,he=U.currentTarget,U=U.listener,ee!==v&&p.isPropagationStopped())break e;v=U,p.currentTarget=he;try{v(p)}catch(Re){wd(Re)}p.currentTarget=null,v=ee}}}}function Bt(r,o){var l=o[vt];l===void 0&&(l=o[vt]=new Set);var u=r+"__bubble";l.has(u)||(gS(o,r,2,!1),l.add(u))}function Jp(r,o,l){var u=0;o&&(u|=4),gS(l,r,u,o)}var lf="_reactListening"+Math.random().toString(36).slice(2);function eg(r){if(!r[lf]){r[lf]=!0,ua.forEach(function(l){l!=="selectionchange"&&(gA.has(l)||Jp(l,!1,r),Jp(l,!0,r))});var o=r.nodeType===9?r:r.ownerDocument;o===null||o[lf]||(o[lf]=!0,Jp("selectionchange",!1,o))}}function gS(r,o,l,u){switch(qS(o)){case 2:var p=YA;break;case 8:p=qA;break;default:p=pg}l=p.bind(null,o,l,r),p=void 0,!xm||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(p=!0),u?p!==void 0?r.addEventListener(o,l,{capture:!0,passive:p}):r.addEventListener(o,l,!0):p!==void 0?r.addEventListener(o,l,{passive:p}):r.addEventListener(o,l,!1)}function tg(r,o,l,u,p){var v=u;if((o&1)===0&&(o&2)===0&&u!==null)e:for(;;){if(u===null)return;var N=u.tag;if(N===3||N===4){var U=u.stateNode.containerInfo;if(U===p)break;if(N===4)for(N=u.return;N!==null;){var ee=N.tag;if((ee===3||ee===4)&&N.stateNode.containerInfo===p)return;N=N.return}for(;U!==null;){if(N=Cn(U),N===null)return;if(ee=N.tag,ee===5||ee===6||ee===26||ee===27){u=v=N;continue e}U=U.parentNode}}u=u.return}w0(function(){var he=v,Re=vm(l),Ne=[];e:{var me=X0.get(r);if(me!==void 0){var ye=vd,nt=r;switch(r){case"keypress":if(gd(l)===0)break e;case"keydown":case"keyup":ye=cN;break;case"focusin":nt="focus",ye=Rm;break;case"focusout":nt="blur",ye=Rm;break;case"beforeblur":case"afterblur":ye=Rm;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ye=R0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ye=Q2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ye=fN;break;case q0:case $0:case K0:ye=eN;break;case G0:ye=mN;break;case"scroll":case"scrollend":ye=X2;break;case"wheel":ye=gN;break;case"copy":case"cut":case"paste":ye=nN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ye=C0;break;case"toggle":case"beforetoggle":ye=vN}var gt=(o&4)!==0,fn=!gt&&(r==="scroll"||r==="scrollend"),se=gt?me!==null?me+"Capture":null:me;gt=[];for(var re=he,fe;re!==null;){var Oe=re;if(fe=Oe.stateNode,Oe=Oe.tag,Oe!==5&&Oe!==26&&Oe!==27||fe===null||se===null||(Oe=lc(re,se),Oe!=null&>.push(Bc(re,Oe,fe))),fn)break;re=re.return}0<gt.length&&(me=new ye(me,nt,null,l,Re),Ne.push({event:me,listeners:gt}))}}if((o&7)===0){e:{if(me=r==="mouseover"||r==="pointerover",ye=r==="mouseout"||r==="pointerout",me&&l!==ym&&(nt=l.relatedTarget||l.fromElement)&&(Cn(nt)||nt[tt]))break e;if((ye||me)&&(me=Re.window===Re?Re:(me=Re.ownerDocument)?me.defaultView||me.parentWindow:window,ye?(nt=l.relatedTarget||l.toElement,ye=he,nt=nt?Cn(nt):null,nt!==null&&(fn=s(nt),gt=nt.tag,nt!==fn||gt!==5&>!==27&>!==6)&&(nt=null)):(ye=null,nt=he),ye!==nt)){if(gt=R0,Oe="onMouseLeave",se="onMouseEnter",re="mouse",(r==="pointerout"||r==="pointerover")&&(gt=C0,Oe="onPointerLeave",se="onPointerEnter",re="pointer"),fn=ye==null?me:Gn(ye),fe=nt==null?me:Gn(nt),me=new gt(Oe,re+"leave",ye,l,Re),me.target=fn,me.relatedTarget=fe,Oe=null,Cn(Re)===he&&(gt=new gt(se,re+"enter",nt,l,Re),gt.target=fe,gt.relatedTarget=fn,Oe=gt),fn=Oe,ye&&nt)t:{for(gt=yA,se=ye,re=nt,fe=0,Oe=se;Oe;Oe=gt(Oe))fe++;Oe=0;for(var dt=re;dt;dt=gt(dt))Oe++;for(;0<fe-Oe;)se=gt(se),fe--;for(;0<Oe-fe;)re=gt(re),Oe--;for(;fe--;){if(se===re||re!==null&&se===re.alternate){gt=se;break t}se=gt(se),re=gt(re)}gt=null}else gt=null;ye!==null&&yS(Ne,me,ye,gt,!1),nt!==null&&fn!==null&&yS(Ne,fn,nt,gt,!0)}}e:{if(me=he?Gn(he):window,ye=me.nodeName&&me.nodeName.toLowerCase(),ye==="select"||ye==="input"&&me.type==="file")var Jt=L0;else if(k0(me))if(_0)Jt=MN;else{Jt=CN;var ot=TN}else ye=me.nodeName,!ye||ye.toLowerCase()!=="input"||me.type!=="checkbox"&&me.type!=="radio"?he&&gm(he.elementType)&&(Jt=L0):Jt=ON;if(Jt&&(Jt=Jt(r,he))){j0(Ne,Jt,l,Re);break e}ot&&ot(r,me,he),r==="focusout"&&he&&me.type==="number"&&he.memoizedProps.value!=null&&pm(me,"number",me.value)}switch(ot=he?Gn(he):window,r){case"focusin":(k0(ot)||ot.contentEditable==="true")&&(js=ot,Am=he,gc=null);break;case"focusout":gc=Am=js=null;break;case"mousedown":Dm=!0;break;case"contextmenu":case"mouseup":case"dragend":Dm=!1,V0(Ne,l,Re);break;case"selectionchange":if(AN)break;case"keydown":case"keyup":V0(Ne,l,Re)}var Lt;if(Cm)e:{switch(r){case"compositionstart":var Vt="onCompositionStart";break e;case"compositionend":Vt="onCompositionEnd";break e;case"compositionupdate":Vt="onCompositionUpdate";break e}Vt=void 0}else ks?A0(r,l)&&(Vt="onCompositionEnd"):r==="keydown"&&l.keyCode===229&&(Vt="onCompositionStart");Vt&&(O0&&l.locale!=="ko"&&(ks||Vt!=="onCompositionStart"?Vt==="onCompositionEnd"&&ks&&(Lt=S0()):(No=Re,wm="value"in No?No.value:No.textContent,ks=!0)),ot=cf(he,Vt),0<ot.length&&(Vt=new T0(Vt,r,null,l,Re),Ne.push({event:Vt,listeners:ot}),Lt?Vt.data=Lt:(Lt=D0(l),Lt!==null&&(Vt.data=Lt)))),(Lt=xN?wN(r,l):SN(r,l))&&(Vt=cf(he,"onBeforeInput"),0<Vt.length&&(ot=new T0("onBeforeInput","beforeinput",null,l,Re),Ne.push({event:ot,listeners:Vt}),ot.data=Lt)),hA(Ne,r,he,l,Re)}pS(Ne,o)})}function Bc(r,o,l){return{instance:r,listener:o,currentTarget:l}}function cf(r,o){for(var l=o+"Capture",u=[];r!==null;){var p=r,v=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||v===null||(p=lc(r,l),p!=null&&u.unshift(Bc(r,p,v)),p=lc(r,o),p!=null&&u.push(Bc(r,p,v))),r.tag===3)return u;r=r.return}return[]}function yA(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function yS(r,o,l,u,p){for(var v=o._reactName,N=[];l!==null&&l!==u;){var U=l,ee=U.alternate,he=U.stateNode;if(U=U.tag,ee!==null&&ee===u)break;U!==5&&U!==26&&U!==27||he===null||(ee=he,p?(he=lc(l,v),he!=null&&N.unshift(Bc(l,he,ee))):p||(he=lc(l,v),he!=null&&N.push(Bc(l,he,ee)))),l=l.return}N.length!==0&&r.push({event:o,listeners:N})}var vA=/\r\n?/g,bA=/\u0000|\uFFFD/g;function vS(r){return(typeof r=="string"?r:""+r).replace(vA,`
|
|
50
|
-
`).replace(bA,"")}function bS(r,o){return o=vS(o),vS(r)===o}function dn(r,o,l,u,p,v){switch(l){case"children":typeof u=="string"?o==="body"||o==="textarea"&&u===""||Ns(r,u):(typeof u=="number"||typeof u=="bigint")&&o!=="body"&&Ns(r,""+u);break;case"className":fa(r,"class",u);break;case"tabIndex":fa(r,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":fa(r,l,u);break;case"style":b0(r,u,v);break;case"data":if(o!=="object"){fa(r,"data",u);break}case"src":case"href":if(u===""&&(o!=="a"||l!=="href")){r.removeAttribute(l);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){r.removeAttribute(l);break}u=md(""+u),r.setAttribute(l,u);break;case"action":case"formAction":if(typeof u=="function"){r.setAttribute(l,"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"&&(l==="formAction"?(o!=="input"&&dn(r,o,"name",p.name,p,null),dn(r,o,"formEncType",p.formEncType,p,null),dn(r,o,"formMethod",p.formMethod,p,null),dn(r,o,"formTarget",p.formTarget,p,null)):(dn(r,o,"encType",p.encType,p,null),dn(r,o,"method",p.method,p,null),dn(r,o,"target",p.target,p,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){r.removeAttribute(l);break}u=md(""+u),r.setAttribute(l,u);break;case"onClick":u!=null&&(r.onclick=Ga);break;case"onScroll":u!=null&&Bt("scroll",r);break;case"onScrollEnd":u!=null&&Bt("scrollend",r);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(l=u.__html,l!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=l}}break;case"multiple":r.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":r.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){r.removeAttribute("xlink:href");break}l=md(""+u),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(l,""+u):r.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(l,""):r.removeAttribute(l);break;case"capture":case"download":u===!0?r.setAttribute(l,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(l,u):r.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?r.setAttribute(l,u):r.removeAttribute(l);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?r.removeAttribute(l):r.setAttribute(l,u);break;case"popover":Bt("beforetoggle",r),Bt("toggle",r),jn(r,"popover",u);break;case"xlinkActuate":Jn(r,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Jn(r,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Jn(r,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Jn(r,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Jn(r,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Jn(r,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Jn(r,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Jn(r,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Jn(r,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":jn(r,"is",u);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=K2.get(l)||l,jn(r,l,u))}}function ng(r,o,l,u,p,v){switch(l){case"style":b0(r,u,v);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(l=u.__html,l!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=l}}break;case"children":typeof u=="string"?Ns(r,u):(typeof u=="number"||typeof u=="bigint")&&Ns(r,""+u);break;case"onScroll":u!=null&&Bt("scroll",r);break;case"onScrollEnd":u!=null&&Bt("scrollend",r);break;case"onClick":u!=null&&(r.onclick=Ga);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ar.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(p=l.endsWith("Capture"),o=l.slice(2,p?l.length-7:void 0),v=r[$e]||null,v=v!=null?v[l]:null,typeof v=="function"&&r.removeEventListener(o,v,p),typeof u=="function")){typeof v!="function"&&v!==null&&(l in r?r[l]=null:r.hasAttribute(l)&&r.removeAttribute(l)),r.addEventListener(o,u,p);break e}l in r?r[l]=u:u===!0?r.setAttribute(l,""):jn(r,l,u)}}}function rr(r,o,l){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Bt("error",r),Bt("load",r);var u=!1,p=!1,v;for(v in l)if(l.hasOwnProperty(v)){var N=l[v];if(N!=null)switch(v){case"src":u=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,o));default:dn(r,o,v,N,l,null)}}p&&dn(r,o,"srcSet",l.srcSet,l,null),u&&dn(r,o,"src",l.src,l,null);return;case"input":Bt("invalid",r);var U=v=N=p=null,ee=null,he=null;for(u in l)if(l.hasOwnProperty(u)){var Re=l[u];if(Re!=null)switch(u){case"name":p=Re;break;case"type":N=Re;break;case"checked":ee=Re;break;case"defaultChecked":he=Re;break;case"value":v=Re;break;case"defaultValue":U=Re;break;case"children":case"dangerouslySetInnerHTML":if(Re!=null)throw Error(a(137,o));break;default:dn(r,o,u,Re,l,null)}}p0(r,v,U,ee,he,N,p,!1);return;case"select":Bt("invalid",r),u=N=v=null;for(p in l)if(l.hasOwnProperty(p)&&(U=l[p],U!=null))switch(p){case"value":v=U;break;case"defaultValue":N=U;break;case"multiple":u=U;default:dn(r,o,p,U,l,null)}o=v,l=N,r.multiple=!!u,o!=null?Ms(r,!!u,o,!1):l!=null&&Ms(r,!!u,l,!0);return;case"textarea":Bt("invalid",r),v=p=u=null;for(N in l)if(l.hasOwnProperty(N)&&(U=l[N],U!=null))switch(N){case"value":u=U;break;case"defaultValue":p=U;break;case"children":v=U;break;case"dangerouslySetInnerHTML":if(U!=null)throw Error(a(91));break;default:dn(r,o,N,U,l,null)}y0(r,u,p,v);return;case"option":for(ee in l)if(l.hasOwnProperty(ee)&&(u=l[ee],u!=null))switch(ee){case"selected":r.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:dn(r,o,ee,u,l,null)}return;case"dialog":Bt("beforetoggle",r),Bt("toggle",r),Bt("cancel",r),Bt("close",r);break;case"iframe":case"object":Bt("load",r);break;case"video":case"audio":for(u=0;u<Hc.length;u++)Bt(Hc[u],r);break;case"image":Bt("error",r),Bt("load",r);break;case"details":Bt("toggle",r);break;case"embed":case"source":case"link":Bt("error",r),Bt("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(he in l)if(l.hasOwnProperty(he)&&(u=l[he],u!=null))switch(he){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,o));default:dn(r,o,he,u,l,null)}return;default:if(gm(o)){for(Re in l)l.hasOwnProperty(Re)&&(u=l[Re],u!==void 0&&ng(r,o,Re,u,l,void 0));return}}for(U in l)l.hasOwnProperty(U)&&(u=l[U],u!=null&&dn(r,o,U,u,l,null))}function xA(r,o,l,u){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,v=null,N=null,U=null,ee=null,he=null,Re=null;for(ye in l){var Ne=l[ye];if(l.hasOwnProperty(ye)&&Ne!=null)switch(ye){case"checked":break;case"value":break;case"defaultValue":ee=Ne;default:u.hasOwnProperty(ye)||dn(r,o,ye,null,u,Ne)}}for(var me in u){var ye=u[me];if(Ne=l[me],u.hasOwnProperty(me)&&(ye!=null||Ne!=null))switch(me){case"type":v=ye;break;case"name":p=ye;break;case"checked":he=ye;break;case"defaultChecked":Re=ye;break;case"value":N=ye;break;case"defaultValue":U=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(a(137,o));break;default:ye!==Ne&&dn(r,o,me,ye,u,Ne)}}mm(r,N,U,ee,he,Re,v,p);return;case"select":ye=N=U=me=null;for(v in l)if(ee=l[v],l.hasOwnProperty(v)&&ee!=null)switch(v){case"value":break;case"multiple":ye=ee;default:u.hasOwnProperty(v)||dn(r,o,v,null,u,ee)}for(p in u)if(v=u[p],ee=l[p],u.hasOwnProperty(p)&&(v!=null||ee!=null))switch(p){case"value":me=v;break;case"defaultValue":U=v;break;case"multiple":N=v;default:v!==ee&&dn(r,o,p,v,u,ee)}o=U,l=N,u=ye,me!=null?Ms(r,!!l,me,!1):!!u!=!!l&&(o!=null?Ms(r,!!l,o,!0):Ms(r,!!l,l?[]:"",!1));return;case"textarea":ye=me=null;for(U in l)if(p=l[U],l.hasOwnProperty(U)&&p!=null&&!u.hasOwnProperty(U))switch(U){case"value":break;case"children":break;default:dn(r,o,U,null,u,p)}for(N in u)if(p=u[N],v=l[N],u.hasOwnProperty(N)&&(p!=null||v!=null))switch(N){case"value":me=p;break;case"defaultValue":ye=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==v&&dn(r,o,N,p,u,v)}g0(r,me,ye);return;case"option":for(var nt in l)if(me=l[nt],l.hasOwnProperty(nt)&&me!=null&&!u.hasOwnProperty(nt))switch(nt){case"selected":r.selected=!1;break;default:dn(r,o,nt,null,u,me)}for(ee in u)if(me=u[ee],ye=l[ee],u.hasOwnProperty(ee)&&me!==ye&&(me!=null||ye!=null))switch(ee){case"selected":r.selected=me&&typeof me!="function"&&typeof me!="symbol";break;default:dn(r,o,ee,me,u,ye)}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 gt in l)me=l[gt],l.hasOwnProperty(gt)&&me!=null&&!u.hasOwnProperty(gt)&&dn(r,o,gt,null,u,me);for(he in u)if(me=u[he],ye=l[he],u.hasOwnProperty(he)&&me!==ye&&(me!=null||ye!=null))switch(he){case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(a(137,o));break;default:dn(r,o,he,me,u,ye)}return;default:if(gm(o)){for(var fn in l)me=l[fn],l.hasOwnProperty(fn)&&me!==void 0&&!u.hasOwnProperty(fn)&&ng(r,o,fn,void 0,u,me);for(Re in u)me=u[Re],ye=l[Re],!u.hasOwnProperty(Re)||me===ye||me===void 0&&ye===void 0||ng(r,o,Re,me,u,ye);return}}for(var se in l)me=l[se],l.hasOwnProperty(se)&&me!=null&&!u.hasOwnProperty(se)&&dn(r,o,se,null,u,me);for(Ne in u)me=u[Ne],ye=l[Ne],!u.hasOwnProperty(Ne)||me===ye||me==null&&ye==null||dn(r,o,Ne,me,u,ye)}function xS(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function wA(){if(typeof performance.getEntriesByType=="function"){for(var r=0,o=0,l=performance.getEntriesByType("resource"),u=0;u<l.length;u++){var p=l[u],v=p.transferSize,N=p.initiatorType,U=p.duration;if(v&&U&&xS(N)){for(N=0,U=p.responseEnd,u+=1;u<l.length;u++){var ee=l[u],he=ee.startTime;if(he>U)break;var Re=ee.transferSize,Ne=ee.initiatorType;Re&&xS(Ne)&&(ee=ee.responseEnd,N+=Re*(ee<U?1:(U-he)/(ee-he)))}if(--u,o+=8*(v+N)/(p.duration/1e3),r++,10<r)break}}if(0<r)return o/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var rg=null,ag=null;function uf(r){return r.nodeType===9?r:r.ownerDocument}function wS(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function SS(r,o){if(r===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&o==="foreignObject"?0:r}function og(r,o){return r==="textarea"||r==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var ig=null;function SA(){var r=window.event;return r&&r.type==="popstate"?r===ig?!1:(ig=r,!0):(ig=null,!1)}var ES=typeof setTimeout=="function"?setTimeout:void 0,EA=typeof clearTimeout=="function"?clearTimeout:void 0,RS=typeof Promise=="function"?Promise:void 0,RA=typeof queueMicrotask=="function"?queueMicrotask:typeof RS<"u"?function(r){return RS.resolve(null).then(r).catch(TA)}:ES;function TA(r){setTimeout(function(){throw r})}function $o(r){return r==="head"}function TS(r,o){var l=o,u=0;do{var p=l.nextSibling;if(r.removeChild(l),p&&p.nodeType===8)if(l=p.data,l==="/$"||l==="/&"){if(u===0){r.removeChild(p),il(o);return}u--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")u++;else if(l==="html")Fc(r.ownerDocument.documentElement);else if(l==="head"){l=r.ownerDocument.head,Fc(l);for(var v=l.firstChild;v;){var N=v.nextSibling,U=v.nodeName;v[wn]||U==="SCRIPT"||U==="STYLE"||U==="LINK"&&v.rel.toLowerCase()==="stylesheet"||l.removeChild(v),v=N}}else l==="body"&&Fc(r.ownerDocument.body);l=p}while(l);il(o)}function CS(r,o){var l=r;r=0;do{var u=l.nextSibling;if(l.nodeType===1?o?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(o?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),u&&u.nodeType===8)if(l=u.data,l==="/$"){if(r===0)break;r--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||r++;l=u}while(l)}function sg(r){var o=r.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var l=o;switch(o=o.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":sg(l),Tn(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}r.removeChild(l)}}function CA(r,o,l,u){for(;r.nodeType===1;){var p=l;if(r.nodeName.toLowerCase()!==o.toLowerCase()){if(!u&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(u){if(!r[wn])switch(o){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(v=r.getAttribute("rel"),v==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(v!==p.rel||r.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||r.getAttribute("title")!==(p.title==null?null:p.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(v=r.getAttribute("src"),(v!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&v&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(o==="input"&&r.type==="hidden"){var v=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===v)return r}else return r;if(r=Jr(r.nextSibling),r===null)break}return null}function OA(r,o,l){if(o==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!l||(r=Jr(r.nextSibling),r===null))return null;return r}function OS(r,o){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!o||(r=Jr(r.nextSibling),r===null))return null;return r}function lg(r){return r.data==="$?"||r.data==="$~"}function cg(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function MA(r,o){var l=r.ownerDocument;if(r.data==="$~")r._reactRetry=o;else if(r.data!=="$?"||l.readyState!=="loading")o();else{var u=function(){o(),l.removeEventListener("DOMContentLoaded",u)};l.addEventListener("DOMContentLoaded",u),r._reactRetry=u}}function Jr(r){for(;r!=null;r=r.nextSibling){var o=r.nodeType;if(o===1||o===3)break;if(o===8){if(o=r.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return r}var ug=null;function MS(r){r=r.nextSibling;for(var o=0;r;){if(r.nodeType===8){var l=r.data;if(l==="/$"||l==="/&"){if(o===0)return Jr(r.nextSibling);o--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||o++}r=r.nextSibling}return null}function NS(r){r=r.previousSibling;for(var o=0;r;){if(r.nodeType===8){var l=r.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(o===0)return r;o--}else l!=="/$"&&l!=="/&"||o++}r=r.previousSibling}return null}function AS(r,o,l){switch(o=uf(l),r){case"html":if(r=o.documentElement,!r)throw Error(a(452));return r;case"head":if(r=o.head,!r)throw Error(a(453));return r;case"body":if(r=o.body,!r)throw Error(a(454));return r;default:throw Error(a(451))}}function Fc(r){for(var o=r.attributes;o.length;)r.removeAttributeNode(o[0]);Tn(r)}var ea=new Map,DS=new Set;function df(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var uo=L.d;L.d={f:NA,r:AA,D:DA,C:kA,L:jA,m:LA,X:IA,S:_A,M:zA};function NA(){var r=uo.f(),o=tf();return r||o}function AA(r){var o=$t(r);o!==null&&o.tag===5&&o.type==="form"?Gx(o):uo.r(r)}var rl=typeof document>"u"?null:document;function kS(r,o,l){var u=rl;if(u&&typeof o=="string"&&o){var p=$r(o);p='link[rel="'+r+'"][href="'+p+'"]',typeof l=="string"&&(p+='[crossorigin="'+l+'"]'),DS.has(p)||(DS.add(p),r={rel:r,crossOrigin:l,href:o},u.querySelector(p)===null&&(o=u.createElement("link"),rr(o,"link",r),bn(o),u.head.appendChild(o)))}}function DA(r){uo.D(r),kS("dns-prefetch",r,null)}function kA(r,o){uo.C(r,o),kS("preconnect",r,o)}function jA(r,o,l){uo.L(r,o,l);var u=rl;if(u&&r&&o){var p='link[rel="preload"][as="'+$r(o)+'"]';o==="image"&&l&&l.imageSrcSet?(p+='[imagesrcset="'+$r(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(p+='[imagesizes="'+$r(l.imageSizes)+'"]')):p+='[href="'+$r(r)+'"]';var v=p;switch(o){case"style":v=al(r);break;case"script":v=ol(r)}ea.has(v)||(r=m({rel:"preload",href:o==="image"&&l&&l.imageSrcSet?void 0:r,as:o},l),ea.set(v,r),u.querySelector(p)!==null||o==="style"&&u.querySelector(Vc(v))||o==="script"&&u.querySelector(Yc(v))||(o=u.createElement("link"),rr(o,"link",r),bn(o),u.head.appendChild(o)))}}function LA(r,o){uo.m(r,o);var l=rl;if(l&&r){var u=o&&typeof o.as=="string"?o.as:"script",p='link[rel="modulepreload"][as="'+$r(u)+'"][href="'+$r(r)+'"]',v=p;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=ol(r)}if(!ea.has(v)&&(r=m({rel:"modulepreload",href:r},o),ea.set(v,r),l.querySelector(p)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Yc(v)))return}u=l.createElement("link"),rr(u,"link",r),bn(u),l.head.appendChild(u)}}}function _A(r,o,l){uo.S(r,o,l);var u=rl;if(u&&r){var p=yr(u).hoistableStyles,v=al(r);o=o||"default";var N=p.get(v);if(!N){var U={loading:0,preload:null};if(N=u.querySelector(Vc(v)))U.loading=5;else{r=m({rel:"stylesheet",href:r,"data-precedence":o},l),(l=ea.get(v))&&dg(r,l);var ee=N=u.createElement("link");bn(ee),rr(ee,"link",r),ee._p=new Promise(function(he,Re){ee.onload=he,ee.onerror=Re}),ee.addEventListener("load",function(){U.loading|=1}),ee.addEventListener("error",function(){U.loading|=2}),U.loading|=4,ff(N,o,u)}N={type:"stylesheet",instance:N,count:1,state:U},p.set(v,N)}}}function IA(r,o){uo.X(r,o);var l=rl;if(l&&r){var u=yr(l).hoistableScripts,p=ol(r),v=u.get(p);v||(v=l.querySelector(Yc(p)),v||(r=m({src:r,async:!0},o),(o=ea.get(p))&&fg(r,o),v=l.createElement("script"),bn(v),rr(v,"link",r),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(p,v))}}function zA(r,o){uo.M(r,o);var l=rl;if(l&&r){var u=yr(l).hoistableScripts,p=ol(r),v=u.get(p);v||(v=l.querySelector(Yc(p)),v||(r=m({src:r,async:!0,type:"module"},o),(o=ea.get(p))&&fg(r,o),v=l.createElement("script"),bn(v),rr(v,"link",r),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(p,v))}}function jS(r,o,l,u){var p=(p=ie.current)?df(p):null;if(!p)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(o=al(l.href),l=yr(p).hoistableStyles,u=l.get(o),u||(u={type:"style",instance:null,count:0,state:null},l.set(o,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){r=al(l.href);var v=yr(p).hoistableStyles,N=v.get(r);if(N||(p=p.ownerDocument||p,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,N),(v=p.querySelector(Vc(r)))&&!v._p&&(N.instance=v,N.state.loading=5),ea.has(r)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},ea.set(r,l),v||PA(p,r,l,N.state))),o&&u===null)throw Error(a(528,""));return N}if(o&&u!==null)throw Error(a(529,""));return null;case"script":return o=l.async,l=l.src,typeof l=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=ol(l),l=yr(p).hoistableScripts,u=l.get(o),u||(u={type:"script",instance:null,count:0,state:null},l.set(o,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function al(r){return'href="'+$r(r)+'"'}function Vc(r){return'link[rel="stylesheet"]['+r+"]"}function LS(r){return m({},r,{"data-precedence":r.precedence,precedence:null})}function PA(r,o,l,u){r.querySelector('link[rel="preload"][as="style"]['+o+"]")?u.loading=1:(o=r.createElement("link"),u.preload=o,o.addEventListener("load",function(){return u.loading|=1}),o.addEventListener("error",function(){return u.loading|=2}),rr(o,"link",l),bn(o),r.head.appendChild(o))}function ol(r){return'[src="'+$r(r)+'"]'}function Yc(r){return"script[async]"+r}function _S(r,o,l){if(o.count++,o.instance===null)switch(o.type){case"style":var u=r.querySelector('style[data-href~="'+$r(l.href)+'"]');if(u)return o.instance=u,bn(u),u;var p=m({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return u=(r.ownerDocument||r).createElement("style"),bn(u),rr(u,"style",p),ff(u,l.precedence,r),o.instance=u;case"stylesheet":p=al(l.href);var v=r.querySelector(Vc(p));if(v)return o.state.loading|=4,o.instance=v,bn(v),v;u=LS(l),(p=ea.get(p))&&dg(u,p),v=(r.ownerDocument||r).createElement("link"),bn(v);var N=v;return N._p=new Promise(function(U,ee){N.onload=U,N.onerror=ee}),rr(v,"link",u),o.state.loading|=4,ff(v,l.precedence,r),o.instance=v;case"script":return v=ol(l.src),(p=r.querySelector(Yc(v)))?(o.instance=p,bn(p),p):(u=l,(p=ea.get(v))&&(u=m({},l),fg(u,p)),r=r.ownerDocument||r,p=r.createElement("script"),bn(p),rr(p,"link",u),r.head.appendChild(p),o.instance=p);case"void":return null;default:throw Error(a(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(u=o.instance,o.state.loading|=4,ff(u,l.precedence,r));return o.instance}function ff(r,o,l){for(var u=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=u.length?u[u.length-1]:null,v=p,N=0;N<u.length;N++){var U=u[N];if(U.dataset.precedence===o)v=U;else if(v!==p)break}v?v.parentNode.insertBefore(r,v.nextSibling):(o=l.nodeType===9?l.head:l,o.insertBefore(r,o.firstChild))}function dg(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.title==null&&(r.title=o.title)}function fg(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.integrity==null&&(r.integrity=o.integrity)}var hf=null;function IS(r,o,l){if(hf===null){var u=new Map,p=hf=new Map;p.set(l,u)}else p=hf,u=p.get(l),u||(u=new Map,p.set(l,u));if(u.has(r))return u;for(u.set(r,null),l=l.getElementsByTagName(r),p=0;p<l.length;p++){var v=l[p];if(!(v[wn]||v[Fe]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var N=v.getAttribute(o)||"";N=r+N;var U=u.get(N);U?U.push(v):u.set(N,[v])}}return u}function zS(r,o,l){r=r.ownerDocument||r,r.head.insertBefore(l,o==="title"?r.querySelector("head > title"):null)}function UA(r,o,l){if(l===1||o.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return r=o.disabled,typeof o.precedence=="string"&&r==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 PS(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function HA(r,o,l,u){if(l.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var p=al(u.href),v=o.querySelector(Vc(p));if(v){o=v._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(r.count++,r=mf.bind(r),o.then(r,r)),l.state.loading|=4,l.instance=v,bn(v);return}v=o.ownerDocument||o,u=LS(u),(p=ea.get(p))&&dg(u,p),v=v.createElement("link"),bn(v);var N=v;N._p=new Promise(function(U,ee){N.onload=U,N.onerror=ee}),rr(v,"link",u),l.instance=v}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(l,o),(o=l.state.preload)&&(l.state.loading&3)===0&&(r.count++,l=mf.bind(r),o.addEventListener("load",l),o.addEventListener("error",l))}}var hg=0;function BA(r,o){return r.stylesheets&&r.count===0&&gf(r,r.stylesheets),0<r.count||0<r.imgCount?function(l){var u=setTimeout(function(){if(r.stylesheets&&gf(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+o);0<r.imgBytes&&hg===0&&(hg=62500*wA());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&gf(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>hg?50:800)+o);return r.unsuspend=l,function(){r.unsuspend=null,clearTimeout(u),clearTimeout(p)}}:null}function mf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)gf(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var pf=null;function gf(r,o){r.stylesheets=null,r.unsuspend!==null&&(r.count++,pf=new Map,o.forEach(FA,r),pf=null,mf.call(r))}function FA(r,o){if(!(o.state.loading&4)){var l=pf.get(r);if(l)var u=l.get(null);else{l=new Map,pf.set(r,l);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<p.length;v++){var N=p[v];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(l.set(N.dataset.precedence,N),u=N)}u&&l.set(null,u)}p=o.instance,N=p.getAttribute("data-precedence"),v=l.get(N)||u,v===u&&l.set(null,p),l.set(N,p),this.count++,u=mf.bind(this),p.addEventListener("load",u),p.addEventListener("error",u),v?v.parentNode.insertBefore(p,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),o.state.loading|=4}}var qc={$$typeof:M,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function VA(r,o,l,u,p,v,N,U,ee){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=rn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rn(0),this.hiddenUpdates=rn(null),this.identifierPrefix=u,this.onUncaughtError=p,this.onCaughtError=v,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ee,this.incompleteTransitions=new Map}function US(r,o,l,u,p,v,N,U,ee,he,Re,Ne){return r=new VA(r,o,l,N,ee,he,Re,Ne,U),o=1,v===!0&&(o|=24),v=kr(3,null,null,o),r.current=v,v.stateNode=r,o=$m(),o.refCount++,r.pooledCache=o,o.refCount++,v.memoizedState={element:u,isDehydrated:l,cache:o},Wm(v),r}function HS(r){return r?(r=Is,r):Is}function BS(r,o,l,u,p,v){p=HS(p),u.context===null?u.context=p:u.pendingContext=p,u=_o(o),u.payload={element:l},v=v===void 0?null:v,v!==null&&(u.callback=v),l=Io(r,u,o),l!==null&&(Er(l,r,o),Ec(l,r,o))}function FS(r,o){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var l=r.retryLane;r.retryLane=l!==0&&l<o?l:o}}function mg(r,o){FS(r,o),(r=r.alternate)&&FS(r,o)}function VS(r){if(r.tag===13||r.tag===31){var o=Ii(r,67108864);o!==null&&Er(o,r,67108864),mg(r,67108864)}}function YS(r){if(r.tag===13||r.tag===31){var o=zr();o=le(o);var l=Ii(r,o);l!==null&&Er(l,r,o),mg(r,o)}}var yf=!0;function YA(r,o,l,u){var p=_.T;_.T=null;var v=L.p;try{L.p=2,pg(r,o,l,u)}finally{L.p=v,_.T=p}}function qA(r,o,l,u){var p=_.T;_.T=null;var v=L.p;try{L.p=8,pg(r,o,l,u)}finally{L.p=v,_.T=p}}function pg(r,o,l,u){if(yf){var p=gg(u);if(p===null)tg(r,o,u,vf,l),$S(r,u);else if(KA(p,r,o,l,u))u.stopPropagation();else if($S(r,u),o&4&&-1<$A.indexOf(r)){for(;p!==null;){var v=$t(p);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var N=mt(v.pendingLanes);if(N!==0){var U=v;for(U.pendingLanes|=2,U.entangledLanes|=2;N;){var ee=1<<31-ft(N);U.entanglements[1]|=ee,N&=~ee}Ma(v),(an&6)===0&&(Jd=Ae()+500,Uc(0))}}break;case 31:case 13:U=Ii(v,2),U!==null&&Er(U,v,2),tf(),mg(v,2)}if(v=gg(u),v===null&&tg(r,o,u,vf,l),v===p)break;p=v}p!==null&&u.stopPropagation()}else tg(r,o,u,null,l)}}function gg(r){return r=vm(r),yg(r)}var vf=null;function yg(r){if(vf=null,r=Cn(r),r!==null){var o=s(r);if(o===null)r=null;else{var l=o.tag;if(l===13){if(r=c(o),r!==null)return r;r=null}else if(l===31){if(r=d(o),r!==null)return r;r=null}else if(l===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;r=null}else o!==r&&(r=null)}}return vf=r,null}function qS(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(it()){case wt:return 2;case xt:return 8;case oe:case xe:return 32;case Ie:return 268435456;default:return 32}default:return 32}}var vg=!1,Ko=null,Go=null,Xo=null,$c=new Map,Kc=new Map,Wo=[],$A="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 $S(r,o){switch(r){case"focusin":case"focusout":Ko=null;break;case"dragenter":case"dragleave":Go=null;break;case"mouseover":case"mouseout":Xo=null;break;case"pointerover":case"pointerout":$c.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Kc.delete(o.pointerId)}}function Gc(r,o,l,u,p,v){return r===null||r.nativeEvent!==v?(r={blockedOn:o,domEventName:l,eventSystemFlags:u,nativeEvent:v,targetContainers:[p]},o!==null&&(o=$t(o),o!==null&&VS(o)),r):(r.eventSystemFlags|=u,o=r.targetContainers,p!==null&&o.indexOf(p)===-1&&o.push(p),r)}function KA(r,o,l,u,p){switch(o){case"focusin":return Ko=Gc(Ko,r,o,l,u,p),!0;case"dragenter":return Go=Gc(Go,r,o,l,u,p),!0;case"mouseover":return Xo=Gc(Xo,r,o,l,u,p),!0;case"pointerover":var v=p.pointerId;return $c.set(v,Gc($c.get(v)||null,r,o,l,u,p)),!0;case"gotpointercapture":return v=p.pointerId,Kc.set(v,Gc(Kc.get(v)||null,r,o,l,u,p)),!0}return!1}function KS(r){var o=Cn(r.target);if(o!==null){var l=s(o);if(l!==null){if(o=l.tag,o===13){if(o=c(l),o!==null){r.blockedOn=o,Ze(r.priority,function(){YS(l)});return}}else if(o===31){if(o=d(l),o!==null){r.blockedOn=o,Ze(r.priority,function(){YS(l)});return}}else if(o===3&&l.stateNode.current.memoizedState.isDehydrated){r.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}r.blockedOn=null}function bf(r){if(r.blockedOn!==null)return!1;for(var o=r.targetContainers;0<o.length;){var l=gg(r.nativeEvent);if(l===null){l=r.nativeEvent;var u=new l.constructor(l.type,l);ym=u,l.target.dispatchEvent(u),ym=null}else return o=$t(l),o!==null&&VS(o),r.blockedOn=l,!1;o.shift()}return!0}function GS(r,o,l){bf(r)&&l.delete(o)}function GA(){vg=!1,Ko!==null&&bf(Ko)&&(Ko=null),Go!==null&&bf(Go)&&(Go=null),Xo!==null&&bf(Xo)&&(Xo=null),$c.forEach(GS),Kc.forEach(GS)}function xf(r,o){r.blockedOn===o&&(r.blockedOn=null,vg||(vg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,GA)))}var wf=null;function XS(r){wf!==r&&(wf=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){wf===r&&(wf=null);for(var o=0;o<r.length;o+=3){var l=r[o],u=r[o+1],p=r[o+2];if(typeof u!="function"){if(yg(u||l)===null)continue;break}var v=$t(l);v!==null&&(r.splice(o,3),o-=3,gp(v,{pending:!0,data:p,method:l.method,action:u},u,p))}}))}function il(r){function o(ee){return xf(ee,r)}Ko!==null&&xf(Ko,r),Go!==null&&xf(Go,r),Xo!==null&&xf(Xo,r),$c.forEach(o),Kc.forEach(o);for(var l=0;l<Wo.length;l++){var u=Wo[l];u.blockedOn===r&&(u.blockedOn=null)}for(;0<Wo.length&&(l=Wo[0],l.blockedOn===null);)KS(l),l.blockedOn===null&&Wo.shift();if(l=(r.ownerDocument||r).$$reactFormReplay,l!=null)for(u=0;u<l.length;u+=3){var p=l[u],v=l[u+1],N=p[$e]||null;if(typeof v=="function")N||XS(l);else if(N){var U=null;if(v&&v.hasAttribute("formAction")){if(p=v,N=v[$e]||null)U=N.formAction;else if(yg(p)!==null)continue}else U=N.action;typeof U=="function"?l[u+1]=U:(l.splice(u,3),u-=3),XS(l)}}}function WS(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(N){return p=N})},focusReset:"manual",scroll:"manual"})}function o(){p!==null&&(p(),p=null),u||setTimeout(l,20)}function l(){if(!u&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(l,100),function(){u=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),p!==null&&(p(),p=null)}}}function bg(r){this._internalRoot=r}Sf.prototype.render=bg.prototype.render=function(r){var o=this._internalRoot;if(o===null)throw Error(a(409));var l=o.current,u=zr();BS(l,u,r,o,null,null)},Sf.prototype.unmount=bg.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var o=r.containerInfo;BS(r.current,2,null,r,null,null),tf(),o[tt]=null}};function Sf(r){this._internalRoot=r}Sf.prototype.unstable_scheduleHydration=function(r){if(r){var o=je();r={blockedOn:null,target:r,priority:o};for(var l=0;l<Wo.length&&o!==0&&o<Wo[l].priority;l++);Wo.splice(l,0,r),l===0&&KS(r)}};var QS=t.version;if(QS!=="19.2.4")throw Error(a(527,QS,"19.2.4"));L.findDOMNode=function(r){var o=r._reactInternals;if(o===void 0)throw typeof r.render=="function"?Error(a(188)):(r=Object.keys(r).join(","),Error(a(268,r)));return r=f(o),r=r!==null?g(r):null,r=r===null?null:r.stateNode,r};var XA={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:_,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ef=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ef.isDisabled&&Ef.supportsFiber)try{st=Ef.inject(XA),ze=Ef}catch{}}return Wc.createRoot=function(r,o){if(!i(r))throw Error(a(299));var l=!1,u="",p=aw,v=ow,N=iw;return o!=null&&(o.unstable_strictMode===!0&&(l=!0),o.identifierPrefix!==void 0&&(u=o.identifierPrefix),o.onUncaughtError!==void 0&&(p=o.onUncaughtError),o.onCaughtError!==void 0&&(v=o.onCaughtError),o.onRecoverableError!==void 0&&(N=o.onRecoverableError)),o=US(r,1,!1,null,null,l,u,null,p,v,N,WS),r[tt]=o.current,eg(r),new bg(o)},Wc.hydrateRoot=function(r,o,l){if(!i(r))throw Error(a(299));var u=!1,p="",v=aw,N=ow,U=iw,ee=null;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(v=l.onUncaughtError),l.onCaughtError!==void 0&&(N=l.onCaughtError),l.onRecoverableError!==void 0&&(U=l.onRecoverableError),l.formState!==void 0&&(ee=l.formState)),o=US(r,1,!0,o,l??null,u,p,ee,v,N,U,WS),o.context=HS(null),l=o.current,u=zr(),u=le(u),p=_o(u),p.callback=null,Io(l,p,u),l=u,o.current.lanes=l,It(o,l),Ma(o),r[tt]=o.current,eg(r),new Sf(o)},Wc.version="19.2.4",Wc}var TE;function fL(){if(TE)return Cg.exports;TE=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(),Cg.exports=dL(),Cg.exports}var hL=fL();/**
|
|
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 kT=e=>{throw TypeError(e)},mL=(e,t,n)=>t.has(e)||kT("Cannot "+n),Ag=(e,t,n)=>(mL(e,t,"read from private field"),n?n.call(e):t.get(e)),pL=(e,t,n)=>t.has(e)?kT("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),CE="popstate";function gL(e={}){function t(a,i){let{pathname:s,search:c,hash:d}=a.location;return Mu("",{pathname:s,search:c,hash:d},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(a,i){return typeof i=="string"?i:Ua(i)}return vL(t,n,null,e)}function Pt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Bn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function yL(){return Math.random().toString(36).substring(2,10)}function OE(e,t){return{usr:e.state,key:e.key,idx:t}}function Mu(e,t,n=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ei(t):t,state:n,key:t&&t.key||a||yL()}}function Ua({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 Ei(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function vL(e,t,n,a={}){let{window:i=document.defaultView,v5Compat:s=!1}=a,c=i.history,d="POP",h=null,f=g();f==null&&(f=0,c.replaceState({...c.state,idx:f},""));function g(){return(c.state||{idx:null}).idx}function m(){d="POP";let E=g(),T=E==null?null:E-f;f=E,h&&h({action:d,location:S.location,delta:T})}function b(E,T){d="PUSH";let C=Mu(S.location,E,T);f=g()+1;let M=OE(C,f),O=S.createHref(C);try{c.pushState(M,"",O)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;i.location.assign(O)}s&&h&&h({action:d,location:S.location,delta:1})}function x(E,T){d="REPLACE";let C=Mu(S.location,E,T);f=g();let M=OE(C,f),O=S.createHref(C);c.replaceState(M,"",O),s&&h&&h({action:d,location:S.location,delta:0})}function w(E){return jT(E)}let S={get action(){return d},get location(){return e(i,c)},listen(E){if(h)throw new Error("A history only accepts one active listener");return i.addEventListener(CE,m),h=E,()=>{i.removeEventListener(CE,m),h=null}},createHref(E){return t(i,E)},createURL:w,encodeLocation(E){let T=w(E);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:b,replace:x,go(E){return c.go(E)}};return S}function jT(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Pt(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:Ua(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}var lu,ME=class{constructor(e){if(pL(this,lu,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(Ag(this,lu).has(e))return Ag(this,lu).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Ag(this,lu).set(e,t)}};lu=new WeakMap;var bL=new Set(["lazy","caseSensitive","path","id","index","children"]);function xL(e){return bL.has(e)}var wL=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function SL(e){return wL.has(e)}function EL(e){return e.index===!0}function Nu(e,t,n=[],a={},i=!1){return e.map((s,c)=>{let d=[...n,String(c)],h=typeof s.id=="string"?s.id:d.join("-");if(Pt(s.index!==!0||!s.children,"Cannot specify children on an index route"),Pt(i||!a[h],`Found a route id collision on id "${h}". Route id's must be globally unique within Data Router usages`),EL(s)){let f={...s,id:h};return a[h]=NE(f,t(f)),f}else{let f={...s,id:h,children:void 0};return a[h]=NE(f,t(f)),s.children&&(f.children=Nu(s.children,t,d,a,i)),f}})}function NE(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function ni(e,t,n="/"){return cu(e,t,n,!1)}function cu(e,t,n,a){let i=typeof t=="string"?Ei(t):t,s=sa(i.pathname||"/",n);if(s==null)return null;let c=LT(e);TL(c);let d=null;for(let h=0;d==null&&h<c.length;++h){let f=IT(s);d=LL(c[h],f,a)}return d}function RL(e,t){let{route:n,pathname:a,params:i}=e;return{id:n.id,pathname:a,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function LT(e,t=[],n=[],a="",i=!1){let s=(c,d,h=i,f)=>{let g={relativePath:f===void 0?c.path||"":f,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(a)&&h)return;Pt(g.relativePath.startsWith(a),`Absolute route path "${g.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(a.length)}let m=Ia([a,g.relativePath]),b=n.concat(g);c.children&&c.children.length>0&&(Pt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),LT(c.children,t,b,m,h)),!(c.path==null&&!c.index)&&t.push({path:m,score:kL(m,c.index),routesMeta:b})};return e.forEach((c,d)=>{var h;if(c.path===""||!((h=c.path)!=null&&h.includes("?")))s(c,d);else for(let f of _T(c.path))s(c,d,!0,f)}),t}function _T(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(a.length===0)return i?[s,""]:[s];let c=_T(a.join("/")),d=[];return d.push(...c.map(h=>h===""?s:[s,h].join("/"))),i&&d.push(...c),d.map(h=>e.startsWith("/")&&h===""?"/":h)}function TL(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:jL(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var CL=/^:[\w-]+$/,OL=3,ML=2,NL=1,AL=10,DL=-2,AE=e=>e==="*";function kL(e,t){let n=e.split("/"),a=n.length;return n.some(AE)&&(a+=DL),t&&(a+=ML),n.filter(i=>!AE(i)).reduce((i,s)=>i+(CL.test(s)?OL:s===""?NL:AL),a)}function jL(e,t){return e.length===t.length&&e.slice(0,-1).every((a,i)=>a===t[i])?e[e.length-1]-t[t.length-1]:0}function LL(e,t,n=!1){let{routesMeta:a}=e,i={},s="/",c=[];for(let d=0;d<a.length;++d){let h=a[d],f=d===a.length-1,g=s==="/"?t:t.slice(s.length)||"/",m=Pl({path:h.relativePath,caseSensitive:h.caseSensitive,end:f},g),b=h.route;if(!m&&f&&n&&!a[a.length-1].route.index&&(m=Pl({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},g)),!m)return null;Object.assign(i,m.params),c.push({params:i,pathname:Ia([s,m.pathname]),pathnameBase:PL(Ia([s,m.pathnameBase])),route:b}),m.pathnameBase!=="/"&&(s=Ia([s,m.pathnameBase]))}return c}function Pl(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=_L(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],c=s.replace(/(.)\/+$/,"$1"),d=i.slice(1);return{params:a.reduce((f,{paramName:g,isOptional:m},b)=>{if(g==="*"){let w=d[b]||"";c=s.slice(0,s.length-w.length).replace(/(.)\/+$/,"$1")}const x=d[b];return m&&!x?f[g]=void 0:f[g]=(x||"").replace(/%2F/g,"/"),f},{}),pathname:s,pathnameBase:c,pattern:e}}function _L(e,t=!1,n=!0){Bn(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 a=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,h)=>(a.push({paramName:d,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),a]}function IT(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Bn(!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 sa(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,a=e.charAt(n);return a&&a!=="/"?null:e.slice(n)||"/"}function IL({basename:e,pathname:t}){return t==="/"?e:Ia([e,t])}var zT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Bv=e=>zT.test(e);function zL(e,t="/"){let{pathname:n,search:a="",hash:i=""}=typeof e=="string"?Ei(e):e,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=DE(n.substring(1),"/"):s=DE(n,t)):s=t,{pathname:s,search:UL(a),hash:HL(i)}}function DE(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Dg(e,t,n,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. 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 PT(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Fv(e){let t=PT(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function Vv(e,t,n,a=!1){let i;typeof e=="string"?i=Ei(e):(i={...e},Pt(!i.pathname||!i.pathname.includes("?"),Dg("?","pathname","search",i)),Pt(!i.pathname||!i.pathname.includes("#"),Dg("#","pathname","hash",i)),Pt(!i.search||!i.search.includes("#"),Dg("#","search","hash",i)));let s=e===""||i.pathname==="",c=s?"/":i.pathname,d;if(c==null)d=n;else{let m=t.length-1;if(!a&&c.startsWith("..")){let b=c.split("/");for(;b[0]==="..";)b.shift(),m-=1;i.pathname=b.join("/")}d=m>=0?t[m]:"/"}let h=zL(i,d),f=c&&c!=="/"&&c.endsWith("/"),g=(s||c===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(f||g)&&(h.pathname+="/"),h}var Ia=e=>e.join("/").replace(/\/\/+/g,"/"),PL=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),UL=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,HL=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Gu=class{constructor(e,t,n,a=!1){this.status=e,this.statusText=t||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Au(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Xu(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var UT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function HT(e,t){let n=e;if(typeof n!="string"||!zT.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,i=!1;if(UT)try{let s=new URL(window.location.href),c=n.startsWith("//")?new URL(s.protocol+n):new URL(n),d=sa(c.pathname,t);c.origin===s.origin&&d!=null?n=d+c.search+c.hash:i=!0}catch{Bn(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:i,to:n}}var hi=Symbol("Uninstrumented");function BL(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(i=>i({id:t.id,index:t.index,path:t.path,instrument(s){let c=Object.keys(n);for(let d of c)s[d]&&n[d].push(s[d])}}));let a={};if(typeof t.lazy=="function"&&n.lazy.length>0){let i=hl(n.lazy,t.lazy,()=>{});i&&(a.lazy=i)}if(typeof t.lazy=="object"){let i=t.lazy;["middleware","loader","action"].forEach(s=>{let c=i[s],d=n[`lazy.${s}`];if(typeof c=="function"&&d.length>0){let h=hl(d,c,()=>{});h&&(a.lazy=Object.assign(a.lazy||{},{[s]:h}))}})}return["loader","action"].forEach(i=>{let s=t[i];if(typeof s=="function"&&n[i].length>0){let c=s[hi]??s,d=hl(n[i],c,(...h)=>kE(h[0]));d&&(i==="loader"&&c.hydrate===!0&&(d.hydrate=!0),d[hi]=c,a[i]=d)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(a.middleware=t.middleware.map(i=>{let s=i[hi]??i,c=hl(n.middleware,s,(...d)=>kE(d[0]));return c?(c[hi]=s,c):i})),a}function FL(e,t){let n={navigate:[],fetch:[]};if(t.forEach(a=>a({instrument(i){let s=Object.keys(i);for(let c of s)i[c]&&n[c].push(i[c])}})),n.navigate.length>0){let a=e.navigate[hi]??e.navigate,i=hl(n.navigate,a,(...s)=>{let[c,d]=s;return{to:typeof c=="number"||typeof c=="string"?c:c?Ua(c):".",...jE(e,d??{})}});i&&(i[hi]=a,e.navigate=i)}if(n.fetch.length>0){let a=e.fetch[hi]??e.fetch,i=hl(n.fetch,a,(...s)=>{let[c,,d,h]=s;return{href:d??".",fetcherKey:c,...jE(e,h??{})}});i&&(i[hi]=a,e.fetch=i)}return e}function hl(e,t,n){return e.length===0?null:async(...a)=>{let i=await BT(e,n(...a),()=>t(...a),e.length-1);if(i.type==="error")throw i.value;return i.value}}async function BT(e,t,n,a){let i=e[a],s;if(i){let c,d=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=BT(e,t,n,a-1),s=await c,Pt(s,"Expected a result"),s.type==="error"&&s.value instanceof Error?{status:"error",error:s.value}:{status:"success",error:void 0});try{await i(d,t)}catch(h){console.error("An instrumentation function threw an error:",h)}c||await d(),await c}else try{s={type:"success",value:await n()}}catch(c){s={type:"error",value:c}}return s||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function kE(e){let{request:t,context:n,params:a,unstable_pattern:i}=e;return{request:VL(t),params:{...a},unstable_pattern:i,context:YL(n)}}function jE(e,t){return{currentUrl:Ua(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 VL(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function YL(e){if($L(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var qL=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function $L(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")===qL}var FT=["POST","PUT","PATCH","DELETE"],KL=new Set(FT),GL=["GET",...FT],XL=new Set(GL),VT=new Set([301,302,303,307,308]),WL=new Set([307,308]),kg={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},QL={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Qc={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ZL=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),YT="remix-router-transitions",qT=Symbol("ResetLoaderData");function JL(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";Pt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.hydrationRouteProperties||[],i=e.mapRouteProperties||ZL,s=i;if(e.unstable_instrumentations){let $=e.unstable_instrumentations;s=ne=>({...i(ne),...BL($.map(le=>le.route).filter(Boolean),ne)})}let c={},d=Nu(e.routes,s,void 0,c),h,f=e.basename||"/";f.startsWith("/")||(f=`/${f}`);let g=e.dataStrategy||a_,m={...e.future},b=null,x=new Set,w=null,S=null,E=null,T=e.hydrationData!=null,C=ni(d,e.history.location,f),M=!1,O=null,D;if(C==null&&!e.patchRoutesOnNavigation){let $=na(404,{pathname:e.history.location.pathname}),{matches:ne,route:le}=Cf(d);D=!0,C=ne,O={[le.id]:$}}else if(C&&!e.hydrationData&&St(C,d,e.history.location.pathname).active&&(C=null),C)if(C.some($=>$.route.lazy))D=!1;else if(!C.some($=>Yv($.route)))D=!0;else{let $=e.hydrationData?e.hydrationData.loaderData:null,ne=e.hydrationData?e.hydrationData.errors:null;if(ne){let le=C.findIndex(Ee=>ne[Ee.route.id]!==void 0);D=C.slice(0,le+1).every(Ee=>!Py(Ee.route,$,ne))}else D=C.every(le=>!Py(le.route,$,ne))}else{D=!1,C=[];let $=St(null,d,e.history.location.pathname);$.active&&$.matches&&(M=!0,C=$.matches)}let k,A={historyAction:e.history.action,location:e.history.location,matches:C,initialized:D,navigation:kg,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||O,fetchers:new Map,blockers:new Map},j="POP",B=null,G=!1,K,I=!1,H=new Map,F=null,Y=!1,_=!1,L=new Set,z=new Map,V=0,Q=-1,P=new Map,q=new Set,X=new Map,W=new Map,ce=new Set,ie=new Map,de,ve=null;function Se(){if(b=e.history.listen(({action:$,location:ne,delta:le})=>{if(de){de(),de=void 0;return}Bn(ie.size===0||le!=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 Ee=et({currentLocation:A.location,nextLocation:ne,historyAction:$});if(Ee&&le!=null){let je=new Promise(Ze=>{de=Ze});e.history.go(le*-1),Ct(Ee,{state:"blocked",location:ne,proceed(){Ct(Ee,{state:"proceeding",proceed:void 0,reset:void 0,location:ne}),je.then(()=>e.history.go(le))},reset(){let Ze=new Map(A.blockers);Ze.set(Ee,Qc),J({blockers:Ze})}}),B==null||B.resolve(),B=null;return}return Ce($,ne)}),n){S_(t,H);let $=()=>E_(t,H);t.addEventListener("pagehide",$),F=()=>t.removeEventListener("pagehide",$)}return A.initialized||Ce("POP",A.location,{initialHydration:!0}),k}function Me(){b&&b(),F&&F(),x.clear(),K&&K.abort(),A.fetchers.forEach(($,ne)=>Ke(ne)),A.blockers.forEach(($,ne)=>ht(ne))}function ke($){return x.add($),()=>x.delete($)}function J($,ne={}){$.matches&&($.matches=$.matches.map(je=>{let Ze=c[je.route.id],Qe=je.route;return Qe.element!==Ze.element||Qe.errorElement!==Ze.errorElement||Qe.hydrateFallbackElement!==Ze.hydrateFallbackElement?{...je,route:Ze}:je})),A={...A,...$};let le=[],Ee=[];A.fetchers.forEach((je,Ze)=>{je.state==="idle"&&(ce.has(Ze)?le.push(Ze):Ee.push(Ze))}),ce.forEach(je=>{!A.fetchers.has(je)&&!z.has(je)&&le.push(je)}),[...x].forEach(je=>je(A,{deletedFetchers:le,newErrors:$.errors??null,viewTransitionOpts:ne.viewTransitionOpts,flushSync:ne.flushSync===!0})),le.forEach(je=>Ke(je)),Ee.forEach(je=>A.fetchers.delete(je))}function ue($,ne,{flushSync:le}={}){var vt,ct;let Ee=A.actionData!=null&&A.navigation.formMethod!=null&&lr(A.navigation.formMethod)&&A.navigation.state==="loading"&&((vt=$.state)==null?void 0:vt._isRedirect)!==!0,je;ne.actionData?Object.keys(ne.actionData).length>0?je=ne.actionData:je=null:Ee?je=A.actionData:je=null;let Ze=ne.loaderData?VE(A.loaderData,ne.loaderData,ne.matches||[],ne.errors):A.loaderData,Qe=A.blockers;Qe.size>0&&(Qe=new Map(Qe),Qe.forEach((At,Ut)=>Qe.set(Ut,Qc)));let Fe=Y?!1:Dt($,ne.matches||A.matches),$e=G===!0||A.navigation.formMethod!=null&&lr(A.navigation.formMethod)&&((ct=$.state)==null?void 0:ct._isRedirect)!==!0;h&&(d=h,h=void 0),Y||j==="POP"||(j==="PUSH"?e.history.push($,$.state):j==="REPLACE"&&e.history.replace($,$.state));let tt;if(j==="POP"){let At=H.get(A.location.pathname);At&&At.has($.pathname)?tt={currentLocation:A.location,nextLocation:$}:H.has($.pathname)&&(tt={currentLocation:$,nextLocation:A.location})}else if(I){let At=H.get(A.location.pathname);At?At.add($.pathname):(At=new Set([$.pathname]),H.set(A.location.pathname,At)),tt={currentLocation:A.location,nextLocation:$}}J({...ne,actionData:je,loaderData:Ze,historyAction:j,location:$,initialized:!0,navigation:kg,revalidation:"idle",restoreScrollPosition:Fe,preventScrollReset:$e,blockers:Qe},{viewTransitionOpts:tt,flushSync:le===!0}),j="POP",G=!1,I=!1,Y=!1,_=!1,B==null||B.resolve(),B=null,ve==null||ve.resolve(),ve=null}async function pe($,ne){if(B==null||B.resolve(),B=null,typeof $=="number"){B||(B=KE());let Ut=B.promise;return e.history.go($),Ut}let le=zy(A.location,A.matches,f,$,ne==null?void 0:ne.fromRouteId,ne==null?void 0:ne.relative),{path:Ee,submission:je,error:Ze}=LE(!1,le,ne),Qe=A.location,Fe=Mu(A.location,Ee,ne&&ne.state);Fe={...Fe,...e.history.encodeLocation(Fe)};let $e=ne&&ne.replace!=null?ne.replace:void 0,tt="PUSH";$e===!0?tt="REPLACE":$e===!1||je!=null&&lr(je.formMethod)&&je.formAction===A.location.pathname+A.location.search&&(tt="REPLACE");let vt=ne&&"preventScrollReset"in ne?ne.preventScrollReset===!0:void 0,ct=(ne&&ne.flushSync)===!0,At=et({currentLocation:Qe,nextLocation:Fe,historyAction:tt});if(At){Ct(At,{state:"blocked",location:Fe,proceed(){Ct(At,{state:"proceeding",proceed:void 0,reset:void 0,location:Fe}),pe($,ne)},reset(){let Ut=new Map(A.blockers);Ut.set(At,Qc),J({blockers:Ut})}});return}await Ce(tt,Fe,{submission:je,pendingError:Ze,preventScrollReset:vt,replace:ne&&ne.replace,enableViewTransition:ne&&ne.viewTransition,flushSync:ct,callSiteDefaultShouldRevalidate:ne&&ne.unstable_defaultShouldRevalidate})}function De(){ve||(ve=KE()),xt(),J({revalidation:"loading"});let $=ve.promise;return A.navigation.state==="submitting"?$:A.navigation.state==="idle"?(Ce(A.historyAction,A.location,{startUninterruptedRevalidation:!0}),$):(Ce(j||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation,enableViewTransition:I===!0}),$)}async function Ce($,ne,le){K&&K.abort(),K=null,j=$,Y=(le&&le.startUninterruptedRevalidation)===!0,Et(A.location,A.matches),G=(le&&le.preventScrollReset)===!0,I=(le&&le.enableViewTransition)===!0;let Ee=h||d,je=le&&le.overrideNavigation,Ze=le!=null&&le.initialHydration&&A.matches&&A.matches.length>0&&!M?A.matches:ni(Ee,ne,f),Qe=(le&&le.flushSync)===!0;if(Ze&&A.initialized&&!_&&f_(A.location,ne)&&!(le&&le.submission&&lr(le.submission.formMethod))){ue(ne,{matches:Ze},{flushSync:Qe});return}let Fe=St(Ze,Ee,ne.pathname);if(Fe.active&&Fe.matches&&(Ze=Fe.matches),!Ze){let{error:Tn,notFoundMatches:Cn,route:$t}=lt(ne.pathname);ue(ne,{matches:Cn,loaderData:{},errors:{[$t.id]:Tn}},{flushSync:Qe});return}K=new AbortController;let $e=dl(e.history,ne,K.signal,le&&le.submission),tt=e.getContext?await e.getContext():new ME,vt;if(le&&le.pendingError)vt=[ri(Ze).route.id,{type:"error",error:le.pendingError}];else if(le&&le.submission&&lr(le.submission.formMethod)){let Tn=await we($e,ne,le.submission,Ze,tt,Fe.active,le&&le.initialHydration===!0,{replace:le.replace,flushSync:Qe});if(Tn.shortCircuited)return;if(Tn.pendingActionResult){let[Cn,$t]=Tn.pendingActionResult;if(Pr($t)&&Au($t.error)&&$t.error.status===404){K=null,ue(ne,{matches:Tn.matches,loaderData:{},errors:{[Cn]:$t.error}});return}}Ze=Tn.matches||Ze,vt=Tn.pendingActionResult,je=jg(ne,le.submission),Qe=!1,Fe.active=!1,$e=dl(e.history,$e.url,$e.signal)}let{shortCircuited:ct,matches:At,loaderData:Ut,errors:wn}=await Te($e,ne,Ze,tt,Fe.active,je,le&&le.submission,le&&le.fetcherSubmission,le&&le.replace,le&&le.initialHydration===!0,Qe,vt,le&&le.callSiteDefaultShouldRevalidate);ct||(K=null,ue(ne,{matches:At||Ze,...YE(vt),loaderData:Ut,errors:wn}))}async function we($,ne,le,Ee,je,Ze,Qe,Fe={}){xt();let $e=x_(ne,le);if(J({navigation:$e},{flushSync:Fe.flushSync===!0}),Ze){let ct=await rn(Ee,ne.pathname,$.signal);if(ct.type==="aborted")return{shortCircuited:!0};if(ct.type==="error"){if(ct.partialMatches.length===0){let{matches:Ut,route:wn}=Cf(d);return{matches:Ut,pendingActionResult:[wn.id,{type:"error",error:ct.error}]}}let At=ri(ct.partialMatches).route.id;return{matches:ct.partialMatches,pendingActionResult:[At,{type:"error",error:ct.error}]}}else if(ct.matches)Ee=ct.matches;else{let{notFoundMatches:At,error:Ut,route:wn}=lt(ne.pathname);return{matches:At,pendingActionResult:[wn.id,{type:"error",error:Ut}]}}}let tt,vt=eh(Ee,ne);if(!vt.route.action&&!vt.route.lazy)tt={type:"error",error:na(405,{method:$.method,pathname:ne.pathname,routeId:vt.route.id})};else{let ct=pl(s,c,$,Ee,vt,Qe?[]:a,je),At=await it($,ct,je,null);if(tt=At[vt.route.id],!tt){for(let Ut of Ee)if(At[Ut.route.id]){tt=At[Ut.route.id];break}}if($.signal.aborted)return{shortCircuited:!0}}if(ns(tt)){let ct;return Fe&&Fe.replace!=null?ct=Fe.replace:ct=HE(tt.response.headers.get("Location"),new URL($.url),f,e.history)===A.location.pathname+A.location.search,await Ae($,tt,!0,{submission:le,replace:ct}),{shortCircuited:!0}}if(Pr(tt)){let ct=ri(Ee,vt.route.id);return(Fe&&Fe.replace)!==!0&&(j="PUSH"),{matches:Ee,pendingActionResult:[ct.route.id,tt,vt.route.id]}}return{matches:Ee,pendingActionResult:[vt.route.id,tt]}}async function Te($,ne,le,Ee,je,Ze,Qe,Fe,$e,tt,vt,ct,At){let Ut=Ze||jg(ne,Qe),wn=Qe||Fe||$E(Ut),Tn=!Y&&!tt;if(je){if(Tn){let jn=Z(ct);J({navigation:Ut,...jn!==void 0?{actionData:jn}:{}},{flushSync:vt})}let Kt=await rn(le,ne.pathname,$.signal);if(Kt.type==="aborted")return{shortCircuited:!0};if(Kt.type==="error"){if(Kt.partialMatches.length===0){let{matches:fa,route:Jn}=Cf(d);return{matches:fa,loaderData:{},errors:{[Jn.id]:Kt.error}}}let jn=ri(Kt.partialMatches).route.id;return{matches:Kt.partialMatches,loaderData:{},errors:{[jn]:Kt.error}}}else if(Kt.matches)le=Kt.matches;else{let{error:jn,notFoundMatches:fa,route:Jn}=lt(ne.pathname);return{matches:fa,loaderData:{},errors:{[Jn.id]:jn}}}}let Cn=h||d,{dsMatches:$t,revalidatingFetchers:Gn}=_E($,Ee,s,c,e.history,A,le,wn,ne,tt?[]:a,tt===!0,_,L,ce,X,q,Cn,f,e.patchRoutesOnNavigation!=null,ct,At);if(Q=++V,!e.dataStrategy&&!$t.some(Kt=>Kt.shouldLoad)&&!$t.some(Kt=>Kt.route.middleware&&Kt.route.middleware.length>0)&&Gn.length===0){let Kt=ft();return ue(ne,{matches:le,loaderData:{},errors:ct&&Pr(ct[1])?{[ct[0]]:ct[1].error}:null,...YE(ct),...Kt?{fetchers:new Map(A.fetchers)}:{}},{flushSync:vt}),{shortCircuited:!0}}if(Tn){let Kt={};if(!je){Kt.navigation=Ut;let jn=Z(ct);jn!==void 0&&(Kt.actionData=jn)}Gn.length>0&&(Kt.fetchers=be(Gn)),J(Kt,{flushSync:vt})}Gn.forEach(Kt=>{ze(Kt.key),Kt.controller&&z.set(Kt.key,Kt.controller)});let yr=()=>Gn.forEach(Kt=>ze(Kt.key));K&&K.signal.addEventListener("abort",yr);let{loaderResults:bn,fetcherResults:ua}=await wt($t,Gn,$,Ee);if($.signal.aborted)return{shortCircuited:!0};K&&K.signal.removeEventListener("abort",yr),Gn.forEach(Kt=>z.delete(Kt.key));let Ar=Of(bn);if(Ar)return await Ae($,Ar.result,!0,{replace:$e}),{shortCircuited:!0};if(Ar=Of(ua),Ar)return q.add(Ar.key),await Ae($,Ar.result,!0,{replace:$e}),{shortCircuited:!0};let{loaderData:da,errors:qr}=FE(A,le,bn,ct,Gn,ua);tt&&A.errors&&(qr={...A.errors,...qr});let Ka=ft(),Ai=jt(Q),Di=Ka||Ai||Gn.length>0;return{matches:le,loaderData:da,errors:qr,...Di?{fetchers:new Map(A.fetchers)}:{}}}function Z($){if($&&!Pr($[1]))return{[$[0]]:$[1].data};if(A.actionData)return Object.keys(A.actionData).length===0?null:A.actionData}function be($){return $.forEach(ne=>{let le=A.fetchers.get(ne.key),Ee=Zc(void 0,le?le.data:void 0);A.fetchers.set(ne.key,Ee)}),new Map(A.fetchers)}async function ge($,ne,le,Ee){ze($);let je=(Ee&&Ee.flushSync)===!0,Ze=h||d,Qe=zy(A.location,A.matches,f,le,ne,Ee==null?void 0:Ee.relative),Fe=ni(Ze,Qe,f),$e=St(Fe,Ze,Qe);if($e.active&&$e.matches&&(Fe=$e.matches),!Fe){xe($,ne,na(404,{pathname:Qe}),{flushSync:je});return}let{path:tt,submission:vt,error:ct}=LE(!0,Qe,Ee);if(ct){xe($,ne,ct,{flushSync:je});return}let At=e.getContext?await e.getContext():new ME,Ut=(Ee&&Ee.preventScrollReset)===!0;if(vt&&lr(vt.formMethod)){await Pe($,ne,tt,Fe,At,$e.active,je,Ut,vt,Ee&&Ee.unstable_defaultShouldRevalidate);return}X.set($,{routeId:ne,path:tt}),await Be($,ne,tt,Fe,At,$e.active,je,Ut,vt)}async function Pe($,ne,le,Ee,je,Ze,Qe,Fe,$e,tt){xt(),X.delete($);let vt=A.fetchers.get($);oe($,w_($e,vt),{flushSync:Qe});let ct=new AbortController,At=dl(e.history,le,ct.signal,$e);if(Ze){let Gt=await rn(Ee,new URL(At.url).pathname,At.signal,$);if(Gt.type==="aborted")return;if(Gt.type==="error"){xe($,ne,Gt.error,{flushSync:Qe});return}else if(Gt.matches)Ee=Gt.matches;else{xe($,ne,na(404,{pathname:le}),{flushSync:Qe});return}}let Ut=eh(Ee,le);if(!Ut.route.action&&!Ut.route.lazy){let Gt=na(405,{method:$e.formMethod,pathname:le,routeId:ne});xe($,ne,Gt,{flushSync:Qe});return}z.set($,ct);let wn=V,Tn=pl(s,c,At,Ee,Ut,a,je),Cn=await it(At,Tn,je,$),$t=Cn[Ut.route.id];if(!$t){for(let Gt of Tn)if(Cn[Gt.route.id]){$t=Cn[Gt.route.id];break}}if(At.signal.aborted){z.get($)===ct&&z.delete($);return}if(ce.has($)){if(ns($t)||Pr($t)){oe($,mo(void 0));return}}else{if(ns($t))if(z.delete($),Q>wn){oe($,mo(void 0));return}else return q.add($),oe($,Zc($e)),Ae(At,$t,!1,{fetcherSubmission:$e,preventScrollReset:Fe});if(Pr($t)){xe($,ne,$t.error);return}}let Gn=A.navigation.location||A.location,yr=dl(e.history,Gn,ct.signal),bn=h||d,ua=A.navigation.state!=="idle"?ni(bn,A.navigation.location,f):A.matches;Pt(ua,"Didn't find any matches after fetcher action");let Ar=++V;P.set($,Ar);let da=Zc($e,$t.data);A.fetchers.set($,da);let{dsMatches:qr,revalidatingFetchers:Ka}=_E(yr,je,s,c,e.history,A,ua,$e,Gn,a,!1,_,L,ce,X,q,bn,f,e.patchRoutesOnNavigation!=null,[Ut.route.id,$t],tt);Ka.filter(Gt=>Gt.key!==$).forEach(Gt=>{let ki=Gt.key,fd=A.fetchers.get(ki),sc=Zc(void 0,fd?fd.data:void 0);A.fetchers.set(ki,sc),ze(ki),Gt.controller&&z.set(ki,Gt.controller)}),J({fetchers:new Map(A.fetchers)});let Ai=()=>Ka.forEach(Gt=>ze(Gt.key));ct.signal.addEventListener("abort",Ai);let{loaderResults:Di,fetcherResults:Kt}=await wt(qr,Ka,yr,je);if(ct.signal.aborted)return;if(ct.signal.removeEventListener("abort",Ai),P.delete($),z.delete($),Ka.forEach(Gt=>z.delete(Gt.key)),A.fetchers.has($)){let Gt=mo($t.data);A.fetchers.set($,Gt)}let jn=Of(Di);if(jn)return Ae(yr,jn.result,!1,{preventScrollReset:Fe});if(jn=Of(Kt),jn)return q.add(jn.key),Ae(yr,jn.result,!1,{preventScrollReset:Fe});let{loaderData:fa,errors:Jn}=FE(A,ua,Di,void 0,Ka,Kt);jt(Ar),A.navigation.state==="loading"&&Ar>Q?(Pt(j,"Expected pending action"),K&&K.abort(),ue(A.navigation.location,{matches:ua,loaderData:fa,errors:Jn,fetchers:new Map(A.fetchers)})):(J({errors:Jn,loaderData:VE(A.loaderData,fa,ua,Jn),fetchers:new Map(A.fetchers)}),_=!1)}async function Be($,ne,le,Ee,je,Ze,Qe,Fe,$e){let tt=A.fetchers.get($);oe($,Zc($e,tt?tt.data:void 0),{flushSync:Qe});let vt=new AbortController,ct=dl(e.history,le,vt.signal);if(Ze){let $t=await rn(Ee,new URL(ct.url).pathname,ct.signal,$);if($t.type==="aborted")return;if($t.type==="error"){xe($,ne,$t.error,{flushSync:Qe});return}else if($t.matches)Ee=$t.matches;else{xe($,ne,na(404,{pathname:le}),{flushSync:Qe});return}}let At=eh(Ee,le);z.set($,vt);let Ut=V,wn=pl(s,c,ct,Ee,At,a,je),Cn=(await it(ct,wn,je,$))[At.route.id];if(z.get($)===vt&&z.delete($),!ct.signal.aborted){if(ce.has($)){oe($,mo(void 0));return}if(ns(Cn))if(Q>Ut){oe($,mo(void 0));return}else{q.add($),await Ae(ct,Cn,!1,{preventScrollReset:Fe});return}if(Pr(Cn)){xe($,ne,Cn.error);return}oe($,mo(Cn.data))}}async function Ae($,ne,le,{submission:Ee,fetcherSubmission:je,preventScrollReset:Ze,replace:Qe}={}){le||(B==null||B.resolve(),B=null),ne.response.headers.has("X-Remix-Revalidate")&&(_=!0);let Fe=ne.response.headers.get("Location");Pt(Fe,"Expected a Location header on the redirect Response"),Fe=HE(Fe,new URL($.url),f,e.history);let $e=Mu(A.location,Fe,{_isRedirect:!0});if(n){let wn=!1;if(ne.response.headers.has("X-Remix-Reload-Document"))wn=!0;else if(Bv(Fe)){const Tn=jT(Fe,!0);wn=Tn.origin!==t.location.origin||sa(Tn.pathname,f)==null}if(wn){Qe?t.location.replace(Fe):t.location.assign(Fe);return}}K=null;let tt=Qe===!0||ne.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:vt,formAction:ct,formEncType:At}=A.navigation;!Ee&&!je&&vt&&ct&&At&&(Ee=$E(A.navigation));let Ut=Ee||je;if(WL.has(ne.response.status)&&Ut&&lr(Ut.formMethod))await Ce(tt,$e,{submission:{...Ut,formAction:Fe},preventScrollReset:Ze||G,enableViewTransition:le?I:void 0});else{let wn=jg($e,Ee);await Ce(tt,$e,{overrideNavigation:wn,fetcherSubmission:je,preventScrollReset:Ze||G,enableViewTransition:le?I:void 0})}}async function it($,ne,le,Ee){var Qe;let je,Ze={};try{je=await i_(g,$,ne,Ee,le,!1)}catch(Fe){return ne.filter($e=>$e.shouldLoad).forEach($e=>{Ze[$e.route.id]={type:"error",error:Fe}}),Ze}if($.signal.aborted)return Ze;if(!lr($.method))for(let Fe of ne){if(((Qe=je[Fe.route.id])==null?void 0:Qe.type)==="error")break;!je.hasOwnProperty(Fe.route.id)&&!A.loaderData.hasOwnProperty(Fe.route.id)&&(!A.errors||!A.errors.hasOwnProperty(Fe.route.id))&&Fe.shouldCallHandler()&&(je[Fe.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Fe.route.id}`)})}for(let[Fe,$e]of Object.entries(je))if(g_($e)){let tt=$e.result;Ze[Fe]={type:"redirect",response:u_(tt,$,Fe,ne,f)}}else Ze[Fe]=await c_($e);return Ze}async function wt($,ne,le,Ee){let je=it(le,$,Ee,null),Ze=Promise.all(ne.map(async $e=>{if($e.matches&&$e.match&&$e.request&&$e.controller){let vt=(await it($e.request,$e.matches,Ee,$e.key))[$e.match.route.id];return{[$e.key]:vt}}else return Promise.resolve({[$e.key]:{type:"error",error:na(404,{pathname:$e.path})}})})),Qe=await je,Fe=(await Ze).reduce(($e,tt)=>Object.assign($e,tt),{});return{loaderResults:Qe,fetcherResults:Fe}}function xt(){_=!0,X.forEach(($,ne)=>{z.has(ne)&&L.add(ne),ze(ne)})}function oe($,ne,le={}){A.fetchers.set($,ne),J({fetchers:new Map(A.fetchers)},{flushSync:(le&&le.flushSync)===!0})}function xe($,ne,le,Ee={}){let je=ri(A.matches,ne);Ke($),J({errors:{[je.route.id]:le},fetchers:new Map(A.fetchers)},{flushSync:(Ee&&Ee.flushSync)===!0})}function Ie($){return W.set($,(W.get($)||0)+1),ce.has($)&&ce.delete($),A.fetchers.get($)||QL}function qe($,ne){ze($,ne==null?void 0:ne.reason),oe($,mo(null))}function Ke($){let ne=A.fetchers.get($);z.has($)&&!(ne&&ne.state==="loading"&&P.has($))&&ze($),X.delete($),P.delete($),q.delete($),ce.delete($),L.delete($),A.fetchers.delete($)}function st($){let ne=(W.get($)||0)-1;ne<=0?(W.delete($),ce.add($)):W.set($,ne),J({fetchers:new Map(A.fetchers)})}function ze($,ne){let le=z.get($);le&&(le.abort(ne),z.delete($))}function Je($){for(let ne of $){let le=Ie(ne),Ee=mo(le.data);A.fetchers.set(ne,Ee)}}function ft(){let $=[],ne=!1;for(let le of q){let Ee=A.fetchers.get(le);Pt(Ee,`Expected fetcher: ${le}`),Ee.state==="loading"&&(q.delete(le),$.push(le),ne=!0)}return Je($),ne}function jt($){let ne=[];for(let[le,Ee]of P)if(Ee<$){let je=A.fetchers.get(le);Pt(je,`Expected fetcher: ${le}`),je.state==="loading"&&(ze(le),P.delete(le),ne.push(le))}return Je(ne),ne.length>0}function nn($,ne){let le=A.blockers.get($)||Qc;return ie.get($)!==ne&&ie.set($,ne),le}function ht($){A.blockers.delete($),ie.delete($)}function Ct($,ne){let le=A.blockers.get($)||Qc;Pt(le.state==="unblocked"&&ne.state==="blocked"||le.state==="blocked"&&ne.state==="blocked"||le.state==="blocked"&&ne.state==="proceeding"||le.state==="blocked"&&ne.state==="unblocked"||le.state==="proceeding"&&ne.state==="unblocked",`Invalid blocker state transition: ${le.state} -> ${ne.state}`);let Ee=new Map(A.blockers);Ee.set($,ne),J({blockers:Ee})}function et({currentLocation:$,nextLocation:ne,historyAction:le}){if(ie.size===0)return;ie.size>1&&Bn(!1,"A router only supports one blocker at a time");let Ee=Array.from(ie.entries()),[je,Ze]=Ee[Ee.length-1],Qe=A.blockers.get(je);if(!(Qe&&Qe.state==="proceeding")&&Ze({currentLocation:$,nextLocation:ne,historyAction:le}))return je}function lt($){let ne=na(404,{pathname:$}),le=h||d,{matches:Ee,route:je}=Cf(le);return{notFoundMatches:Ee,route:je,error:ne}}function mt($,ne,le){if(w=$,E=ne,S=le||null,!T&&A.navigation===kg){T=!0;let Ee=Dt(A.location,A.matches);Ee!=null&&J({restoreScrollPosition:Ee})}return()=>{w=null,E=null,S=null}}function Ve($,ne){return S&&S($,ne.map(Ee=>RL(Ee,A.loaderData)))||$.key}function Et($,ne){if(w&&E){let le=Ve($,ne);w[le]=E()}}function Dt($,ne){if(w){let le=Ve($,ne),Ee=w[le];if(typeof Ee=="number")return Ee}return null}function St($,ne,le){if(e.patchRoutesOnNavigation)if($){if(Object.keys($[0].params).length>0)return{active:!0,matches:cu(ne,le,f,!0)}}else return{active:!0,matches:cu(ne,le,f,!0)||[]};return{active:!1,matches:null}}async function rn($,ne,le,Ee){if(!e.patchRoutesOnNavigation)return{type:"success",matches:$};let je=$;for(;;){let Ze=h==null,Qe=h||d,Fe=c;try{await e.patchRoutesOnNavigation({signal:le,path:ne,matches:je,fetcherKey:Ee,patch:(vt,ct)=>{le.aborted||IE(vt,ct,Qe,Fe,s,!1)}})}catch(vt){return{type:"error",error:vt,partialMatches:je}}finally{Ze&&!le.aborted&&(d=[...d])}if(le.aborted)return{type:"aborted"};let $e=ni(Qe,ne,f),tt=null;if($e){if(Object.keys($e[0].params).length===0)return{type:"success",matches:$e};if(tt=cu(Qe,ne,f,!0),!(tt&&je.length<tt.length&&It(je,tt.slice(0,je.length))))return{type:"success",matches:$e}}if(tt||(tt=cu(Qe,ne,f,!0)),!tt||It(je,tt))return{type:"success",matches:null};je=tt}}function It($,ne){return $.length===ne.length&&$.every((le,Ee)=>le.route.id===ne[Ee].route.id)}function Xe($){c={},h=Nu($,s,void 0,c)}function Rt($,ne,le=!1){let Ee=h==null;IE($,ne,h||d,c,s,le),Ee&&(d=[...d],J({}))}return k={get basename(){return f},get future(){return m},get state(){return A},get routes(){return d},get window(){return t},initialize:Se,subscribe:ke,enableScrollRestoration:mt,navigate:pe,fetch:ge,revalidate:De,createHref:$=>e.history.createHref($),encodeLocation:$=>e.history.encodeLocation($),getFetcher:Ie,resetFetcher:qe,deleteFetcher:st,dispose:Me,getBlocker:nn,deleteBlocker:ht,patchRoutes:Rt,_internalFetchControllers:z,_internalSetRoutes:Xe,_internalSetStateDoNotUseOrYouWillBreakYourApp($){J($)}},e.unstable_instrumentations&&(k=FL(k,e.unstable_instrumentations.map($=>$.router).filter(Boolean))),k}function e_(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function zy(e,t,n,a,i,s){let c,d;if(i){c=[];for(let f of t)if(c.push(f),f.route.id===i){d=f;break}}else c=t,d=t[t.length-1];let h=Vv(a||".",Fv(c),sa(e.pathname,n)||e.pathname,s==="path");if(a==null&&(h.search=e.search,h.hash=e.hash),(a==null||a===""||a===".")&&d){let f=$v(h.search);if(d.route.index&&!f)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&f){let g=new URLSearchParams(h.search),m=g.getAll("index");g.delete("index"),m.filter(x=>x).forEach(x=>g.append("index",x));let b=g.toString();h.search=b?`?${b}`:""}}return n!=="/"&&(h.pathname=IL({basename:n,pathname:h.pathname})),Ua(h)}function LE(e,t,n){if(!n||!e_(n))return{path:t};if(n.formMethod&&!b_(n.formMethod))return{path:t,error:na(405,{method:n.formMethod})};let a=()=>({path:t,error:na(400,{type:"invalid-body"})}),s=(n.formMethod||"get").toUpperCase(),c=QT(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!lr(s))return a();let m=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((b,[x,w])=>`${b}${x}=${w}
|
|
60
|
-
`,""):String(n.body);return{path:t,submission:{formMethod:s,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:m}}}else if(n.formEncType==="application/json"){if(!lr(s))return a();try{let m=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:s,formAction:c,formEncType:n.formEncType,formData:void 0,json:m,text:void 0}}}catch{return a()}}}Pt(typeof FormData=="function","FormData is not available in this environment");let d,h;if(n.formData)d=Hy(n.formData),h=n.formData;else if(n.body instanceof FormData)d=Hy(n.body),h=n.body;else if(n.body instanceof URLSearchParams)d=n.body,h=BE(d);else if(n.body==null)d=new URLSearchParams,h=new FormData;else try{d=new URLSearchParams(n.body),h=BE(d)}catch{return a()}let f={formMethod:s,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:h,json:void 0,text:void 0};if(lr(f.formMethod))return{path:t,submission:f};let g=Ei(t);return e&&g.search&&$v(g.search)&&d.append("index",""),g.search=`?${d}`,{path:Ua(g),submission:f}}function _E(e,t,n,a,i,s,c,d,h,f,g,m,b,x,w,S,E,T,C,M,O){var Y;let D=M?Pr(M[1])?M[1].error:M[1].data:void 0,k=i.createURL(s.location),A=i.createURL(h),j;if(g&&s.errors){let _=Object.keys(s.errors)[0];j=c.findIndex(L=>L.route.id===_)}else if(M&&Pr(M[1])){let _=M[0];j=c.findIndex(L=>L.route.id===_)-1}let B=M?M[1].statusCode:void 0,G=B&&B>=400,K={currentUrl:k,currentParams:((Y=s.matches[0])==null?void 0:Y.params)||{},nextUrl:A,nextParams:c[0].params,...d,actionResult:D,actionStatus:B},I=Xu(c),H=c.map((_,L)=>{let{route:z}=_,V=null;if(j!=null&&L>j?V=!1:z.lazy?V=!0:Yv(z)?g?V=Py(z,s.loaderData,s.errors):t_(s.loaderData,s.matches[L],_)&&(V=!0):V=!1,V!==null)return Uy(n,a,e,I,_,f,t,V);let Q=!1;typeof O=="boolean"?Q=O:G?Q=!1:(m||k.pathname+k.search===A.pathname+A.search||k.search!==A.search||n_(s.matches[L],_))&&(Q=!0);let P={...K,defaultShouldRevalidate:Q},q=hu(_,P);return Uy(n,a,e,I,_,f,t,q,P,O)}),F=[];return w.forEach((_,L)=>{if(g||!c.some(ce=>ce.route.id===_.routeId)||x.has(L))return;let z=s.fetchers.get(L),V=z&&z.state!=="idle"&&z.data===void 0,Q=ni(E,_.path,T);if(!Q){if(C&&V)return;F.push({key:L,routeId:_.routeId,path:_.path,matches:null,match:null,request:null,controller:null});return}if(S.has(L))return;let P=eh(Q,_.path),q=new AbortController,X=dl(i,_.path,q.signal),W=null;if(b.has(L))b.delete(L),W=pl(n,a,X,Q,P,f,t);else if(V)m&&(W=pl(n,a,X,Q,P,f,t));else{let ce;typeof O=="boolean"?ce=O:G?ce=!1:ce=m;let ie={...K,defaultShouldRevalidate:ce};hu(P,ie)&&(W=pl(n,a,X,Q,P,f,t,ie))}W&&F.push({key:L,routeId:_.routeId,path:_.path,matches:W,match:P,request:X,controller:q})}),{dsMatches:H,revalidatingFetchers:F}}function Yv(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Py(e,t,n){if(e.lazy)return!0;if(!Yv(e))return!1;let a=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;return!a&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!a&&!i}function t_(e,t,n){let a=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return a||i}function n_(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function hu(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function IE(e,t,n,a,i,s){let c;if(e){let f=a[e];Pt(f,`No route found to patch children into: routeId = ${e}`),f.children||(f.children=[]),c=f.children}else c=n;let d=[],h=[];if(t.forEach(f=>{let g=c.find(m=>$T(f,m));g?h.push({existingRoute:g,newRoute:f}):d.push(f)}),d.length>0){let f=Nu(d,i,[e||"_","patch",String((c==null?void 0:c.length)||"0")],a);c.push(...f)}if(s&&h.length>0)for(let f=0;f<h.length;f++){let{existingRoute:g,newRoute:m}=h[f],b=g,[x]=Nu([m],i,[],{},!0);Object.assign(b,{element:x.element?x.element:b.element,errorElement:x.errorElement?x.errorElement:b.errorElement,hydrateFallbackElement:x.hydrateFallbackElement?x.hydrateFallbackElement:b.hydrateFallbackElement})}}function $T(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,a)=>{var i;return(i=t.children)==null?void 0:i.some(s=>$T(n,s))}):!1}var zE=new WeakMap,KT=({key:e,route:t,manifest:n,mapRouteProperties:a})=>{let i=n[t.id];if(Pt(i,"No route found in manifest"),!i.lazy||typeof i.lazy!="object")return;let s=i.lazy[e];if(!s)return;let c=zE.get(i);c||(c={},zE.set(i,c));let d=c[e];if(d)return d;let h=(async()=>{let f=xL(e),m=i[e]!==void 0&&e!=="hasErrorBoundary";if(f)Bn(!f,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(m)Bn(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let b=await s();b!=null&&(Object.assign(i,{[e]:b}),Object.assign(i,a(i)))}typeof i.lazy=="object"&&(i.lazy[e]=void 0,Object.values(i.lazy).every(b=>b===void 0)&&(i.lazy=void 0))})();return c[e]=h,h},PE=new WeakMap;function r_(e,t,n,a,i){let s=n[e.id];if(Pt(s,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let g=PE.get(s);if(g)return{lazyRoutePromise:g,lazyHandlerPromise:g};let m=(async()=>{Pt(typeof e.lazy=="function","No lazy route function found");let b=await e.lazy(),x={};for(let w in b){let S=b[w];if(S===void 0)continue;let E=SL(w),C=s[w]!==void 0&&w!=="hasErrorBoundary";E?Bn(!E,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):C?Bn(!C,`Route "${s.id}" has a static property "${w}" defined but its lazy function is also returning a value for this property. The lazy route property "${w}" will be ignored.`):x[w]=S}Object.assign(s,x),Object.assign(s,{...a(s),lazy:void 0})})();return PE.set(s,m),m.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:m}}let c=Object.keys(e.lazy),d=[],h;for(let g of c){if(i&&i.includes(g))continue;let m=KT({key:g,route:e,manifest:n,mapRouteProperties:a});m&&(d.push(m),g===t&&(h=m))}let f=d.length>0?Promise.all(d).then(()=>{}):void 0;return f==null||f.catch(()=>{}),h==null||h.catch(()=>{}),{lazyRoutePromise:f,lazyHandlerPromise:h}}async function UE(e){let t=e.matches.filter(i=>i.shouldLoad),n={};return(await Promise.all(t.map(i=>i.resolve()))).forEach((i,s)=>{n[t[s].route.id]=i}),n}async function a_(e){return e.matches.some(t=>t.route.middleware)?GT(e,()=>UE(e)):UE(e)}function GT(e,t){return o_(e,t,a=>{if(v_(a))throw a;return a},m_,n);function n(a,i,s){if(s)return Promise.resolve(Object.assign(s.value,{[i]:{type:"error",result:a}}));{let{matches:c}=e,d=Math.min(Math.max(c.findIndex(f=>f.route.id===i),0),Math.max(c.findIndex(f=>f.shouldCallHandler()),0)),h=ri(c,c[d].route.id).route.id;return Promise.resolve({[h]:{type:"error",result:a}})}}}async function o_(e,t,n,a,i){let{matches:s,request:c,params:d,context:h,unstable_pattern:f}=e,g=s.flatMap(b=>b.route.middleware?b.route.middleware.map(x=>[b.route.id,x]):[]);return await XT({request:c,params:d,context:h,unstable_pattern:f},g,t,n,a,i)}async function XT(e,t,n,a,i,s,c=0){let{request:d}=e;if(d.signal.aborted)throw d.signal.reason??new Error(`Request aborted: ${d.method} ${d.url}`);let h=t[c];if(!h)return await n();let[f,g]=h,m,b=async()=>{if(m)throw new Error("You may only call `next()` once per middleware");try{return m={value:await XT(e,t,n,a,i,s,c+1)},m.value}catch(x){return m={value:await s(x,f,m)},m.value}};try{let x=await g(e,b),w=x!=null?a(x):void 0;return i(w)?w:m?w??m.value:(m={value:await b()},m.value)}catch(x){return await s(x,f,m)}}function WT(e,t,n,a,i){let s=KT({key:"middleware",route:a.route,manifest:t,mapRouteProperties:e}),c=r_(a.route,lr(n.method)?"action":"loader",t,e,i);return{middleware:s,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function Uy(e,t,n,a,i,s,c,d,h=null,f){let g=!1,m=WT(e,t,n,i,s);return{...i,_lazyPromises:m,shouldLoad:d,shouldRevalidateArgs:h,shouldCallHandler(b){return g=!0,h?typeof f=="boolean"?hu(i,{...h,defaultShouldRevalidate:f}):typeof b=="boolean"?hu(i,{...h,defaultShouldRevalidate:b}):hu(i,h):d},resolve(b){let{lazy:x,loader:w,middleware:S}=i.route,E=g||d||b&&!lr(n.method)&&(x||w),T=S&&S.length>0&&!w&&!x;return E&&(lr(n.method)||!T)?s_({request:n,unstable_pattern:a,match:i,lazyHandlerPromise:m==null?void 0:m.handler,lazyRoutePromise:m==null?void 0:m.route,handlerOverride:b,scopedContext:c}):Promise.resolve({type:"data",result:void 0})}}}function pl(e,t,n,a,i,s,c,d=null){return a.map(h=>h.route.id!==i.route.id?{...h,shouldLoad:!1,shouldRevalidateArgs:d,shouldCallHandler:()=>!1,_lazyPromises:WT(e,t,n,h,s),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Uy(e,t,n,Xu(a),h,s,c,!0,d))}async function i_(e,t,n,a,i,s){n.some(f=>{var g;return(g=f._lazyPromises)==null?void 0:g.middleware})&&await Promise.all(n.map(f=>{var g;return(g=f._lazyPromises)==null?void 0:g.middleware}));let c={request:t,unstable_pattern:Xu(n),params:n[0].params,context:i,matches:n},h=await e({...c,fetcherKey:a,runClientMiddleware:f=>{let g=c;return GT(g,()=>f({...g,fetcherKey:a,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(f=>{var g,m;return[(g=f._lazyPromises)==null?void 0:g.handler,(m=f._lazyPromises)==null?void 0:m.route]}))}catch{}return h}async function s_({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:a,lazyRoutePromise:i,handlerOverride:s,scopedContext:c}){let d,h,f=lr(e.method),g=f?"action":"loader",m=b=>{let x,w=new Promise((T,C)=>x=C);h=()=>x(),e.signal.addEventListener("abort",h);let S=T=>typeof b!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${g}" [routeId: ${n.route.id}]`)):b({request:e,unstable_pattern:t,params:n.params,context:c},...T!==void 0?[T]:[]),E=(async()=>{try{return{type:"data",result:await(s?s(C=>S(C)):S())}}catch(T){return{type:"error",result:T}}})();return Promise.race([E,w])};try{let b=f?n.route.action:n.route.loader;if(a||i)if(b){let x,[w]=await Promise.all([m(b).catch(S=>{x=S}),a,i]);if(x!==void 0)throw x;d=w}else{await a;let x=f?n.route.action:n.route.loader;if(x)[d]=await Promise.all([m(x),i]);else if(g==="action"){let w=new URL(e.url),S=w.pathname+w.search;throw na(405,{method:e.method,pathname:S,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(b)d=await m(b);else{let x=new URL(e.url),w=x.pathname+x.search;throw na(404,{pathname:w})}}catch(b){return{type:"error",result:b}}finally{h&&e.signal.removeEventListener("abort",h)}return d}async function l_(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 c_(e){var a,i,s,c,d;let{result:t,type:n}=e;if(qv(t)){let h;try{h=await l_(t)}catch(f){return{type:"error",error:f}}return n==="error"?{type:"error",error:new Gu(t.status,t.statusText,h),statusCode:t.status,headers:t.headers}:{type:"data",data:h,statusCode:t.status,headers:t.headers}}return n==="error"?qE(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(a=t.init)==null?void 0:a.status,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}:{type:"error",error:h_(t),statusCode:Au(t)?t.status:void 0,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Au(t)?t.status:void 0}:qE(t)?{type:"data",data:t.data,statusCode:(c=t.init)==null?void 0:c.status,headers:(d=t.init)!=null&&d.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function u_(e,t,n,a,i){let s=e.headers.get("Location");if(Pt(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!Bv(s)){let c=a.slice(0,a.findIndex(d=>d.route.id===n)+1);s=zy(new URL(t.url),c,i,s),e.headers.set("Location",s)}return e}function HE(e,t,n,a){let i=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Bv(e)){let s=e,c=s.startsWith("//")?new URL(t.protocol+s):new URL(s);if(i.includes(c.protocol))throw new Error("Invalid redirect location");let d=sa(c.pathname,n)!=null;if(c.origin===t.origin&&d)return c.pathname+c.search+c.hash}try{let s=a.createURL(e);if(i.includes(s.protocol))throw new Error("Invalid redirect location")}catch{}return e}function dl(e,t,n,a){let i=e.createURL(QT(t)).toString(),s={signal:n};if(a&&lr(a.formMethod)){let{formMethod:c,formEncType:d}=a;s.method=c.toUpperCase(),d==="application/json"?(s.headers=new Headers({"Content-Type":d}),s.body=JSON.stringify(a.json)):d==="text/plain"?s.body=a.text:d==="application/x-www-form-urlencoded"&&a.formData?s.body=Hy(a.formData):s.body=a.formData}return new Request(i,s)}function Hy(e){let t=new URLSearchParams;for(let[n,a]of e.entries())t.append(n,typeof a=="string"?a:a.name);return t}function BE(e){let t=new FormData;for(let[n,a]of e.entries())t.append(n,a);return t}function d_(e,t,n,a=!1,i=!1){let s={},c=null,d,h=!1,f={},g=n&&Pr(n[1])?n[1].error:void 0;return e.forEach(m=>{if(!(m.route.id in t))return;let b=m.route.id,x=t[b];if(Pt(!ns(x),"Cannot handle redirect results in processLoaderData"),Pr(x)){let w=x.error;if(g!==void 0&&(w=g,g=void 0),c=c||{},i)c[b]=w;else{let S=ri(e,b);c[S.route.id]==null&&(c[S.route.id]=w)}a||(s[b]=qT),h||(h=!0,d=Au(x.error)?x.error.status:500),x.headers&&(f[b]=x.headers)}else s[b]=x.data,x.statusCode&&x.statusCode!==200&&!h&&(d=x.statusCode),x.headers&&(f[b]=x.headers)}),g!==void 0&&n&&(c={[n[0]]:g},n[2]&&(s[n[2]]=void 0)),{loaderData:s,errors:c,statusCode:d||200,loaderHeaders:f}}function FE(e,t,n,a,i,s){let{loaderData:c,errors:d}=d_(t,n,a);return i.filter(h=>!h.matches||h.matches.some(f=>f.shouldLoad)).forEach(h=>{let{key:f,match:g,controller:m}=h;if(m&&m.signal.aborted)return;let b=s[f];if(Pt(b,"Did not find corresponding fetcher result"),Pr(b)){let x=ri(e.matches,g==null?void 0:g.route.id);d&&d[x.route.id]||(d={...d,[x.route.id]:b.error}),e.fetchers.delete(f)}else if(ns(b))Pt(!1,"Unhandled fetcher revalidation redirect");else{let x=mo(b.data);e.fetchers.set(f,x)}}),{loaderData:c,errors:d}}function VE(e,t,n,a){let i=Object.entries(t).filter(([,s])=>s!==qT).reduce((s,[c,d])=>(s[c]=d,s),{});for(let s of n){let c=s.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&s.route.loader&&(i[c]=e[c]),a&&a.hasOwnProperty(c))break}return i}function YE(e){return e?Pr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ri(e,t){return(t?e.slice(0,e.findIndex(a=>a.route.id===t)+1):[...e]).reverse().find(a=>a.route.hasErrorBoundary===!0)||e[0]}function Cf(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 na(e,{pathname:t,routeId:n,method:a,type:i,message:s}={}){let c="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(c="Bad Request",a&&t&&n?d=`You made a ${a} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i==="invalid-body"&&(d="Unable to encode submission body")):e===403?(c="Forbidden",d=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",d=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",a&&t&&n?d=`You made a ${a.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:a&&(d=`Invalid request method "${a.toUpperCase()}"`)),new Gu(e||500,c,new Error(d),!0)}function Of(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[a,i]=t[n];if(ns(i))return{key:a,result:i}}}function QT(e){let t=typeof e=="string"?Ei(e):e;return Ua({...t,hash:""})}function f_(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function h_(e){var t,n;return new Gu(((t=e.init)==null?void 0:t.status)??500,((n=e.init)==null?void 0:n.statusText)??"Internal Server Error",e.data)}function m_(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&p_(n))}function p_(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function g_(e){return qv(e.result)&&VT.has(e.result.status)}function Pr(e){return e.type==="error"}function ns(e){return(e&&e.type)==="redirect"}function qE(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function qv(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function y_(e){return VT.has(e)}function v_(e){return qv(e)&&y_(e.status)&&e.headers.has("Location")}function b_(e){return XL.has(e.toUpperCase())}function lr(e){return KL.has(e.toUpperCase())}function $v(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function eh(e,t){let n=typeof t=="string"?Ei(t).search:t.search;if(e[e.length-1].route.index&&$v(n||""))return e[e.length-1];let a=PT(e);return a[a.length-1]}function $E(e){let{formMethod:t,formAction:n,formEncType:a,text:i,formData:s,json:c}=e;if(!(!t||!n||!a)){if(i!=null)return{formMethod:t,formAction:n,formEncType:a,formData:void 0,json:void 0,text:i};if(s!=null)return{formMethod:t,formAction:n,formEncType:a,formData:s,json:void 0,text:void 0};if(c!==void 0)return{formMethod:t,formAction:n,formEncType:a,formData:void 0,json:c,text:void 0}}}function jg(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 x_(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 Zc(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 w_(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 mo(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 S_(e,t){try{let n=e.sessionStorage.getItem(YT);if(n){let a=JSON.parse(n);for(let[i,s]of Object.entries(a||{}))s&&Array.isArray(s)&&t.set(i,new Set(s||[]))}}catch{}}function E_(e,t){if(t.size>0){let n={};for(let[a,i]of t)n[a]=[...i];try{e.sessionStorage.setItem(YT,JSON.stringify(n))}catch(a){Bn(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function KE(){let e,t,n=new Promise((a,i)=>{e=async s=>{a(s);try{await n}catch{}},t=async s=>{i(s);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Cs=y.createContext(null);Cs.displayName="DataRouter";var Wu=y.createContext(null);Wu.displayName="DataRouterState";var ZT=y.createContext(!1);function R_(){return y.useContext(ZT)}var Kv=y.createContext({isTransitioning:!1});Kv.displayName="ViewTransition";var JT=y.createContext(new Map);JT.displayName="Fetchers";var T_=y.createContext(null);T_.displayName="Await";var ca=y.createContext(null);ca.displayName="Navigation";var Ph=y.createContext(null);Ph.displayName="Location";var Ea=y.createContext({outlet:null,matches:[],isDataRoute:!1});Ea.displayName="Route";var Gv=y.createContext(null);Gv.displayName="RouteError";var eC="REACT_ROUTER_ERROR",C_="REDIRECT",O_="ROUTE_ERROR_RESPONSE";function M_(e){if(e.startsWith(`${eC}:${C_}:{`))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 N_(e){if(e.startsWith(`${eC}:${O_}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Gu(t.status,t.statusText,t.data)}catch{}}function A_(e,{relative:t}={}){Pt(Xl(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=y.useContext(ca),{hash:i,pathname:s,search:c}=Qu(e,{relative:t}),d=s;return n!=="/"&&(d=s==="/"?n:Ia([n,s])),a.createHref({pathname:d,search:c,hash:i})}function Xl(){return y.useContext(Ph)!=null}function Va(){return Pt(Xl(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(Ph).location}function B7(e){Pt(Xl(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=Va();return y.useMemo(()=>Pl(e,IT(t)),[t,e])}var tC="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function nC(e){y.useContext(ca).static||y.useLayoutEffect(e)}function Xv(){let{isDataRoute:e}=y.useContext(Ea);return e?$_():D_()}function D_(){Pt(Xl(),"useNavigate() may be used only in the context of a <Router> component.");let e=y.useContext(Cs),{basename:t,navigator:n}=y.useContext(ca),{matches:a}=y.useContext(Ea),{pathname:i}=Va(),s=JSON.stringify(Fv(a)),c=y.useRef(!1);return nC(()=>{c.current=!0}),y.useCallback((h,f={})=>{if(Bn(c.current,tC),!c.current)return;if(typeof h=="number"){n.go(h);return}let g=Vv(h,JSON.parse(s),i,f.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:Ia([t,g.pathname])),(f.replace?n.replace:n.push)(g,f.state,f)},[t,n,s,i,e])}var k_=y.createContext(null);function j_(e){let t=y.useContext(Ea).outlet;return y.useMemo(()=>t&&y.createElement(k_.Provider,{value:e},t),[t,e])}function L_(){let{matches:e}=y.useContext(Ea),t=e[e.length-1];return t?t.params:{}}function Qu(e,{relative:t}={}){let{matches:n}=y.useContext(Ea),{pathname:a}=Va(),i=JSON.stringify(Fv(n));return y.useMemo(()=>Vv(e,JSON.parse(i),a,t==="path"),[e,i,a,t])}function __(e,t,n,a,i){Pt(Xl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=y.useContext(ca),{matches:c}=y.useContext(Ea),d=c[c.length-1],h=d?d.params:{},f=d?d.pathname:"/",g=d?d.pathnameBase:"/",m=d&&d.route;{let C=m&&m.path||"";aC(f,!m||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${C}">) 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="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let b=Va(),x;x=b;let w=x.pathname||"/",S=w;if(g!=="/"){let C=g.replace(/^\//,"").split("/");S="/"+w.replace(/^\//,"").split("/").slice(C.length).join("/")}let E=ni(e,{pathname:S});return Bn(m||E!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),Bn(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.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.`),H_(E&&E.map(C=>Object.assign({},C,{params:Object.assign({},h,C.params),pathname:Ia([g,s.encodeLocation?s.encodeLocation(C.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?g:Ia([g,s.encodeLocation?s.encodeLocation(C.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),c,n,a,i)}function I_(){let e=q_(),t=Au(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:a},s={padding:"2px 4px",backgroundColor:a},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:s},"ErrorBoundary")," or"," ",y.createElement("code",{style:s},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:i},n):null,c)}var z_=y.createElement(I_,null),rC=class extends y.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=N_(e.digest);n&&(e=n)}let t=e!==void 0?y.createElement(Ea.Provider,{value:this.props.routeContext},y.createElement(Gv.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?y.createElement(P_,{error:e},t):t}};rC.contextType=ZT;var Lg=new WeakMap;function P_({children:e,error:t}){let{basename:n}=y.useContext(ca);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=M_(t.digest);if(a){let i=Lg.get(t);if(i)throw i;let s=HT(a.location,n);if(UT&&!Lg.get(t))if(s.isExternal||a.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:a.replace}));throw Lg.set(t,c),c}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function U_({routeContext:e,match:t,children:n}){let a=y.useContext(Cs);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(Ea.Provider,{value:e},n)}function H_(e,t=[],n=null,a=null,i=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,c=n==null?void 0:n.errors;if(c!=null){let g=s.findIndex(m=>m.route.id&&(c==null?void 0:c[m.route.id])!==void 0);Pt(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),s=s.slice(0,Math.min(s.length,g+1))}let d=!1,h=-1;if(n)for(let g=0;g<s.length;g++){let m=s[g];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(h=g),m.route.id){let{loaderData:b,errors:x}=n,w=m.route.loader&&!b.hasOwnProperty(m.route.id)&&(!x||x[m.route.id]===void 0);if(m.route.lazy||w){d=!0,h>=0?s=s.slice(0,h+1):s=[s[0]];break}}}let f=n&&a?(g,m)=>{var b,x;a(g,{location:n.location,params:((x=(b=n.matches)==null?void 0:b[0])==null?void 0:x.params)??{},unstable_pattern:Xu(n.matches),errorInfo:m})}:void 0;return s.reduceRight((g,m,b)=>{let x,w=!1,S=null,E=null;n&&(x=c&&m.route.id?c[m.route.id]:void 0,S=m.route.errorElement||z_,d&&(h<0&&b===0?(aC("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,E=null):h===b&&(w=!0,E=m.route.hydrateFallbackElement||null)));let T=t.concat(s.slice(0,b+1)),C=()=>{let M;return x?M=S:w?M=E:m.route.Component?M=y.createElement(m.route.Component,null):m.route.element?M=m.route.element:M=g,y.createElement(U_,{match:m,routeContext:{outlet:g,matches:T,isDataRoute:n!=null},children:M})};return n&&(m.route.ErrorBoundary||m.route.errorElement||b===0)?y.createElement(rC,{location:n.location,revalidation:n.revalidation,component:S,error:x,children:C(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:f}):C()},null)}function Wv(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function B_(e){let t=y.useContext(Cs);return Pt(t,Wv(e)),t}function F_(e){let t=y.useContext(Wu);return Pt(t,Wv(e)),t}function V_(e){let t=y.useContext(Ea);return Pt(t,Wv(e)),t}function Qv(e){let t=V_(e),n=t.matches[t.matches.length-1];return Pt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Y_(){return Qv("useRouteId")}function q_(){var a;let e=y.useContext(Gv),t=F_("useRouteError"),n=Qv("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function $_(){let{router:e}=B_("useNavigate"),t=Qv("useNavigate"),n=y.useRef(!1);return nC(()=>{n.current=!0}),y.useCallback(async(i,s={})=>{Bn(n.current,tC),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...s}))},[e,t])}var GE={};function aC(e,t,n){!t&&!GE[e]&&(GE[e]=!0,Bn(!1,n))}var XE={};function WE(e,t){!e&&!XE[t]&&(XE[t]=!0,console.warn(t))}var K_="useOptimistic",QE=Uv[K_],G_=()=>{};function X_(e){return QE?QE(e):[e,G_]}function W_(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Bn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:y.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Bn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:y.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Bn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:y.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Q_=["HydrateFallback","hydrateFallbackElement"],Z_=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 J_({router:e,flushSync:t,onError:n,unstable_useTransitions:a}){a=R_()||a;let[s,c]=y.useState(e.state),[d,h]=X_(s),[f,g]=y.useState(),[m,b]=y.useState({isTransitioning:!1}),[x,w]=y.useState(),[S,E]=y.useState(),[T,C]=y.useState(),M=y.useRef(new Map),O=y.useCallback((j,{deletedFetchers:B,newErrors:G,flushSync:K,viewTransitionOpts:I})=>{G&&n&&Object.values(G).forEach(F=>{var Y;return n(F,{location:j.location,params:((Y=j.matches[0])==null?void 0:Y.params)??{},unstable_pattern:Xu(j.matches)})}),j.fetchers.forEach((F,Y)=>{F.data!==void 0&&M.current.set(Y,F.data)}),B.forEach(F=>M.current.delete(F)),WE(K===!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 H=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(WE(I==null||H,"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."),!I||!H){t&&K?t(()=>c(j)):a===!1?c(j):y.startTransition(()=>{a===!0&&h(F=>ZE(F,j)),c(j)});return}if(t&&K){t(()=>{S&&(x==null||x.resolve(),S.skipTransition()),b({isTransitioning:!0,flushSync:!0,currentLocation:I.currentLocation,nextLocation:I.nextLocation})});let F=e.window.document.startViewTransition(()=>{t(()=>c(j))});F.finished.finally(()=>{t(()=>{w(void 0),E(void 0),g(void 0),b({isTransitioning:!1})})}),t(()=>E(F));return}S?(x==null||x.resolve(),S.skipTransition(),C({state:j,currentLocation:I.currentLocation,nextLocation:I.nextLocation})):(g(j),b({isTransitioning:!0,flushSync:!1,currentLocation:I.currentLocation,nextLocation:I.nextLocation}))},[e.window,t,S,x,a,h,n]);y.useLayoutEffect(()=>e.subscribe(O),[e,O]),y.useEffect(()=>{m.isTransitioning&&!m.flushSync&&w(new Z_)},[m]),y.useEffect(()=>{if(x&&f&&e.window){let j=f,B=x.promise,G=e.window.document.startViewTransition(async()=>{a===!1?c(j):y.startTransition(()=>{a===!0&&h(K=>ZE(K,j)),c(j)}),await B});G.finished.finally(()=>{w(void 0),E(void 0),g(void 0),b({isTransitioning:!1})}),E(G)}},[f,x,e.window,a,h]),y.useEffect(()=>{x&&f&&d.location.key===f.location.key&&x.resolve()},[x,S,d.location,f]),y.useEffect(()=>{!m.isTransitioning&&T&&(g(T.state),b({isTransitioning:!0,flushSync:!1,currentLocation:T.currentLocation,nextLocation:T.nextLocation}),C(void 0))},[m.isTransitioning,T]);let D=y.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:j=>e.navigate(j),push:(j,B,G)=>e.navigate(j,{state:B,preventScrollReset:G==null?void 0:G.preventScrollReset}),replace:(j,B,G)=>e.navigate(j,{replace:!0,state:B,preventScrollReset:G==null?void 0:G.preventScrollReset})}),[e]),k=e.basename||"/",A=y.useMemo(()=>({router:e,navigator:D,static:!1,basename:k,onError:n}),[e,D,k,n]);return y.createElement(y.Fragment,null,y.createElement(Cs.Provider,{value:A},y.createElement(Wu.Provider,{value:d},y.createElement(JT.Provider,{value:M.current},y.createElement(Kv.Provider,{value:m},y.createElement(rI,{basename:k,location:d.location,navigationType:d.historyAction,navigator:D,unstable_useTransitions:a},y.createElement(eI,{routes:e.routes,future:e.future,state:d,onError:n})))))),null)}function ZE(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 eI=y.memo(tI);function tI({routes:e,future:t,state:n,onError:a}){return __(e,void 0,n,a,t)}function nI(e){return j_(e.context)}function rI({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:i,static:s=!1,unstable_useTransitions:c}){Pt(!Xl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),h=y.useMemo(()=>({basename:d,navigator:i,static:s,unstable_useTransitions:c,future:{}}),[d,i,s,c]);typeof n=="string"&&(n=Ei(n));let{pathname:f="/",search:g="",hash:m="",state:b=null,key:x="default"}=n,w=y.useMemo(()=>{let S=sa(f,d);return S==null?null:{location:{pathname:S,search:g,hash:m,state:b,key:x},navigationType:a}},[d,f,g,m,b,x,a]);return Bn(w!=null,`<Router basename="${d}"> is not able to match the URL "${f}${g}${m}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:y.createElement(ca.Provider,{value:h},y.createElement(Ph.Provider,{children:t,value:w}))}var th="get",nh="application/x-www-form-urlencoded";function Uh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function aI(e){return Uh(e)&&e.tagName.toLowerCase()==="button"}function oI(e){return Uh(e)&&e.tagName.toLowerCase()==="form"}function iI(e){return Uh(e)&&e.tagName.toLowerCase()==="input"}function sI(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function lI(e,t){return e.button===0&&(!t||t==="_self")&&!sI(e)}var Mf=null;function cI(){if(Mf===null)try{new FormData(document.createElement("form"),0),Mf=!1}catch{Mf=!0}return Mf}var uI=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function _g(e){return e!=null&&!uI.has(e)?(Bn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${nh}"`),null):e}function dI(e,t){let n,a,i,s,c;if(oI(e)){let d=e.getAttribute("action");a=d?sa(d,t):null,n=e.getAttribute("method")||th,i=_g(e.getAttribute("enctype"))||nh,s=new FormData(e)}else if(aI(e)||iI(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||d.getAttribute("action");if(a=h?sa(h,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||th,i=_g(e.getAttribute("formenctype"))||_g(d.getAttribute("enctype"))||nh,s=new FormData(d,e),!cI()){let{name:f,type:g,value:m}=e;if(g==="image"){let b=f?`${f}.`:"";s.append(`${b}x`,"0"),s.append(`${b}y`,"0")}else f&&s.append(f,m)}}else{if(Uh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=th,a=null,i=nh,c=e}return s&&i==="text/plain"&&(c=s,s=void 0),{action:a,method:n.toLowerCase(),encType:i,formData:s,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Zv(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function fI(e,t,n,a){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${a}`:i.pathname=`${i.pathname}.${a}`:i.pathname==="/"?i.pathname=`_root.${a}`:t&&sa(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${a}`,i}async function hI(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 mI(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 pI(e,t,n){let a=await Promise.all(e.map(async i=>{let s=t.routes[i.route.id];if(s){let c=await hI(s,n);return c.links?c.links():[]}return[]}));return bI(a.flat(1).filter(mI).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function JE(e,t,n,a,i,s){let c=(h,f)=>n[f]?h.route.id!==n[f].route.id:!0,d=(h,f)=>{var g;return n[f].pathname!==h.pathname||((g=n[f].route.path)==null?void 0:g.endsWith("*"))&&n[f].params["*"]!==h.params["*"]};return s==="assets"?t.filter((h,f)=>c(h,f)||d(h,f)):s==="data"?t.filter((h,f)=>{var m;let g=a.routes[h.route.id];if(!g||!g.hasLoader)return!1;if(c(h,f)||d(h,f))return!0;if(h.route.shouldRevalidate){let b=h.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((m=n[0])==null?void 0:m.params)||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function gI(e,t,{includeHydrateFallback:n}={}){return yI(e.map(a=>{let i=t.routes[a.route.id];if(!i)return[];let s=[i.module];return i.clientActionModule&&(s=s.concat(i.clientActionModule)),i.clientLoaderModule&&(s=s.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(s=s.concat(i.hydrateFallbackModule)),i.imports&&(s=s.concat(i.imports)),s}).flat(1))}function yI(e){return[...new Set(e)]}function vI(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function bI(e,t){let n=new Set;return new Set(t),e.reduce((a,i)=>{let s=JSON.stringify(vI(i));return n.has(s)||(n.add(s),a.push({key:s,link:i})),a},[])}function oC(){let e=y.useContext(Cs);return Zv(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function xI(){let e=y.useContext(Wu);return Zv(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Jv=y.createContext(void 0);Jv.displayName="FrameworkContext";function iC(){let e=y.useContext(Jv);return Zv(e,"You must render this element inside a <HydratedRouter> element"),e}function wI(e,t){let n=y.useContext(Jv),[a,i]=y.useState(!1),[s,c]=y.useState(!1),{onFocus:d,onBlur:h,onMouseEnter:f,onMouseLeave:g,onTouchStart:m}=t,b=y.useRef(null);y.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let S=T=>{T.forEach(C=>{c(C.isIntersecting)})},E=new IntersectionObserver(S,{threshold:.5});return b.current&&E.observe(b.current),()=>{E.disconnect()}}},[e]),y.useEffect(()=>{if(a){let S=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(S)}}},[a]);let x=()=>{i(!0)},w=()=>{i(!1),c(!1)};return n?e!=="intent"?[s,b,{}]:[s,b,{onFocus:Jc(d,x),onBlur:Jc(h,w),onMouseEnter:Jc(f,x),onMouseLeave:Jc(g,w),onTouchStart:Jc(m,x)}]:[!1,b,{}]}function Jc(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function SI({page:e,...t}){let{router:n}=oC(),a=y.useMemo(()=>ni(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?y.createElement(RI,{page:e,matches:a,...t}):null}function EI(e){let{manifest:t,routeModules:n}=iC(),[a,i]=y.useState([]);return y.useEffect(()=>{let s=!1;return pI(e,t,n).then(c=>{s||i(c)}),()=>{s=!0}},[e,t,n]),a}function RI({page:e,matches:t,...n}){let a=Va(),{future:i,manifest:s,routeModules:c}=iC(),{basename:d}=oC(),{loaderData:h,matches:f}=xI(),g=y.useMemo(()=>JE(e,t,f,s,a,"data"),[e,t,f,s,a]),m=y.useMemo(()=>JE(e,t,f,s,a,"assets"),[e,t,f,s,a]),b=y.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let S=new Set,E=!1;if(t.forEach(C=>{var O;let M=s.routes[C.route.id];!M||!M.hasLoader||(!g.some(D=>D.route.id===C.route.id)&&C.route.id in h&&((O=c[C.route.id])!=null&&O.shouldRevalidate)||M.hasClientLoader?E=!0:S.add(C.route.id))}),S.size===0)return[];let T=fI(e,d,i.unstable_trailingSlashAwareDataRequests,"data");return E&&S.size>0&&T.searchParams.set("_routes",t.filter(C=>S.has(C.route.id)).map(C=>C.route.id).join(",")),[T.pathname+T.search]},[d,i.unstable_trailingSlashAwareDataRequests,h,a,s,g,t,e,c]),x=y.useMemo(()=>gI(m,s),[m,s]),w=EI(m);return y.createElement(y.Fragment,null,b.map(S=>y.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),x.map(S=>y.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),w.map(({key:S,link:E})=>y.createElement("link",{key:S,nonce:n.nonce,...E,crossOrigin:E.crossOrigin??n.crossOrigin})))}function TI(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var CI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{CI&&(window.__reactRouterVersion="7.13.0")}catch{}function OI(e,t){return JL({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:gL({window:t==null?void 0:t.window}),hydrationData:MI(),routes:e,mapRouteProperties:W_,hydrationRouteProperties:Q_,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 MI(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:NI(e.errors)}),e}function NI(e){if(!e)return null;let t=Object.entries(e),n={};for(let[a,i]of t)if(i&&i.__type==="RouteErrorResponse")n[a]=new Gu(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let s=window[i.__subType];if(typeof s=="function")try{let c=new s(i.message);c.stack="",n[a]=c}catch{}}if(n[a]==null){let s=new Error(i.message);s.stack="",n[a]=s}}else n[a]=i;return n}var sC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,eb=y.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:i,reloadDocument:s,replace:c,state:d,target:h,to:f,preventScrollReset:g,viewTransition:m,unstable_defaultShouldRevalidate:b,...x},w){let{basename:S,unstable_useTransitions:E}=y.useContext(ca),T=typeof f=="string"&&sC.test(f),C=HT(f,S);f=C.to;let M=A_(f,{relative:i}),[O,D,k]=wI(a,x),A=jI(f,{replace:c,state:d,target:h,preventScrollReset:g,relative:i,viewTransition:m,unstable_defaultShouldRevalidate:b,unstable_useTransitions:E});function j(G){t&&t(G),G.defaultPrevented||A(G)}let B=y.createElement("a",{...x,...k,href:C.absoluteURL||M,onClick:C.isExternal||s?t:j,ref:TI(w,D),target:h,"data-discover":!T&&n==="render"?"true":void 0});return O&&!T?y.createElement(y.Fragment,null,B,y.createElement(SI,{page:M})):B});eb.displayName="Link";var AI=y.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:i=!1,style:s,to:c,viewTransition:d,children:h,...f},g){let m=Qu(c,{relative:f.relative}),b=Va(),x=y.useContext(Wu),{navigator:w,basename:S}=y.useContext(ca),E=x!=null&&PI(m)&&d===!0,T=w.encodeLocation?w.encodeLocation(m).pathname:m.pathname,C=b.pathname,M=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;n||(C=C.toLowerCase(),M=M?M.toLowerCase():null,T=T.toLowerCase()),M&&S&&(M=sa(M,S)||M);const O=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let D=C===T||!i&&C.startsWith(T)&&C.charAt(O)==="/",k=M!=null&&(M===T||!i&&M.startsWith(T)&&M.charAt(T.length)==="/"),A={isActive:D,isPending:k,isTransitioning:E},j=D?t:void 0,B;typeof a=="function"?B=a(A):B=[a,D?"active":null,k?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let G=typeof s=="function"?s(A):s;return y.createElement(eb,{...f,"aria-current":j,className:B,ref:g,style:G,to:c,viewTransition:d},typeof h=="function"?h(A):h)});AI.displayName="NavLink";var DI=y.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:i,state:s,method:c=th,action:d,onSubmit:h,relative:f,preventScrollReset:g,viewTransition:m,unstable_defaultShouldRevalidate:b,...x},w)=>{let{unstable_useTransitions:S}=y.useContext(ca),E=II(),T=zI(d,{relative:f}),C=c.toLowerCase()==="get"?"get":"post",M=typeof d=="string"&&sC.test(d),O=D=>{if(h&&h(D),D.defaultPrevented)return;D.preventDefault();let k=D.nativeEvent.submitter,A=(k==null?void 0:k.getAttribute("formmethod"))||c,j=()=>E(k||D.currentTarget,{fetcherKey:t,method:A,navigate:n,replace:i,state:s,relative:f,preventScrollReset:g,viewTransition:m,unstable_defaultShouldRevalidate:b});S&&n!==!1?y.startTransition(()=>j()):j()};return y.createElement("form",{ref:w,method:C,action:T,onSubmit:a?h:O,...x,"data-discover":!M&&e==="render"?"true":void 0})});DI.displayName="Form";function kI(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function lC(e){let t=y.useContext(Cs);return Pt(t,kI(e)),t}function jI(e,{target:t,replace:n,state:a,preventScrollReset:i,relative:s,viewTransition:c,unstable_defaultShouldRevalidate:d,unstable_useTransitions:h}={}){let f=Xv(),g=Va(),m=Qu(e,{relative:s});return y.useCallback(b=>{if(lI(b,t)){b.preventDefault();let x=n!==void 0?n:Ua(g)===Ua(m),w=()=>f(e,{replace:x,state:a,preventScrollReset:i,relative:s,viewTransition:c,unstable_defaultShouldRevalidate:d});h?y.startTransition(()=>w()):w()}},[g,f,m,n,a,t,e,i,s,c,d,h])}var LI=0,_I=()=>`__${String(++LI)}__`;function II(){let{router:e}=lC("useSubmit"),{basename:t}=y.useContext(ca),n=Y_(),a=e.fetch,i=e.navigate;return y.useCallback(async(s,c={})=>{let{action:d,method:h,encType:f,formData:g,body:m}=dI(s,t);if(c.navigate===!1){let b=c.fetcherKey||_I();await a(b,n,c.action||d,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:g,body:m,formMethod:c.method||h,formEncType:c.encType||f,flushSync:c.flushSync})}else await i(c.action||d,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:g,body:m,formMethod:c.method||h,formEncType:c.encType||f,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[a,i,t,n])}function zI(e,{relative:t}={}){let{basename:n}=y.useContext(ca),a=y.useContext(Ea);Pt(a,"useFormAction must be used inside a RouteContext");let[i]=a.matches.slice(-1),s={...Qu(e||".",{relative:t})},c=Va();if(e==null){s.search=c.search;let d=new URLSearchParams(s.search),h=d.getAll("index");if(h.some(g=>g==="")){d.delete("index"),h.filter(m=>m).forEach(m=>d.append("index",m));let g=d.toString();s.search=g?`?${g}`:""}}return(!e||e===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:Ia([n,s.pathname])),Ua(s)}function PI(e,{relative:t}={}){let n=y.useContext(Kv);Pt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=lC("useViewTransitionState"),i=Qu(e,{relative:t});if(!n.isTransitioning)return!1;let s=sa(n.currentLocation.pathname,a)||n.currentLocation.pathname,c=sa(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Pl(i.pathname,c)!=null||Pl(i.pathname,s)!=null}var or=DT();const UI=mT(or);function HI(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 BI=e=>{switch(e){case"success":return YI;case"info":return $I;case"warning":return qI;case"error":return KI;default:return null}},FI=Array(12).fill(0),VI=({visible:e,className:t})=>_e.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},_e.createElement("div",{className:"sonner-spinner"},FI.map((n,a)=>_e.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),YI=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},_e.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"})),qI=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},_e.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"})),$I=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},_e.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"})),KI=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},_e.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"})),GI=_e.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"},_e.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),_e.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),XI=()=>{const[e,t]=_e.useState(document.hidden);return _e.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let By=1;class WI{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:a,...i}=t,s=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:By++,c=this.toasts.find(h=>h.id===s),d=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),c?this.toasts=this.toasts.map(h=>h.id===s?(this.publish({...h,...t,id:s,title:a}),{...h,...t,id:s,dismissible:d,title:a}):h):this.addToast({title:a,...i,dismissible:d,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(a=>a({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 a;n.loading!==void 0&&(a=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let s=a!==void 0,c;const d=i.then(async f=>{if(c=["resolve",f],_e.isValidElement(f))s=!1,this.create({id:a,type:"default",message:f});else if(ZI(f)&&!f.ok){s=!1;const m=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,b=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,w=typeof m=="object"&&!_e.isValidElement(m)?m:{message:m};this.create({id:a,type:"error",description:b,...w})}else if(f instanceof Error){s=!1;const m=typeof n.error=="function"?await n.error(f):n.error,b=typeof n.description=="function"?await n.description(f):n.description,w=typeof m=="object"&&!_e.isValidElement(m)?m:{message:m};this.create({id:a,type:"error",description:b,...w})}else if(n.success!==void 0){s=!1;const m=typeof n.success=="function"?await n.success(f):n.success,b=typeof n.description=="function"?await n.description(f):n.description,w=typeof m=="object"&&!_e.isValidElement(m)?m:{message:m};this.create({id:a,type:"success",description:b,...w})}}).catch(async f=>{if(c=["reject",f],n.error!==void 0){s=!1;const g=typeof n.error=="function"?await n.error(f):n.error,m=typeof n.description=="function"?await n.description(f):n.description,x=typeof g=="object"&&!_e.isValidElement(g)?g:{message:g};this.create({id:a,type:"error",description:m,...x})}}).finally(()=>{s&&(this.dismiss(a),a=void 0),n.finally==null||n.finally.call(n)}),h=()=>new Promise((f,g)=>d.then(()=>c[0]==="reject"?g(c[1]):f(c[1])).catch(g));return typeof a!="string"&&typeof a!="number"?{unwrap:h}:Object.assign(a,{unwrap:h})},this.custom=(t,n)=>{const a=(n==null?void 0:n.id)||By++;return this.create({jsx:t(a),id:a,...n}),a},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Cr=new WI,QI=(e,t)=>{const n=(t==null?void 0:t.id)||By++;return Cr.addToast({title:e,...t,id:n}),n},ZI=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",JI=QI,ez=()=>Cr.toasts,tz=()=>Cr.getActiveToasts(),cn=Object.assign(JI,{success:Cr.success,info:Cr.info,warning:Cr.warning,error:Cr.error,custom:Cr.custom,message:Cr.message,promise:Cr.promise,dismiss:Cr.dismiss,loading:Cr.loading},{getHistory:ez,getToasts:tz});HI("[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 Nf(e){return e.label!==void 0}const nz=3,rz="24px",az="16px",e1=4e3,oz=356,iz=14,sz=45,lz=200;function Na(...e){return e.filter(Boolean).join(" ")}function cz(e){const[t,n]=e.split("-"),a=[];return t&&a.push(t),n&&a.push(n),a}const uz=e=>{var t,n,a,i,s,c,d,h,f;const{invert:g,toast:m,unstyled:b,interacting:x,setHeights:w,visibleToasts:S,heights:E,index:T,toasts:C,expanded:M,removeToast:O,defaultRichColors:D,closeButton:k,style:A,cancelButtonStyle:j,actionButtonStyle:B,className:G="",descriptionClassName:K="",duration:I,position:H,gap:F,expandByDefault:Y,classNames:_,icons:L,closeButtonAriaLabel:z="Close toast"}=e,[V,Q]=_e.useState(null),[P,q]=_e.useState(null),[X,W]=_e.useState(!1),[ce,ie]=_e.useState(!1),[de,ve]=_e.useState(!1),[Se,Me]=_e.useState(!1),[ke,J]=_e.useState(!1),[ue,pe]=_e.useState(0),[De,Ce]=_e.useState(0),we=_e.useRef(m.duration||I||e1),Te=_e.useRef(null),Z=_e.useRef(null),be=T===0,ge=T+1<=S,Pe=m.type,Be=m.dismissible!==!1,Ae=m.className||"",it=m.descriptionClassName||"",wt=_e.useMemo(()=>E.findIndex(Ve=>Ve.toastId===m.id)||0,[E,m.id]),xt=_e.useMemo(()=>{var Ve;return(Ve=m.closeButton)!=null?Ve:k},[m.closeButton,k]),oe=_e.useMemo(()=>m.duration||I||e1,[m.duration,I]),xe=_e.useRef(0),Ie=_e.useRef(0),qe=_e.useRef(0),Ke=_e.useRef(null),[st,ze]=H.split("-"),Je=_e.useMemo(()=>E.reduce((Ve,Et,Dt)=>Dt>=wt?Ve:Ve+Et.height,0),[E,wt]),ft=XI(),jt=m.invert||g,nn=Pe==="loading";Ie.current=_e.useMemo(()=>wt*F+Je,[wt,Je]),_e.useEffect(()=>{we.current=oe},[oe]),_e.useEffect(()=>{W(!0)},[]),_e.useEffect(()=>{const Ve=Z.current;if(Ve){const Et=Ve.getBoundingClientRect().height;return Ce(Et),w(Dt=>[{toastId:m.id,height:Et,position:m.position},...Dt]),()=>w(Dt=>Dt.filter(St=>St.toastId!==m.id))}},[w,m.id]),_e.useLayoutEffect(()=>{if(!X)return;const Ve=Z.current,Et=Ve.style.height;Ve.style.height="auto";const Dt=Ve.getBoundingClientRect().height;Ve.style.height=Et,Ce(Dt),w(St=>St.find(It=>It.toastId===m.id)?St.map(It=>It.toastId===m.id?{...It,height:Dt}:It):[{toastId:m.id,height:Dt,position:m.position},...St])},[X,m.title,m.description,w,m.id,m.jsx,m.action,m.cancel]);const ht=_e.useCallback(()=>{ie(!0),pe(Ie.current),w(Ve=>Ve.filter(Et=>Et.toastId!==m.id)),setTimeout(()=>{O(m)},lz)},[m,O,w,Ie]);_e.useEffect(()=>{if(m.promise&&Pe==="loading"||m.duration===1/0||m.type==="loading")return;let Ve;return M||x||ft?(()=>{if(qe.current<xe.current){const St=new Date().getTime()-xe.current;we.current=we.current-St}qe.current=new Date().getTime()})():(()=>{we.current!==1/0&&(xe.current=new Date().getTime(),Ve=setTimeout(()=>{m.onAutoClose==null||m.onAutoClose.call(m,m),ht()},we.current))})(),()=>clearTimeout(Ve)},[M,x,m,Pe,ft,ht]),_e.useEffect(()=>{m.delete&&(ht(),m.onDismiss==null||m.onDismiss.call(m,m))},[ht,m.delete]);function Ct(){var Ve;if(L!=null&&L.loading){var Et;return _e.createElement("div",{className:Na(_==null?void 0:_.loader,m==null||(Et=m.classNames)==null?void 0:Et.loader,"sonner-loader"),"data-visible":Pe==="loading"},L.loading)}return _e.createElement(VI,{className:Na(_==null?void 0:_.loader,m==null||(Ve=m.classNames)==null?void 0:Ve.loader),visible:Pe==="loading"})}const et=m.icon||(L==null?void 0:L[Pe])||BI(Pe);var lt,mt;return _e.createElement("li",{tabIndex:0,ref:Z,className:Na(G,Ae,_==null?void 0:_.toast,m==null||(t=m.classNames)==null?void 0:t.toast,_==null?void 0:_.default,_==null?void 0:_[Pe],m==null||(n=m.classNames)==null?void 0:n[Pe]),"data-sonner-toast":"","data-rich-colors":(lt=m.richColors)!=null?lt:D,"data-styled":!(m.jsx||m.unstyled||b),"data-mounted":X,"data-promise":!!m.promise,"data-swiped":ke,"data-removed":ce,"data-visible":ge,"data-y-position":st,"data-x-position":ze,"data-index":T,"data-front":be,"data-swiping":de,"data-dismissible":Be,"data-type":Pe,"data-invert":jt,"data-swipe-out":Se,"data-swipe-direction":P,"data-expanded":!!(M||Y&&X),"data-testid":m.testId,style:{"--index":T,"--toasts-before":T,"--z-index":C.length-T,"--offset":`${ce?ue:Ie.current}px`,"--initial-height":Y?"auto":`${De}px`,...A,...m.style},onDragEnd:()=>{ve(!1),Q(null),Ke.current=null},onPointerDown:Ve=>{Ve.button!==2&&(nn||!Be||(Te.current=new Date,pe(Ie.current),Ve.target.setPointerCapture(Ve.pointerId),Ve.target.tagName!=="BUTTON"&&(ve(!0),Ke.current={x:Ve.clientX,y:Ve.clientY})))},onPointerUp:()=>{var Ve,Et,Dt;if(Se||!Be)return;Ke.current=null;const St=Number(((Ve=Z.current)==null?void 0:Ve.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),rn=Number(((Et=Z.current)==null?void 0:Et.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),It=new Date().getTime()-((Dt=Te.current)==null?void 0:Dt.getTime()),Xe=V==="x"?St:rn,Rt=Math.abs(Xe)/It;if(Math.abs(Xe)>=sz||Rt>.11){pe(Ie.current),m.onDismiss==null||m.onDismiss.call(m,m),q(V==="x"?St>0?"right":"left":rn>0?"down":"up"),ht(),Me(!0);return}else{var $,ne;($=Z.current)==null||$.style.setProperty("--swipe-amount-x","0px"),(ne=Z.current)==null||ne.style.setProperty("--swipe-amount-y","0px")}J(!1),ve(!1),Q(null)},onPointerMove:Ve=>{var Et,Dt,St;if(!Ke.current||!Be||((Et=window.getSelection())==null?void 0:Et.toString().length)>0)return;const It=Ve.clientY-Ke.current.y,Xe=Ve.clientX-Ke.current.x;var Rt;const $=(Rt=e.swipeDirections)!=null?Rt:cz(H);!V&&(Math.abs(Xe)>1||Math.abs(It)>1)&&Q(Math.abs(Xe)>Math.abs(It)?"x":"y");let ne={x:0,y:0};const le=Ee=>1/(1.5+Math.abs(Ee)/20);if(V==="y"){if($.includes("top")||$.includes("bottom"))if($.includes("top")&&It<0||$.includes("bottom")&&It>0)ne.y=It;else{const Ee=It*le(It);ne.y=Math.abs(Ee)<Math.abs(It)?Ee:It}}else if(V==="x"&&($.includes("left")||$.includes("right")))if($.includes("left")&&Xe<0||$.includes("right")&&Xe>0)ne.x=Xe;else{const Ee=Xe*le(Xe);ne.x=Math.abs(Ee)<Math.abs(Xe)?Ee:Xe}(Math.abs(ne.x)>0||Math.abs(ne.y)>0)&&J(!0),(Dt=Z.current)==null||Dt.style.setProperty("--swipe-amount-x",`${ne.x}px`),(St=Z.current)==null||St.style.setProperty("--swipe-amount-y",`${ne.y}px`)}},xt&&!m.jsx&&Pe!=="loading"?_e.createElement("button",{"aria-label":z,"data-disabled":nn,"data-close-button":!0,onClick:nn||!Be?()=>{}:()=>{ht(),m.onDismiss==null||m.onDismiss.call(m,m)},className:Na(_==null?void 0:_.closeButton,m==null||(a=m.classNames)==null?void 0:a.closeButton)},(mt=L==null?void 0:L.close)!=null?mt:GI):null,(Pe||m.icon||m.promise)&&m.icon!==null&&((L==null?void 0:L[Pe])!==null||m.icon)?_e.createElement("div",{"data-icon":"",className:Na(_==null?void 0:_.icon,m==null||(i=m.classNames)==null?void 0:i.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||Ct():null,m.type!=="loading"?et:null):null,_e.createElement("div",{"data-content":"",className:Na(_==null?void 0:_.content,m==null||(s=m.classNames)==null?void 0:s.content)},_e.createElement("div",{"data-title":"",className:Na(_==null?void 0:_.title,m==null||(c=m.classNames)==null?void 0:c.title)},m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title),m.description?_e.createElement("div",{"data-description":"",className:Na(K,it,_==null?void 0:_.description,m==null||(d=m.classNames)==null?void 0:d.description)},typeof m.description=="function"?m.description():m.description):null),_e.isValidElement(m.cancel)?m.cancel:m.cancel&&Nf(m.cancel)?_e.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||j,onClick:Ve=>{Nf(m.cancel)&&Be&&(m.cancel.onClick==null||m.cancel.onClick.call(m.cancel,Ve),ht())},className:Na(_==null?void 0:_.cancelButton,m==null||(h=m.classNames)==null?void 0:h.cancelButton)},m.cancel.label):null,_e.isValidElement(m.action)?m.action:m.action&&Nf(m.action)?_e.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||B,onClick:Ve=>{Nf(m.action)&&(m.action.onClick==null||m.action.onClick.call(m.action,Ve),!Ve.defaultPrevented&&ht())},className:Na(_==null?void 0:_.actionButton,m==null||(f=m.classNames)==null?void 0:f.actionButton)},m.action.label):null)};function t1(){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 dz(e,t){const n={};return[e,t].forEach((a,i)=>{const s=i===1,c=s?"--mobile-offset":"--offset",d=s?az:rz;function h(f){["top","right","bottom","left"].forEach(g=>{n[`${c}-${g}`]=typeof f=="number"?`${f}px`:f})}typeof a=="number"||typeof a=="string"?h(a):typeof a=="object"?["top","right","bottom","left"].forEach(f=>{a[f]===void 0?n[`${c}-${f}`]=d:n[`${c}-${f}`]=typeof a[f]=="number"?`${a[f]}px`:a[f]}):h(d)}),n}const fz=_e.forwardRef(function(t,n){const{id:a,invert:i,position:s="bottom-right",hotkey:c=["altKey","KeyT"],expand:d,closeButton:h,className:f,offset:g,mobileOffset:m,theme:b="light",richColors:x,duration:w,style:S,visibleToasts:E=nz,toastOptions:T,dir:C=t1(),gap:M=iz,icons:O,containerAriaLabel:D="Notifications"}=t,[k,A]=_e.useState([]),j=_e.useMemo(()=>a?k.filter(X=>X.toasterId===a):k.filter(X=>!X.toasterId),[k,a]),B=_e.useMemo(()=>Array.from(new Set([s].concat(j.filter(X=>X.position).map(X=>X.position)))),[j,s]),[G,K]=_e.useState([]),[I,H]=_e.useState(!1),[F,Y]=_e.useState(!1),[_,L]=_e.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),z=_e.useRef(null),V=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),Q=_e.useRef(null),P=_e.useRef(!1),q=_e.useCallback(X=>{A(W=>{var ce;return(ce=W.find(ie=>ie.id===X.id))!=null&&ce.delete||Cr.dismiss(X.id),W.filter(({id:ie})=>ie!==X.id)})},[]);return _e.useEffect(()=>Cr.subscribe(X=>{if(X.dismiss){requestAnimationFrame(()=>{A(W=>W.map(ce=>ce.id===X.id?{...ce,delete:!0}:ce))});return}setTimeout(()=>{UI.flushSync(()=>{A(W=>{const ce=W.findIndex(ie=>ie.id===X.id);return ce!==-1?[...W.slice(0,ce),{...W[ce],...X},...W.slice(ce+1)]:[X,...W]})})})}),[k]),_e.useEffect(()=>{if(b!=="system"){L(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?L("dark"):L("light")),typeof window>"u")return;const X=window.matchMedia("(prefers-color-scheme: dark)");try{X.addEventListener("change",({matches:W})=>{L(W?"dark":"light")})}catch{X.addListener(({matches:ce})=>{try{L(ce?"dark":"light")}catch(ie){console.error(ie)}})}},[b]),_e.useEffect(()=>{k.length<=1&&H(!1)},[k]),_e.useEffect(()=>{const X=W=>{var ce;if(c.every(ve=>W[ve]||W.code===ve)){var de;H(!0),(de=z.current)==null||de.focus()}W.code==="Escape"&&(document.activeElement===z.current||(ce=z.current)!=null&&ce.contains(document.activeElement))&&H(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[c]),_e.useEffect(()=>{if(z.current)return()=>{Q.current&&(Q.current.focus({preventScroll:!0}),Q.current=null,P.current=!1)}},[z.current]),_e.createElement("section",{ref:n,"aria-label":`${D} ${V}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},B.map((X,W)=>{var ce;const[ie,de]=X.split("-");return j.length?_e.createElement("ol",{key:X,dir:C==="auto"?t1():C,tabIndex:-1,ref:z,className:f,"data-sonner-toaster":!0,"data-sonner-theme":_,"data-y-position":ie,"data-x-position":de,style:{"--front-toast-height":`${((ce=G[0])==null?void 0:ce.height)||0}px`,"--width":`${oz}px`,"--gap":`${M}px`,...S,...dz(g,m)},onBlur:ve=>{P.current&&!ve.currentTarget.contains(ve.relatedTarget)&&(P.current=!1,Q.current&&(Q.current.focus({preventScroll:!0}),Q.current=null))},onFocus:ve=>{ve.target instanceof HTMLElement&&ve.target.dataset.dismissible==="false"||P.current||(P.current=!0,Q.current=ve.relatedTarget)},onMouseEnter:()=>H(!0),onMouseMove:()=>H(!0),onMouseLeave:()=>{F||H(!1)},onDragEnd:()=>H(!1),onPointerDown:ve=>{ve.target instanceof HTMLElement&&ve.target.dataset.dismissible==="false"||Y(!0)},onPointerUp:()=>Y(!1)},j.filter(ve=>!ve.position&&W===0||ve.position===X).map((ve,Se)=>{var Me,ke;return _e.createElement(uz,{key:ve.id,icons:O,index:Se,toast:ve,defaultRichColors:x,duration:(Me=T==null?void 0:T.duration)!=null?Me:w,className:T==null?void 0:T.className,descriptionClassName:T==null?void 0:T.descriptionClassName,invert:i,visibleToasts:E,closeButton:(ke=T==null?void 0:T.closeButton)!=null?ke:h,interacting:F,position:X,style:T==null?void 0:T.style,unstyled:T==null?void 0:T.unstyled,classNames:T==null?void 0:T.classNames,cancelButtonStyle:T==null?void 0:T.cancelButtonStyle,actionButtonStyle:T==null?void 0:T.actionButtonStyle,closeButtonAriaLabel:T==null?void 0:T.closeButtonAriaLabel,removeToast:q,toasts:j.filter(J=>J.position==ve.position),heights:G.filter(J=>J.position==ve.position),setHeights:K,expandByDefault:d,gap:M,expanded:I,swipeDirections:t.swipeDirections})})):null}))}),Tt=e=>typeof e=="string",eu=()=>{let e,t;const n=new Promise((a,i)=>{e=a,t=i});return n.resolve=e,n.reject=t,n},n1=e=>e==null?"":""+e,hz=(e,t,n)=>{e.forEach(a=>{t[a]&&(n[a]=t[a])})},mz=/###/g,r1=e=>e&&e.indexOf("###")>-1?e.replace(mz,"."):e,a1=e=>!e||Tt(e),mu=(e,t,n)=>{const a=Tt(t)?t.split("."):t;let i=0;for(;i<a.length-1;){if(a1(e))return{};const s=r1(a[i]);!e[s]&&n&&(e[s]=new n),Object.prototype.hasOwnProperty.call(e,s)?e=e[s]:e={},++i}return a1(e)?{}:{obj:e,k:r1(a[i])}},o1=(e,t,n)=>{const{obj:a,k:i}=mu(e,t,Object);if(a!==void 0||t.length===1){a[i]=n;return}let s=t[t.length-1],c=t.slice(0,t.length-1),d=mu(e,c,Object);for(;d.obj===void 0&&c.length;)s=`${c[c.length-1]}.${s}`,c=c.slice(0,c.length-1),d=mu(e,c,Object),d!=null&&d.obj&&typeof d.obj[`${d.k}.${s}`]<"u"&&(d.obj=void 0);d.obj[`${d.k}.${s}`]=n},pz=(e,t,n,a)=>{const{obj:i,k:s}=mu(e,t,Object);i[s]=i[s]||[],i[s].push(n)},hh=(e,t)=>{const{obj:n,k:a}=mu(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,a))return n[a]},gz=(e,t,n)=>{const a=hh(e,n);return a!==void 0?a:hh(t,n)},cC=(e,t,n)=>{for(const a in t)a!=="__proto__"&&a!=="constructor"&&(a in e?Tt(e[a])||e[a]instanceof String||Tt(t[a])||t[a]instanceof String?n&&(e[a]=t[a]):cC(e[a],t[a],n):e[a]=t[a]);return e},sl=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var yz={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const vz=e=>Tt(e)?e.replace(/[&<>"'\/]/g,t=>yz[t]):e;class bz{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 a=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,a),this.regExpQueue.push(t),a}}const xz=[" ",",","?","!",";"],wz=new bz(20),Sz=(e,t,n)=>{t=t||"",n=n||"";const a=xz.filter(c=>t.indexOf(c)<0&&n.indexOf(c)<0);if(a.length===0)return!0;const i=wz.getRegExp(`(${a.map(c=>c==="?"?"\\?":c).join("|")})`);let s=!i.test(e);if(!s){const c=e.indexOf(n);c>0&&!i.test(e.substring(0,c))&&(s=!0)}return s},Fy=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const a=t.split(n);let i=e;for(let s=0;s<a.length;){if(!i||typeof i!="object")return;let c,d="";for(let h=s;h<a.length;++h)if(h!==s&&(d+=n),d+=a[h],c=i[d],c!==void 0){if(["string","number","boolean"].indexOf(typeof c)>-1&&h<a.length-1)continue;s+=h-s+1;break}i=c}return i},Du=e=>e==null?void 0:e.replace("_","-"),Ez={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,a;(a=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||a.call(n,console,t)}};class mh{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||Ez,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,a,i){return i&&!this.debug?null:(Tt(t[0])&&(t[0]=`${a}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new mh(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new mh(this.logger,t)}}var _a=new mh;class Hh{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(a=>{this.observers[a]||(this.observers[a]=new Map);const i=this.observers[a].get(n)||0;this.observers[a].set(n,i+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(([i,s])=>{for(let c=0;c<s;c++)i(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,s])=>{for(let c=0;c<s;c++)i.apply(i,[t,...n])})}}class i1 extends Hh{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,a,i={}){var f,g;const s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,c=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let d;t.indexOf(".")>-1?d=t.split("."):(d=[t,n],a&&(Array.isArray(a)?d.push(...a):Tt(a)&&s?d.push(...a.split(s)):d.push(a)));const h=hh(this.data,d);return!h&&!n&&!a&&t.indexOf(".")>-1&&(t=d[0],n=d[1],a=d.slice(2).join(".")),h||!c||!Tt(a)?h:Fy((g=(f=this.data)==null?void 0:f[t])==null?void 0:g[n],a,s)}addResource(t,n,a,i,s={silent:!1}){const c=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let d=[t,n];a&&(d=d.concat(c?a.split(c):a)),t.indexOf(".")>-1&&(d=t.split("."),i=n,n=d[1]),this.addNamespaces(n),o1(this.data,d,i),s.silent||this.emit("added",t,n,a,i)}addResources(t,n,a,i={silent:!1}){for(const s in a)(Tt(a[s])||Array.isArray(a[s]))&&this.addResource(t,n,s,a[s],{silent:!0});i.silent||this.emit("added",t,n,a)}addResourceBundle(t,n,a,i,s,c={silent:!1,skipCopy:!1}){let d=[t,n];t.indexOf(".")>-1&&(d=t.split("."),i=a,a=n,n=d[1]),this.addNamespaces(n);let h=hh(this.data,d)||{};c.skipCopy||(a=JSON.parse(JSON.stringify(a))),i?cC(h,a,s):h={...h,...a},o1(this.data,d,h),c.silent||this.emit("added",t,n,a)}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(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var uC={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,a,i){return e.forEach(s=>{var c;t=((c=this.processors[s])==null?void 0:c.process(t,n,a,i))??t}),t}};const dC=Symbol("i18next/PATH_KEY");function Rz(){const e=[],t=Object.create(null);let n;return t.get=(a,i)=>{var s;return(s=n==null?void 0:n.revoke)==null||s.call(n),i===dC?e:(e.push(i),n=Proxy.revocable(a,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Vy(e,t){const{[dC]:n}=e(Rz());return n.join((t==null?void 0:t.keySeparator)??".")}const s1={},Ig=e=>!Tt(e)&&typeof e!="boolean"&&typeof e!="number";class ph extends Hh{constructor(t,n={}){super(),hz(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=_a.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const a={...n};if(t==null)return!1;const i=this.resolve(t,a);if((i==null?void 0:i.res)===void 0)return!1;const s=Ig(i.res);return!(a.returnObjects===!1&&s)}extractFromKey(t,n){let a=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const c=a&&t.indexOf(a)>-1,d=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Sz(t,a,i);if(c&&!d){const h=t.match(this.interpolator.nestingRegexp);if(h&&h.length>0)return{key:t,namespaces:Tt(s)?[s]:s};const f=t.split(a);(a!==i||a===i&&this.options.ns.indexOf(f[0])>-1)&&(s=f.shift()),t=f.join(i)}return{key:t,namespaces:Tt(s)?[s]:s}}translate(t,n,a){let i=typeof n=="object"?{...n}:n;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),t==null)return"";typeof t=="function"&&(t=Vy(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]);const s=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,c=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:d,namespaces:h}=this.extractFromKey(t[t.length-1],i),f=h[h.length-1];let g=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;g===void 0&&(g=":");const m=i.lng||this.language,b=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((m==null?void 0:m.toLowerCase())==="cimode")return b?s?{res:`${f}${g}${d}`,usedKey:d,exactUsedKey:d,usedLng:m,usedNS:f,usedParams:this.getUsedParamsDetails(i)}:`${f}${g}${d}`:s?{res:d,usedKey:d,exactUsedKey:d,usedLng:m,usedNS:f,usedParams:this.getUsedParamsDetails(i)}:d;const x=this.resolve(t,i);let w=x==null?void 0:x.res;const S=(x==null?void 0:x.usedKey)||d,E=(x==null?void 0:x.exactUsedKey)||d,T=["[object Number]","[object Function]","[object RegExp]"],C=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,M=!this.i18nFormat||this.i18nFormat.handleAsObject,O=i.count!==void 0&&!Tt(i.count),D=ph.hasDefaultValue(i),k=O?this.pluralResolver.getSuffix(m,i.count,i):"",A=i.ordinal&&O?this.pluralResolver.getSuffix(m,i.count,{ordinal:!1}):"",j=O&&!i.ordinal&&i.count===0,B=j&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${k}`]||i[`defaultValue${A}`]||i.defaultValue;let G=w;M&&!w&&D&&(G=B);const K=Ig(G),I=Object.prototype.toString.apply(G);if(M&&G&&K&&T.indexOf(I)<0&&!(Tt(C)&&Array.isArray(G))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const H=this.options.returnedObjectHandler?this.options.returnedObjectHandler(S,G,{...i,ns:h}):`key '${d} (${this.language})' returned an object instead of string.`;return s?(x.res=H,x.usedParams=this.getUsedParamsDetails(i),x):H}if(c){const H=Array.isArray(G),F=H?[]:{},Y=H?E:S;for(const _ in G)if(Object.prototype.hasOwnProperty.call(G,_)){const L=`${Y}${c}${_}`;D&&!w?F[_]=this.translate(L,{...i,defaultValue:Ig(B)?B[_]:void 0,joinArrays:!1,ns:h}):F[_]=this.translate(L,{...i,joinArrays:!1,ns:h}),F[_]===L&&(F[_]=G[_])}w=F}}else if(M&&Tt(C)&&Array.isArray(w))w=w.join(C),w&&(w=this.extendTranslation(w,t,i,a));else{let H=!1,F=!1;!this.isValidLookup(w)&&D&&(H=!0,w=B),this.isValidLookup(w)||(F=!0,w=d);const _=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&F?void 0:w,L=D&&B!==w&&this.options.updateMissing;if(F||H||L){if(this.logger.log(L?"updateKey":"missingKey",m,f,d,L?B:w),c){const P=this.resolve(d,{...i,keySeparator:!1});P&&P.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 z=[];const V=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&V&&V[0])for(let P=0;P<V.length;P++)z.push(V[P]);else this.options.saveMissingTo==="all"?z=this.languageUtils.toResolveHierarchy(i.lng||this.language):z.push(i.lng||this.language);const Q=(P,q,X)=>{var ce;const W=D&&X!==w?X:_;this.options.missingKeyHandler?this.options.missingKeyHandler(P,f,q,W,L,i):(ce=this.backendConnector)!=null&&ce.saveMissing&&this.backendConnector.saveMissing(P,f,q,W,L,i),this.emit("missingKey",P,f,q,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?z.forEach(P=>{const q=this.pluralResolver.getSuffixes(P,i);j&&i[`defaultValue${this.options.pluralSeparator}zero`]&&q.indexOf(`${this.options.pluralSeparator}zero`)<0&&q.push(`${this.options.pluralSeparator}zero`),q.forEach(X=>{Q([P],d+X,i[`defaultValue${X}`]||B)})}):Q(z,d,B))}w=this.extendTranslation(w,t,i,x,a),F&&w===d&&this.options.appendNamespaceToMissingKey&&(w=`${f}${g}${d}`),(F||H)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${f}${g}${d}`:d,H?w:void 0,i))}return s?(x.res=w,x.usedParams=this.getUsedParamsDetails(i),x):w}extendTranslation(t,n,a,i,s){var h,f;if((h=this.i18nFormat)!=null&&h.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...a},a.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!a.skipInterpolation){a.interpolation&&this.interpolator.init({...a,interpolation:{...this.options.interpolation,...a.interpolation}});const g=Tt(t)&&(((f=a==null?void 0:a.interpolation)==null?void 0:f.skipOnVariables)!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let m;if(g){const x=t.match(this.interpolator.nestingRegexp);m=x&&x.length}let b=a.replace&&!Tt(a.replace)?a.replace:a;if(this.options.interpolation.defaultVariables&&(b={...this.options.interpolation.defaultVariables,...b}),t=this.interpolator.interpolate(t,b,a.lng||this.language||i.usedLng,a),g){const x=t.match(this.interpolator.nestingRegexp),w=x&&x.length;m<w&&(a.nest=!1)}!a.lng&&i&&i.res&&(a.lng=this.language||i.usedLng),a.nest!==!1&&(t=this.interpolator.nest(t,(...x)=>(s==null?void 0:s[0])===x[0]&&!a.context?(this.logger.warn(`It seems you are nesting recursively key: ${x[0]} in key: ${n[0]}`),null):this.translate(...x,n),a)),a.interpolation&&this.interpolator.reset()}const c=a.postProcess||this.options.postProcess,d=Tt(c)?[c]:c;return t!=null&&(d!=null&&d.length)&&a.applyPostProcessor!==!1&&(t=uC.handle(d,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(a)},...a}:a,this)),t}resolve(t,n={}){let a,i,s,c,d;return Tt(t)&&(t=[t]),t.forEach(h=>{if(this.isValidLookup(a))return;const f=this.extractFromKey(h,n),g=f.key;i=g;let m=f.namespaces;this.options.fallbackNS&&(m=m.concat(this.options.fallbackNS));const b=n.count!==void 0&&!Tt(n.count),x=b&&!n.ordinal&&n.count===0,w=n.context!==void 0&&(Tt(n.context)||typeof n.context=="number")&&n.context!=="",S=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);m.forEach(E=>{var T,C;this.isValidLookup(a)||(d=E,!s1[`${S[0]}-${E}`]&&((T=this.utils)!=null&&T.hasLoadedNamespace)&&!((C=this.utils)!=null&&C.hasLoadedNamespace(d))&&(s1[`${S[0]}-${E}`]=!0,this.logger.warn(`key "${i}" for languages "${S.join(", ")}" won't get resolved as namespace "${d}" 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!!!")),S.forEach(M=>{var k;if(this.isValidLookup(a))return;c=M;const O=[g];if((k=this.i18nFormat)!=null&&k.addLookupKeys)this.i18nFormat.addLookupKeys(O,g,M,E,n);else{let A;b&&(A=this.pluralResolver.getSuffix(M,n.count,n));const j=`${this.options.pluralSeparator}zero`,B=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(b&&(n.ordinal&&A.indexOf(B)===0&&O.push(g+A.replace(B,this.options.pluralSeparator)),O.push(g+A),x&&O.push(g+j)),w){const G=`${g}${this.options.contextSeparator||"_"}${n.context}`;O.push(G),b&&(n.ordinal&&A.indexOf(B)===0&&O.push(G+A.replace(B,this.options.pluralSeparator)),O.push(G+A),x&&O.push(G+j))}}let D;for(;D=O.pop();)this.isValidLookup(a)||(s=D,a=this.getResource(M,E,D,n))}))})}),{res:a,usedKey:i,exactUsedKey:s,usedLng:c,usedNS:d}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,a,i={}){var s;return(s=this.i18nFormat)!=null&&s.getResource?this.i18nFormat.getResource(t,n,a,i):this.resourceStore.getResource(t,n,a,i)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],a=t.replace&&!Tt(t.replace);let i=a?t.replace:t;if(a&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!a){i={...i};for(const s of n)delete i[s]}return i}static hasDefaultValue(t){const n="defaultValue";for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)&&n===a.substring(0,n.length)&&t[a]!==void 0)return!0;return!1}}class l1{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=_a.create("languageUtils")}getScriptPartFromCode(t){if(t=Du(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=Du(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Tt(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(a=>{if(n)return;const i=this.formatLanguageCode(a);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(a=>{if(n)return;const i=this.getScriptPartFromCode(a);if(this.isSupportedCode(i))return n=i;const s=this.getLanguagePartFromCode(a);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(c=>{if(c===s)return c;if(!(c.indexOf("-")<0&&s.indexOf("-")<0)&&(c.indexOf("-")>0&&s.indexOf("-")<0&&c.substring(0,c.indexOf("-"))===s||c.indexOf(s)===0&&s.length>1))return c})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Tt(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let a=t[n];return a||(a=t[this.getScriptPartFromCode(n)]),a||(a=t[this.formatLanguageCode(n)]),a||(a=t[this.getLanguagePartFromCode(n)]),a||(a=t.default),a||[]}toResolveHierarchy(t,n){const a=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),i=[],s=c=>{c&&(this.isSupportedCode(c)?i.push(c):this.logger.warn(`rejecting language code not found in supportedLngs: ${c}`))};return Tt(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))):Tt(t)&&s(this.formatLanguageCode(t)),a.forEach(c=>{i.indexOf(c)<0&&s(this.formatLanguageCode(c))}),i}}const c1={zero:0,one:1,two:2,few:3,many:4,other:5},u1={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Tz{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=_a.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const a=Du(t==="dev"?"en":t),i=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:a,type:i});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let c;try{c=new Intl.PluralRules(a,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),u1;if(!t.match(/-|_/))return u1;const h=this.languageUtils.getLanguagePartFromCode(t);c=this.getRule(h,n)}return this.pluralRulesCache[s]=c,c}needsPlural(t,n={}){let a=this.getRule(t,n);return a||(a=this.getRule("dev",n)),(a==null?void 0:a.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,a={}){return this.getSuffixes(t,a).map(i=>`${n}${i}`)}getSuffixes(t,n={}){let a=this.getRule(t,n);return a||(a=this.getRule("dev",n)),a?a.resolvedOptions().pluralCategories.sort((i,s)=>c1[i]-c1[s]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(t,n,a={}){const i=this.getRule(t,a);return i?`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,a))}}const d1=(e,t,n,a=".",i=!0)=>{let s=gz(e,t,n);return!s&&i&&Tt(n)&&(s=Fy(e,n,a),s===void 0&&(s=Fy(t,n,a))),s},zg=e=>e.replace(/\$/g,"$$$$");class f1{constructor(t={}){var n;this.logger=_a.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(a=>a),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:a,useRawValueToEscape:i,prefix:s,prefixEscaped:c,suffix:d,suffixEscaped:h,formatSeparator:f,unescapeSuffix:g,unescapePrefix:m,nestingPrefix:b,nestingPrefixEscaped:x,nestingSuffix:w,nestingSuffixEscaped:S,nestingOptionsSeparator:E,maxReplaces:T,alwaysFormat:C}=t.interpolation;this.escape=n!==void 0?n:vz,this.escapeValue=a!==void 0?a:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=s?sl(s):c||"{{",this.suffix=d?sl(d):h||"}}",this.formatSeparator=f||",",this.unescapePrefix=g?"":m||"-",this.unescapeSuffix=this.unescapePrefix?"":g||"",this.nestingPrefix=b?sl(b):x||sl("$t("),this.nestingSuffix=w?sl(w):S||sl(")"),this.nestingOptionsSeparator=E||",",this.maxReplaces=T||1e3,this.alwaysFormat=C!==void 0?C:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,a)=>(n==null?void 0:n.source)===a?(n.lastIndex=0,n):new RegExp(a,"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,a,i){var x;let s,c,d;const h=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},f=w=>{if(w.indexOf(this.formatSeparator)<0){const C=d1(n,h,w,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(C,void 0,a,{...i,...n,interpolationkey:w}):C}const S=w.split(this.formatSeparator),E=S.shift().trim(),T=S.join(this.formatSeparator).trim();return this.format(d1(n,h,E,this.options.keySeparator,this.options.ignoreJSONStructure),T,a,{...i,...n,interpolationkey:E})};this.resetRegExp();const g=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,m=((x=i==null?void 0:i.interpolation)==null?void 0:x.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:w=>zg(w)},{regex:this.regexp,safeValue:w=>this.escapeValue?zg(this.escape(w)):zg(w)}].forEach(w=>{for(d=0;s=w.regex.exec(t);){const S=s[1].trim();if(c=f(S),c===void 0)if(typeof g=="function"){const T=g(t,s,i);c=Tt(T)?T:""}else if(i&&Object.prototype.hasOwnProperty.call(i,S))c="";else if(m){c=s[0];continue}else this.logger.warn(`missed to pass in variable ${S} for interpolating ${t}`),c="";else!Tt(c)&&!this.useRawValueToEscape&&(c=n1(c));const E=w.safeValue(c);if(t=t.replace(s[0],E),m?(w.regex.lastIndex+=c.length,w.regex.lastIndex-=s[0].length):w.regex.lastIndex=0,d++,d>=this.maxReplaces)break}}),t}nest(t,n,a={}){let i,s,c;const d=(h,f)=>{const g=this.nestingOptionsSeparator;if(h.indexOf(g)<0)return h;const m=h.split(new RegExp(`${g}[ ]*{`));let b=`{${m[1]}`;h=m[0],b=this.interpolate(b,c);const x=b.match(/'/g),w=b.match(/"/g);(((x==null?void 0:x.length)??0)%2===0&&!w||w.length%2!==0)&&(b=b.replace(/'/g,'"'));try{c=JSON.parse(b),f&&(c={...f,...c})}catch(S){return this.logger.warn(`failed parsing options string in nesting for key ${h}`,S),`${h}${g}${b}`}return c.defaultValue&&c.defaultValue.indexOf(this.prefix)>-1&&delete c.defaultValue,h};for(;i=this.nestingRegexp.exec(t);){let h=[];c={...a},c=c.replace&&!Tt(c.replace)?c.replace:c,c.applyPostProcessor=!1,delete c.defaultValue;const f=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(f!==-1&&(h=i[1].slice(f).split(this.formatSeparator).map(g=>g.trim()).filter(Boolean),i[1]=i[1].slice(0,f)),s=n(d.call(this,i[1].trim(),c),c),s&&i[0]===t&&!Tt(s))return s;Tt(s)||(s=n1(s)),s||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),s=""),h.length&&(s=h.reduce((g,m)=>this.format(g,m,a.lng,{...a,interpolationkey:i[1].trim()}),s.trim())),t=t.replace(i[0],s),this.regexp.lastIndex=0}return t}}const Cz=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const a=e.split("(");t=a[0].toLowerCase().trim();const i=a[1].substring(0,a[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(c=>{if(c){const[d,...h]=c.split(":"),f=h.join(":").trim().replace(/^'+|'+$/g,""),g=d.trim();n[g]||(n[g]=f),f==="false"&&(n[g]=!1),f==="true"&&(n[g]=!0),isNaN(f)||(n[g]=parseInt(f,10))}})}return{formatName:t,formatOptions:n}},h1=e=>{const t={};return(n,a,i)=>{let s=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(s={...s,[i.interpolationkey]:void 0});const c=a+JSON.stringify(s);let d=t[c];return d||(d=e(Du(a),i),t[c]=d),d(n)}},Oz=e=>(t,n,a)=>e(Du(n),a)(t);class Mz{constructor(t={}){this.logger=_a.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const a=n.cacheInBuiltFormats?h1:Oz;this.formats={number:a((i,s)=>{const c=new Intl.NumberFormat(i,{...s});return d=>c.format(d)}),currency:a((i,s)=>{const c=new Intl.NumberFormat(i,{...s,style:"currency"});return d=>c.format(d)}),datetime:a((i,s)=>{const c=new Intl.DateTimeFormat(i,{...s});return d=>c.format(d)}),relativetime:a((i,s)=>{const c=new Intl.RelativeTimeFormat(i,{...s});return d=>c.format(d,s.range||"day")}),list:a((i,s)=>{const c=new Intl.ListFormat(i,{...s});return d=>c.format(d)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=h1(n)}format(t,n,a,i={}){const s=n.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&s[0].indexOf(")")<0&&s.find(d=>d.indexOf(")")>-1)){const d=s.findIndex(h=>h.indexOf(")")>-1);s[0]=[s[0],...s.splice(1,d)].join(this.formatSeparator)}return s.reduce((d,h)=>{var m;const{formatName:f,formatOptions:g}=Cz(h);if(this.formats[f]){let b=d;try{const x=((m=i==null?void 0:i.formatParams)==null?void 0:m[i.interpolationkey])||{},w=x.locale||x.lng||i.locale||i.lng||a;b=this.formats[f](d,w,{...g,...i,...x})}catch(x){this.logger.warn(x)}return b}else this.logger.warn(`there was no format function for ${f}`);return d},t)}}const Nz=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class Az extends Hh{constructor(t,n,a,i={}){var s,c;super(),this.backend=t,this.store=n,this.services=a,this.languageUtils=a.languageUtils,this.options=i,this.logger=_a.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(c=(s=this.backend)==null?void 0:s.init)==null||c.call(s,a,i.backend,i)}queueLoad(t,n,a,i){const s={},c={},d={},h={};return t.forEach(f=>{let g=!0;n.forEach(m=>{const b=`${f}|${m}`;!a.reload&&this.store.hasResourceBundle(f,m)?this.state[b]=2:this.state[b]<0||(this.state[b]===1?c[b]===void 0&&(c[b]=!0):(this.state[b]=1,g=!1,c[b]===void 0&&(c[b]=!0),s[b]===void 0&&(s[b]=!0),h[m]===void 0&&(h[m]=!0)))}),g||(d[f]=!0)}),(Object.keys(s).length||Object.keys(c).length)&&this.queue.push({pending:c,pendingCount:Object.keys(c).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(s),pending:Object.keys(c),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(h)}}loaded(t,n,a){const i=t.split("|"),s=i[0],c=i[1];n&&this.emit("failedLoading",s,c,n),!n&&a&&this.store.addResourceBundle(s,c,a,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&a&&(this.state[t]=0);const d={};this.queue.forEach(h=>{pz(h.loaded,[s],c),Nz(h,t),n&&h.errors.push(n),h.pendingCount===0&&!h.done&&(Object.keys(h.loaded).forEach(f=>{d[f]||(d[f]={});const g=h.loaded[f];g.length&&g.forEach(m=>{d[f][m]===void 0&&(d[f][m]=!0)})}),h.done=!0,h.errors.length?h.callback(h.errors):h.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(h=>!h.done)}read(t,n,a,i=0,s=this.retryTimeout,c){if(!t.length)return c(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:a,tried:i,wait:s,callback:c});return}this.readingCalls++;const d=(f,g)=>{if(this.readingCalls--,this.waitingReads.length>0){const m=this.waitingReads.shift();this.read(m.lng,m.ns,m.fcName,m.tried,m.wait,m.callback)}if(f&&g&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,a,i+1,s*2,c)},s);return}c(f,g)},h=this.backend[a].bind(this.backend);if(h.length===2){try{const f=h(t,n);f&&typeof f.then=="function"?f.then(g=>d(null,g)).catch(d):d(null,f)}catch(f){d(f)}return}return h(t,n,d)}prepareLoading(t,n,a={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();Tt(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Tt(n)&&(n=[n]);const s=this.queueLoad(t,n,a,i);if(!s.toLoad.length)return s.pending.length||i(),null;s.toLoad.forEach(c=>{this.loadOne(c)})}load(t,n,a){this.prepareLoading(t,n,{},a)}reload(t,n,a){this.prepareLoading(t,n,{reload:!0},a)}loadOne(t,n=""){const a=t.split("|"),i=a[0],s=a[1];this.read(i,s,"read",void 0,void 0,(c,d)=>{c&&this.logger.warn(`${n}loading namespace ${s} for language ${i} failed`,c),!c&&d&&this.logger.log(`${n}loaded namespace ${s} for language ${i}`,d),this.loaded(t,c,d)})}saveMissing(t,n,a,i,s,c={},d=()=>{}){var h,f,g,m,b;if((f=(h=this.services)==null?void 0:h.utils)!=null&&f.hasLoadedNamespace&&!((m=(g=this.services)==null?void 0:g.utils)!=null&&m.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${a}" 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(!(a==null||a==="")){if((b=this.backend)!=null&&b.create){const x={...c,isUpdate:s},w=this.backend.create.bind(this.backend);if(w.length<6)try{let S;w.length===5?S=w(t,n,a,i,x):S=w(t,n,a,i),S&&typeof S.then=="function"?S.then(E=>d(null,E)).catch(d):d(null,S)}catch(S){d(S)}else w(t,n,a,i,d,x)}!t||!t[0]||this.store.addResource(t[0],n,a,i)}}}const Pg=()=>({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]),Tt(e[1])&&(t.defaultValue=e[1]),Tt(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(a=>{t[a]=n[a]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),m1=e=>{var t,n;return Tt(e.ns)&&(e.ns=[e.ns]),Tt(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Tt(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},Af=()=>{},Dz=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})},kz=e=>{var t,n,a,i,s,c,d,h,f;return!!(((a=(n=(t=e==null?void 0:e.modules)==null?void 0:t.backend)==null?void 0:n.name)==null?void 0:a.indexOf("Locize"))>0||((d=(c=(s=(i=e==null?void 0:e.modules)==null?void 0:i.backend)==null?void 0:s.constructor)==null?void 0:c.name)==null?void 0:d.indexOf("Locize"))>0||(f=(h=e==null?void 0:e.options)==null?void 0:h.backend)!=null&&f.backends&&e.options.backend.backends.some(g=>{var m,b,x;return((m=g==null?void 0:g.name)==null?void 0:m.indexOf("Locize"))>0||((x=(b=g==null?void 0:g.constructor)==null?void 0:b.name)==null?void 0:x.indexOf("Locize"))>0}))};class pu extends Hh{constructor(t={},n){if(super(),this.options=m1(t),this.services={},this.logger=_a,this.modules={external:[]},Dz(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&&(Tt(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const a=Pg();this.options={...a,...this.options,...m1(t)},this.options.interpolation={...a.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=a.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!kz(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 i=f=>f?typeof f=="function"?new f:f:null;if(!this.options.isClone){this.modules.logger?_a.init(i(this.modules.logger),this.options):_a.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:f=Mz;const g=new l1(this.options);this.store=new i1(this.options.resources,this.options);const m=this.services;m.logger=_a,m.resourceStore=this.store,m.languageUtils=g,m.pluralResolver=new Tz(g,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==a.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"),f&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(m.formatter=i(f),m.formatter.init&&m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new f1(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new Az(i(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",(x,...w)=>{this.emit(x,...w)}),this.modules.languageDetector&&(m.languageDetector=i(this.modules.languageDetector),m.languageDetector.init&&m.languageDetector.init(m,this.options.detection,this.options)),this.modules.i18nFormat&&(m.i18nFormat=i(this.modules.i18nFormat),m.i18nFormat.init&&m.i18nFormat.init(this)),this.translator=new ph(this.services,this.options),this.translator.on("*",(x,...w)=>{this.emit(x,...w)}),this.modules.external.forEach(x=>{x.init&&x.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Af),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[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(f=>{this[f]=(...g)=>this.store[f](...g)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(f=>{this[f]=(...g)=>(this.store[f](...g),this)});const d=eu(),h=()=>{const f=(g,m)=>{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),d.resolve(m),n(g,m)};if(this.languages&&!this.isInitialized)return f(null,this.t.bind(this));this.changeLanguage(this.options.lng,f)};return this.options.resources||!this.options.initAsync?h():setTimeout(h,0),d}loadResources(t,n=Af){var s,c;let a=n;const i=Tt(t)?t:this.language;if(typeof t=="function"&&(a=t),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return a();const d=[],h=f=>{if(!f||f==="cimode")return;this.services.languageUtils.toResolveHierarchy(f).forEach(m=>{m!=="cimode"&&d.indexOf(m)<0&&d.push(m)})};i?h(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(g=>h(g)),(c=(s=this.options.preload)==null?void 0:s.forEach)==null||c.call(s,f=>h(f)),this.services.backendConnector.load(d,this.options.ns,f=>{!f&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),a(f)})}else a(null)}reloadResources(t,n,a){const i=eu();return typeof t=="function"&&(a=t,t=void 0),typeof n=="function"&&(a=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),a||(a=Af),this.services.backendConnector.reload(t,n,s=>{i.resolve(),a(s)}),i}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"&&uC.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 a=this.languages[n];if(!(["cimode","dev"].indexOf(a)>-1)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;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 a=eu();this.emit("languageChanging",t);const i=d=>{this.language=d,this.languages=this.services.languageUtils.toResolveHierarchy(d),this.resolvedLanguage=void 0,this.setResolvedLanguage(d)},s=(d,h)=>{h?this.isLanguageChangingTo===t&&(i(h),this.translator.changeLanguage(h),this.isLanguageChangingTo=void 0,this.emit("languageChanged",h),this.logger.log("languageChanged",h)):this.isLanguageChangingTo=void 0,a.resolve((...f)=>this.t(...f)),n&&n(d,(...f)=>this.t(...f))},c=d=>{var g,m;!t&&!d&&this.services.languageDetector&&(d=[]);const h=Tt(d)?d:d&&d[0],f=this.store.hasLanguageSomeTranslations(h)?h:this.services.languageUtils.getBestMatchFromCodes(Tt(d)?[d]:d);f&&(this.language||i(f),this.translator.language||this.translator.changeLanguage(f),(m=(g=this.services.languageDetector)==null?void 0:g.cacheUserLanguage)==null||m.call(g,f)),this.loadResources(f,b=>{s(b,f)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(t),a}getFixedT(t,n,a){const i=(s,c,...d)=>{let h;typeof c!="object"?h=this.options.overloadTranslationOptionHandler([s,c].concat(d)):h={...c},h.lng=h.lng||i.lng,h.lngs=h.lngs||i.lngs,h.ns=h.ns||i.ns,h.keyPrefix!==""&&(h.keyPrefix=h.keyPrefix||a||i.keyPrefix);const f=this.options.keySeparator||".";let g;return h.keyPrefix&&Array.isArray(s)?g=s.map(m=>(typeof m=="function"&&(m=Vy(m,{...this.options,...c})),`${h.keyPrefix}${f}${m}`)):(typeof s=="function"&&(s=Vy(s,{...this.options,...c})),g=h.keyPrefix?`${h.keyPrefix}${f}${s}`:s),this.t(g,h)};return Tt(t)?i.lng=t:i.lngs=t,i.ns=n,i.keyPrefix=a,i}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 a=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;const c=(d,h)=>{const f=this.services.backendConnector.state[`${d}|${h}`];return f===-1||f===0||f===2};if(n.precheck){const d=n.precheck(this,c);if(d!==void 0)return d}return!!(this.hasResourceBundle(a,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(a,t)&&(!i||c(s,t)))}loadNamespaces(t,n){const a=eu();return this.options.ns?(Tt(t)&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{a.resolve(),n&&n(i)}),a):(n&&n(),Promise.resolve())}loadLanguages(t,n){const a=eu();Tt(t)&&(t=[t]);const i=this.options.preload||[],s=t.filter(c=>i.indexOf(c)<0&&this.services.languageUtils.isSupportedCode(c));return s.length?(this.options.preload=i.concat(s),this.loadResources(c=>{a.resolve(),n&&n(c)}),a):(n&&n(),Promise.resolve())}dir(t){var i,s;if(t||(t=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const c=new Intl.Locale(t);if(c&&c.getTextInfo){const d=c.getTextInfo();if(d&&d.direction)return d.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"],a=((s=this.services)==null?void 0:s.languageUtils)||new l1(Pg());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(a.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const a=new pu(t,n);return a.createInstance=pu.createInstance,a}cloneInstance(t={},n=Af){const a=t.forkResourceStore;a&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},s=new pu(i);if((t.debug!==void 0||t.prefix!==void 0)&&(s.logger=s.logger.clone(t)),["store","services","language"].forEach(d=>{s[d]=this[d]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},a){const d=Object.keys(this.store.data).reduce((h,f)=>(h[f]={...this.store.data[f]},h[f]=Object.keys(h[f]).reduce((g,m)=>(g[m]={...h[f][m]},g),h[f]),h),{});s.store=new i1(d,i),s.services.resourceStore=s.store}if(t.interpolation){const h={...Pg().interpolation,...this.options.interpolation,...t.interpolation},f={...i,interpolation:h};s.services.interpolator=new f1(f)}return s.translator=new ph(s.services,i),s.translator.on("*",(d,...h)=>{s.emit(d,...h)}),s.init(i,n),s.translator.options=i,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 qt=pu.createInstance();qt.createInstance;qt.dir;qt.init;qt.loadResources;qt.reloadResources;qt.use;qt.changeLanguage;qt.getFixedT;qt.t;qt.exists;qt.setDefaultNamespace;qt.hasLoadedNamespace;qt.loadNamespaces;qt.loadLanguages;var jz=function(t){return{type:"backend",init:function(a,i,s){},read:function(a,i,s){if(typeof t=="function"){if(t.length<3){try{var c=t(a,i);c&&typeof c.then=="function"?c.then(function(d){return s(null,d&&d.default||d)}).catch(s):s(null,c)}catch(d){s(d)}return}t(a,i,s);return}s(null,t&&t[a]&&t[a][i])}}};const Lz=(e,t,n,a)=>{var s,c,d,h;const i=[n,{code:t,...a||{}}];if((c=(s=e==null?void 0:e.services)==null?void 0:s.logger)!=null&&c.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);vs(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),(h=(d=e==null?void 0:e.services)==null?void 0:d.logger)!=null&&h.warn?e.services.logger.warn(...i):console!=null&&console.warn&&console.warn(...i)},p1={},fC=(e,t,n,a)=>{vs(n)&&p1[n]||(vs(n)&&(p1[n]=new Date),Lz(e,t,n,a))},hC=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},Yy=(e,t,n)=>{e.loadNamespaces(t,hC(e,n))},g1=(e,t,n,a)=>{if(vs(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Yy(e,n,a);n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,hC(e,a))},_z=(e,t,n={})=>!t.languages||!t.languages.length?(fC(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(a,i)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&a.services.backendConnector.backend&&a.isLanguageChangingTo&&!i(a.isLanguageChangingTo,e))return!1}}),vs=e=>typeof e=="string",Iz=e=>typeof e=="object"&&e!==null,zz=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Pz={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Uz=e=>Pz[e],Hz=e=>e.replace(zz,Uz);let qy={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Hz,transDefaultProps:void 0};const Bz=(e={})=>{qy={...qy,...e}},Fz=()=>qy;let mC;const Vz=e=>{mC=e},Yz=()=>mC,qz={type:"3rdParty",init(e){Bz(e.options.react),Vz(e)}},$z=y.createContext();class Kz{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var Ug={exports:{}},Hg={};/**
|
|
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 y1;function Gz(){if(y1)return Hg;y1=1;var e=qu();function t(m,b){return m===b&&(m!==0||1/m===1/b)||m!==m&&b!==b}var n=typeof Object.is=="function"?Object.is:t,a=e.useState,i=e.useEffect,s=e.useLayoutEffect,c=e.useDebugValue;function d(m,b){var x=b(),w=a({inst:{value:x,getSnapshot:b}}),S=w[0].inst,E=w[1];return s(function(){S.value=x,S.getSnapshot=b,h(S)&&E({inst:S})},[m,x,b]),i(function(){return h(S)&&E({inst:S}),m(function(){h(S)&&E({inst:S})})},[m]),c(x),x}function h(m){var b=m.getSnapshot;m=m.value;try{var x=b();return!n(m,x)}catch{return!0}}function f(m,b){return b()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:d;return Hg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,Hg}var v1;function pC(){return v1||(v1=1,Ug.exports=Gz()),Ug.exports}var tb=pC();const Xz=(e,t)=>vs(t)?t:Iz(t)&&vs(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,Wz={t:Xz,ready:!1},Qz=()=>()=>{},gr=(e,t={})=>{var B,G,K;const{i18n:n}=t,{i18n:a,defaultNS:i}=y.useContext($z)||{},s=n||a||Yz();s&&!s.reportNamespaces&&(s.reportNamespaces=new Kz),s||fC(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const c=y.useMemo(()=>{var I;return{...Fz(),...(I=s==null?void 0:s.options)==null?void 0:I.react,...t}},[s,t]),{useSuspense:d,keyPrefix:h}=c,f=i||((B=s==null?void 0:s.options)==null?void 0:B.defaultNS),g=vs(f)?[f]:f||["translation"],m=y.useMemo(()=>g,g);(K=(G=s==null?void 0:s.reportNamespaces)==null?void 0:G.addUsedNamespaces)==null||K.call(G,m);const b=y.useRef(0),x=y.useCallback(I=>{if(!s)return Qz;const{bindI18n:H,bindI18nStore:F}=c,Y=()=>{b.current+=1,I()};return H&&s.on(H,Y),F&&s.store.on(F,Y),()=>{H&&H.split(" ").forEach(_=>s.off(_,Y)),F&&F.split(" ").forEach(_=>s.store.off(_,Y))}},[s,c]),w=y.useRef(),S=y.useCallback(()=>{if(!s)return Wz;const I=!!(s.isInitialized||s.initializedStoreOnce)&&m.every(z=>_z(z,s,c)),H=t.lng||s.language,F=b.current,Y=w.current;if(Y&&Y.ready===I&&Y.lng===H&&Y.keyPrefix===h&&Y.revision===F)return Y;const L={t:s.getFixedT(H,c.nsMode==="fallback"?m:m[0],h),ready:I,lng:H,keyPrefix:h,revision:F};return w.current=L,L},[s,m,h,c,t.lng]),[E,T]=y.useState(0),{t:C,ready:M}=tb.useSyncExternalStore(x,S,S);y.useEffect(()=>{if(s&&!M&&!d){const I=()=>T(H=>H+1);t.lng?g1(s,t.lng,m,I):Yy(s,m,I)}},[s,t.lng,m,M,d,E]);const O=s||{},D=y.useRef(null),k=y.useRef(),A=I=>{const H=Object.getOwnPropertyDescriptors(I);H.__original&&delete H.__original;const F=Object.create(Object.getPrototypeOf(I),H);if(!Object.prototype.hasOwnProperty.call(F,"__original"))try{Object.defineProperty(F,"__original",{value:I,writable:!1,enumerable:!1,configurable:!1})}catch{}return F},j=y.useMemo(()=>{const I=O,H=I==null?void 0:I.language;let F=I;I&&(D.current&&D.current.__original===I?k.current!==H?(F=A(I),D.current=F,k.current=H):F=D.current:(F=A(I),D.current=F,k.current=H));const Y=[C,F,M];return Y.t=C,Y.i18n=F,Y.ready=M,Y},[C,O,M,O.resolvedLanguage,O.language,O.languages]);if(s&&d&&!M)throw new Promise(I=>{const H=()=>I();t.lng?g1(s,t.lng,m,H):Yy(s,m,H)});return j},Zz=Object.assign({"../../../../packages/shared/src/i18n/locales/en_US.json":()=>So(()=>import("./en_US-Cf2EOKiI.js"),[]),"../../../../packages/shared/src/i18n/locales/ja_JP.json":()=>So(()=>import("./ja_JP-s3e_OwvM.js"),[]),"../../../../packages/shared/src/i18n/locales/zh_CN.json":()=>So(()=>import("./zh_CN-6UyMkvZM.js"),[])});function Jz(e){const t=Object.entries(Zz).find(([n])=>n.endsWith(`/${e}.json`));return t==null?void 0:t[1]}function e5(){const e=navigator.language;return e.startsWith("zh")?"zh_CN":e.startsWith("ja")?"ja_JP":Hv}const t5=qt.use(jz(async(e,t)=>{const n=Jz(e);return n?(await n()).default[t]??{}:{}})).use(qz).init({lng:e5(),fallbackLng:Hv,ns:["translation"],defaultNS:"translation",interpolation:{escapeValue:!1},returnNull:!1,react:{useSuspense:!1}}),n5={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"},r5={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 a5(e){const t=e==="light"?n5:r5;return`fg=${t.foreground},bg=${t.background}`}let rh=null;function b1(e){rh=e}function o5(e,t){rh==null||rh(e,t)}let wo=null;function x1(e){wo=e}function F7(){wo!=null&&wo.isMobile&&wo.setOpenMobile(!0)}function i5(){wo!=null&&wo.isMobile&&wo.setOpenMobile(!1)}const s5=/^\/devices\/([^/]+)\/windows\/([^/]+)\/panes\/([^/]+)$/;function l5(e){try{const t=new URL(e,window.location.origin);return t.pathname+t.search+t.hash}catch{return e}}function gh(e){const t=l5(e),n=s5.exec(t);if(n){const[,a,i,s]=n;window.dispatchEvent(new CustomEvent("tmex:user-initiated-selection",{detail:{deviceId:a,windowId:i,paneId:decodeURIComponent(s)}}))}o5(t,{replace:!0}),i5()}const c5=`${typeof window<"u"&&window.location.protocol==="https:"?"wss:":"ws:"}//${typeof window<"u"?window.location.host:""}/ws`,u5={clientImpl:"tmex-fe",clientVersion:"0.1.0",maxFrameBytes:1048576,reconnectDelayMs:1e3,maxReconnectAttempts:5,heartbeatIntervalMs:5e3};class d5{constructor(t={}){We(this,"ws",null);We(this,"options");We(this,"state","IDLE");We(this,"seq",0);We(this,"chunkReassembler",new Qj);We(this,"reconnectAttempts",0);We(this,"reconnectTimer",null);We(this,"heartbeatTimer",null);We(this,"pongTimeoutTimer",null);We(this,"lastPingSentAt",0);We(this,"messageHandlers",new Set);We(this,"stateChangeHandlers",new Set);We(this,"errorHandlers",new Set);We(this,"latencyHandlers",new Set);We(this,"visibilityHandler",null);We(this,"lastVisibilityReconnectAt",0);We(this,"pendingMessages",[]);We(this,"maxPendingMessages",100);We(this,"hasConnectedOnce",!1);We(this,"latencyMs",null);this.options={...u5,...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(a){console.error("[borsh-client] State change handler error:",a)}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)}onLatency(t){return this.latencyHandlers.add(t),()=>this.latencyHandlers.delete(t)}connect(){var t,n;if(this.setupVisibilityListener(),!(((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(c5),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{this.sendHello()},this.ws.onmessage=a=>{this.handleMessage(a.data)},this.ws.onclose=()=>{this.handleClose()},this.ws.onerror=()=>{this.handleError(new Error("WebSocket error"))}}catch(a){this.handleError(a instanceof Error?a:new Error(String(a)))}}}disconnect(){this.setState("CLOSED"),this.clearTimers(),this.latencyMs=null,this.ws&&(this.ws.close(),this.ws=null),this.visibilityHandler&&(document.removeEventListener("visibilitychange",this.visibilityHandler),this.visibilityHandler=null)}handleMessage(t){if(typeof t=="string")return;const n=new Uint8Array(t);if(!Xj(n)){console.warn("[borsh-client] Received message without magic, ignoring");return}try{const a=$j(n);if(a.kind===Sk){const i=Gj(a.payload),s=this.chunkReassembler.addChunk(i);s&&this.dispatchMessage({kind:s.kind,seq:s.seq,payload:s.payload});return}if(a.kind===KD){this.handleHelloS2C(a.payload);return}if(a.kind===XD){if(this.clearPongTimeout(),this.lastPingSentAt>0){const i=Date.now()-this.lastPingSentAt;this.latencyMs=i;for(const s of this.latencyHandlers)try{s(i)}catch{}}return}this.dispatchMessage({kind:a.kind,seq:a.seq,payload:a.payload})}catch(a){console.error("[borsh-client] Failed to decode message:",a)}}dispatchMessage(t){for(const n of this.messageHandlers)try{n(t)}catch(a){console.error("[borsh-client] Message handler error:",a)}}handleHelloS2C(t){try{const n=Aa(nj,t);console.log("[borsh-client] HELLO_S2C received:",n),this.setState("READY"),this.hasConnectedOnce=!0,this.startHeartbeat(),this.sendPing(),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(a){console.error("[borsh-client] Error handler error:",a)}}sendHello(){const t={clientImpl:this.options.clientImpl,clientVersion:this.options.clientVersion,maxFrameBytes:this.options.maxFrameBytes,supportsCompression:!1,supportsDiffSnapshot:!1},n=$n(tj,t),a=this.nextSeq(),i=Jf($D,n,a);this.sendRaw(i),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 a=this.nextSeq(),i=Zj(n,t,a,{maxFrameBytes:this.options.maxFrameBytes,chunkStreamId:Jj()});if(i.totalChunks===0){const s=Jf(t,n,a);this.sendRaw(s)}else for(const s of i.chunks){const c=Kj(s,this.nextSeq());this.sendRaw(c)}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=$n(rj,t),a=this.nextSeq(),i=Jf(GD,n,a);this.sendRaw(i),this.lastPingSentAt=Date.now(),this.clearPongTimeout(),this.pongTimeoutTimer=setTimeout(()=>{var s;this.pongTimeoutTimer=null,(s=this.ws)==null||s.close()},1e4)}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(),this.clearPongTimeout()}clearPongTimeout(){this.pongTimeoutTimer&&(clearTimeout(this.pongTimeoutTimer),this.pongTimeoutTimer=null)}setupVisibilityListener(){if(this.visibilityHandler||typeof document>"u")return;const t=()=>{if(document.visibilityState==="visible")if(this.clearPongTimeout(),this.state==="CLOSED"){const n=Date.now();if(n-this.lastVisibilityReconnectAt<5e3)return;this.lastVisibilityReconnectAt=n,this.reconnectAttempts=0,this.connect()}else this.state==="RECONNECT_BACKOFF"?(this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.reconnectAttempts=0,this.connect()):this.state==="READY"&&this.sendPing()};document.addEventListener("visibilitychange",t),this.visibilityHandler=t}reconnect(){this.clearTimers(),this.latencyMs=null,this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null),this.reconnectAttempts=0,this.setState("IDLE"),this.connect()}nextSeq(){return this.seq=(this.seq+1)%4294967295,this.seq}}let Bg=null;function Sn(){return Bg||(Bg=new d5),Bg}class f5{constructor(t={}){We(this,"transactions",new Map);We(this,"outputGates",new Map);We(this,"deferredResets",new Set);We(this,"deferredHistories",new Map);We(this,"deferredFlushes",new Map);We(this,"deferredOutputs",new Map);We(this,"callbacks");We(this,"ackTimeoutMs",1500);We(this,"liveResumeTimeoutMs",2e3);We(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:a,paneId:i,selectToken:s,wantHistory:c}=t;this.cancelTransaction(n),this.clearDeferred(n);const d={state:"SELECTING",deviceId:n,windowId:a,paneId:i,selectToken:new Uint8Array(s),wantHistory:c,startedAt:Date.now()};this.transactions.set(n,d),this.startOutputBuffering(n),this.setTimer(n,()=>{this.handleTimeout(n,"ack")},this.ackTimeoutMs)}handleSwitchAck(t){const{deviceId:n,selectToken:a}=t,i=this.transactions.get(n);!i||!this.validateToken(i.selectToken,a)||i.state==="SELECTING"&&(this.clearTimer(n),i.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:a,data:i}=t,s=this.transactions.get(n);!s||!this.validateToken(s.selectToken,a)||s.state==="ACKED"&&(s.state="HISTORY_APPLIED",this.callbacks.onApplyHistory?this.callbacks.onApplyHistory(n,i,t.alternateScreen):this.deferredHistories.set(n,{data:i,alternateScreen:t.alternateScreen}),this.setTimer(n,()=>{this.handleTimeout(n,"live")},this.liveResumeTimeoutMs))}handleLiveResume(t){const{deviceId:n,selectToken:a}=t,i=this.transactions.get(n);if(!i||!this.validateToken(i.selectToken,a)||i.state!=="ACKED"&&i.state!=="HISTORY_APPLIED")return;this.clearTimer(n),i.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:a,data:i}=t,s=this.transactions.get(n);if(s&&s.paneId!==a)return;if(this.isBuffering(n)){this.bufferOutput(n,i);return}if(this.callbacks.onOutput){this.callbacks.onOutput(n,a,i);return}const c=this.deferredOutputs.get(n)??[];c.push({paneId:a,data:new Uint8Array(i)}),this.deferredOutputs.set(n,c)}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 a,i;const n=this.transactions.get(t);n&&(n.state="SELECT_FAILED",this.stopOutputBuffering(t),(i=(a=this.callbacks).onSelectFailed)==null||i.call(a,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 a=[...n.buffer];return this.outputGates.delete(t),a}bufferOutput(t,n){const a=this.outputGates.get(t);a&&(a.buffer.length>=1e3&&a.buffer.shift(),a.buffer.push(new Uint8Array(n)))}validateToken(t,n){if(t.length!==n.length)return!1;for(let a=0;a<t.length;a++)if(t[a]!==n[a])return!1;return!0}replayDeferred(t){var s,c;this.deferredResets.has(t)&&(this.deferredResets.delete(t),(c=(s=this.callbacks).onResetTerminal)==null||c.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 a=this.deferredFlushes.get(t);a&&this.callbacks.onFlushBuffer&&(this.callbacks.onFlushBuffer(t,a),this.deferredFlushes.delete(t));const i=this.deferredOutputs.get(t);if(i&&this.callbacks.onOutput){for(const d of i)this.callbacks.onOutput(t,d.paneId,d.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,a){this.clearTimer(t);const i=setTimeout(n,a);this.timers.set(t,i)}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 tu=null;function ku(e){return tu?(e&&tu.setCallbacks(e),tu):(tu=new f5(e),tu)}function h5(){return crypto.getRandomValues(new Uint8Array(16))}function gC(e){const t=$n(aj,{deviceId:e});return{kind:QD,payload:t}}function m5(e){const t=$n(ij,{deviceId:e});return{kind:JD,payload:t}}function p5(e){const t=$n(cj,{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:nk,payload:t}}function g5(e,t){const n=$n(uj,{deviceId:e,windowId:t});return{kind:rk,payload:n}}function y5(e,t,n){const a=$n(dj,{deviceId:e,name:t??null,cwd:n??null});return{kind:ak,payload:a}}function v5(e,t){const n=$n(fj,{deviceId:e,windowId:t});return{kind:ok,payload:n}}function b5(e,t){const n=$n(hj,{deviceId:e,paneId:t});return{kind:ik,payload:n}}function x5(e,t,n){const a=$n(mj,{deviceId:e,windowId:t,name:n});return{kind:sk,payload:a}}function w5(e,t){const n=$n(pj,{deviceId:e,style:t});return{kind:uk,payload:n}}function S5(e,t){const n=$n(gj,{deviceId:e,windowIds:t});return{kind:dk,payload:n}}function E5(e,t,n){const a=$n(yj,{deviceId:e,windowId:t,paneIds:n});return{kind:fk,payload:a}}function R5(e,t,n,a=!1){const i=new TextEncoder,s=$n(bj,{deviceId:e,paneId:t,encoding:2,data:i.encode(n),isComposing:a});return{kind:hk,payload:s}}function T5(e,t,n){const a=new TextEncoder,i=$n(xj,{deviceId:e,paneId:t,encoding:2,data:a.encode(n),isComposing:!1});return{kind:mk,payload:i}}function C5(e,t,n,a){const i=$n(NT,{deviceId:e,paneId:t,cols:n,rows:a});return{kind:pk,payload:i}}function O5(e,t,n,a){const i=$n(wj,{deviceId:e,paneId:t,cols:n,rows:a});return{kind:gk,payload:i}}function M5(e){const t=$n(Dj,{sessionId:e});return{kind:Ek,payload:t}}function N5(e){const t=$n(kj,{sessionId:e});return{kind:Rk,payload:t}}const w1=e=>{let t;const n=new Set,a=(f,g)=>{const m=typeof f=="function"?f(t):f;if(!Object.is(m,t)){const b=t;t=g??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(x=>x(t,b))}},i=()=>t,d={setState:a,getState:i,getInitialState:()=>h,subscribe:f=>(n.add(f),()=>n.delete(f))},h=t=e(a,i,d);return d},A5=(e=>e?w1(e):w1),D5=e=>e;function k5(e,t=D5){const n=_e.useSyncExternalStore(e.subscribe,_e.useCallback(()=>t(e.getState()),[e,t]),_e.useCallback(()=>t(e.getInitialState()),[e,t]));return _e.useDebugValue(n),n}const S1=e=>{const t=A5(e),n=a=>k5(t,a);return Object.assign(n,t),n},Bh=(e=>e?S1(e):S1),Fg={siteName:"tmex",siteUrl:typeof window<"u"?window.location.origin:"http://localhost:9663",bellThrottleSeconds:6,notificationThrottleSeconds:3,enableBrowserBellToast:!0,enableBrowserNotificationToast:!0,enableTelegramBellPush:!0,enableTelegramNotificationPush:!0,enableWeixinBellPush:!1,enableWeixinNotificationPush:!1,sshReconnectMaxRetries:2,sshReconnectDelaySeconds:10,language:Hv,updatedAt:new Date(0).toISOString()};async function E1(){const e=await fetch("/api/settings/site");if(!e.ok)throw new Error("Failed to load site settings");return(await e.json()).settings}const bs=Bh((e,t)=>({settings:null,loading:!1,fetchSettings:async()=>{const n=t().settings;if(n)return n;e({loading:!0});try{const a=await E1();return e({settings:a,loading:!1}),qt.changeLanguage(a.language),a}catch(a){return console.error("[site] failed to fetch settings:",a),e({settings:Fg,loading:!1}),qt.changeLanguage(Fg.language),Fg}},refreshSettings:async()=>{e({loading:!0});try{const n=await E1();return e({settings:n,loading:!1}),qt.changeLanguage(n.language),n}catch(n){throw console.error("[site] failed to refresh settings:",n),e({loading:!1}),n}}}));function j5(e){return typeof e.paneTitle=="string"&&e.paneTitle?e.paneTitle:typeof e.paneCurrentCommand=="string"&&e.paneCurrentCommand?e.paneCurrentCommand:typeof e.paneIndex=="number"?qt.t("terminal.paneTitle",{index:e.paneIndex}):typeof e.paneId=="string"&&e.paneId?qt.t("terminal.paneTitle",{index:e.paneId}):""}function yC(e){const t=typeof e.windowIndex=="number"?String(e.windowIndex):typeof e.windowId=="string"&&e.windowId?e.windowId:"",n=j5(e);return t&&n?qt.t("terminal.bellDescriptionWithTitle",{window:t,paneLabel:n}):t?`${qt.t("notification.window")} ${t}`:n||""}function L5(e){const t=typeof e.title=="string"&&e.title?e.title:qt.t("terminal.notificationFallbackTitle"),n=yC(e),a=typeof e.body=="string"&&e.body?e.body:typeof e.source=="string"&&e.source?qt.t("terminal.notificationSourceLabel",{source:e.source}):qt.t("terminal.notificationFallbackDetail");return{title:t,description:n?`${n}
|
|
71
|
-
${a}`:a}}const Vg=[{id:"geist-mono",displayName:"Geist Mono",cssFamily:"GeistMonoTmex",bundled:!0,isDefault:!0,files:{regular:"/fonts/GeistMonoNerdFontMono-Regular.woff2",bold:"/fonts/GeistMonoNerdFontMono-Bold.woff2"}},{id:"jetbrains-mono",displayName:"JetBrains Mono",cssFamily:"JetBrainsMonoTmex",bundled:!0,files:{regular:"/fonts/generated/jetbrains-mono/jetbrains-mono-regular.woff2",bold:"/fonts/generated/jetbrains-mono/jetbrains-mono-bold.woff2"}},{id:"fira-code",displayName:"Fira Code",cssFamily:"FiraCodeTmex",bundled:!0,files:{regular:"/fonts/generated/fira-code/fira-code-regular.woff2",bold:"/fonts/generated/fira-code/fira-code-bold.woff2"}},{id:"blex-mono",displayName:"Blex Mono (IBM Plex Mono)",cssFamily:"BlexMonoTmex",bundled:!0,files:{regular:"/fonts/generated/blex-mono/blex-mono-regular.woff2",bold:"/fonts/generated/blex-mono/blex-mono-bold.woff2"}},{id:"noto-sans-mono",displayName:"Noto Sans Mono",cssFamily:"NotoSansMTmex",bundled:!0,files:{regular:"/fonts/generated/noto-sans-mono/noto-sans-mono-regular.woff2",bold:"/fonts/generated/noto-sans-mono/noto-sans-mono-bold.woff2"}},{id:"zed-mono",displayName:"Zed Mono",cssFamily:"ZedMonoTmex",bundled:!0,files:{regular:"/fonts/generated/zed-mono/zed-mono-regular.woff2",bold:"/fonts/generated/zed-mono/zed-mono-bold.woff2"}},{id:"victor-mono",displayName:"Victor Mono",cssFamily:"VictorMonoTmex",bundled:!0,files:{regular:"/fonts/generated/victor-mono/victor-mono-regular.woff2",bold:"/fonts/generated/victor-mono/victor-mono-bold.woff2"}}],vC="geist-mono";function _5(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var s;const c=h=>h===null?null:JSON.parse(h,void 0),d=(s=n.getItem(i))!=null?s:null;return d instanceof Promise?d.then(c):c(d)},setItem:(i,s)=>n.setItem(i,JSON.stringify(s,void 0)),removeItem:i=>n.removeItem(i)}}const $y=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(a){return $y(a)(n)},catch(a){return this}}}catch(n){return{then(a){return this},catch(a){return $y(a)(n)}}}},I5=(e,t)=>(n,a,i)=>{let s={storage:_5(()=>window.localStorage),partialize:E=>E,version:0,merge:(E,T)=>({...T,...E}),...t},c=!1,d=0;const h=new Set,f=new Set;let g=s.storage;if(!g)return e((...E)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...E)},a,i);const m=()=>{const E=s.partialize({...a()});return g.setItem(s.name,{state:E,version:s.version})},b=i.setState;i.setState=(E,T)=>(b(E,T),m());const x=e((...E)=>(n(...E),m()),a,i);i.getInitialState=()=>x;let w;const S=()=>{var E,T;if(!g)return;const C=++d;c=!1,h.forEach(O=>{var D;return O((D=a())!=null?D:x)});const M=((T=s.onRehydrateStorage)==null?void 0:T.call(s,(E=a())!=null?E:x))||void 0;return $y(g.getItem.bind(g))(s.name).then(O=>{if(O)if(typeof O.version=="number"&&O.version!==s.version){if(s.migrate){const D=s.migrate(O.state,O.version);return D instanceof Promise?D.then(k=>[!0,k]):[!0,D]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,O.state];return[!1,void 0]}).then(O=>{var D;if(C!==d)return;const[k,A]=O;if(w=s.merge(A,(D=a())!=null?D:x),n(w,!0),k)return m()}).then(()=>{C===d&&(M==null||M(w,void 0),w=a(),c=!0,f.forEach(O=>O(w)))}).catch(O=>{C===d&&(M==null||M(void 0,O))})};return i.persist={setOptions:E=>{s={...s,...E},E.storage&&(g=E.storage)},clearStorage:()=>{g==null||g.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>S(),hasHydrated:()=>c,onHydrate:E=>(h.add(E),()=>{h.delete(E)}),onFinishHydration:E=>(f.add(E),()=>{f.delete(E)})},s.skipHydration||S(),w||x},bC=I5,z5=13,P5=1.2,Fr=Bh()(bC(e=>({sidebarCollapsed:!1,sidebarTab:"panes",inputMode:"direct",editorSendWithEnter:!0,theme:"dark",keyboardBehaviorMode:"follow",editorHistory:[],editorDrafts:{},terminalFontSize:z5,terminalLineHeight:P5,terminalFontId:vC,setSidebarCollapsed:t=>e({sidebarCollapsed:t}),setSidebarTab:t=>e({sidebarTab:t}),setInputMode:t=>e({inputMode:t}),setKeyboardBehaviorMode:t=>e({keyboardBehaviorMode:t}),setEditorSendWithEnter:t=>e({editorSendWithEnter:t}),setTheme:t=>e({theme:t}),setTerminalFontSize:t=>e({terminalFontSize:t}),setTerminalLineHeight:t=>e({terminalLineHeight:t}),setTerminalFontId:t=>e({terminalFontId:t}),addEditorHistory:t=>e(n=>({editorHistory:[t,...n.editorHistory.slice(0,49)]})),setEditorDraft:(t,n)=>e(a=>({editorDrafts:{...a.editorDrafts,[t]:n}})),removeEditorDraft:t=>e(n=>{if(!(t in n.editorDrafts))return n;const a={...n.editorDrafts};return delete a[t],{editorDrafts:a}})}),{name:"tmex-ui",partialize:e=>({sidebarCollapsed:e.sidebarCollapsed,inputMode:e.inputMode,editorSendWithEnter:e.editorSendWithEnter,theme:e.theme,keyboardBehaviorMode:e.keyboardBehaviorMode,editorHistory:e.editorHistory,editorDrafts:e.editorDrafts,terminalFontSize:e.terminalFontSize,terminalLineHeight:e.terminalLineHeight,terminalFontId:e.terminalFontId}),merge:(e,t)=>{const{sidebarTab:n,...a}=e??{};return{...t,...a}}})),U5=500,R1=new Map,Yg=new Map;function xC(e){const t=Date.now(),n=R1.get(e);return n!==void 0&&t-n<U5?!0:(R1.set(e,t),!1)}let T1=!1;function qg(e){const t=a5(Fr.getState().theme),n=w5(e,t);Sn().send(n.kind,n.payload)}function $g(e,t){if(typeof e!="number"||typeof t!="number")return null;const n=Math.max(2,Math.floor(e)),a=Math.max(2,Math.floor(t));return{cols:n,rows:a}}function H5(e,t){if(T1)return;T1=!0;const n=Sn(),a=s=>{const c=t().selectedPanes[s];!c||ku().getTransaction(s)||t().selectPane(s,c.windowId,c.paneId)};n.onStateChange(s=>{e(c=>({connectionState:s,hasConnectedOnce:s==="READY"?!0:c.hasConnectedOnce,wsLatencyMs:s==="READY"?c.wsLatencyMs:null}))}),n.onMessage(s=>{const c=ku();switch(s.kind){case ZD:{const d=Aa(oj,s.payload);e(h=>({deviceConnected:{...h.deviceConnected,[d.deviceId]:!0},deviceErrors:{...h.deviceErrors,[d.deviceId]:void 0},deviceReconnecting:{...h.deviceReconnecting,[d.deviceId]:void 0}})),qg(d.deviceId),a(d.deviceId);return}case ek:{const d=Aa(sj,s.payload);c.cleanup(d.deviceId),e(h=>({deviceConnected:{...h.deviceConnected,[d.deviceId]:!1}}));return}case tk:{const d=tL(s.payload);B5(e,d),d.type==="reconnected"&&(qg(d.deviceId),a(d.deviceId));return}case ck:{const d=aL(s.payload);e(h=>({snapshots:{...h.snapshots,[d.deviceId]:d}}));return}case lk:{const d=nL(s.payload);F5(e,d);return}case xk:{const d=Aa(Tj,s.payload);c.dispatch({type:"SWITCH_ACK",deviceId:d.deviceId,selectToken:d.selectToken});return}case vk:{const d=Aa(Ej,s.payload),h=new TextDecoder().decode(d.data);c.dispatch({type:"HISTORY",deviceId:d.deviceId,selectToken:d.selectToken,data:h,alternateScreen:d.alternateScreen});return}case wk:{const d=Aa(Cj,s.payload);c.dispatch({type:"LIVE_RESUME",deviceId:d.deviceId,selectToken:d.selectToken});return}case yk:{const d=Aa(Sj,s.payload);c.dispatch({type:"OUTPUT",deviceId:d.deviceId,paneId:d.paneId,data:d.data});return}case bk:{const d=Aa(Rj,s.payload);if(document.visibilityState!=="visible")return;const h=t().selectedPanes[d.deviceId];if(!h||h.paneId!==d.paneId)return;navigator.clipboard.writeText(d.text).then(()=>{cn.success(qt.t("terminal.copied"))},f=>{console.warn("[tmux] clipboard write failed:",f)});return}case WD:return}}),n.onError(s=>{console.error("[tmux] borsh ws error:",s)}),n.onLatency(s=>{e({wsLatencyMs:s})}),n.onStateChange(s=>{if(s!=="READY")return;const c=t().connectedDevices;for(const d of c){if(xC(d))continue;const h=gC(d);n.send(h.kind,h.payload)}});let i=Fr.getState().theme;Fr.subscribe(s=>{if(s.theme===i)return;i=s.theme;const c=t();for(const d of c.connectedDevices)c.deviceConnected[d]&&qg(d)})}function B5(e,t){if(t.type==="error"){const n=t.message??"Device Error",a=t.errorType??"unknown";if(a==="reconnecting"){e(i=>({deviceReconnecting:{...i.deviceReconnecting,[t.deviceId]:{message:n,at:Date.now()}}}));return}e(i=>{const s=i.deviceErrors[t.deviceId];return(!s||s.type!==a)&&cn.error(n),{deviceErrors:{...i.deviceErrors,[t.deviceId]:{message:n,type:a,rawMessage:t.rawMessage,at:Date.now()}},deviceReconnecting:{...i.deviceReconnecting,[t.deviceId]:void 0}}});return}if(t.type==="disconnected"){ku().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 F5(e,t){if(t.type==="bell"){console.log("[tmex] bell",t.data);const n=bs.getState().settings;if((n==null?void 0:n.enableBrowserBellToast)===!1)return;const a=t.data??{},i=qt.t("terminal.bellNotification"),s=yC(a),c=typeof a.paneUrl=="string"?a.paneUrl:void 0;cn(i,{description:s||qt.t("terminal.bellFallback"),action:c?{label:"Open",onClick:()=>{gh(c)}}:void 0})}if(t.type==="notification"){console.log("[tmex] notification",t.data);const n=bs.getState().settings;if((n==null?void 0:n.enableBrowserNotificationToast)===!1)return;const a=t.data??{},{title:i,description:s}=L5(a),c=typeof a.paneUrl=="string"?a.paneUrl:void 0;cn(i,{description:s,action:c?{label:"Open",onClick:()=>{gh(c)}}:void 0})}if(t.type==="pane-active"){const n=t.data;n!=null&&n.windowId&&(n!=null&&n.paneId)&&e(a=>({activePaneFromEvent:{...a.activePaneFromEvent,[t.deviceId]:{windowId:n.windowId,paneId:n.paneId}}}))}}const mn=Bh((e,t)=>({connectionState:"IDLE",hasConnectedOnce:!1,wsLatencyMs:null,snapshots:{},connectedDevices:new Set,deviceConnected:{},deviceErrors:{},deviceReconnecting:{},selectedPanes:{},activePaneFromEvent:{},pendingCreateWindowAt:{},ensureSocketConnected(){H5(e,t),Sn().connect()},connectDevice(n){if(!n||(e(i=>{const s=new Set(i.connectedDevices);return s.add(n),{connectedDevices:s}}),t().ensureSocketConnected(),xC(n)))return;const a=gC(n);Sn().send(a.kind,a.payload)},disconnectDevice(n){if(!n)return;e(i=>{const s=new Set(i.connectedDevices);return s.delete(n),{connectedDevices:s}}),ku().cleanup(n);const a=m5(n);Sn().send(a.kind,a.payload)},clearDeviceError(n){e(a=>({deviceErrors:{...a.deviceErrors,[n]:void 0},deviceReconnecting:{...a.deviceReconnecting,[n]:void 0}}))},hydrateDeviceErrors(n){e(a=>{const i={...a.deviceErrors};for(const s of n)i[s.deviceId]||!s.lastError||!s.lastErrorType||(i[s.deviceId]={message:s.lastError,type:s.lastErrorType,at:0});return{deviceErrors:i}})},selectPane(n,a,i,s){if(!n||!a||!i)return;e(g=>({selectedPanes:{...g.selectedPanes,[n]:{windowId:a,paneId:i}}}));const c=h5(),d=!0;ku().dispatch({type:"SELECT_START",deviceId:n,windowId:a,paneId:i,selectToken:c,wantHistory:d});const h=$g(s==null?void 0:s.cols,s==null?void 0:s.rows)??Yg.get(n)??null,f=p5({deviceId:n,windowId:a,paneId:i,selectToken:c,wantHistory:d,cols:h==null?void 0:h.cols,rows:h==null?void 0:h.rows});Sn().send(f.kind,f.payload)},selectWindow(n,a){if(!n||!a)return;const i=g5(n,a);Sn().send(i.kind,i.payload)},sendInput(n,a,i,s=!1){if(!n||!a)return;const c=R5(n,a,i,s);Sn().send(c.kind,c.payload)},resizePane(n,a,i,s){if(!n||!a)return;const c=$g(i,s);c&&Yg.set(n,{...c,at:Date.now()});const d=C5(n,a,i,s);Sn().send(d.kind,d.payload)},syncPaneSize(n,a,i,s){if(!n||!a)return;const c=$g(i,s);c&&Yg.set(n,{...c,at:Date.now()});const d=O5(n,a,i,s);Sn().send(d.kind,d.payload)},paste(n,a,i){if(!n||!a)return;const s=T5(n,a,i);Sn().send(s.kind,s.payload)},createWindow(n,a,i){if(!n)return;const s=y5(n,a,i);Sn().send(s.kind,s.payload),e(c=>({pendingCreateWindowAt:{...c.pendingCreateWindowAt,[n]:Date.now()}}))},clearPendingCreateWindow(n){n&&e(a=>{if(a.pendingCreateWindowAt[n]===void 0)return a;const i={...a.pendingCreateWindowAt};return delete i[n],{pendingCreateWindowAt:i}})},closeWindow(n,a){if(!n||!a)return;const i=v5(n,a);Sn().send(i.kind,i.payload)},closePane(n,a){if(!n||!a)return;const i=b5(n,a);Sn().send(i.kind,i.payload)},renameWindow(n,a,i){if(!n||!a)return;const s=x5(n,a,i);Sn().send(s.kind,s.payload)},reorderWindows(n,a){if(!n||a.length===0)return;e(s=>{const c=s.snapshots[n],d=c==null?void 0:c.session;if(!d)return{};const h=new Map(d.windows.map(m=>[m.id,m])),f=a.map(m=>h.get(m)).filter(m=>m!==void 0),g=d.windows.filter(m=>!a.includes(m.id));return{snapshots:{...s.snapshots,[n]:{...c,session:{...d,windows:[...f,...g]}}}}});const i=S5(n,a);Sn().send(i.kind,i.payload)},reorderPanes(n,a,i){if(!n||!a||i.length===0)return;e(c=>{const d=c.snapshots[n],h=d==null?void 0:d.session;if(!h)return{};const f=h.windows.map(g=>{if(g.id!==a)return g;const m=new Map(g.panes.map(w=>[w.id,w])),b=i.map(w=>m.get(w)).filter(w=>w!==void 0),x=g.panes.filter(w=>!i.includes(w.id));return{...g,panes:[...b,...x]}});return{snapshots:{...c.snapshots,[n]:{...d,session:{...h,windows:f}}}}});const s=E5(n,a,i);Sn().send(s.kind,s.payload)}}));/**
|
|
72
|
-
* @license lucide-react v0.564.0 - ISC
|
|
73
|
-
*
|
|
74
|
-
* This source code is licensed under the ISC license.
|
|
75
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
-
*/const wC=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();/**
|
|
77
|
-
* @license lucide-react v0.564.0 - ISC
|
|
78
|
-
*
|
|
79
|
-
* This source code is licensed under the ISC license.
|
|
80
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/const V5=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
82
|
-
* @license lucide-react v0.564.0 - ISC
|
|
83
|
-
*
|
|
84
|
-
* This source code is licensed under the ISC license.
|
|
85
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/const Y5=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());/**
|
|
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 C1=e=>{const t=Y5(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
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
|
-
*/var q5={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"};/**
|
|
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 $5=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
|
|
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 K5=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:i="",children:s,iconNode:c,...d},h)=>y.createElement("svg",{ref:h,...q5,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:wC("lucide",i),...!s&&!$5(d)&&{"aria-hidden":"true"},...d},[...c.map(([f,g])=>y.createElement(f,g)),...Array.isArray(s)?s:[s]]));/**
|
|
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
|
-
*/const Zt=(e,t)=>{const n=y.forwardRef(({className:a,...i},s)=>y.createElement(K5,{ref:s,iconNode:t,className:wC(`lucide-${V5(C1(e))}`,`lucide-${e}`,a),...i}));return n.displayName=C1(e),n};/**
|
|
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 G5=[["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"}]],X5=Zt("activity",G5);/**
|
|
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 W5=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Q5=Zt("arrow-left",W5);/**
|
|
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 Z5=[["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"}]],J5=Zt("bell",Z5);/**
|
|
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 eP=[["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"}]],nb=Zt("bot",eP);/**
|
|
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 tP=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],nP=Zt("check",tP);/**
|
|
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 rP=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],SC=Zt("chevron-down",rP);/**
|
|
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 aP=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],EC=Zt("chevron-right",aP);/**
|
|
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 oP=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],iP=Zt("chevron-up",oP);/**
|
|
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 sP=[["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"}]],lP=Zt("circle-alert",sP);/**
|
|
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 cP=[["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"}]],RC=Zt("ellipsis-vertical",cP);/**
|
|
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 uP=[["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"}]],dP=Zt("ellipsis",uP);/**
|
|
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 fP=[["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"}]],hP=Zt("folder-closed",fP);/**
|
|
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 mP=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],TC=Zt("folder-open",mP);/**
|
|
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 pP=[["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"}]],gP=Zt("globe",pP);/**
|
|
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 yP=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],rb=Zt("grip-vertical",yP);/**
|
|
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 vP=[["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"}]],bP=Zt("history",vP);/**
|
|
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 xP=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ul=Zt("loader-circle",xP);/**
|
|
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 wP=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],SP=Zt("menu",wP);/**
|
|
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 EP=[["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"}]],CC=Zt("monitor",EP);/**
|
|
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 RP=[["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"}]],TP=Zt("moon",RP);/**
|
|
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 CP=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],OP=Zt("panel-left",CP);/**
|
|
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 MP=[["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"}]],NP=Zt("panels-top-left",MP);/**
|
|
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 AP=[["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"}]],ab=Zt("pencil",AP);/**
|
|
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 DP=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ob=Zt("plus",DP);/**
|
|
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 kP=[["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"}]],jP=Zt("power-off",kP);/**
|
|
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 LP=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],_P=Zt("power",LP);/**
|
|
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 IP=[["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"}]],zP=Zt("radar",IP);/**
|
|
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 PP=[["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"}]],OC=Zt("refresh-ccw",PP);/**
|
|
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 UP=[["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"}]],HP=Zt("settings",UP);/**
|
|
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 BP=[["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"}]],FP=Zt("sparkles",BP);/**
|
|
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 VP=[["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"}]],YP=Zt("sun",VP);/**
|
|
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 qP=[["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"}]],MC=Zt("trash-2",qP);/**
|
|
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 $P=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Hl=Zt("x",$P);function KP(e){return e==="WS_CONNECTING"||e==="HELLO_NEGOTIATING"||e==="RECONNECT_BACKOFF"||e==="CLOSED"}function GP(){const{t:e}=gr(),t=mn(m=>m.connectionState),n=mn(m=>m.hasConnectedOnce),[a,i]=y.useState("hidden"),s=y.useRef(a);s.current=a;const c=KP(t);y.useEffect(()=>{c&&(s.current==="hidden"||s.current==="exiting")?(i("entering"),requestAnimationFrame(()=>{requestAnimationFrame(()=>{i("visible")})})):!c&&s.current==="visible"&&i("exiting")},[c]);const d=()=>{s.current==="exiting"&&i("hidden")};if(a==="hidden")return null;const h=t==="CLOSED",f=!n&&!h,g={bottom:"calc(1rem + env(safe-area-inset-bottom, 0px))",transition:a==="exiting"?"transform 300ms ease-in, opacity 300ms ease-in":"transform 300ms ease-out, opacity 300ms ease-out",transform:a==="visible"?"translateY(0)":a==="exiting"?"translateY(20px) scale(0.8)":"translateY(20px)",opacity:a==="visible"?1:0};return h?R.jsxs("div",{className:"fixed z-50 right-4 flex items-center rounded-full bg-background border border-border shadow-lg px-3 py-2 gap-2 text-sm text-destructive cursor-pointer",style:g,onTransitionEnd:d,onClick:()=>Sn().reconnect(),children:[R.jsx(OC,{className:"size-4"}),R.jsx("span",{children:e("websocket.reconnect")})]}):f?R.jsx("div",{className:"fixed z-50 right-4 flex items-center rounded-full bg-background border border-border shadow-lg p-2.5 text-sm text-muted-foreground",style:g,onTransitionEnd:d,children:R.jsx(Ul,{className:"size-4 animate-spin"})}):R.jsxs("div",{className:"fixed z-50 right-4 flex items-center rounded-full bg-background border border-border shadow-lg px-3 py-2 gap-2 text-sm text-muted-foreground",style:g,onTransitionEnd:d,children:[R.jsx(Ul,{className:"size-4 animate-spin"}),R.jsx("span",{children:e("websocket.reconnecting")})]})}function Ky(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const gu={};function la(e,t,n,a,i){let s={...Gy(e,gu)};return t&&(s=uu(s,t)),n&&(s=uu(s,n)),a&&(s=uu(s,a)),i&&(s=uu(s,i)),s}function XP(e){if(e.length===0)return gu;if(e.length===1)return Gy(e[0],gu);let t={...Gy(e[0],gu)};for(let n=1;n<e.length;n+=1)t=uu(t,e[n]);return t}function uu(e,t){return NC(t)?t(e):WP(e,t)}function WP(e,t){if(!t)return e;for(const n in t){const a=t[n];switch(n){case"style":{e[n]=Ky(e.style,a);break}case"className":{e[n]=AC(e.className,a);break}default:QP(n,a)?e[n]=ZP(e[n],a):e[n]=a}}return e}function QP(e,t){const n=e.charCodeAt(0),a=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&a===110&&i>=65&&i<=90&&(typeof t=="function"||typeof t>"u")}function NC(e){return typeof e=="function"}function Gy(e,t){return NC(e)?e(t):e??gu}function ZP(e,t){return t?e?n=>{if(JP(n)){const i=n;Xy(i);const s=t(i);return i.baseUIHandlerPrevented||e==null||e(i),s}const a=t(n);return e==null||e(n),a}:t:e}function Xy(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function AC(e,t){return t?e?t+" "+e:t:e}function JP(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function pn(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(a=>n.searchParams.append("args[]",a)),`Base UI error #${e}; visit ${n} for the full message.`}const O1={};function Kn(e,t){const n=y.useRef(O1);return n.current===O1&&(n.current=e(t)),n}function xa(e,t,n,a){const i=Kn(DC).current;return t3(i,e,t,n,a)&&kC(i,[e,t,n,a]),i.callback}function e3(e){const t=Kn(DC).current;return n3(t,e)&&kC(t,e),t.callback}function DC(){return{callback:null,cleanup:null,refs:[]}}function t3(e,t,n,a,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==a||e.refs[3]!==i}function n3(e,t){return e.refs.length!==t.length||e.refs.some((n,a)=>n!==t[a])}function kC(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 a=Array(t.length).fill(null);for(let i=0;i<t.length;i+=1){const s=t[i];if(s!=null)switch(typeof s){case"function":{const c=s(n);typeof c=="function"&&(a[i]=c);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let i=0;i<t.length;i+=1){const s=t[i];if(s!=null)switch(typeof s){case"function":{const c=a[i];typeof c=="function"?c():s(null);break}case"object":{s.current=null;break}}}}}}}const r3=parseInt(y.version,10);function ib(e){return r3>=e}function M1(e){if(!y.isValidElement(e))return null;const t=e,n=t.props;return(ib(19)?n==null?void 0:n.ref:t.ref)??null}function a3(e,t){const n={};for(const a in e){const i=e[a];if(t!=null&&t.hasOwnProperty(a)){const s=t[a](i);s!=null&&Object.assign(n,s);continue}i===!0?n[`data-${a.toLowerCase()}`]="":i&&(n[`data-${a.toLowerCase()}`]=i.toString())}return n}function o3(e,t){return typeof e=="function"?e(t):e}function i3(e,t){return typeof e=="function"?e(t):e}function Or(){}const Si=Object.freeze([]),En=Object.freeze({}),s3=500,l3=500,c3={style:{transition:"none"}},u3="data-base-ui-click-trigger",jC={fallbackAxisSide:"none"},LC={fallbackAxisSide:"end"},d3={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Mt(e,t,n={}){const a=t.render,i=f3(t,n);if(n.enabled===!1)return null;const s=n.state??En;return m3(e,a,i,s)}function f3(e,t={}){const{className:n,style:a,render:i}=e,{state:s=En,ref:c,props:d,stateAttributesMapping:h,enabled:f=!0}=t,g=f?o3(n,s):void 0,m=f?i3(a,s):void 0,b=f?a3(s,h):En,x=f?Ky(b,Array.isArray(d)?XP(d):d)??En:En;return typeof document<"u"&&(f?Array.isArray(c)?x.ref=e3([x.ref,M1(i),...c]):x.ref=xa(x.ref,M1(i),c):xa(null,null)),f?(g!==void 0&&(x.className=AC(x.className,g)),m!==void 0&&(x.style=Ky(x.style,m)),x):En}const h3=Symbol.for("react.lazy");function m3(e,t,n,a){if(t){if(typeof t=="function")return t(n,a);const i=la(n,t.props);i.ref=n.ref;let s=t;return(s==null?void 0:s.$$typeof)===h3&&(s=y.Children.toArray(t)[0]),y.cloneElement(s,i)}if(e&&typeof e=="string")return p3(e,n);throw new Error(pn(8))}function p3(e,t){return e==="button"?y.createElement("button",{type:"button",...t,key:t.key}):e==="img"?y.createElement("img",{alt:"",...t,key:t.key}):y.createElement(e,t)}function Fh(e){return Mt(e.defaultTagName??"div",e,e)}function _C(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=_C(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function IC(){for(var e,t,n=0,a="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=_C(e))&&(a&&(a+=" "),a+=t);return a}const N1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,A1=IC,Vh=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return A1(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=t,c=Object.keys(i).map(f=>{const g=n==null?void 0:n[f],m=s==null?void 0:s[f];if(g===null)return null;const b=N1(g)||N1(m);return i[f][b]}),d=n&&Object.entries(n).reduce((f,g)=>{let[m,b]=g;return b===void 0||(f[m]=b),f},{}),h=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((f,g)=>{let{class:m,className:b,...x}=g;return Object.entries(x).every(w=>{let[S,E]=w;return Array.isArray(E)?E.includes({...s,...d}[S]):{...s,...d}[S]===E})?[...f,m,b]:f},[]);return A1(e,c,h,n==null?void 0:n.class,n==null?void 0:n.className)},Kg=768;function g3(){const[e,t]=y.useState(void 0);return y.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Kg-1}px)`),a=()=>{t(window.innerWidth<Kg)};return n.addEventListener("change",a),t(window.innerWidth<Kg),()=>n.removeEventListener("change",a)},[]),!!e}const y3=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},v3=(e,t)=>({classGroupId:e,validator:t}),zC=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),yh="-",D1=[],b3="arbitrary..",x3=e=>{const t=S3(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return w3(c);const d=c.split(yh),h=d[0]===""&&d.length>1?1:0;return PC(d,h,t)},getConflictingClassGroupIds:(c,d)=>{if(d){const h=a[c],f=n[c];return h?f?y3(f,h):h:f||D1}return n[c]||D1}}},PC=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],s=n.nextPart.get(i);if(s){const f=PC(e,t+1,s);if(f)return f}const c=n.validators;if(c===null)return;const d=t===0?e.join(yh):e.slice(t).join(yh),h=c.length;for(let f=0;f<h;f++){const g=c[f];if(g.validator(d))return g.classGroupId}},w3=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?b3+a:void 0})(),S3=e=>{const{theme:t,classGroups:n}=e;return E3(n,t)},E3=(e,t)=>{const n=zC();for(const a in e){const i=e[a];sb(i,n,a,t)}return n},sb=(e,t,n,a)=>{const i=e.length;for(let s=0;s<i;s++){const c=e[s];R3(c,t,n,a)}},R3=(e,t,n,a)=>{if(typeof e=="string"){T3(e,t,n);return}if(typeof e=="function"){C3(e,t,n,a);return}O3(e,t,n,a)},T3=(e,t,n)=>{const a=e===""?t:UC(t,e);a.classGroupId=n},C3=(e,t,n,a)=>{if(M3(e)){sb(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(v3(n,e))},O3=(e,t,n,a)=>{const i=Object.entries(e),s=i.length;for(let c=0;c<s;c++){const[d,h]=i[c];sb(h,UC(t,d),n,a)}},UC=(e,t)=>{let n=e;const a=t.split(yh),i=a.length;for(let s=0;s<i;s++){const c=a[s];let d=n.nextPart.get(c);d||(d=zC(),n.nextPart.set(c,d)),n=d}return n},M3=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,N3=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const i=(s,c)=>{n[s]=c,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(s){let c=n[s];if(c!==void 0)return c;if((c=a[s])!==void 0)return i(s,c),c},set(s,c){s in n?n[s]=c:i(s,c)}}},Wy="!",k1=":",A3=[],j1=(e,t,n,a,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:i}),D3=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=i=>{const s=[];let c=0,d=0,h=0,f;const g=i.length;for(let S=0;S<g;S++){const E=i[S];if(c===0&&d===0){if(E===k1){s.push(i.slice(h,S)),h=S+1;continue}if(E==="/"){f=S;continue}}E==="["?c++:E==="]"?c--:E==="("?d++:E===")"&&d--}const m=s.length===0?i:i.slice(h);let b=m,x=!1;m.endsWith(Wy)?(b=m.slice(0,-1),x=!0):m.startsWith(Wy)&&(b=m.slice(1),x=!0);const w=f&&f>h?f-h:void 0;return j1(s,x,b,w)};if(t){const i=t+k1,s=a;a=c=>c.startsWith(i)?s(c.slice(i.length)):j1(A3,!1,c,void 0,!0)}if(n){const i=a;a=s=>n({className:s,parseClassName:i})}return a},k3=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let i=[];for(let s=0;s<n.length;s++){const c=n[s],d=c[0]==="[",h=t.has(c);d||h?(i.length>0&&(i.sort(),a.push(...i),i=[]),a.push(c)):i.push(c)}return i.length>0&&(i.sort(),a.push(...i)),a}},j3=e=>({cache:N3(e.cacheSize),parseClassName:D3(e),sortModifiers:k3(e),...x3(e)}),L3=/\s+/,_3=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:i,sortModifiers:s}=t,c=[],d=e.trim().split(L3);let h="";for(let f=d.length-1;f>=0;f-=1){const g=d[f],{isExternal:m,modifiers:b,hasImportantModifier:x,baseClassName:w,maybePostfixModifierPosition:S}=n(g);if(m){h=g+(h.length>0?" "+h:h);continue}let E=!!S,T=a(E?w.substring(0,S):w);if(!T){if(!E){h=g+(h.length>0?" "+h:h);continue}if(T=a(w),!T){h=g+(h.length>0?" "+h:h);continue}E=!1}const C=b.length===0?"":b.length===1?b[0]:s(b).join(":"),M=x?C+Wy:C,O=M+T;if(c.indexOf(O)>-1)continue;c.push(O);const D=i(T,E);for(let k=0;k<D.length;++k){const A=D[k];c.push(M+A)}h=g+(h.length>0?" "+h:h)}return h},I3=(...e)=>{let t=0,n,a,i="";for(;t<e.length;)(n=e[t++])&&(a=HC(n))&&(i&&(i+=" "),i+=a);return i},HC=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=HC(e[a]))&&(n&&(n+=" "),n+=t);return n},z3=(e,...t)=>{let n,a,i,s;const c=h=>{const f=t.reduce((g,m)=>m(g),e());return n=j3(f),a=n.cache.get,i=n.cache.set,s=d,d(h)},d=h=>{const f=a(h);if(f)return f;const g=_3(h,n);return i(h,g),g};return s=c,(...h)=>s(I3(...h))},P3=[],Vn=e=>{const t=n=>n[e]||P3;return t.isThemeGetter=!0,t},BC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,FC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,U3=/^\d+\/\d+$/,H3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,B3=/\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$/,F3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,V3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Y3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ll=e=>U3.test(e),zt=e=>!!e&&!Number.isNaN(Number(e)),Zo=e=>!!e&&Number.isInteger(Number(e)),Gg=e=>e.endsWith("%")&&zt(e.slice(0,-1)),fo=e=>H3.test(e),q3=()=>!0,$3=e=>B3.test(e)&&!F3.test(e),VC=()=>!1,K3=e=>V3.test(e),G3=e=>Y3.test(e),X3=e=>!rt(e)&&!at(e),W3=e=>Wl(e,$C,VC),rt=e=>BC.test(e),Qi=e=>Wl(e,KC,$3),Xg=e=>Wl(e,t4,zt),L1=e=>Wl(e,YC,VC),Q3=e=>Wl(e,qC,G3),Df=e=>Wl(e,GC,K3),at=e=>FC.test(e),nu=e=>Ql(e,KC),Z3=e=>Ql(e,n4),_1=e=>Ql(e,YC),J3=e=>Ql(e,$C),e4=e=>Ql(e,qC),kf=e=>Ql(e,GC,!0),Wl=(e,t,n)=>{const a=BC.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},Ql=(e,t,n=!1)=>{const a=FC.exec(e);return a?a[1]?t(a[1]):n:!1},YC=e=>e==="position"||e==="percentage",qC=e=>e==="image"||e==="url",$C=e=>e==="length"||e==="size"||e==="bg-size",KC=e=>e==="length",t4=e=>e==="number",n4=e=>e==="family-name",GC=e=>e==="shadow",r4=()=>{const e=Vn("color"),t=Vn("font"),n=Vn("text"),a=Vn("font-weight"),i=Vn("tracking"),s=Vn("leading"),c=Vn("breakpoint"),d=Vn("container"),h=Vn("spacing"),f=Vn("radius"),g=Vn("shadow"),m=Vn("inset-shadow"),b=Vn("text-shadow"),x=Vn("drop-shadow"),w=Vn("blur"),S=Vn("perspective"),E=Vn("aspect"),T=Vn("ease"),C=Vn("animate"),M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...O(),at,rt],k=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],j=()=>[at,rt,h],B=()=>[ll,"full","auto",...j()],G=()=>[Zo,"none","subgrid",at,rt],K=()=>["auto",{span:["full",Zo,at,rt]},Zo,at,rt],I=()=>[Zo,"auto",at,rt],H=()=>["auto","min","max","fr",at,rt],F=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],_=()=>["auto",...j()],L=()=>[ll,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],z=()=>[e,at,rt],V=()=>[...O(),_1,L1,{position:[at,rt]}],Q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],P=()=>["auto","cover","contain",J3,W3,{size:[at,rt]}],q=()=>[Gg,nu,Qi],X=()=>["","none","full",f,at,rt],W=()=>["",zt,nu,Qi],ce=()=>["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"],de=()=>[zt,Gg,_1,L1],ve=()=>["","none",w,at,rt],Se=()=>["none",zt,at,rt],Me=()=>["none",zt,at,rt],ke=()=>[zt,at,rt],J=()=>[ll,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[fo],breakpoint:[fo],color:[q3],container:[fo],"drop-shadow":[fo],ease:["in","out","in-out"],font:[X3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[fo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[fo],shadow:[fo],spacing:["px",zt],text:[fo],"text-shadow":[fo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ll,rt,at,E]}],container:["container"],columns:[{columns:[zt,rt,at,d]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"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:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:B()}],"inset-x":[{"inset-x":B()}],"inset-y":[{"inset-y":B()}],start:[{start:B()}],end:[{end:B()}],top:[{top:B()}],right:[{right:B()}],bottom:[{bottom:B()}],left:[{left:B()}],visibility:["visible","invisible","collapse"],z:[{z:[Zo,"auto",at,rt]}],basis:[{basis:[ll,"full","auto",d,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[zt,ll,"auto","initial","none",rt]}],grow:[{grow:["",zt,at,rt]}],shrink:[{shrink:["",zt,at,rt]}],order:[{order:[Zo,"first","last","none",at,rt]}],"grid-cols":[{"grid-cols":G()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":G()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:_()}],mx:[{mx:_()}],my:[{my:_()}],ms:[{ms:_()}],me:[{me:_()}],mt:[{mt:_()}],mr:[{mr:_()}],mb:[{mb:_()}],ml:[{ml:_()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:L()}],w:[{w:[d,"screen",...L()]}],"min-w":[{"min-w":[d,"screen","none",...L()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[c]},...L()]}],h:[{h:["screen","lh",...L()]}],"min-h":[{"min-h":["screen","lh","none",...L()]}],"max-h":[{"max-h":["screen","lh",...L()]}],"font-size":[{text:["base",n,nu,Qi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,at,Xg]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Gg,rt]}],"font-family":[{font:[Z3,rt,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:[i,at,rt]}],"line-clamp":[{"line-clamp":[zt,"none",at,Xg]}],leading:[{leading:[s,...j()]}],"list-image":[{"list-image":["none",at,rt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",at,rt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[zt,"from-font","auto",at,Qi]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[zt,"auto",at,rt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",at,rt]}],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",at,rt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:V()}],"bg-repeat":[{bg:Q()}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Zo,at,rt],radial:["",at,rt],conic:[Zo,at,rt]},e4,Q3]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:q()}],"gradient-via-pos":[{via:q()}],"gradient-to-pos":[{to:q()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:W()}],"border-w-x":[{"border-x":W()}],"border-w-y":[{"border-y":W()}],"border-w-s":[{"border-s":W()}],"border-w-e":[{"border-e":W()}],"border-w-t":[{"border-t":W()}],"border-w-r":[{"border-r":W()}],"border-w-b":[{"border-b":W()}],"border-w-l":[{"border-l":W()}],"divide-x":[{"divide-x":W()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":W()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ce(),"hidden","none"]}],"divide-style":[{divide:[...ce(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[zt,at,rt]}],"outline-w":[{outline:["",zt,nu,Qi]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",g,kf,Df]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",m,kf,Df]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[zt,Qi]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":W()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",b,kf,Df]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[zt,at,rt]}],"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":[zt]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[at,rt]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"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":O()}],"mask-image-conic-pos":[{"mask-conic":[zt]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:V()}],"mask-repeat":[{mask:Q()}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",at,rt]}],filter:[{filter:["","none",at,rt]}],blur:[{blur:ve()}],brightness:[{brightness:[zt,at,rt]}],contrast:[{contrast:[zt,at,rt]}],"drop-shadow":[{"drop-shadow":["","none",x,kf,Df]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",zt,at,rt]}],"hue-rotate":[{"hue-rotate":[zt,at,rt]}],invert:[{invert:["",zt,at,rt]}],saturate:[{saturate:[zt,at,rt]}],sepia:[{sepia:["",zt,at,rt]}],"backdrop-filter":[{"backdrop-filter":["","none",at,rt]}],"backdrop-blur":[{"backdrop-blur":ve()}],"backdrop-brightness":[{"backdrop-brightness":[zt,at,rt]}],"backdrop-contrast":[{"backdrop-contrast":[zt,at,rt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",zt,at,rt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[zt,at,rt]}],"backdrop-invert":[{"backdrop-invert":["",zt,at,rt]}],"backdrop-opacity":[{"backdrop-opacity":[zt,at,rt]}],"backdrop-saturate":[{"backdrop-saturate":[zt,at,rt]}],"backdrop-sepia":[{"backdrop-sepia":["",zt,at,rt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",at,rt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[zt,"initial",at,rt]}],ease:[{ease:["linear","initial",T,at,rt]}],delay:[{delay:[zt,at,rt]}],animate:[{animate:["none",C,at,rt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,at,rt]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:Me()}],"scale-x":[{"scale-x":Me()}],"scale-y":[{"scale-y":Me()}],"scale-z":[{"scale-z":Me()}],"scale-3d":["scale-3d"],skew:[{skew:ke()}],"skew-x":[{"skew-x":ke()}],"skew-y":[{"skew-y":ke()}],transform:[{transform:[at,rt,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:J()}],"translate-x":[{"translate-x":J()}],"translate-y":[{"translate-y":J()}],"translate-z":[{"translate-z":J()}],"translate-none":["translate-none"],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"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",at,rt]}],"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":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",at,rt]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[zt,nu,Qi,Xg]}],stroke:[{stroke:["none",...z()]}],"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"]}},a4=z3(r4);function Le(...e){return a4(IC(e))}function Yh(){return typeof window<"u"}function Ri(e){return lb(e)?(e.nodeName||"").toLowerCase():"#document"}function kn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ya(e){var t;return(t=(lb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function lb(e){return Yh()?e instanceof Node||e instanceof kn(e).Node:!1}function tn(e){return Yh()?e instanceof Element||e instanceof kn(e).Element:!1}function vn(e){return Yh()?e instanceof HTMLElement||e instanceof kn(e).HTMLElement:!1}function Qy(e){return!Yh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof kn(e).ShadowRoot}const o4=new Set(["inline","contents"]);function Ti(e){const{overflow:t,overflowX:n,overflowY:a,display:i}=Vr(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&!o4.has(i)}const i4=new Set(["table","td","th"]);function s4(e){return i4.has(Ri(e))}const l4=[":popover-open",":modal"];function qh(e){return l4.some(t=>{try{return e.matches(t)}catch{return!1}})}const c4=["transform","translate","scale","rotate","perspective"],u4=["transform","translate","scale","rotate","perspective","filter"],d4=["paint","layout","strict","content"];function cb(e){const t=$h(),n=tn(e)?Vr(e):e;return c4.some(a=>n[a]?n[a]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||u4.some(a=>(n.willChange||"").includes(a))||d4.some(a=>(n.contain||"").includes(a))}function f4(e){let t=Ha(e);for(;vn(t)&&!za(t);){if(cb(t))return t;if(qh(t))return null;t=Ha(t)}return null}function $h(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const h4=new Set(["html","body","#document"]);function za(e){return h4.has(Ri(e))}function Vr(e){return kn(e).getComputedStyle(e)}function Kh(e){return tn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ha(e){if(Ri(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Qy(e)&&e.host||Ya(e);return Qy(t)?t.host:t}function XC(e){const t=Ha(e);return za(t)?e.ownerDocument?e.ownerDocument.body:e.body:vn(t)&&Ti(t)?t:XC(t)}function vi(e,t,n){var a;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=XC(e),s=i===((a=e.ownerDocument)==null?void 0:a.body),c=kn(i);if(s){const d=Zy(c);return t.concat(c,c.visualViewport||[],Ti(i)?i:[],d&&n?vi(d):[])}return t.concat(i,vi(i,[],n))}function Zy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Wg=Uv[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],m4=Wg&&Wg!==y.useLayoutEffect?Wg:e=>e();function He(e){const t=Kn(p4).current;return t.next=e,m4(t.effect),t.trampoline}function p4(){const e={next:void 0,callback:g4,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function g4(){}const y4={...Uv},v4=()=>{},Ue=typeof document<"u"?y.useLayoutEffect:v4,WC=y.createContext(void 0);function ub(e=!1){const t=y.useContext(WC);if(t===void 0&&!e)throw new Error(pn(16));return t}function b4(e){const{focusableWhenDisabled:t,disabled:n,composite:a=!1,tabIndex:i=0,isNativeButton:s}=e,c=a&&t!==!1,d=a&&t===!1;return{props:y.useMemo(()=>{const f={onKeyDown(g){n&&t&&g.key!=="Tab"&&g.preventDefault()}};return a||(f.tabIndex=i,!s&&n&&(f.tabIndex=t?i:-1)),(s&&(t||c)||!s&&n)&&(f["aria-disabled"]=n),s&&(!t||d)&&(f.disabled=n),f},[a,n,t,c,d,s,i])}}function To(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:a=0,native:i=!0}=e,s=y.useRef(null),c=ub(!0)!==void 0,d=He(()=>{const b=s.current;return!!((b==null?void 0:b.tagName)==="A"&&(b!=null&&b.href))}),{props:h}=b4({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:a,isNativeButton:i}),f=y.useCallback(()=>{const b=s.current;x4(b)&&c&&t&&h.disabled===void 0&&b.disabled&&(b.disabled=!1)},[t,h.disabled,c]);Ue(f,[f]);const g=y.useCallback((b={})=>{const{onClick:x,onMouseDown:w,onKeyUp:S,onKeyDown:E,onPointerDown:T,...C}=b;return la({type:i?"button":void 0,onClick(O){if(t){O.preventDefault();return}x==null||x(O)},onMouseDown(O){t||w==null||w(O)},onKeyDown(O){if(t||(Xy(O),E==null||E(O)),O.baseUIHandlerPrevented)return;const D=O.target===O.currentTarget&&!i&&!d()&&!t,k=O.key==="Enter",A=O.key===" ";D&&((A||k)&&O.preventDefault(),k&&(x==null||x(O)))},onKeyUp(O){t||(Xy(O),S==null||S(O)),!O.baseUIHandlerPrevented&&O.target===O.currentTarget&&!i&&!t&&O.key===" "&&(x==null||x(O))},onPointerDown(O){if(t){O.preventDefault();return}T==null||T(O)}},i?void 0:{role:"button"},h,C)},[t,h,i,d]),m=He(b=>{s.current=b,f()});return{getButtonProps:g,buttonRef:m}}function x4(e){return vn(e)&&e.tagName==="BUTTON"}const w4=y.forwardRef(function(t,n){const{render:a,className:i,disabled:s=!1,focusableWhenDisabled:c=!1,nativeButton:d=!0,...h}=t,{getButtonProps:f,buttonRef:g}=To({disabled:s,focusableWhenDisabled:c,native:d});return Mt("button",t,{state:{disabled:s},ref:[n,g],props:[h,f]})}),S4=Vh("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 Rn({className:e,variant:t="default",size:n="default",...a}){return R.jsx(w4,{"data-slot":"button",className:Le(S4({variant:t,size:n,className:e})),...a})}let I1=(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 E4={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},db={valid(e){return e===null?null:e?{[I1.valid]:""}:{[I1.invalid]:""}}},R4=y.createContext({invalid:void 0,name:void 0,validityData:{state:E4,errors:[],error:"",value:"",initialValue:null},setValidityData:Or,disabled:void 0,touched:!1,setTouched:Or,dirty:!1,setDirty:Or,filled:!1,setFilled:Or,focused:!1,setFocused:Or,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=En)=>e,getInputValidationProps:(e=En)=>e,inputRef:{current:null},commit:async()=>{}}});function Zl(e=!0){const t=y.useContext(R4);if(t.setValidityData===Or&&!e)throw new Error(pn(28));return t}const T4=y.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Or,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function fb(){return y.useContext(T4)}let z1=0;function C4(e,t="mui"){const[n,a]=y.useState(e),i=e||n;return y.useEffect(()=>{n==null&&(z1+=1,a(`${t}-${z1}`))},[n,t]),i}const P1=y4.useId;function Os(e,t){if(P1!==void 0){const n=P1();return e??(t?`${t}-${n}`:n)}return C4(e,t)}function Ra(e){return Os(e,"base-ui")}const O4=y.createContext({controlId:void 0,registerControlId:Or,labelId:void 0,setLabelId:Or,messageIds:[],setMessageIds:Or,getDescriptionProps:e=>e});function Gh(){return y.useContext(O4)}const M4=[];function Xh(e){y.useEffect(e,M4)}const ru=0;class Ba{constructor(){We(this,"currentId",ru);We(this,"clear",()=>{this.currentId!==ru&&(clearTimeout(this.currentId),this.currentId=ru)});We(this,"disposeEffect",()=>this.clear)}static create(){return new Ba}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ru,n()},t)}isStarted(){return this.currentId!==ru}}function Dn(){const e=Kn(Ba.create).current;return Xh(e.disposeEffect),e}function N4(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function Yt(e){return(e==null?void 0:e.ownerDocument)||document}const Jl=typeof navigator<"u",Qg=D4(),QC=j4(),ZC=k4(),Wh=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),JC=Qg.platform==="MacIntel"&&Qg.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Qg.platform),eO=Jl&&/apple/i.test(navigator.vendor),Jy=Jl&&/android/i.test(QC)||/android/i.test(ZC),A4=Jl&&QC.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,tO=ZC.includes("jsdom/");function D4(){if(!Jl)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 k4(){if(!Jl)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function j4(){if(!Jl)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}const ev="data-base-ui-focusable",nO="active",rO="selected",aO="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",bi="ArrowLeft",xi="ArrowRight",hb="ArrowUp",Zu="ArrowDown";function Hr(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 Ot(e,t){var a;if(!e||!t)return!1;const n=(a=t.getRootNode)==null?void 0:a.call(t);if(e.contains(t))return!0;if(n&&Qy(n)){let i=t;for(;i;){if(e===i)return!0;i=i.parentNode||i.host}}return!1}function vh(e,t){if(!tn(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,a]of t.entries())if(Ot(a,n))return!a.hasAttribute("data-trigger-disabled");return!1}function pr(e){return"composedPath"in e?e.composedPath()[0]:e.target}function ga(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 L4(e){return e.matches("html,body")}function Qh(e){return vn(e)&&e.matches(aO)}function tv(e){return e?e.getAttribute("role")==="combobox"&&Qh(e):!1}function _4(e){if(!e||tO)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function ju(e){return e?e.hasAttribute(ev)?e:e.querySelector(`[${ev}]`)||e:null}function ms(e,t,n=!0){return e.filter(i=>{var s;return i.parentId===t&&(!n||((s=i.context)==null?void 0:s.open))}).flatMap(i=>[i,...ms(e,i.id,n)])}function U1(e,t){var i;let n=[],a=(i=e.find(s=>s.id===t))==null?void 0:i.parentId;for(;a;){const s=e.find(c=>c.id===a);a=s==null?void 0:s.parentId,s&&(n=n.concat(s))}return n}function cr(e){e.preventDefault(),e.stopPropagation()}function I4(e){return"nativeEvent"in e}function oO(e){return e.pointerType===""&&e.isTrusted?!0:Jy&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function iO(e){return tO?!1:!Jy&&e.width===0&&e.height===0||Jy&&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 xs(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function sO(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const z4=["top","right","bottom","left"],Bl=Math.min,Br=Math.max,bh=Math.round,ml=Math.floor,Pa=e=>({x:e,y:e}),P4={left:"right",right:"left",bottom:"top",top:"bottom"},U4={start:"end",end:"start"};function nv(e,t,n){return Br(e,Bl(t,n))}function Ro(e,t){return typeof e=="function"?e(t):e}function Mr(e){return e.split("-")[0]}function Ci(e){return e.split("-")[1]}function mb(e){return e==="x"?"y":"x"}function pb(e){return e==="y"?"height":"width"}const H4=new Set(["top","bottom"]);function oa(e){return H4.has(Mr(e))?"y":"x"}function gb(e){return mb(oa(e))}function B4(e,t,n){n===void 0&&(n=!1);const a=Ci(e),i=gb(e),s=pb(i);let c=i==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=xh(c)),[c,xh(c)]}function F4(e){const t=xh(e);return[rv(e),t,rv(t)]}function rv(e){return e.replace(/start|end/g,t=>U4[t])}const H1=["left","right"],B1=["right","left"],V4=["top","bottom"],Y4=["bottom","top"];function q4(e,t,n){switch(e){case"top":case"bottom":return n?t?B1:H1:t?H1:B1;case"left":case"right":return t?V4:Y4;default:return[]}}function $4(e,t,n,a){const i=Ci(e);let s=q4(Mr(e),n==="start",a);return i&&(s=s.map(c=>c+"-"+i),t&&(s=s.concat(s.map(rv)))),s}function xh(e){return e.replace(/left|right|bottom|top/g,t=>P4[t])}function K4(e){return{top:0,right:0,bottom:0,left:0,...e}}function lO(e){return typeof e!="number"?K4(e):{top:e,right:e,bottom:e,left:e}}function wh(e){const{x:t,y:n,width:a,height:i}=e;return{width:a,height:i,top:n,left:t,right:t+a,bottom:n+i,x:t,y:n}}function jf(e,t,n){return Math.floor(e/t)!==n}function gl(e,t){return t<0||t>=e.current.length}function ah(e,t){return ar(e,{disabledIndices:t})}function av(e,t){return ar(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ar(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:a,amount:i=1}={}){let s=t;do s+=n?-i:i;while(s>=0&&s<=e.current.length-1&&wi(e,s,a));return s}function cO(e,{event:t,orientation:n,loopFocus:a,rtl:i,cols:s,disabledIndices:c,minIndex:d,maxIndex:h,prevIndex:f,stopEvent:g=!1}){let m=f;const b=[],x={};let w=!1;{let T=null,C=-1;e.current.forEach((M,O)=>{if(M==null)return;const D=M.closest('[role="row"]');D&&(w=!0),(D!==T||C===-1)&&(T=D,C+=1,b[C]=[]),b[C].push(O),x[O]=C})}const S=w&&b.length>0&&b.some(T=>T.length!==s);function E(T){if(!S||f===-1)return;const C=x[f];if(C==null)return;const M=b[C].indexOf(f);let O=T==="up"?C-1:C+1;a&&(O<0?O=b.length-1:O>=b.length&&(O=0));const D=new Set;for(;O>=0&&O<b.length&&!D.has(O);){D.add(O);const k=b[O];if(k.length===0){O=T==="up"?O-1:O+1;continue}const A=Math.min(M,k.length-1);for(let j=A;j>=0;j-=1){const B=k[j];if(!wi(e,B,c))return B}O=T==="up"?O-1:O+1,a&&(O<0?O=b.length-1:O>=b.length&&(O=0))}}if(t.key===hb){const T=E("up");if(T!==void 0)g&&cr(t),m=T;else{if(g&&cr(t),f===-1)m=h;else if(m=ar(e,{startingIndex:m,amount:s,decrement:!0,disabledIndices:c}),a&&(f-s<d||m<0)){const C=f%s,M=h%s,O=h-(M-C);M===C?m=h:m=M>C?O:O-s}gl(e,m)&&(m=f)}}if(t.key===Zu){const T=E("down");T!==void 0?(g&&cr(t),m=T):(g&&cr(t),f===-1?m=d:(m=ar(e,{startingIndex:f,amount:s,disabledIndices:c}),a&&f+s>h&&(m=ar(e,{startingIndex:f%s-s,amount:s,disabledIndices:c}))),gl(e,m)&&(m=f))}if(n==="both"){const T=ml(f/s);t.key===(i?bi:xi)&&(g&&cr(t),f%s!==s-1?(m=ar(e,{startingIndex:f,disabledIndices:c}),a&&jf(m,s,T)&&(m=ar(e,{startingIndex:f-f%s-1,disabledIndices:c}))):a&&(m=ar(e,{startingIndex:f-f%s-1,disabledIndices:c})),jf(m,s,T)&&(m=f)),t.key===(i?xi:bi)&&(g&&cr(t),f%s!==0?(m=ar(e,{startingIndex:f,decrement:!0,disabledIndices:c}),a&&jf(m,s,T)&&(m=ar(e,{startingIndex:f+(s-f%s),decrement:!0,disabledIndices:c}))):a&&(m=ar(e,{startingIndex:f+(s-f%s),decrement:!0,disabledIndices:c})),jf(m,s,T)&&(m=f));const C=ml(h/s)===T;gl(e,m)&&(a&&C?m=t.key===(i?xi:bi)?h:ar(e,{startingIndex:f-f%s-1,disabledIndices:c}):m=f)}return m}function uO(e,t,n){const a=[];let i=0;return e.forEach(({width:s,height:c},d)=>{let h=!1;for(n&&(i=0);!h;){const f=[];for(let g=0;g<s;g+=1)for(let m=0;m<c;m+=1)f.push(i+g+m*t);i%t+s<=t&&f.every(g=>a[g]==null)?(f.forEach(g=>{a[g]=d}),h=!0):i+=1}}),[...a]}function dO(e,t,n,a,i){if(e===-1)return-1;const s=n.indexOf(e),c=t[e];switch(i){case"tl":return s;case"tr":return c?s+c.width-1:s;case"bl":return c?s+(c.height-1)*a:s;case"br":return n.lastIndexOf(e);default:return-1}}function fO(e,t){return t.flatMap((n,a)=>e.includes(n)?[a]:[])}function wi(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const a=e.current[t];return a?a.hasAttribute("disabled")||a.getAttribute("aria-disabled")==="true":!1}/*!
|
|
277
|
-
* tabbable 6.4.0
|
|
278
|
-
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
279
|
-
*/var G4=["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] *)"],Sh=G4.join(","),hO=typeof Element>"u",Fl=hO?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Eh=!hO&&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},Rh=function(t,n){var a;n===void 0&&(n=!0);var i=t==null||(a=t.getAttribute)===null||a===void 0?void 0:a.call(t,"inert"),s=i===""||i==="true",c=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Rh(t.parentNode));return c},X4=function(t){var n,a=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return a===""||a==="true"},mO=function(t,n,a){if(Rh(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Sh));return n&&Fl.call(t,Sh)&&i.unshift(t),i=i.filter(a),i},Th=function(t,n,a){for(var i=[],s=Array.from(t);s.length;){var c=s.shift();if(!Rh(c,!1))if(c.tagName==="SLOT"){var d=c.assignedElements(),h=d.length?d:c.children,f=Th(h,!0,a);a.flatten?i.push.apply(i,f):i.push({scopeParent:c,candidates:f})}else{var g=Fl.call(c,Sh);g&&a.filter(c)&&(n||!t.includes(c))&&i.push(c);var m=c.shadowRoot||typeof a.getShadowRoot=="function"&&a.getShadowRoot(c),b=!Rh(m,!1)&&(!a.shadowRootFilter||a.shadowRootFilter(c));if(m&&b){var x=Th(m===!0?c.children:m.children,!0,a);a.flatten?i.push.apply(i,x):i.push({scopeParent:c,candidates:x})}else s.unshift.apply(s,c.children)}}return i},pO=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},gO=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||X4(t))&&!pO(t)?0:t.tabIndex},W4=function(t,n){var a=gO(t);return a<0&&n&&!pO(t)?0:a},Q4=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},yO=function(t){return t.tagName==="INPUT"},Z4=function(t){return yO(t)&&t.type==="hidden"},J4=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(a){return a.tagName==="SUMMARY"});return n},eU=function(t,n){for(var a=0;a<t.length;a++)if(t[a].checked&&t[a].form===n)return t[a]},tU=function(t){if(!t.name)return!0;var n=t.form||Eh(t),a=function(d){return n.querySelectorAll('input[type="radio"][name="'+d+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=a(window.CSS.escape(t.name));else try{i=a(t.name)}catch(c){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",c.message),!1}var s=eU(i,t.form);return!s||s===t},nU=function(t){return yO(t)&&t.type==="radio"},rU=function(t){return nU(t)&&!tU(t)},aU=function(t){var n,a=t&&Eh(t),i=(n=a)===null||n===void 0?void 0:n.host,s=!1;if(a&&a!==t){var c,d,h;for(s=!!((c=i)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(i)||t!=null&&(h=t.ownerDocument)!==null&&h!==void 0&&h.contains(t));!s&&i;){var f,g,m;a=Eh(i),i=(f=a)===null||f===void 0?void 0:f.host,s=!!((g=i)!==null&&g!==void 0&&(m=g.ownerDocument)!==null&&m!==void 0&&m.contains(i))}}return s},F1=function(t){var n=t.getBoundingClientRect(),a=n.width,i=n.height;return a===0&&i===0},oU=function(t,n){var a=n.displayCheck,i=n.getShadowRoot;if(a==="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 c=Fl.call(t,"details>summary:first-of-type"),d=c?t.parentElement:t;if(Fl.call(d,"details:not([open]) *"))return!0;if(!a||a==="full"||a==="full-native"||a==="legacy-full"){if(typeof i=="function"){for(var h=t;t;){var f=t.parentElement,g=Eh(t);if(f&&!f.shadowRoot&&i(f)===!0)return F1(t);t.assignedSlot?t=t.assignedSlot:!f&&g!==t.ownerDocument?t=g.host:t=f}t=h}if(aU(t))return!t.getClientRects().length;if(a!=="legacy-full")return!0}else if(a==="non-zero-area")return F1(t);return!1},iU=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var a=0;a<n.children.length;a++){var i=n.children.item(a);if(i.tagName==="LEGEND")return Fl.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},ov=function(t,n){return!(n.disabled||Z4(n)||oU(n,t)||J4(n)||iU(n))},iv=function(t,n){return!(rU(n)||gO(n)<0||!ov(t,n))},sU=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},vO=function(t){var n=[],a=[];return t.forEach(function(i,s){var c=!!i.scopeParent,d=c?i.scopeParent:i,h=W4(d,c),f=c?vO(i.candidates):d;h===0?c?n.push.apply(n,f):n.push(d):a.push({documentOrder:s,tabIndex:h,item:i,isScope:c,content:f})}),a.sort(Q4).reduce(function(i,s){return s.isScope?i.push.apply(i,s.content):i.push(s.content),i},[]).concat(n)},Ju=function(t,n){n=n||{};var a;return n.getShadowRoot?a=Th([t],n.includeContainer,{filter:iv.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:sU}):a=mO(t,n.includeContainer,iv.bind(null,n)),vO(a)},lU=function(t,n){n=n||{};var a;return n.getShadowRoot?a=Th([t],n.includeContainer,{filter:ov.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):a=mO(t,n.includeContainer,ov.bind(null,n)),a},bO=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Fl.call(t,Sh)===!1?!1:iv(n,t)};const ec=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function xO(e,t){const n=Ju(e,ec()),a=n.length;if(a===0)return;const i=Hr(Yt(e)),s=n.indexOf(i),c=s===-1?t===1?0:a-1:s+t;return n[c]}function yb(e){return xO(Yt(e).body,1)||e}function wO(e){return xO(Yt(e).body,-1)||e}function SO(e,t){if(!e)return null;const n=Ju(Yt(e).body,ec()),a=n.length;if(a===0)return null;const i=n.indexOf(e);if(i===-1)return null;const s=(i+t+a)%a;return n[s]}function cU(e){return SO(e,1)}function uU(e){return SO(e,-1)}function yl(e,t){const n=t||e.currentTarget,a=e.relatedTarget;return!a||!Ot(n,a)}function dU(e){Ju(e,ec()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function V1(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const a=n.dataset.tabindex;delete n.dataset.tabindex,a?n.setAttribute("tabindex",a):n.removeAttribute("tabindex")})}const Lf=null;class fU{constructor(){We(this,"callbacks",[]);We(this,"callbacksCount",0);We(this,"nextId",1);We(this,"startId",1);We(this,"isScheduled",!1);We(this,"tick",t=>{var i;this.isScheduled=!1;const n=this.callbacks,a=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,a>0)for(let s=0;s<n.length;s+=1)(i=n[s])==null||i.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 _f=new fU;class An{constructor(){We(this,"currentId",Lf);We(this,"cancel",()=>{this.currentId!==Lf&&(_f.cancel(this.currentId),this.currentId=Lf)});We(this,"disposeEffect",()=>this.cancel)}static create(){return new An}static request(t){return _f.request(t)}static cancel(t){return _f.cancel(t)}request(t){this.cancel(),this.currentId=_f.request(()=>{this.currentId=Lf,t()})}}function ed(){const e=Kn(An.create).current;return Xh(e.disposeEffect),e}function po(e){return e==null?e:"current"in e?e.current:e}let ws=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const hU={[ws.startingStyle]:""},mU={[ws.endingStyle]:""},Co={transitionStatus(e){return e==="starting"?hU:e==="ending"?mU:null}};function EO(e,t=!1,n=!0){const a=ed();return He((i,s=null)=>{a.cancel();function c(){or.flushSync(i)}const d=po(e);if(d==null)return;const h=d;if(typeof h.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)i();else{let f=function(){const m=ws.startingStyle;if(!h.hasAttribute(m)){a.request(g);return}const b=new MutationObserver(()=>{h.hasAttribute(m)||(b.disconnect(),g())});b.observe(h,{attributes:!0,attributeFilter:[m]}),s==null||s.addEventListener("abort",()=>b.disconnect(),{once:!0})},g=function(){Promise.all(h.getAnimations().map(m=>m.finished)).then(()=>{s!=null&&s.aborted||c()}).catch(()=>{const m=h.getAnimations();if(n){if(s!=null&&s.aborted)return;c()}else m.length>0&&m.some(b=>b.pending||b.playState!=="finished")&&g()})};if(t){f();return}a.request(g)}})}function Oo(e){const{enabled:t=!0,open:n,ref:a,onComplete:i}=e,s=He(i),c=EO(a,n,!1);y.useEffect(()=>{if(!t)return;const d=new AbortController;return c(s,d.signal),()=>{d.abort()}},[t,n,s,c])}function td(e,t=!1,n=!1){const[a,i]=y.useState(e&&t?"idle":void 0),[s,c]=y.useState(e);return e&&!s&&(c(!0),i("starting")),!e&&s&&a!=="ending"&&!n&&i("ending"),!e&&!s&&a==="ending"&&i(void 0),Ue(()=>{if(!e&&s&&a!=="ending"&&n){const d=An.request(()=>{i("ending")});return()=>{An.cancel(d)}}},[e,s,a,n]),Ue(()=>{if(!e||t)return;const d=An.request(()=>{i(void 0)});return()=>{An.cancel(d)}},[t,e]),Ue(()=>{if(!e||!t)return;e&&s&&a!=="idle"&&i("starting");const d=An.request(()=>{i("idle")});return()=>{An.cancel(d)}},[t,e,s,i,a]),y.useMemo(()=>({mounted:s,setMounted:c,transitionStatus:a}),[s,a])}function Vl({controlled:e,default:t,name:n,state:a="value"}){const{current:i}=y.useRef(e!==void 0),[s,c]=y.useState(t),d=i?e:s,h=y.useCallback(f=>{i||c(f)},[]);return[d,h]}function Zh(e={}){const{id:t,implicit:n=!1,controlRef:a}=e,{controlId:i,registerControlId:s}=Gh(),c=Ra(t),d=n?i:void 0,h=Kn(()=>Symbol("labelable-control")),f=y.useRef(!1),g=y.useRef(t!=null),m=He(()=>{!f.current||s===Or||(f.current=!1,s(h.current,void 0))});return Ue(()=>{if(s===Or)return;let b;if(n){const x=a==null?void 0:a.current;tn(x)&&x.closest("label")!=null?b=t??null:b=d??c}else if(t!=null)g.current=!0,b=t;else if(g.current)b=c;else{m();return}if(b===void 0){m();return}f.current=!0,s(h.current,b)},[t,a,d,s,n,c,h,m]),y.useEffect(()=>m,[m]),i??c}function vb(e){const{enabled:t=!0,value:n,id:a,name:i,controlRef:s,commit:c}=e,{formRef:d}=fb(),{invalid:h,markedDirtyRef:f,validityData:g,setValidityData:m}=Zl(),b=He(e.getValue);Ue(()=>{if(!t)return;let x=n;x===void 0&&(x=b()),g.initialValue===null&&x!==null&&m(w=>({...w,initialValue:x}))},[t,m,n,g.initialValue,b]),Ue(()=>{!t||!a||d.current.fields.set(a,{getValue:b,name:i,controlRef:s,validityData:N4(g,h),validate(x=!0){let w=n;w===void 0&&(w=b()),f.current=!0,x?or.flushSync(()=>c(w)):c(w)}})},[c,s,t,d,b,a,h,f,i,g,n]),Ue(()=>{const x=d.current.fields;return()=>{a&&x.delete(a)}},[d,a])}const wa="none",Ss="trigger-press",ur="trigger-hover",vl="trigger-focus",Jh="outside-press",yu="item-press",pU="close-press",Es="focus-out",em="escape-key",oh="list-navigation",RO="cancel-open",ih="sibling-open",gU="disabled",bb="imperative-action",yU="window-resize";function pt(e,t,n,a){let i=!1,s=!1;const c=a??En;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){s=!0},get isCanceled(){return i},get isPropagationAllowed(){return s},trigger:n,...c}}const vU=y.forwardRef(function(t,n){const{render:a,className:i,id:s,name:c,value:d,disabled:h=!1,onValueChange:f,defaultValue:g,autoFocus:m=!1,...b}=t,{state:x,name:w,disabled:S,setTouched:E,setDirty:T,validityData:C,setFocused:M,setFilled:O,validationMode:D,validation:k}=Zl(),A=S||h,j=w??c,B={...x,disabled:A},{labelId:G}=Gh(),K=Zh({id:s});Ue(()=>{var z;const L=d!=null;(z=k.inputRef.current)!=null&&z.value||L&&d!==""?O(!0):L&&d===""&&O(!1)},[k.inputRef,O,d]);const I=y.useRef(null);Ue(()=>{m&&I.current===Hr(Yt(I.current))&&M(!0)},[m,M]);const[H]=Vl({controlled:d,default:g,name:"FieldControl",state:"value"}),F=d!==void 0,Y=F?H:void 0;return vb({id:K,name:j,commit:k.commit,value:Y,getValue:()=>{var L;return(L=k.inputRef.current)==null?void 0:L.value},controlRef:k.inputRef}),Mt("input",t,{ref:[n,I],state:B,props:[{id:K,disabled:A,name:j,ref:k.inputRef,"aria-labelledby":G,autoFocus:m,...F?{value:Y}:{defaultValue:g},onChange(L){const z=L.currentTarget.value;f==null||f(z,pt(wa,L.nativeEvent)),T(z!==C.initialValue),O(z!=="")},onFocus(){M(!0)},onBlur(L){E(!0),M(!1),D==="onBlur"&&k.commit(L.currentTarget.value)},onKeyDown(L){L.currentTarget.tagName==="INPUT"&&L.key==="Enter"&&(E(!0),k.commit(L.currentTarget.value))}},k.getInputValidationProps(),b],stateAttributesMapping:db})}),bU=y.forwardRef(function(t,n){return R.jsx(vU,{ref:n,...t})});function ya({className:e,type:t,...n}){return R.jsx(bU,{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})}const TO=y.forwardRef(function(t,n){const{className:a,render:i,orientation:s="horizontal",...c}=t;return Mt("div",t,{state:{orientation:s},ref:n,props:[{role:"separator","aria-orientation":s},c]})});function xU({className:e,orientation:t="horizontal",...n}){return R.jsx(TO,{"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 xb=y.createContext(void 0);function Oi(e){const t=y.useContext(xb);if(e===!1&&t===void 0)throw new Error(pn(27));return t}let rs=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=ws.startingStyle]="startingStyle",e[e.endingStyle=ws.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),Ch=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const wU={[Ch.popupOpen]:""},SU={[Ch.popupOpen]:"",[Ch.pressed]:""},EU={[rs.open]:""},RU={[rs.closed]:""},TU={[rs.anchorHidden]:""},CO={open(e){return e?wU:null}},sv={open(e){return e?SU:null}},qa={open(e){return e?EU:RU},anchorHidden(e){return e?TU:null}},CU={...qa,...Co},wb=y.forwardRef(function(t,n){const{render:a,className:i,forceRender:s=!1,...c}=t,{store:d}=Oi(),h=d.useState("open"),f=d.useState("nested"),g=d.useState("mounted"),m=d.useState("transitionStatus");return Mt("div",t,{state:{open:h,transitionStatus:m},ref:[d.context.backdropRef,n],stateAttributesMapping:CU,props:[{role:"presentation",hidden:!g,style:{userSelect:"none",WebkitUserSelect:"none"}},c],enabled:s||!f})}),tm=y.forwardRef(function(t,n){const{render:a,className:i,disabled:s=!1,nativeButton:c=!0,...d}=t,{store:h}=Oi(),f=h.useState("open");function g(w){f&&h.setOpen(!1,pt(pU,w.nativeEvent))}const{getButtonProps:m,buttonRef:b}=To({disabled:s,native:c});return Mt("button",t,{state:{disabled:s},ref:[n,b],props:[{onClick:g},d,m]})}),Sb=y.forwardRef(function(t,n){const{render:a,className:i,id:s,...c}=t,{store:d}=Oi(),h=Ra(s);return d.useSyncedValueWithCleanup("descriptionElementId",h),Mt("p",t,{ref:n,props:[{id:h},c]})});function Zn(e){const t=Kn(OU,e).current;return t.next=e,Ue(t.effect),t}function OU(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function OO(){const e=new Map;return{emit(t,n){var a;(a=e.get(t))==null||a.forEach(i=>i(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var a;(a=e.get(t))==null||a.delete(n)}}}class Eb{constructor(){We(this,"nodesRef",{current:[]});We(this,"events",OO())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(a=>a===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const MO=y.createContext(null),NO=y.createContext(null),Mo=()=>{var e;return((e=y.useContext(MO))==null?void 0:e.id)||null},Mi=e=>{const t=y.useContext(NO);return e??t};function AO(e){const t=Os(),n=Mi(e),a=Mo();return Ue(()=>{if(!t)return;const i={id:t,parentId:a};return n==null||n.addNode(i),()=>{n==null||n.removeNode(i)}},[n,t,a]),t}function MU(e){const{children:t,id:n}=e,a=Mo();return R.jsx(MO.Provider,{value:y.useMemo(()=>({id:n,parentId:a}),[n,a]),children:t})}function NU(e){const{children:t,externalTree:n}=e,a=Kn(()=>n??new Eb).current;return R.jsx(NO.Provider,{value:a,children:t})}function Yl(e){return`data-base-ui-${e}`}function sh(e,t,n){if(n&&!xs(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const a=e();return typeof a=="number"?a:a==null?void 0:a[t]}return e==null?void 0:e[t]}const AU=y.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Ba,currentIdRef:{current:null},currentContextRef:{current:null}});function DU(e,t={open:!1}){const n="rootStore"in e?e.rootStore:e,a=n.useState("floatingId"),{open:i}=t,s=y.useContext(AU),{currentIdRef:c,delayRef:d,timeoutMs:h,initialDelayRef:f,currentContextRef:g,hasProvider:m,timeout:b}=s,[x,w]=y.useState(!1);return Ue(()=>{function S(){var E;w(!1),(E=g.current)==null||E.setIsInstantPhase(!1),c.current=null,g.current=null,d.current=f.current}if(c.current&&!i&&c.current===a){if(w(!1),h){const E=a;return b.start(h,()=>{n.select("open")||c.current&&c.current!==E||S()}),()=>{b.clear()}}S()}},[i,a,c,d,h,f,g,b,n]),Ue(()=>{if(!i)return;const S=g.current,E=c.current;b.clear(),g.current={onOpenChange:n.setOpen,setIsInstantPhase:w},c.current=a,d.current={open:0,close:sh(f.current,"close")},E!==null&&E!==a?(w(!0),S==null||S.setIsInstantPhase(!0),S==null||S.onOpenChange(!1,pt(wa))):(w(!1),S==null||S.setIsInstantPhase(!1))},[i,a,n,c,d,h,f,g,b]),Ue(()=>()=>{g.current=null},[g]),y.useMemo(()=>({hasProvider:m,delayRef:d,isInstantPhase:x}),[m,d,x])}const DO={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},nm={...DO,position:"fixed",top:0,left:0},kO={...DO,position:"absolute"},ql=y.forwardRef(function(t,n){const[a,i]=y.useState();Ue(()=>{eO&&i("button")},[]);const s={tabIndex:0,role:a};return R.jsx("span",{...t,ref:n,style:nm,"aria-hidden":a?void 0:!0,...s,"data-base-ui-focus-guard":""})});let Y1=0;function vu(e,t={}){const{preventScroll:n=!1,cancelPrevious:a=!0,sync:i=!1}=t;a&&cancelAnimationFrame(Y1);const s=()=>e==null?void 0:e.focus({preventScroll:n});i?s():Y1=requestAnimationFrame(s)}const bl={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function q1(e){return e==="inert"?bl.inert:e==="aria-hidden"?bl["aria-hidden"]:bl.none}let If=new WeakSet,zf={},Zg=0;const jO=e=>e&&(e.host||jO(e.parentNode)),kU=(e,t)=>t.map(n=>{if(e.contains(n))return n;const a=jO(n);return e.contains(a)?a:null}).filter(n=>n!=null);function jU(e,t,n,a){const i="data-base-ui-inert",s=a?"inert":n?"aria-hidden":null,c=kU(t,e),d=new Set,h=new Set(c),f=[];zf[i]||(zf[i]=new WeakMap);const g=zf[i];c.forEach(m),b(t),d.clear();function m(x){!x||d.has(x)||(d.add(x),x.parentNode&&m(x.parentNode))}function b(x){!x||h.has(x)||[].forEach.call(x.children,w=>{if(Ri(w)!=="script")if(d.has(w))b(w);else{const S=s?w.getAttribute(s):null,E=S!==null&&S!=="false",T=q1(s),C=(T.get(w)||0)+1,M=(g.get(w)||0)+1;T.set(w,C),g.set(w,M),f.push(w),C===1&&E&&If.add(w),M===1&&w.setAttribute(i,""),!E&&s&&w.setAttribute(s,s==="inert"?"":"true")}})}return Zg+=1,()=>{f.forEach(x=>{const w=q1(s),E=(w.get(x)||0)-1,T=(g.get(x)||0)-1;w.set(x,E),g.set(x,T),E||(!If.has(x)&&s&&x.removeAttribute(s),If.delete(x)),T||x.removeAttribute(i)}),Zg-=1,Zg||(bl.inert=new WeakMap,bl["aria-hidden"]=new WeakMap,bl.none=new WeakMap,If=new WeakSet,zf={})}}function LU(e,t=!1,n=!1){const a=Yt(e[0]).body;return jU(e.concat(Array.from(a.querySelectorAll("[aria-live]"))),a,t,n)}const LO=y.createContext(null),_O=()=>y.useContext(LO),_U=Yl("portal");function IO(e={}){const{ref:t,container:n,componentProps:a=En,elementProps:i}=e,s=Os(),c=_O(),d=c==null?void 0:c.portalNode,[h,f]=y.useState(null),[g,m]=y.useState(null),b=He(E=>{E!==null&&m(E)}),x=y.useRef(null);Ue(()=>{if(n===null){x.current&&(x.current=null,m(null),f(null));return}if(s==null)return;const E=(n&&(lb(n)?n:n.current))??d??document.body;if(E==null){x.current&&(x.current=null,m(null),f(null));return}x.current!==E&&(x.current=E,m(null),f(E))},[n,d,s]);const w=Mt("div",a,{ref:[t,b],props:[{id:s,[_U]:""},i]});return{portalNode:g,portalSubtree:h&&w?or.createPortal(w,h):null}}const Rb=y.forwardRef(function(t,n){const{children:a,container:i,className:s,render:c,renderGuards:d,...h}=t,{portalNode:f,portalSubtree:g}=IO({container:i,ref:n,componentProps:t,elementProps:h}),m=y.useRef(null),b=y.useRef(null),x=y.useRef(null),w=y.useRef(null),[S,E]=y.useState(null),T=S==null?void 0:S.modal,C=S==null?void 0:S.open,M=typeof d=="boolean"?d:!!S&&!S.modal&&S.open&&!!f;y.useEffect(()=>{if(!f||T)return;function D(k){f&&k.relatedTarget&&yl(k)&&(k.type==="focusin"?V1:dU)(f)}return f.addEventListener("focusin",D,!0),f.addEventListener("focusout",D,!0),()=>{f.removeEventListener("focusin",D,!0),f.removeEventListener("focusout",D,!0)}},[f,T]),y.useEffect(()=>{!f||C||V1(f)},[C,f]);const O=y.useMemo(()=>({beforeOutsideRef:m,afterOutsideRef:b,beforeInsideRef:x,afterInsideRef:w,portalNode:f,setFocusManagerState:E}),[f]);return R.jsxs(y.Fragment,{children:[g,R.jsxs(LO.Provider,{value:O,children:[M&&f&&R.jsx(ql,{"data-type":"outside",ref:m,onFocus:D=>{var k;if(yl(D,f))(k=x.current)==null||k.focus();else{const A=S?S.domReference:null,j=wO(A);j==null||j.focus()}}}),M&&f&&R.jsx("span",{"aria-owns":f.id,style:d3}),f&&or.createPortal(a,f),M&&f&&R.jsx(ql,{"data-type":"outside",ref:b,onFocus:D=>{var k;if(yl(D,f))(k=w.current)==null||k.focus();else{const A=S?S.domReference:null,j=yb(A);j==null||j.focus(),S!=null&&S.closeOnFocusOut&&(S==null||S.onOpenChange(!1,pt(Es,D.nativeEvent)))}}})]})]})});function IU(e,t){const n=kn(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 $1=20;let mi=[];function Tb(){mi=mi.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function zU(e){Tb(),e&&Ri(e)!=="body"&&(mi.push(new WeakRef(e)),mi.length>$1&&(mi=mi.slice(-$1)))}function Jg(){var e;return Tb(),(e=mi[mi.length-1])==null?void 0:e.deref()}function PU(e){if(!e)return null;const t=ec();return bO(e,t)?e:Ju(e,t)[0]||e}function UU(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Vr(e).display!=="none"}function K1(e,t){var c;if(!t.current.includes("floating")&&!((c=e.getAttribute("role"))!=null&&c.includes("dialog")))return;const n=ec(),i=lU(e,n).filter(d=>{const h=d.getAttribute("data-tabindex")||"";return bO(d,n)||d.hasAttribute("data-tabindex")&&!h.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||i.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 Cb(e){const{context:t,children:n,disabled:a=!1,initialFocus:i=!0,returnFocus:s=!0,restoreFocus:c=!1,modal:d=!0,closeOnFocusOut:h=!0,openInteractionType:f="",nextFocusableElement:g,previousFocusableElement:m,beforeContentFocusGuardRef:b,externalTree:x}=e,w="rootStore"in t?t.rootStore:t,S=w.useState("open"),E=w.useState("domReferenceElement"),T=w.useState("floatingElement"),{events:C,dataRef:M}=w.context,O=He(()=>{var ue;return(ue=M.current.floatingContext)==null?void 0:ue.nodeId}),D=i===!1,k=tv(E)&&D,A=y.useRef(["content"]),j=Zn(i),B=Zn(s),G=Zn(f),K=Mi(x),I=_O(),H=y.useRef(null),F=y.useRef(null),Y=y.useRef(!1),_=y.useRef(!1),L=y.useRef(!1),z=y.useRef(-1),V=y.useRef(""),Q=y.useRef(""),P=y.useRef(null),q=y.useRef(null),X=xa(P,b,I==null?void 0:I.beforeInsideRef),W=xa(q,I==null?void 0:I.afterInsideRef),ce=Dn(),ie=Dn(),de=ed(),ve=I!=null,Se=ju(T),Me=He((ue=Se)=>ue?Ju(ue,ec()):[]),ke=He(ue=>{const pe=Me(ue);return A.current.map(()=>pe).filter(Boolean).flat()});y.useEffect(()=>{if(a||!d)return;function ue(De){De.key==="Tab"&&Ot(Se,Hr(Yt(Se)))&&Me().length===0&&!k&&cr(De)}const pe=Yt(Se);return pe.addEventListener("keydown",ue),()=>{pe.removeEventListener("keydown",ue)}},[a,E,Se,d,A,k,Me,ke]),y.useEffect(()=>{if(a||!S)return;const ue=Yt(Se);function pe(){L.current=!1}function De(we){const Te=pr(we),Z=Ot(T,Te)||Ot(E,Te)||Ot(I==null?void 0:I.portalNode,Te);L.current=!Z,Q.current=we.pointerType||"keyboard",Te!=null&&Te.closest(`[${u3}]`)&&(_.current=!0)}function Ce(){Q.current="keyboard"}return ue.addEventListener("pointerdown",De,!0),ue.addEventListener("pointerup",pe,!0),ue.addEventListener("pointercancel",pe,!0),ue.addEventListener("keydown",Ce,!0),()=>{ue.removeEventListener("pointerdown",De,!0),ue.removeEventListener("pointerup",pe,!0),ue.removeEventListener("pointercancel",pe,!0),ue.removeEventListener("keydown",Ce,!0)}},[a,T,E,Se,S,I]),y.useEffect(()=>{if(a||!h)return;const ue=Yt(Se);function pe(){_.current=!0,ie.start(0,()=>{_.current=!1})}function De(be){const ge=pr(be),Be=Me().indexOf(ge);Be!==-1&&(z.current=Be)}function Ce(be){const ge=be.relatedTarget,Pe=be.currentTarget,Be=pr(be);queueMicrotask(()=>{const Ae=O(),it=w.context.triggerElements,wt=(ge==null?void 0:ge.hasAttribute(Yl("focus-guard")))&&[P.current,q.current,I==null?void 0:I.beforeInsideRef.current,I==null?void 0:I.afterInsideRef.current,I==null?void 0:I.beforeOutsideRef.current,I==null?void 0:I.afterOutsideRef.current,po(m),po(g)].includes(ge),xt=!(Ot(E,ge)||Ot(T,ge)||Ot(ge,T)||Ot(I==null?void 0:I.portalNode,ge)||ge!=null&&it.hasElement(ge)||it.hasMatchingElement(oe=>Ot(oe,ge))||wt||K&&(ms(K.nodesRef.current,Ae).find(oe=>{var xe,Ie;return Ot((xe=oe.context)==null?void 0:xe.elements.floating,ge)||Ot((Ie=oe.context)==null?void 0:Ie.elements.domReference,ge)})||U1(K.nodesRef.current,Ae).find(oe=>{var xe,Ie,qe;return[(xe=oe.context)==null?void 0:xe.elements.floating,ju((Ie=oe.context)==null?void 0:Ie.elements.floating)].includes(ge)||((qe=oe.context)==null?void 0:qe.elements.domReference)===ge})));if(Pe===E&&Se&&K1(Se,A),c&&Pe!==E&&!UU(Be)&&Hr(ue)===ue.body){if(vn(Se)&&(Se.focus(),c==="popup")){de.request(()=>{Se.focus()});return}const oe=z.current,xe=Me(),Ie=xe[oe]||xe[xe.length-1]||Se;vn(Ie)&&Ie.focus()}if(M.current.insideReactTree){M.current.insideReactTree=!1;return}(k||!d)&&ge&&xt&&!_.current&&(k||ge!==Jg())&&(Y.current=!0,w.setOpen(!1,pt(Es,be)))})}function we(){L.current||(M.current.insideReactTree=!0,ce.start(0,()=>{M.current.insideReactTree=!1}))}const Te=vn(E)?E:null,Z=[];if(!(!T&&!Te))return Te&&(Te.addEventListener("focusout",Ce),Te.addEventListener("pointerdown",pe),Z.push(()=>{Te.removeEventListener("focusout",Ce),Te.removeEventListener("pointerdown",pe)})),T&&(T.addEventListener("focusin",De),T.addEventListener("focusout",Ce),I&&(T.addEventListener("focusout",we,!0),Z.push(()=>{T.removeEventListener("focusout",we,!0)})),Z.push(()=>{T.removeEventListener("focusin",De),T.removeEventListener("focusout",Ce)})),()=>{Z.forEach(be=>{be()})}},[a,E,T,Se,d,K,I,w,h,c,Me,k,O,A,M,ce,ie,de,g,m]),y.useEffect(()=>{var we,Te,Z;if(a||!T||!S)return;const ue=Array.from(((we=I==null?void 0:I.portalNode)==null?void 0:we.querySelectorAll(`[${Yl("portal")}]`))||[]),De=(Z=(Te=(K?U1(K.nodesRef.current,O()):[]).find(be=>{var ge;return tv(((ge=be.context)==null?void 0:ge.elements.domReference)||null)}))==null?void 0:Te.context)==null?void 0:Z.elements.domReference,Ce=[T,De,...ue,H.current,F.current,P.current,q.current,I==null?void 0:I.beforeOutsideRef.current,I==null?void 0:I.afterOutsideRef.current,po(m),po(g),k?E:null].filter(be=>be!=null);return LU(Ce,d||k)},[S,a,E,T,d,A,I,k,K,O,g,m]),Ue(()=>{if(!S||a||!vn(Se))return;const ue=Yt(Se),pe=Hr(ue);queueMicrotask(()=>{const De=ke(Se),Ce=j.current,we=typeof Ce=="function"?Ce(G.current||""):Ce;if(we===void 0||we===!1)return;let Te;we===!0||we===null?Te=De[0]||Se:Te=po(we),Te=Te||De[0]||Se,!Ot(Se,pe)&&vu(Te,{preventScroll:Te===Se})})},[a,S,Se,D,ke,j,G]),Ue(()=>{if(a||!Se)return;const ue=Yt(Se),pe=Hr(ue);zU(pe);function De(Te){if(Te.open||(V.current=IU(Te.nativeEvent,Q.current)),Te.reason===ur&&Te.nativeEvent.type==="mouseleave"&&(Y.current=!0),Te.reason===Jh)if(Te.nested)Y.current=!1;else if(oO(Te.nativeEvent)||iO(Te.nativeEvent))Y.current=!1;else{let Z=!1;document.createElement("div").focus({get preventScroll(){return Z=!0,!1}}),Z?Y.current=!1:Y.current=!0}}C.on("openchange",De);const Ce=ue.createElement("span");Ce.setAttribute("tabindex","-1"),Ce.setAttribute("aria-hidden","true"),Object.assign(Ce.style,nm),ve&&E&&E.insertAdjacentElement("afterend",Ce);function we(){const Te=B.current;let Z=typeof Te=="function"?Te(V.current):Te;if(Z===void 0||Z===!1)return null;if(Z===null&&(Z=!0),typeof Z=="boolean"){const ge=E||Jg();return ge&&ge.isConnected?ge:Ce}const be=E||Jg()||Ce;return po(Z)||be}return()=>{C.off("openchange",De);const Te=Hr(ue),Z=Ot(T,Te)||K&&ms(K.nodesRef.current,O(),!1).some(ge=>{var Pe;return Ot((Pe=ge.context)==null?void 0:Pe.elements.floating,Te)}),be=we();queueMicrotask(()=>{const ge=PU(be),Pe=typeof B.current!="boolean";B.current&&!Y.current&&vn(ge)&&(!(!Pe&&ge!==Te&&Te!==ue.body)||Z)&&ge.focus({preventScroll:!0}),Ce.remove(),Y.current=!1})}},[a,T,Se,B,M,C,K,ve,E,O]),Ue(()=>{if(!Wh||S||!T)return;const ue=Hr(Yt(T));!vn(ue)||!Qh(ue)||Ot(T,ue)&&ue.blur()},[S,T]),Ue(()=>{if(!(a||!I))return I.setFocusManagerState({modal:d,closeOnFocusOut:h,open:S,onOpenChange:w.setOpen,domReference:E}),()=>{I.setFocusManagerState(null)}},[a,I,d,S,w,h,E]),Ue(()=>{if(!(a||!Se))return K1(Se,A),()=>{queueMicrotask(Tb)}},[a,Se,A]);const J=!a&&(d?!k:!0)&&(ve||d);return R.jsxs(y.Fragment,{children:[J&&R.jsx(ql,{"data-type":"inside",ref:X,onFocus:ue=>{var pe;if(d){const De=ke();vu(De[De.length-1])}else if(I!=null&&I.portalNode)if(Y.current=!1,yl(ue,I.portalNode)){const De=yb(E);De==null||De.focus()}else(pe=po(m??I.beforeOutsideRef))==null||pe.focus()}}),n,J&&R.jsx(ql,{"data-type":"inside",ref:W,onFocus:ue=>{var pe;if(d)vu(ke()[0]);else if(I!=null&&I.portalNode)if(h&&(Y.current=!0),yl(ue,I.portalNode)){const De=wO(E);De==null||De.focus()}else(pe=po(g??I.afterOutsideRef))==null||pe.focus()}})]})}function zO(e,t={}){const n="rootStore"in e?e.rootStore:e,a=n.context.dataRef,{enabled:i=!0,event:s="click",toggle:c=!0,ignoreMouse:d=!1,stickIfOpen:h=!0,touchOpenDelay:f=0,reason:g=Ss}=t,m=y.useRef(void 0),b=ed(),x=Dn(),w=y.useMemo(()=>({onPointerDown(S){m.current=S.pointerType},onMouseDown(S){const E=m.current,T=S.nativeEvent,C=n.select("open");if(S.button!==0||s==="click"||xs(E,!0)&&d)return;const M=a.current.openEvent,O=M==null?void 0:M.type,D=n.select("domReferenceElement")!==S.currentTarget,k=C&&D||!(C&&c&&(!(M&&h)||O==="click"||O==="mousedown"));if(Qh(T.target)){const j=pt(g,T,T.target);k&&E==="touch"&&f>0?x.start(f,()=>{n.setOpen(!0,j)}):n.setOpen(k,j);return}const A=S.currentTarget;b.request(()=>{const j=pt(g,T,A);k&&E==="touch"&&f>0?x.start(f,()=>{n.setOpen(!0,j)}):n.setOpen(k,j)})},onClick(S){if(s==="mousedown-only")return;const E=m.current;if(s==="mousedown"&&E){m.current=void 0;return}if(xs(E,!0)&&d)return;const T=n.select("open"),C=a.current.openEvent,M=n.select("domReferenceElement")!==S.currentTarget,O=T&&M||!(T&&c&&(!(C&&h)||sO(C))),D=pt(g,S.nativeEvent,S.currentTarget);O&&E==="touch"&&f>0?x.start(f,()=>{n.setOpen(!0,D)}):n.setOpen(O,D)},onKeyDown(){m.current=void 0}}),[a,s,d,n,h,c,b,x,f,g]);return y.useMemo(()=>i?{reference:w}:En,[i,w])}function HU(e,t){let n=null,a=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){var x;const s=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},c=t.axis==="x"||t.axis==="both",d=t.axis==="y"||t.axis==="both",h=["mouseenter","mousemove"].includes(((x=t.dataRef.current.openEvent)==null?void 0:x.type)||"")&&t.pointerType!=="touch";let f=s.width,g=s.height,m=s.x,b=s.y;return n==null&&t.x&&c&&(n=s.x-t.x),a==null&&t.y&&d&&(a=s.y-t.y),m-=n||0,b-=a||0,f=0,g=0,!i||h?(f=t.axis==="y"?s.width:0,g=t.axis==="x"?s.height:0,m=c&&t.x!=null?t.x:m,b=d&&t.y!=null?t.y:b):i&&!h&&(g=t.axis==="x"?s.height:g,f=t.axis==="y"?s.width:f),i=!0,{width:f,height:g,x:m,y:b,top:b,right:m+f,bottom:b+g,left:m}}}}function G1(e){return e!=null&&e.clientX!=null}function BU(e,t={}){const n="rootStore"in e?e.rootStore:e,a=n.useState("open"),i=n.useState("floatingElement"),s=n.useState("domReferenceElement"),c=n.context.dataRef,{enabled:d=!0,axis:h="both"}=t,f=y.useRef(!1),g=y.useRef(null),[m,b]=y.useState(),[x,w]=y.useState([]),S=He((O,D,k)=>{f.current||c.current.openEvent&&!G1(c.current.openEvent)||n.set("positionReference",HU(k??s,{x:O,y:D,axis:h,dataRef:c,pointerType:m}))}),E=He(O=>{a?g.current||w([]):S(O.clientX,O.clientY,O.currentTarget)}),T=xs(m)?i:a,C=y.useCallback(()=>{if(!T||!d)return;const O=kn(i);function D(k){const A=pr(k);Ot(i,A)?(O.removeEventListener("mousemove",D),g.current=null):S(k.clientX,k.clientY)}if(!c.current.openEvent||G1(c.current.openEvent)){O.addEventListener("mousemove",D);const k=()=>{O.removeEventListener("mousemove",D),g.current=null};return g.current=k,k}n.set("positionReference",s)},[T,d,i,c,s,n,S]);y.useEffect(()=>C(),[C,x]),y.useEffect(()=>{d&&!i&&(f.current=!1)},[d,i]),y.useEffect(()=>{!d&&a&&(f.current=!0)},[d,a]);const M=y.useMemo(()=>{function O(D){b(D.pointerType)}return{onPointerDown:O,onPointerEnter:O,onMouseMove:E,onMouseEnter:E}},[E]);return y.useMemo(()=>d?{reference:M,trigger:M}:{},[d,M])}function X1(e,t,n){let{reference:a,floating:i}=e;const s=oa(t),c=gb(t),d=pb(c),h=Mr(t),f=s==="y",g=a.x+a.width/2-i.width/2,m=a.y+a.height/2-i.height/2,b=a[d]/2-i[d]/2;let x;switch(h){case"top":x={x:g,y:a.y-i.height};break;case"bottom":x={x:g,y:a.y+a.height};break;case"right":x={x:a.x+a.width,y:m};break;case"left":x={x:a.x-i.width,y:m};break;default:x={x:a.x,y:a.y}}switch(Ci(t)){case"start":x[c]-=b*(n&&f?-1:1);break;case"end":x[c]+=b*(n&&f?-1:1);break}return x}async function FU(e,t){var n;t===void 0&&(t={});const{x:a,y:i,platform:s,rects:c,elements:d,strategy:h}=e,{boundary:f="clippingAncestors",rootBoundary:g="viewport",elementContext:m="floating",altBoundary:b=!1,padding:x=0}=Ro(t,e),w=lO(x),E=d[b?m==="floating"?"reference":"floating":m],T=wh(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(E)))==null||n?E:E.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(d.floating)),boundary:f,rootBoundary:g,strategy:h})),C=m==="floating"?{x:a,y:i,width:c.floating.width,height:c.floating.height}:c.reference,M=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d.floating)),O=await(s.isElement==null?void 0:s.isElement(M))?await(s.getScale==null?void 0:s.getScale(M))||{x:1,y:1}:{x:1,y:1},D=wh(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:C,offsetParent:M,strategy:h}):C);return{top:(T.top-D.top+w.top)/O.y,bottom:(D.bottom-T.bottom+w.bottom)/O.y,left:(T.left-D.left+w.left)/O.x,right:(D.right-T.right+w.right)/O.x}}const VU=async(e,t,n)=>{const{placement:a="bottom",strategy:i="absolute",middleware:s=[],platform:c}=n,d=s.filter(Boolean),h=await(c.isRTL==null?void 0:c.isRTL(t));let f=await c.getElementRects({reference:e,floating:t,strategy:i}),{x:g,y:m}=X1(f,a,h),b=a,x={},w=0;for(let E=0;E<d.length;E++){var S;const{name:T,fn:C}=d[E],{x:M,y:O,data:D,reset:k}=await C({x:g,y:m,initialPlacement:a,placement:b,strategy:i,middlewareData:x,rects:f,platform:{...c,detectOverflow:(S=c.detectOverflow)!=null?S:FU},elements:{reference:e,floating:t}});g=M??g,m=O??m,x={...x,[T]:{...x[T],...D}},k&&w<=50&&(w++,typeof k=="object"&&(k.placement&&(b=k.placement),k.rects&&(f=k.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:i}):k.rects),{x:g,y:m}=X1(f,b,h)),E=-1)}return{x:g,y:m,placement:b,strategy:i,middlewareData:x}},YU=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,a;const{placement:i,middlewareData:s,rects:c,initialPlacement:d,platform:h,elements:f}=t,{mainAxis:g=!0,crossAxis:m=!0,fallbackPlacements:b,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:S=!0,...E}=Ro(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const T=Mr(i),C=oa(d),M=Mr(d)===d,O=await(h.isRTL==null?void 0:h.isRTL(f.floating)),D=b||(M||!S?[xh(d)]:F4(d)),k=w!=="none";!b&&k&&D.push(...$4(d,S,w,O));const A=[d,...D],j=await h.detectOverflow(t,E),B=[];let G=((a=s.flip)==null?void 0:a.overflows)||[];if(g&&B.push(j[T]),m){const F=B4(i,c,O);B.push(j[F[0]],j[F[1]])}if(G=[...G,{placement:i,overflows:B}],!B.every(F=>F<=0)){var K,I;const F=(((K=s.flip)==null?void 0:K.index)||0)+1,Y=A[F];if(Y&&(!(m==="alignment"?C!==oa(Y):!1)||G.every(z=>oa(z.placement)===C?z.overflows[0]>0:!0)))return{data:{index:F,overflows:G},reset:{placement:Y}};let _=(I=G.filter(L=>L.overflows[0]<=0).sort((L,z)=>L.overflows[1]-z.overflows[1])[0])==null?void 0:I.placement;if(!_)switch(x){case"bestFit":{var H;const L=(H=G.filter(z=>{if(k){const V=oa(z.placement);return V===C||V==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(V=>V>0).reduce((V,Q)=>V+Q,0)]).sort((z,V)=>z[1]-V[1])[0])==null?void 0:H[0];L&&(_=L);break}case"initialPlacement":_=d;break}if(i!==_)return{reset:{placement:_}}}return{}}}};function W1(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Q1(e){return z4.some(t=>e[t]>=0)}const qU=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:a}=t,{strategy:i="referenceHidden",...s}=Ro(e,t);switch(i){case"referenceHidden":{const c=await a.detectOverflow(t,{...s,elementContext:"reference"}),d=W1(c,n.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Q1(d)}}}case"escaped":{const c=await a.detectOverflow(t,{...s,altBoundary:!0}),d=W1(c,n.floating);return{data:{escapedOffsets:d,escaped:Q1(d)}}}default:return{}}}}},PO=new Set(["left","top"]);async function $U(e,t){const{placement:n,platform:a,elements:i}=e,s=await(a.isRTL==null?void 0:a.isRTL(i.floating)),c=Mr(n),d=Ci(n),h=oa(n)==="y",f=PO.has(c)?-1:1,g=s&&h?-1:1,m=Ro(t,e);let{mainAxis:b,crossAxis:x,alignmentAxis:w}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return d&&typeof w=="number"&&(x=d==="end"?w*-1:w),h?{x:x*g,y:b*f}:{x:b*f,y:x*g}}const KU=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,a;const{x:i,y:s,placement:c,middlewareData:d}=t,h=await $U(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(a=d.arrow)!=null&&a.alignmentOffset?{}:{x:i+h.x,y:s+h.y,data:{...h,placement:c}}}}},GU=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:a,placement:i,platform:s}=t,{mainAxis:c=!0,crossAxis:d=!1,limiter:h={fn:T=>{let{x:C,y:M}=T;return{x:C,y:M}}},...f}=Ro(e,t),g={x:n,y:a},m=await s.detectOverflow(t,f),b=oa(Mr(i)),x=mb(b);let w=g[x],S=g[b];if(c){const T=x==="y"?"top":"left",C=x==="y"?"bottom":"right",M=w+m[T],O=w-m[C];w=nv(M,w,O)}if(d){const T=b==="y"?"top":"left",C=b==="y"?"bottom":"right",M=S+m[T],O=S-m[C];S=nv(M,S,O)}const E=h.fn({...t,[x]:w,[b]:S});return{...E,data:{x:E.x-n,y:E.y-a,enabled:{[x]:c,[b]:d}}}}}},XU=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:a,placement:i,rects:s,middlewareData:c}=t,{offset:d=0,mainAxis:h=!0,crossAxis:f=!0}=Ro(e,t),g={x:n,y:a},m=oa(i),b=mb(m);let x=g[b],w=g[m];const S=Ro(d,t),E=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(h){const M=b==="y"?"height":"width",O=s.reference[b]-s.floating[M]+E.mainAxis,D=s.reference[b]+s.reference[M]-E.mainAxis;x<O?x=O:x>D&&(x=D)}if(f){var T,C;const M=b==="y"?"width":"height",O=PO.has(Mr(i)),D=s.reference[m]-s.floating[M]+(O&&((T=c.offset)==null?void 0:T[m])||0)+(O?0:E.crossAxis),k=s.reference[m]+s.reference[M]+(O?0:((C=c.offset)==null?void 0:C[m])||0)-(O?E.crossAxis:0);w<D?w=D:w>k&&(w=k)}return{[b]:x,[m]:w}}}},WU=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,a;const{placement:i,rects:s,platform:c,elements:d}=t,{apply:h=()=>{},...f}=Ro(e,t),g=await c.detectOverflow(t,f),m=Mr(i),b=Ci(i),x=oa(i)==="y",{width:w,height:S}=s.floating;let E,T;m==="top"||m==="bottom"?(E=m,T=b===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(T=m,E=b==="end"?"top":"bottom");const C=S-g.top-g.bottom,M=w-g.left-g.right,O=Bl(S-g[E],C),D=Bl(w-g[T],M),k=!t.middlewareData.shift;let A=O,j=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(j=M),(a=t.middlewareData.shift)!=null&&a.enabled.y&&(A=C),k&&!b){const G=Br(g.left,0),K=Br(g.right,0),I=Br(g.top,0),H=Br(g.bottom,0);x?j=w-2*(G!==0||K!==0?G+K:Br(g.left,g.right)):A=S-2*(I!==0||H!==0?I+H:Br(g.top,g.bottom))}await h({...t,availableWidth:j,availableHeight:A});const B=await c.getDimensions(d.floating);return w!==B.width||S!==B.height?{reset:{rects:!0}}:{}}}};function UO(e){const t=Vr(e);let n=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const i=vn(e),s=i?e.offsetWidth:n,c=i?e.offsetHeight:a,d=bh(n)!==s||bh(a)!==c;return d&&(n=s,a=c),{width:n,height:a,$:d}}function Ob(e){return tn(e)?e:e.contextElement}function xl(e){const t=Ob(e);if(!vn(t))return Pa(1);const n=t.getBoundingClientRect(),{width:a,height:i,$:s}=UO(t);let c=(s?bh(n.width):n.width)/a,d=(s?bh(n.height):n.height)/i;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const QU=Pa(0);function HO(e){const t=kn(e);return!$h()||!t.visualViewport?QU:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ZU(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==kn(e)?!1:t}function Rs(e,t,n,a){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Ob(e);let c=Pa(1);t&&(a?tn(a)&&(c=xl(a)):c=xl(e));const d=ZU(s,n,a)?HO(s):Pa(0);let h=(i.left+d.x)/c.x,f=(i.top+d.y)/c.y,g=i.width/c.x,m=i.height/c.y;if(s){const b=kn(s),x=a&&tn(a)?kn(a):a;let w=b,S=Zy(w);for(;S&&a&&x!==w;){const E=xl(S),T=S.getBoundingClientRect(),C=Vr(S),M=T.left+(S.clientLeft+parseFloat(C.paddingLeft))*E.x,O=T.top+(S.clientTop+parseFloat(C.paddingTop))*E.y;h*=E.x,f*=E.y,g*=E.x,m*=E.y,h+=M,f+=O,w=kn(S),S=Zy(w)}}return wh({width:g,height:m,x:h,y:f})}function rm(e,t){const n=Kh(e).scrollLeft;return t?t.left+n:Rs(Ya(e)).left+n}function BO(e,t){const n=e.getBoundingClientRect(),a=n.left+t.scrollLeft-rm(e,n),i=n.top+t.scrollTop;return{x:a,y:i}}function JU(e){let{elements:t,rect:n,offsetParent:a,strategy:i}=e;const s=i==="fixed",c=Ya(a),d=t?qh(t.floating):!1;if(a===c||d&&s)return n;let h={scrollLeft:0,scrollTop:0},f=Pa(1);const g=Pa(0),m=vn(a);if((m||!m&&!s)&&((Ri(a)!=="body"||Ti(c))&&(h=Kh(a)),vn(a))){const x=Rs(a);f=xl(a),g.x=x.x+a.clientLeft,g.y=x.y+a.clientTop}const b=c&&!m&&!s?BO(c,h):Pa(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-h.scrollLeft*f.x+g.x+b.x,y:n.y*f.y-h.scrollTop*f.y+g.y+b.y}}function eH(e){return Array.from(e.getClientRects())}function tH(e){const t=Ya(e),n=Kh(e),a=e.ownerDocument.body,i=Br(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),s=Br(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let c=-n.scrollLeft+rm(e);const d=-n.scrollTop;return Vr(a).direction==="rtl"&&(c+=Br(t.clientWidth,a.clientWidth)-i),{width:i,height:s,x:c,y:d}}const Z1=25;function nH(e,t){const n=kn(e),a=Ya(e),i=n.visualViewport;let s=a.clientWidth,c=a.clientHeight,d=0,h=0;if(i){s=i.width,c=i.height;const g=$h();(!g||g&&t==="fixed")&&(d=i.offsetLeft,h=i.offsetTop)}const f=rm(a);if(f<=0){const g=a.ownerDocument,m=g.body,b=getComputedStyle(m),x=g.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,w=Math.abs(a.clientWidth-m.clientWidth-x);w<=Z1&&(s-=w)}else f<=Z1&&(s+=f);return{width:s,height:c,x:d,y:h}}const rH=new Set(["absolute","fixed"]);function aH(e,t){const n=Rs(e,!0,t==="fixed"),a=n.top+e.clientTop,i=n.left+e.clientLeft,s=vn(e)?xl(e):Pa(1),c=e.clientWidth*s.x,d=e.clientHeight*s.y,h=i*s.x,f=a*s.y;return{width:c,height:d,x:h,y:f}}function J1(e,t,n){let a;if(t==="viewport")a=nH(e,n);else if(t==="document")a=tH(Ya(e));else if(tn(t))a=aH(t,n);else{const i=HO(e);a={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return wh(a)}function FO(e,t){const n=Ha(e);return n===t||!tn(n)||za(n)?!1:Vr(n).position==="fixed"||FO(n,t)}function oH(e,t){const n=t.get(e);if(n)return n;let a=vi(e,[],!1).filter(d=>tn(d)&&Ri(d)!=="body"),i=null;const s=Vr(e).position==="fixed";let c=s?Ha(e):e;for(;tn(c)&&!za(c);){const d=Vr(c),h=cb(c);!h&&d.position==="fixed"&&(i=null),(s?!h&&!i:!h&&d.position==="static"&&!!i&&rH.has(i.position)||Ti(c)&&!h&&FO(e,c))?a=a.filter(g=>g!==c):i=d,c=Ha(c)}return t.set(e,a),a}function iH(e){let{element:t,boundary:n,rootBoundary:a,strategy:i}=e;const c=[...n==="clippingAncestors"?qh(t)?[]:oH(t,this._c):[].concat(n),a],d=c[0],h=c.reduce((f,g)=>{const m=J1(t,g,i);return f.top=Br(m.top,f.top),f.right=Bl(m.right,f.right),f.bottom=Bl(m.bottom,f.bottom),f.left=Br(m.left,f.left),f},J1(t,d,i));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function sH(e){const{width:t,height:n}=UO(e);return{width:t,height:n}}function lH(e,t,n){const a=vn(t),i=Ya(t),s=n==="fixed",c=Rs(e,!0,s,t);let d={scrollLeft:0,scrollTop:0};const h=Pa(0);function f(){h.x=rm(i)}if(a||!a&&!s)if((Ri(t)!=="body"||Ti(i))&&(d=Kh(t)),a){const x=Rs(t,!0,s,t);h.x=x.x+t.clientLeft,h.y=x.y+t.clientTop}else i&&f();s&&!a&&i&&f();const g=i&&!a&&!s?BO(i,d):Pa(0),m=c.left+d.scrollLeft-h.x-g.x,b=c.top+d.scrollTop-h.y-g.y;return{x:m,y:b,width:c.width,height:c.height}}function ey(e){return Vr(e).position==="static"}function eR(e,t){if(!vn(e)||Vr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ya(e)===n&&(n=n.ownerDocument.body),n}function VO(e,t){const n=kn(e);if(qh(e))return n;if(!vn(e)){let i=Ha(e);for(;i&&!za(i);){if(tn(i)&&!ey(i))return i;i=Ha(i)}return n}let a=eR(e,t);for(;a&&s4(a)&&ey(a);)a=eR(a,t);return a&&za(a)&&ey(a)&&!cb(a)?n:a||f4(e)||n}const cH=async function(e){const t=this.getOffsetParent||VO,n=this.getDimensions,a=await n(e.floating);return{reference:lH(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function uH(e){return Vr(e).direction==="rtl"}const dH={convertOffsetParentRelativeRectToViewportRelativeRect:JU,getDocumentElement:Ya,getClippingRect:iH,getOffsetParent:VO,getElementRects:cH,getClientRects:eH,getDimensions:sH,getScale:xl,isElement:tn,isRTL:uH};function YO(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fH(e,t){let n=null,a;const i=Ya(e);function s(){var d;clearTimeout(a),(d=n)==null||d.disconnect(),n=null}function c(d,h){d===void 0&&(d=!1),h===void 0&&(h=1),s();const f=e.getBoundingClientRect(),{left:g,top:m,width:b,height:x}=f;if(d||t(),!b||!x)return;const w=ml(m),S=ml(i.clientWidth-(g+b)),E=ml(i.clientHeight-(m+x)),T=ml(g),M={rootMargin:-w+"px "+-S+"px "+-E+"px "+-T+"px",threshold:Br(0,Bl(1,h))||1};let O=!0;function D(k){const A=k[0].intersectionRatio;if(A!==h){if(!O)return c();A?c(!1,A):a=setTimeout(()=>{c(!1,1e-7)},1e3)}A===1&&!YO(f,e.getBoundingClientRect())&&c(),O=!1}try{n=new IntersectionObserver(D,{...M,root:i.ownerDocument})}catch{n=new IntersectionObserver(D,M)}n.observe(e)}return c(!0),s}function tR(e,t,n,a){a===void 0&&(a={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:h=!1}=a,f=Ob(e),g=i||s?[...f?vi(f):[],...vi(t)]:[];g.forEach(T=>{i&&T.addEventListener("scroll",n,{passive:!0}),s&&T.addEventListener("resize",n)});const m=f&&d?fH(f,n):null;let b=-1,x=null;c&&(x=new ResizeObserver(T=>{let[C]=T;C&&C.target===f&&x&&(x.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var M;(M=x)==null||M.observe(t)})),n()}),f&&!h&&x.observe(f),x.observe(t));let w,S=h?Rs(e):null;h&&E();function E(){const T=Rs(e);S&&!YO(S,T)&&n(),S=T,w=requestAnimationFrame(E)}return n(),()=>{var T;g.forEach(C=>{i&&C.removeEventListener("scroll",n),s&&C.removeEventListener("resize",n)}),m==null||m(),(T=x)==null||T.disconnect(),x=null,h&&cancelAnimationFrame(w)}}const hH=KU,mH=GU,pH=YU,gH=WU,yH=qU,vH=XU,bH=(e,t,n)=>{const a=new Map,i={platform:dH,...n},s={...i.platform,_c:a};return VU(e,t,{...i,platform:s})};var xH=typeof document<"u",wH=function(){},lh=xH?y.useLayoutEffect:wH;function Oh(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,a,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(a=n;a--!==0;)if(!Oh(e[a],t[a]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(a=n;a--!==0;)if(!{}.hasOwnProperty.call(t,i[a]))return!1;for(a=n;a--!==0;){const s=i[a];if(!(s==="_owner"&&e.$$typeof)&&!Oh(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function qO(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nR(e,t){const n=qO(e);return Math.round(t*n)/n}function ty(e){const t=y.useRef(e);return lh(()=>{t.current=e}),t}function SH(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:a=[],platform:i,elements:{reference:s,floating:c}={},transform:d=!0,whileElementsMounted:h,open:f}=e,[g,m]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,x]=y.useState(a);Oh(b,a)||x(a);const[w,S]=y.useState(null),[E,T]=y.useState(null),C=y.useCallback(z=>{z!==k.current&&(k.current=z,S(z))},[]),M=y.useCallback(z=>{z!==A.current&&(A.current=z,T(z))},[]),O=s||w,D=c||E,k=y.useRef(null),A=y.useRef(null),j=y.useRef(g),B=h!=null,G=ty(h),K=ty(i),I=ty(f),H=y.useCallback(()=>{if(!k.current||!A.current)return;const z={placement:t,strategy:n,middleware:b};K.current&&(z.platform=K.current),bH(k.current,A.current,z).then(V=>{const Q={...V,isPositioned:I.current!==!1};F.current&&!Oh(j.current,Q)&&(j.current=Q,or.flushSync(()=>{m(Q)}))})},[b,t,n,K,I]);lh(()=>{f===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,m(z=>({...z,isPositioned:!1})))},[f]);const F=y.useRef(!1);lh(()=>(F.current=!0,()=>{F.current=!1}),[]),lh(()=>{if(O&&(k.current=O),D&&(A.current=D),O&&D){if(G.current)return G.current(O,D,H);H()}},[O,D,H,G,B]);const Y=y.useMemo(()=>({reference:k,floating:A,setReference:C,setFloating:M}),[C,M]),_=y.useMemo(()=>({reference:O,floating:D}),[O,D]),L=y.useMemo(()=>{const z={position:n,left:0,top:0};if(!_.floating)return z;const V=nR(_.floating,g.x),Q=nR(_.floating,g.y);return d?{...z,transform:"translate("+V+"px, "+Q+"px)",...qO(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:Q}},[n,d,_.floating,g.x,g.y]);return y.useMemo(()=>({...g,update:H,refs:Y,elements:_,floatingStyles:L}),[g,H,Y,_,L])}const EH=(e,t)=>({...hH(e),options:[e,t]}),RH=(e,t)=>({...mH(e),options:[e,t]}),TH=(e,t)=>({...vH(e),options:[e,t]}),CH=(e,t)=>({...pH(e),options:[e,t]}),OH=(e,t)=>({...gH(e),options:[e,t]}),MH=(e,t)=>({...yH(e),options:[e,t]}),NH={intentional:"onClick",sloppy:"onPointerDown"};function AH(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 am(e,t={}){const n="rootStore"in e?e.rootStore:e,a=n.useState("open"),i=n.useState("floatingElement"),s=n.useState("referenceElement"),c=n.useState("domReferenceElement"),{onOpenChange:d,dataRef:h}=n.context,{enabled:f=!0,escapeKey:g=!0,outsidePress:m=!0,outsidePressEvent:b="sloppy",referencePress:x=!1,referencePressEvent:w="sloppy",ancestorScroll:S=!1,bubbles:E,externalTree:T}=t,C=Mi(T),M=He(typeof m=="function"?m:()=>!1),O=typeof m=="function"?M:m,D=y.useRef(!1),{escapeKey:k,outsidePress:A}=AH(E),j=y.useRef(null),B=Dn(),G=Dn(),K=He(()=>{G.clear(),h.current.insideReactTree=!1}),I=y.useRef(!1),H=y.useRef(""),F=He(J=>{H.current=J.pointerType}),Y=He(()=>{const J=H.current,ue=J==="pen"||!J?"mouse":J,pe=typeof b=="function"?b():b;return typeof pe=="string"?pe:pe[ue]}),_=He(J=>{var we;if(!a||!f||!g||J.key!=="Escape"||I.current)return;const ue=(we=h.current.floatingContext)==null?void 0:we.nodeId,pe=C?ms(C.nodesRef.current,ue):[];if(!k&&pe.length>0){let Te=!0;if(pe.forEach(Z=>{var be;(be=Z.context)!=null&&be.open&&!Z.context.dataRef.current.__escapeKeyBubbles&&(Te=!1)}),!Te)return}const De=I4(J)?J.nativeEvent:J,Ce=pt(em,De);n.setOpen(!1,Ce),!k&&!Ce.isPropagationAllowed&&J.stopPropagation()}),L=He(J=>{const ue=Y();return ue==="intentional"&&J.type!=="click"||ue==="sloppy"&&J.type==="click"}),z=He(()=>{h.current.insideReactTree=!0,G.start(0,K)}),V=He((J,ue=!1)=>{var Pe;if(L(J)){K();return}if(h.current.insideReactTree){K();return}if(Y()==="intentional"&&ue||typeof O=="function"&&!O(J))return;const pe=pr(J),De=`[${Yl("inert")}]`,Ce=Yt(n.select("floatingElement")).querySelectorAll(De),we=n.context.triggerElements;if(pe&&(we.hasElement(pe)||we.hasMatchingElement(Be=>Ot(Be,pe))))return;let Te=tn(pe)?pe:null;for(;Te&&!za(Te);){const Be=Ha(Te);if(za(Be)||!tn(Be))break;Te=Be}if(Ce.length&&tn(pe)&&!L4(pe)&&!Ot(pe,n.select("floatingElement"))&&Array.from(Ce).every(Be=>!Ot(Te,Be)))return;if(vn(pe)&&!("touches"in J)){const Be=za(pe),Ae=Vr(pe),it=/auto|scroll/,wt=Be||it.test(Ae.overflowX),xt=Be||it.test(Ae.overflowY),oe=wt&&pe.clientWidth>0&&pe.scrollWidth>pe.clientWidth,xe=xt&&pe.clientHeight>0&&pe.scrollHeight>pe.clientHeight,Ie=Ae.direction==="rtl",qe=xe&&(Ie?J.offsetX<=pe.offsetWidth-pe.clientWidth:J.offsetX>pe.clientWidth),Ke=oe&&J.offsetY>pe.clientHeight;if(qe||Ke)return}const Z=(Pe=h.current.floatingContext)==null?void 0:Pe.nodeId,be=C&&ms(C.nodesRef.current,Z).some(Be=>{var Ae;return ga(J,(Ae=Be.context)==null?void 0:Ae.elements.floating)});if(ga(J,n.select("floatingElement"))||ga(J,n.select("domReferenceElement"))||be)return;const ge=C?ms(C.nodesRef.current,Z):[];if(ge.length>0){let Be=!0;if(ge.forEach(Ae=>{var it;(it=Ae.context)!=null&&it.open&&!Ae.context.dataRef.current.__outsidePressBubbles&&(Be=!1)}),!Be)return}n.setOpen(!1,pt(Jh,J)),K()}),Q=He(J=>{Y()!=="sloppy"||J.pointerType==="touch"||!n.select("open")||!f||ga(J,n.select("floatingElement"))||ga(J,n.select("domReferenceElement"))||V(J)}),P=He(J=>{if(Y()!=="sloppy"||!n.select("open")||!f||ga(J,n.select("floatingElement"))||ga(J,n.select("domReferenceElement")))return;const ue=J.touches[0];ue&&(j.current={startTime:Date.now(),startX:ue.clientX,startY:ue.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},B.start(1e3,()=>{j.current&&(j.current.dismissOnTouchEnd=!1,j.current.dismissOnMouseDown=!1)}))}),q=He(J=>{const ue=pr(J);function pe(){P(J),ue==null||ue.removeEventListener(J.type,pe)}ue==null||ue.addEventListener(J.type,pe)}),X=He(J=>{const ue=D.current;if(D.current=!1,B.clear(),J.type==="mousedown"&&j.current&&!j.current.dismissOnMouseDown)return;const pe=pr(J);function De(){J.type==="pointerdown"?Q(J):V(J,ue),pe==null||pe.removeEventListener(J.type,De)}pe==null||pe.addEventListener(J.type,De)}),W=He(J=>{if(Y()!=="sloppy"||!j.current||ga(J,n.select("floatingElement"))||ga(J,n.select("domReferenceElement")))return;const ue=J.touches[0];if(!ue)return;const pe=Math.abs(ue.clientX-j.current.startX),De=Math.abs(ue.clientY-j.current.startY),Ce=Math.sqrt(pe*pe+De*De);Ce>5&&(j.current.dismissOnTouchEnd=!0),Ce>10&&(V(J),B.clear(),j.current=null)}),ce=He(J=>{const ue=pr(J);function pe(){W(J),ue==null||ue.removeEventListener(J.type,pe)}ue==null||ue.addEventListener(J.type,pe)}),ie=He(J=>{Y()!=="sloppy"||!j.current||ga(J,n.select("floatingElement"))||ga(J,n.select("domReferenceElement"))||(j.current.dismissOnTouchEnd&&V(J),B.clear(),j.current=null)}),de=He(J=>{const ue=pr(J);function pe(){ie(J),ue==null||ue.removeEventListener(J.type,pe)}ue==null||ue.addEventListener(J.type,pe)});y.useEffect(()=>{if(!a||!f)return;h.current.__escapeKeyBubbles=k,h.current.__outsidePressBubbles=A;const J=new Ba;function ue(Te){n.setOpen(!1,pt(wa,Te))}function pe(){J.clear(),I.current=!0}function De(){J.start($h()?5:0,()=>{I.current=!1})}const Ce=Yt(i);Ce.addEventListener("pointerdown",F,!0),g&&(Ce.addEventListener("keydown",_),Ce.addEventListener("compositionstart",pe),Ce.addEventListener("compositionend",De)),O&&(Ce.addEventListener("click",X,!0),Ce.addEventListener("pointerdown",X,!0),Ce.addEventListener("touchstart",q,!0),Ce.addEventListener("touchmove",ce,!0),Ce.addEventListener("touchend",de,!0),Ce.addEventListener("mousedown",X,!0));let we=[];return S&&(tn(c)&&(we=vi(c)),tn(i)&&(we=we.concat(vi(i))),!tn(s)&&s&&s.contextElement&&(we=we.concat(vi(s.contextElement)))),we=we.filter(Te=>{var Z;return Te!==((Z=Ce.defaultView)==null?void 0:Z.visualViewport)}),we.forEach(Te=>{Te.addEventListener("scroll",ue,{passive:!0})}),()=>{Ce.removeEventListener("pointerdown",F,!0),g&&(Ce.removeEventListener("keydown",_),Ce.removeEventListener("compositionstart",pe),Ce.removeEventListener("compositionend",De)),O&&(Ce.removeEventListener("click",X,!0),Ce.removeEventListener("pointerdown",X,!0),Ce.removeEventListener("touchstart",q,!0),Ce.removeEventListener("touchmove",ce,!0),Ce.removeEventListener("touchend",de,!0),Ce.removeEventListener("mousedown",X,!0)),we.forEach(Te=>{Te.removeEventListener("scroll",ue)}),J.clear(),D.current=!1}},[h,i,s,c,g,O,a,d,S,f,k,A,_,V,X,Q,q,ce,de,F,n]),y.useEffect(K,[O,K]);const ve=y.useMemo(()=>({onKeyDown:_,...x&&{[NH[w]]:J=>{n.setOpen(!1,pt(Ss,J.nativeEvent))},...w!=="intentional"&&{onClick(J){n.setOpen(!1,pt(Ss,J.nativeEvent))}}}}),[_,n,x,w]),Se=He(J=>{const ue=pr(J.nativeEvent);!Ot(n.select("floatingElement"),ue)||J.button!==0||(D.current=!0)}),Me=He(J=>{!a||!f||J.button!==0||(D.current=!0)}),ke=y.useMemo(()=>({onKeyDown:_,onPointerDown:Se,onMouseDown:Se,onMouseUp:Se,onClickCapture:z,onMouseDownCapture(J){z(),Me(J)},onPointerDownCapture(J){z(),Me(J)},onMouseUpCapture:z,onTouchEndCapture:z,onTouchMoveCapture:z}),[_,Se,z,Me]);return y.useMemo(()=>f?{reference:ve,floating:ke,trigger:ve}:{},[f,ve,ke])}var Mh=Symbol("NOT_FOUND");function DH(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function kH(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function jH(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(a=>typeof a=="function"?`function ${a.name||"unnamed"}()`:typeof a).join(", ");throw new TypeError(`${t}[${n}]`)}}var rR=e=>Array.isArray(e)?e:[e];function LH(e){const t=Array.isArray(e[0])?e[0]:e;return jH(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function _H(e,t){const n=[],{length:a}=e;for(let i=0;i<a;i++)n.push(e[i].apply(null,t));return n}function IH(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Mh},put(n,a){t={key:n,value:a}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function zH(e,t){let n=[];function a(d){const h=n.findIndex(f=>t(d,f.key));if(h>-1){const f=n[h];return h>0&&(n.splice(h,1),n.unshift(f)),f.value}return Mh}function i(d,h){a(d)===Mh&&(n.unshift({key:d,value:h}),n.length>e&&n.pop())}function s(){return n}function c(){n=[]}return{get:a,put:i,getEntries:s,clear:c}}var PH=(e,t)=>e===t;function UH(e){return function(n,a){if(n===null||a===null||n.length!==a.length)return!1;const{length:i}=n;for(let s=0;s<i;s++)if(!e(n[s],a[s]))return!1;return!0}}function HH(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:a=PH,maxSize:i=1,resultEqualityCheck:s}=n,c=UH(a);let d=0;const h=i<=1?IH(c):zH(i,c);function f(){let g=h.get(arguments);if(g===Mh){if(g=e.apply(null,arguments),d++,s){const b=h.getEntries().find(x=>s(x.value,g));b&&(g=b.value,d!==0&&d--)}h.put(arguments,g)}return g}return f.clearCache=()=>{h.clear(),f.resetResultsCount()},f.resultsCount=()=>d,f.resetResultsCount=()=>{d=0},f}var BH=class{constructor(e){this.value=e}deref(){return this.value}},FH=typeof WeakRef<"u"?WeakRef:BH,VH=0,aR=1;function Pf(){return{s:VH,v:void 0,o:null,p:null}}function $O(e,t={}){let n=Pf();const{resultEqualityCheck:a}=t;let i,s=0;function c(){var m;let d=n;const{length:h}=arguments;for(let b=0,x=h;b<x;b++){const w=arguments[b];if(typeof w=="function"||typeof w=="object"&&w!==null){let S=d.o;S===null&&(d.o=S=new WeakMap);const E=S.get(w);E===void 0?(d=Pf(),S.set(w,d)):d=E}else{let S=d.p;S===null&&(d.p=S=new Map);const E=S.get(w);E===void 0?(d=Pf(),S.set(w,d)):d=E}}const f=d;let g;if(d.s===aR)g=d.v;else if(g=e.apply(null,arguments),s++,a){const b=((m=i==null?void 0:i.deref)==null?void 0:m.call(i))??i;b!=null&&a(b,g)&&(g=b,s!==0&&s--),i=typeof g=="object"&&g!==null||typeof g=="function"?new FH(g):g}return f.s=aR,f.v=g,g}return c.clearCache=()=>{n=Pf(),c.resetResultsCount()},c.resultsCount=()=>s,c.resetResultsCount=()=>{s=0},c}function KO(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,a=(...i)=>{let s=0,c=0,d,h={},f=i.pop();typeof f=="object"&&(h=f,f=i.pop()),DH(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const g={...n,...h},{memoize:m,memoizeOptions:b=[],argsMemoize:x=$O,argsMemoizeOptions:w=[]}=g,S=rR(b),E=rR(w),T=LH(i),C=m(function(){return s++,f.apply(null,arguments)},...S),M=x(function(){c++;const D=_H(T,arguments);return d=C.apply(null,D),d},...E);return Object.assign(M,{resultFunc:f,memoizedResultFunc:C,dependencies:T,dependencyRecomputations:()=>c,resetDependencyRecomputations:()=>{c=0},lastResult:()=>d,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:m,argsMemoize:x})};return Object.assign(a,{withTypes:()=>a}),a}var YH=KO($O),qH=Object.assign((e,t=YH)=>{kH(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),a=n.map(s=>e[s]);return t(a,(...s)=>s.reduce((c,d,h)=>(c[n[h]]=d,c),{}))},{withTypes:()=>qH});KO({memoize:HH,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Ye=(e,t,n,a,i,s,...c)=>{if(c.length>0)throw new Error(pn(1));let d;if(e)d=e;else throw new Error("Missing arguments");return d};var ny={exports:{}},ry={};/**
|
|
280
|
-
* @license React
|
|
281
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
282
|
-
*
|
|
283
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
284
|
-
*
|
|
285
|
-
* This source code is licensed under the MIT license found in the
|
|
286
|
-
* LICENSE file in the root directory of this source tree.
|
|
287
|
-
*/var oR;function $H(){if(oR)return ry;oR=1;var e=qu(),t=pC();function n(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var a=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,s=e.useRef,c=e.useEffect,d=e.useMemo,h=e.useDebugValue;return ry.useSyncExternalStoreWithSelector=function(f,g,m,b,x){var w=s(null);if(w.current===null){var S={hasValue:!1,value:null};w.current=S}else S=w.current;w=d(function(){function T(k){if(!C){if(C=!0,M=k,k=b(k),x!==void 0&&S.hasValue){var A=S.value;if(x(A,k))return O=A}return O=k}if(A=O,a(M,k))return A;var j=b(k);return x!==void 0&&x(A,j)?(M=k,A):(M=k,O=j)}var C=!1,M,O,D=m===void 0?null:m;return[function(){return T(g())},D===null?void 0:function(){return T(D())}]},[g,m,b,x]);var E=i(f,w[0],w[1]);return c(function(){S.hasValue=!0,S.value=E},[E]),h(E),E},ry}var iR;function KH(){return iR||(iR=1,ny.exports=$H()),ny.exports}var GH=KH();const lv=[];let cv;function XH(){return cv}function WH(e){lv.push(e)}function Mb(e){const t=(n,a)=>{const i=Kn(QH).current;let s;try{cv=i;for(const c of lv)c.before(i);s=e(n,a);for(const c of lv)c.after(i);i.didInitialize=!0}finally{cv=void 0}return s};return t.displayName=e.displayName||e.name,t}function GO(e){return y.forwardRef(Mb(e))}function QH(){return{didInitialize:!1}}const ZH=ib(19),JH=ZH?t6:n6;function bt(e,t,n,a,i){return JH(e,t,n,a,i)}function e6(e,t,n,a,i){const s=y.useCallback(()=>t(e.getSnapshot(),n,a,i),[e,t,n,a,i]);return tb.useSyncExternalStore(e.subscribe,s,s)}WH({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 a=e.syncHooks[n],i=a.selector(a.store.state,a.a1,a.a2,a.a3);(a.didChange||!Object.is(a.value,i))&&(t=!0,a.value=i,a.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 i of e.syncHooks)n.add(i.store);const a=[];for(const i of n)a.push(i.subscribe(t));return()=>{for(const i of a)i()}}),tb.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function t6(e,t,n,a,i){const s=XH();if(!s)return e6(e,t,n,a,i);const c=s.syncIndex;s.syncIndex+=1;let d;return s.didInitialize?(d=s.syncHooks[c],(d.store!==e||d.selector!==t||!Object.is(d.a1,n)||!Object.is(d.a2,a)||!Object.is(d.a3,i))&&(d.store!==e&&(s.didChangeStore=!0),d.store=e,d.selector=t,d.a1=n,d.a2=a,d.a3=i,d.didChange=!0)):(d={store:e,selector:t,a1:n,a2:a,a3:i,value:t(e.getSnapshot(),n,a,i),didChange:!1},s.syncHooks.push(d)),d.value}function n6(e,t,n,a,i){return GH.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,a,i))}class XO{constructor(t){We(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));We(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 a of this.listeners){if(n!==this.updateTick)return;a(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,a,i){return bt(this,t,n,a,i)}}class om extends XO{constructor(t,n={},a){super(t),this.context=n,this.selectors=a}useSyncedValue(t,n){y.useDebugValue(t),Ue(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const a=this;Ue(()=>(a.state[t]!==n&&a.set(t,n),()=>{a.set(t,void 0)}),[a,t,n])}useSyncedValues(t){const n=this,a=Object.values(t);Ue(()=>{n.update(t)},[n,...a])}useControlledProp(t,n){y.useDebugValue(t);const a=n!==void 0;Ue(()=>{a&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,a])}select(t,n,a,i){const s=this.selectors[t];return s(this.state,n,a,i)}useState(t,n,a,i){return y.useDebugValue(t),bt(this,this.selectors[t],n,a,i)}useContextCallback(t,n){y.useDebugValue(t);const a=He(n??Or);this.context[t]=a}useStateSetter(t){const n=y.useRef(void 0);return n.current===void 0&&(n.current=a=>{this.set(t,a)}),n.current}observe(t,n){let a;typeof t=="function"?a=t:a=this.selectors[t];let i=a(this.state);return n(i,i,this),this.subscribe(s=>{const c=a(s);if(!Object.is(i,c)){const d=i;i=c,n(c,d,this)}})}}const r6={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 Nb extends om{constructor(n){const{nested:a,noEmit:i,onOpenChange:s,triggerElements:c,...d}=n;super({...d,positionReference:d.referenceElement,domReferenceElement:d.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:OO(),nested:a,noEmit:i,triggerElements:c},r6);We(this,"setOpen",(n,a)=>{var i,s;if((!n||!this.state.open||sO(a.event))&&(this.context.dataRef.current.openEvent=n?a.event:void 0),!this.context.noEmit){const c={open:n,reason:a.reason,nativeEvent:a.event,nested:this.context.nested,triggerElement:a.trigger};this.context.events.emit("openchange",c)}(s=(i=this.context).onOpenChange)==null||s.call(i,n,a)})}}function a6(e,t){const n=y.useRef(null),a=y.useRef(null);return y.useCallback(i=>{if(e!==void 0){if(n.current!==null){const s=n.current,c=a.current,d=t.context.triggerElements.getById(s);c&&d===c&&t.context.triggerElements.delete(s),n.current=null,a.current=null}i!==null&&(n.current=e,a.current=i,t.context.triggerElements.add(e,i))}},[t,e])}function WO(e,t,n,a){const i=n.useState("isMountedByTrigger",e),s=a6(e,n),c=He(d=>{if(s(d),!d||!n.select("open"))return;const h=n.select("activeTriggerId");if(h===e){n.update({activeTriggerElement:d,...a});return}h==null&&n.update({activeTriggerId:e,activeTriggerElement:d,...a})});return Ue(()=>{i&&n.update({activeTriggerElement:t.current,...a})},[i,n,t,...Object.values(a)]),{registerTrigger:c,isMountedByThisTrigger:i}}function Ab(e){const t=e.useState("open");Ue(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[a,i]=n.value;e.update({activeTriggerId:a,activeTriggerElement:i})}}},[t,e])}function Db(e,t,n){const{mounted:a,setMounted:i,transitionStatus:s}=td(e);t.useSyncedValues({mounted:a,transitionStatus:s});const c=He(()=>{var h,f;i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n==null||n(),(f=(h=t.context).onOpenChangeComplete)==null||f.call(h,!1)}),d=t.useState("preventUnmountingOnClose");return Oo({enabled:!d,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:s}}class nd{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const a=this.idMap.get(t);a!==n&&(a!==void 0&&this.elementsSet.delete(a),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 o6(){return new Nb({open:!1,floatingElement:null,referenceElement:null,triggerElements:new nd,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function kb(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:o6(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:En,inactiveTriggerProps:En,popupProps:En}}const Uf=Ye(e=>e.triggerIdProp??e.activeTriggerId),jb={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:Uf,activeTriggerElement:Ye(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:Ye((e,t)=>t!==void 0&&Uf(e)===t),isOpenedByTrigger:Ye((e,t)=>t!==void 0&&Uf(e)===t&&e.open),isMountedByTrigger:Ye((e,t)=>t!==void 0&&Uf(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 QO(e){const{open:t=!1,onOpenChange:n,elements:a={}}=e,i=Os(),s=Mo()!=null,c=Kn(()=>new Nb({open:t,onOpenChange:n,referenceElement:a.reference??null,floatingElement:a.floating??null,triggerElements:new nd,floatingId:i,nested:s,noEmit:!1})).current;return Ue(()=>{const d={open:t,floatingId:i};a.reference!==void 0&&(d.referenceElement=a.reference,d.domReferenceElement=tn(a.reference)?a.reference:null),a.floating!==void 0&&(d.floatingElement=a.floating),c.update(d)},[t,i,a.reference,a.floating,c]),c.context.onOpenChange=n,c.context.nested=s,c.context.noEmit=!1,c}function i6(e={}){const{nodeId:t,externalTree:n}=e,a=QO(e),i=e.rootContext||a,s={reference:i.useState("referenceElement"),floating:i.useState("floatingElement"),domReference:i.useState("domReferenceElement")},[c,d]=y.useState(null),h=y.useRef(null),f=Mi(n);Ue(()=>{s.domReference&&(h.current=s.domReference)},[s.domReference]);const g=SH({...e,elements:{...s,...c&&{reference:c}}}),m=y.useCallback(A=>{const j=tn(A)?{getBoundingClientRect:()=>A.getBoundingClientRect(),getClientRects:()=>A.getClientRects(),contextElement:A}:A;d(j),g.refs.setReference(j)},[g.refs]),[b,x]=y.useState(null),[w,S]=y.useState(null);i.useSyncedValue("referenceElement",b),i.useSyncedValue("domReferenceElement",tn(b)?b:null),i.useSyncedValue("floatingElement",w);const E=y.useCallback(A=>{(tn(A)||A===null)&&(h.current=A,x(A)),(tn(g.refs.reference.current)||g.refs.reference.current===null||A!==null&&!tn(A))&&g.refs.setReference(A)},[g.refs,x]),T=y.useCallback(A=>{S(A),g.refs.setFloating(A)},[g.refs]),C=y.useMemo(()=>({...g.refs,setReference:E,setFloating:T,setPositionReference:m,domReference:h}),[g.refs,E,T,m]),M=y.useMemo(()=>({...g.elements,domReference:s.domReference}),[g.elements,s.domReference]),O=i.useState("open"),D=i.useState("floatingId"),k=y.useMemo(()=>({...g,dataRef:i.context.dataRef,open:O,onOpenChange:i.setOpen,events:i.context.events,floatingId:D,refs:C,elements:M,nodeId:t,rootStore:i}),[g,C,M,t,i,O,D]);return Ue(()=>{i.context.dataRef.current.floatingContext=k;const A=f==null?void 0:f.nodesRef.current.find(j=>j.id===t);A&&(A.context=k)}),y.useMemo(()=>({...g,context:k,refs:C,elements:M,rootStore:i}),[g,C,M,k,i])}function Lb(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:a=!1,onOpenChange:i}=e,s=Os(),c=Mo()!=null,d=t.useState("open"),h=t.useState("activeTriggerElement"),f=t.useState(a?"popupElement":"positionerElement"),g=t.context.triggerElements,m=Kn(()=>new Nb({open:d,referenceElement:h,floatingElement:f,triggerElements:g,onOpenChange:i,floatingId:s,nested:c,noEmit:n})).current;return Ue(()=>{const b={open:d,floatingId:s,referenceElement:h,floatingElement:f};tn(h)&&(b.domReferenceElement=h),m.state.positionReference===m.state.referenceElement&&(b.positionReference=h),m.update(b)},[d,s,h,f,m]),m.context.onOpenChange=i,m.context.nested=c,m.context.noEmit=n,m}const ay=A4&&eO;function ZO(e,t={}){const n="rootStore"in e?e.rootStore:e,{events:a,dataRef:i}=n.context,{enabled:s=!0,delay:c}=t,d=y.useRef(!1),h=y.useRef(null),f=Dn(),g=y.useRef(!0);y.useEffect(()=>{const b=n.select("domReferenceElement");if(!s)return;const x=kn(b);function w(){const T=n.select("domReferenceElement");!n.select("open")&&vn(T)&&T===Hr(Yt(T))&&(d.current=!0)}function S(){g.current=!0}function E(){g.current=!1}return x.addEventListener("blur",w),ay&&(x.addEventListener("keydown",S,!0),x.addEventListener("pointerdown",E,!0)),()=>{x.removeEventListener("blur",w),ay&&(x.removeEventListener("keydown",S,!0),x.removeEventListener("pointerdown",E,!0))}},[n,s]),y.useEffect(()=>{if(!s)return;function b(x){if(x.reason===Ss||x.reason===em){const w=n.select("domReferenceElement");tn(w)&&(h.current=w,d.current=!0)}}return a.on("openchange",b),()=>{a.off("openchange",b)}},[a,s,n]);const m=y.useMemo(()=>({onMouseLeave(){d.current=!1,h.current=null},onFocus(b){const x=b.currentTarget;if(d.current){if(h.current===x)return;d.current=!1,h.current=null}const w=pr(b.nativeEvent);if(tn(w)){if(ay&&!b.relatedTarget){if(!g.current&&!Qh(w))return}else if(!_4(w))return}const S=vh(b.relatedTarget,n.context.triggerElements),{nativeEvent:E,currentTarget:T}=b,C=typeof c=="function"?c():c;if(n.select("open")&&S||C===0||C===void 0){n.setOpen(!0,pt(vl,E,T));return}f.start(C,()=>{d.current||n.setOpen(!0,pt(vl,E,T))})},onBlur(b){d.current=!1,h.current=null;const x=b.relatedTarget,w=b.nativeEvent,S=tn(x)&&x.hasAttribute(Yl("focus-guard"))&&x.getAttribute("data-type")==="outside";f.start(0,()=>{var M;const E=n.select("domReferenceElement"),T=Hr(E?E.ownerDocument:document);!x&&T===E||Ot((M=i.current.floatingContext)==null?void 0:M.refs.floating.current,T)||Ot(E,T)||S||vh(x??T,n.context.triggerElements)||n.setOpen(!1,pt(vl,w))})}}),[i,n,f,c]);return y.useMemo(()=>s?{reference:m,trigger:m}:{},[s,m])}const uv=Yl("safe-polygon"),s6=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${aO}`;function l6(e){return e?!!e.closest(s6):!1}class _b{constructor(){We(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});We(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 Ba,this.restTimeout=new Ba,this.handleCloseOptions=void 0}static create(){return new _b}}function JO(e){const t=Kn(_b.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),Xh(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}const c6=new Set(["click","mousedown"]);function eM(e,t={}){const n="rootStore"in e?e.rootStore:e,a=n.useState("open"),i=n.useState("floatingElement"),s=n.useState("domReferenceElement"),{dataRef:c}=n.context,{enabled:d=!0,closeDelay:h=0}=t,f=JO(n),g=Mi(),m=Mo(),b=He(()=>f.interactedInside?!0:c.current.openEvent?c6.has(c.current.openEvent.type):!1),x=He(()=>{var O;const M=(O=c.current.openEvent)==null?void 0:O.type;return(M==null?void 0:M.includes("mouse"))&&M!=="mousedown"}),w=He(M=>vh(M,n.context.triggerElements)),S=y.useCallback((M,O=!0)=>{const D=u6(h,f.pointerType);D&&!f.handler?f.openChangeTimeout.start(D,()=>n.setOpen(!1,pt(ur,M))):O&&(f.openChangeTimeout.clear(),n.setOpen(!1,pt(ur,M)))},[h,n,f]),E=He(()=>{f.unbindMouseMove(),f.handler=void 0}),T=He(()=>{if(f.performedPointerEventsMutation){const M=Yt(i).body;M.style.pointerEvents="",M.removeAttribute(uv),f.performedPointerEventsMutation=!1}}),C=He(M=>{const O=pr(M);if(!l6(O)){f.interactedInside=!1;return}f.interactedInside=!0});Ue(()=>{a||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,E(),T())},[a,f,E,T]),y.useEffect(()=>()=>{E()},[E]),y.useEffect(()=>T,[T]),Ue(()=>{var M,O,D;if(d&&a&&(M=f.handleCloseOptions)!=null&&M.blockPointerEvents&&x()&&tn(s)&&i){f.performedPointerEventsMutation=!0;const k=Yt(i).body;k.setAttribute(uv,"");const A=s,j=i,B=(D=(O=g==null?void 0:g.nodesRef.current.find(G=>G.id===m))==null?void 0:O.context)==null?void 0:D.elements.floating;return B&&(B.style.pointerEvents=""),k.style.pointerEvents="none",A.style.pointerEvents="auto",j.style.pointerEvents="auto",()=>{k.style.pointerEvents="",A.style.pointerEvents="",j.style.pointerEvents=""}}},[d,a,s,i,f,x,g,m]),y.useEffect(()=>{if(!d)return;function M(A){b()||!c.current.floatingContext||!n.select("open")||w(A.relatedTarget)||(T(),E(),b()||S(A))}function O(A){var j;f.openChangeTimeout.clear(),T(),(j=f.handler)==null||j.call(f,A),E()}function D(A){b()||S(A,!1)}const k=i;return k&&(k.addEventListener("mouseleave",M),k.addEventListener("mouseenter",O),k.addEventListener("mouseleave",D),k.addEventListener("pointerdown",C,!0)),()=>{k&&(k.removeEventListener("mouseleave",M),k.removeEventListener("mouseenter",O),k.removeEventListener("mouseleave",D),k.removeEventListener("pointerdown",C,!0))}},[d,i,n,c,b,w,S,T,E,C,f])}function u6(e,t){return t&&!xs(t)?0:typeof e=="function"?e():e}function oy(e){return typeof e=="function"?e():e}const d6={current:null};function tM(e,t={}){var G;const n="rootStore"in e?e.rootStore:e,{dataRef:a,events:i}=n.context,{enabled:s=!0,delay:c=0,handleClose:d=null,mouseOnly:h=!1,restMs:f=0,move:g=!0,triggerElementRef:m=d6,externalTree:b,isActiveTrigger:x=!0}=t,w=Mi(b),S=JO(n),E=Zn(d),T=Zn(c),C=Zn(f),M=Zn(s);x&&(S.handleCloseOptions=(G=E.current)==null?void 0:G.__options);const O=He(()=>S.interactedInside?!0:a.current.openEvent?["click","mousedown"].includes(a.current.openEvent.type):!1),D=He(K=>vh(K,n.context.triggerElements)),k=y.useCallback((K,I=!0)=>{const H=sh(T.current,"close",S.pointerType);H&&!S.handler?S.openChangeTimeout.start(H,()=>n.setOpen(!1,pt(ur,K))):I&&(S.openChangeTimeout.clear(),n.setOpen(!1,pt(ur,K)))},[T,n,S]),A=He(()=>{S.unbindMouseMove(),S.handler=void 0}),j=He(()=>{if(S.performedPointerEventsMutation){const K=Yt(n.select("domReferenceElement")).body;K.style.pointerEvents="",K.removeAttribute(uv),S.performedPointerEventsMutation=!1}});y.useEffect(()=>{if(!s)return;function K(I){I.open||(S.openChangeTimeout.clear(),S.restTimeout.clear(),S.blockMouseMove=!0,S.restTimeoutPending=!1)}return i.on("openchange",K),()=>{i.off("openchange",K)}},[s,i,S]);const B=He(K=>{var H;if(O()||!a.current.floatingContext||D(K.relatedTarget))return;const I=m.current;(H=E.current)==null||H.call(E,{...a.current.floatingContext,tree:w,x:K.clientX,y:K.clientY,onClose(){j(),A(),!O()&&I===n.select("domReferenceElement")&&k(K)}})(K)});return y.useEffect(()=>{if(!s)return;const K=m.current??(x?n.select("domReferenceElement"):null);if(!tn(K))return;function I(Y){if(S.openChangeTimeout.clear(),S.blockMouseMove=!1,h&&!xs(S.pointerType)||oy(C.current)>0&&!sh(T.current,"open"))return;const _=sh(T.current,"open",S.pointerType),L=n.select("domReferenceElement"),z=n.context.triggerElements,V=(z.hasElement(Y.target)||z.hasMatchingElement(X=>Ot(X,Y.target)))&&(!L||!Ot(L,Y.target)),Q=Y.currentTarget??null,P=n.select("open"),q=!P||V;V&&P?n.setOpen(!0,pt(ur,Y,Q)):_?S.openChangeTimeout.start(_,()=>{q&&n.setOpen(!0,pt(ur,Y,Q))}):q&&n.setOpen(!0,pt(ur,Y,Q))}function H(Y){if(O()){j();return}S.unbindMouseMove();const _=n.select("domReferenceElement"),L=Yt(_);if(S.restTimeout.clear(),S.restTimeoutPending=!1,D(Y.relatedTarget))return;if(E.current&&a.current.floatingContext){n.select("open")||S.openChangeTimeout.clear();const V=m.current;S.handler=E.current({...a.current.floatingContext,tree:w,x:Y.clientX,y:Y.clientY,onClose(){j(),A(),M.current&&!O()&&V===n.select("domReferenceElement")&&k(Y,!0)}});const Q=S.handler;Q(Y),L.addEventListener("mousemove",Q),S.unbindMouseMove=()=>{L.removeEventListener("mousemove",Q)};return}(S.pointerType==="touch"?!Ot(n.select("floatingElement"),Y.relatedTarget):!0)&&k(Y)}function F(Y){B(Y)}return n.select("open")&&K.addEventListener("mouseleave",F),g&&K.addEventListener("mousemove",I,{once:!0}),K.addEventListener("mouseenter",I),K.addEventListener("mouseleave",H),()=>{K.removeEventListener("mouseleave",F),g&&K.removeEventListener("mousemove",I),K.removeEventListener("mouseenter",I),K.removeEventListener("mouseleave",H)}},[A,j,a,T,k,n,s,E,B,S,x,O,D,h,g,C,m,w,M]),y.useMemo(()=>{if(!s)return;function K(I){S.pointerType=I.pointerType}return{onPointerDown:K,onPointerEnter:K,onMouseMove(I){const{nativeEvent:H}=I,F=I.currentTarget,Y=n.select("domReferenceElement"),_=n.context.triggerElements,L=n.select("open"),z=(_.hasElement(I.target)||_.hasMatchingElement(Q=>Ot(Q,I.target)))&&(!Y||!Ot(Y,I.target));if(h&&!xs(S.pointerType)||L&&!z||oy(C.current)===0||!z&&S.restTimeoutPending&&I.movementX**2+I.movementY**2<2)return;S.restTimeout.clear();function V(){if(S.restTimeoutPending=!1,O())return;const Q=n.select("open");!S.blockMouseMove&&(!Q||z)&&n.setOpen(!0,pt(ur,H,F))}S.pointerType==="touch"?or.flushSync(()=>{V()}):z&&L?V():(S.restTimeoutPending=!0,S.restTimeout.start(oy(C.current),V))}}},[s,S,O,h,n,C])}function rd(e=[]){const t=e.map(f=>f==null?void 0:f.reference),n=e.map(f=>f==null?void 0:f.floating),a=e.map(f=>f==null?void 0:f.item),i=e.map(f=>f==null?void 0:f.trigger),s=y.useCallback(f=>Hf(f,e,"reference"),t),c=y.useCallback(f=>Hf(f,e,"floating"),n),d=y.useCallback(f=>Hf(f,e,"item"),a),h=y.useCallback(f=>Hf(f,e,"trigger"),i);return y.useMemo(()=>({getReferenceProps:s,getFloatingProps:c,getItemProps:d,getTriggerProps:h}),[s,c,d,h])}function Hf(e,t,n){var c;const a=new Map,i=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[ev]="");for(const d in e)i&&e&&(d===nO||d===rO)||(s[d]=e[d]);for(let d=0;d<t.length;d+=1){let h;const f=(c=t[d])==null?void 0:c[n];typeof f=="function"?h=e?f(e):null:h=f,h&&sR(s,h,i,a)}return sR(s,e,i,a),s}function sR(e,t,n,a){var i;for(const s in t){const c=t[s];n&&(s===nO||s===rO)||(s.startsWith("on")?(a.has(s)||a.set(s,[]),typeof c=="function"&&((i=a.get(s))==null||i.push(c),e[s]=(...d)=>{var h;return(h=a.get(s))==null?void 0:h.map(f=>f(...d)).find(f=>f!==void 0)})):e[s]=c)}}const f6="Escape";function im(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Bf(e,t){return im(t,e===hb||e===Zu,e===bi||e===xi)}function iy(e,t,n){return im(t,e===Zu,n?e===bi:e===xi)||e==="Enter"||e===" "||e===""}function h6(e,t,n){return im(t,n?e===bi:e===xi,e===Zu)}function m6(e,t,n,a){const i=n?e===xi:e===bi,s=e===hb;return t==="both"||t==="horizontal"&&a&&a>1?e===f6:im(t,i,s)}function nM(e,t){const n="rootStore"in e?e.rootStore:e,a=n.useState("open"),i=n.useState("floatingElement"),s=n.useState("domReferenceElement"),c=n.context.dataRef,{listRef:d,activeIndex:h,onNavigate:f=()=>{},enabled:g=!0,selectedIndex:m=null,allowEscape:b=!1,loopFocus:x=!1,nested:w=!1,rtl:S=!1,virtual:E=!1,focusItemOnOpen:T="auto",focusItemOnHover:C=!0,openOnArrowKeyDown:M=!0,disabledIndices:O=void 0,orientation:D="vertical",parentOrientation:k,cols:A=1,id:j,resetOnPointerLeave:B=!0,externalTree:G}=t,K=ju(i),I=Zn(K),H=Mo(),F=Mi(G);Ue(()=>{c.current.orientation=D},[c,D]);const Y=tv(s),_=y.useRef(T),L=y.useRef(m??-1),z=y.useRef(null),V=y.useRef(!0),Q=He(Z=>{f(L.current===-1?null:L.current,Z)}),P=y.useRef(Q),q=y.useRef(!!i),X=y.useRef(a),W=y.useRef(!1),ce=y.useRef(!1),ie=Zn(O),de=Zn(a),ve=Zn(m),Se=Zn(B),Me=He(()=>{function Z(Be){E?F==null||F.events.emit("virtualfocus",Be):vu(Be,{sync:W.current,preventScroll:!0})}const be=d.current[L.current],ge=ce.current;be&&Z(be),(W.current?Be=>Be():requestAnimationFrame)(()=>{var it;const Be=d.current[L.current]||be;if(!Be)return;be||Z(Be),J&&(ge||!V.current)&&((it=Be.scrollIntoView)==null||it.call(Be,{block:"nearest",inline:"nearest"}))})});Ue(()=>{g&&(a&&i?(L.current=m??-1,_.current&&m!=null&&(ce.current=!0,Q())):q.current&&(L.current=-1,P.current()))},[g,a,i,m,Q]),Ue(()=>{if(g){if(!a){W.current=!1;return}if(i)if(h==null){if(W.current=!1,ve.current!=null)return;if(q.current&&(L.current=-1,Me()),(!X.current||!q.current)&&_.current&&(z.current!=null||_.current===!0&&z.current==null)){let Z=0;const be=()=>{d.current[0]==null?(Z<2&&(Z?requestAnimationFrame:queueMicrotask)(be),Z+=1):(L.current=z.current==null||iy(z.current,D,S)||w?ah(d):av(d),z.current=null,Q())};be()}}else gl(d,h)||(L.current=h,Me(),ce.current=!1)}},[g,a,i,h,ve,w,d,D,S,Q,Me,ie]),Ue(()=>{var Be,Ae;if(!g||i||!F||E||!q.current)return;const Z=F.nodesRef.current,be=(Ae=(Be=Z.find(it=>it.id===H))==null?void 0:Be.context)==null?void 0:Ae.elements.floating,ge=Hr(Yt(i)),Pe=Z.some(it=>it.context&&Ot(it.context.elements.floating,ge));be&&!Pe&&V.current&&be.focus({preventScroll:!0})},[g,i,F,H,E]),Ue(()=>{P.current=Q,X.current=a,q.current=!!i}),Ue(()=>{a||(z.current=null,_.current=T)},[a,T]);const ke=h!=null,J=y.useMemo(()=>{function Z(ge){if(!de.current)return;const Pe=d.current.indexOf(ge.currentTarget);Pe!==-1&&L.current!==Pe&&(L.current=Pe,Q(ge))}return{onFocus(ge){W.current=!0,Z(ge)},onClick:({currentTarget:ge})=>ge.focus({preventScroll:!0}),onMouseMove(ge){W.current=!0,ce.current=!1,C&&Z(ge)},onPointerLeave(ge){var Be;if(!de.current||!V.current||ge.pointerType==="touch")return;W.current=!0;const Pe=ge.relatedTarget;!C||d.current.includes(Pe)||Se.current&&(vu(null,{sync:!0}),L.current=-1,Q(ge),E||(Be=I.current)==null||Be.focus({preventScroll:!0}))}}},[de,I,C,d,Q,Se,E]),ue=y.useCallback(()=>{var Z,be,ge;return k??((ge=(be=(Z=F==null?void 0:F.nodesRef.current.find(Pe=>Pe.id===H))==null?void 0:Z.context)==null?void 0:be.dataRef)==null?void 0:ge.current.orientation)},[H,F,k]),pe=He(Z=>{if(V.current=!1,W.current=!0,Z.which===229||!de.current&&Z.currentTarget===I.current)return;if(w&&m6(Z.key,D,S,A)){Bf(Z.key,ue())||cr(Z),n.setOpen(!1,pt(oh,Z.nativeEvent)),vn(s)&&(E?F==null||F.events.emit("virtualfocus",s):s.focus());return}const be=L.current,ge=ah(d,O),Pe=av(d,O);if(Y||(Z.key==="Home"&&(cr(Z),L.current=ge,Q(Z)),Z.key==="End"&&(cr(Z),L.current=Pe,Q(Z))),A>1){const Be=Array.from({length:d.current.length},()=>({width:1,height:1})),Ae=uO(Be,A,!1),it=Ae.findIndex(oe=>oe!=null&&!wi(d,oe,O)),wt=Ae.reduce((oe,xe,Ie)=>xe!=null&&!wi(d,xe,O)?Ie:oe,-1),xt=Ae[cO({current:Ae.map(oe=>oe!=null?d.current[oe]:null)},{event:Z,orientation:D,loopFocus:x,rtl:S,cols:A,disabledIndices:fO([...(typeof O!="function"?O:null)||d.current.map((oe,xe)=>wi(d,xe,O)?xe:void 0),void 0],Ae),minIndex:it,maxIndex:wt,prevIndex:dO(L.current>Pe?ge:L.current,Be,Ae,A,Z.key===Zu?"bl":Z.key===(S?bi:xi)?"tr":"tl"),stopEvent:!0})];if(xt!=null&&(L.current=xt,Q(Z)),D==="both")return}if(Bf(Z.key,D)){if(cr(Z),a&&!E&&Hr(Z.currentTarget.ownerDocument)===Z.currentTarget){L.current=iy(Z.key,D,S)?ge:Pe,Q(Z);return}iy(Z.key,D,S)?x?be>=Pe?b&&be!==d.current.length?L.current=-1:(W.current=!1,L.current=ge):L.current=ar(d,{startingIndex:be,disabledIndices:O}):L.current=Math.min(Pe,ar(d,{startingIndex:be,disabledIndices:O})):x?be<=ge?b&&be!==-1?L.current=d.current.length:(W.current=!1,L.current=Pe):L.current=ar(d,{startingIndex:be,decrement:!0,disabledIndices:O}):L.current=Math.max(ge,ar(d,{startingIndex:be,decrement:!0,disabledIndices:O})),gl(d,L.current)&&(L.current=-1),Q(Z)}}),De=y.useMemo(()=>E&&a&&ke&&{"aria-activedescendant":`${j}-${h}`},[E,a,ke,j,h]),Ce=y.useMemo(()=>({"aria-orientation":D==="both"?void 0:D,...Y?{}:De,onKeyDown(Z){if(Z.key==="Tab"&&Z.shiftKey&&a&&!E){const be=pr(Z.nativeEvent);if(be&&!Ot(I.current,be))return;cr(Z),n.setOpen(!1,pt(Es,Z.nativeEvent)),vn(s)&&s.focus();return}pe(Z)},onPointerMove(){V.current=!0}}),[De,pe,I,D,Y,n,a,E,s]),we=y.useMemo(()=>{function Z(ge){T==="auto"&&oO(ge.nativeEvent)&&(_.current=!E)}function be(ge){_.current=T,T==="auto"&&iO(ge.nativeEvent)&&(_.current=!0)}return{onKeyDown(ge){const Pe=n.select("open");V.current=!1;const Be=ge.key.startsWith("Arrow"),Ae=h6(ge.key,ue(),S),it=Bf(ge.key,D),wt=(w?Ae:it)||ge.key==="Enter"||ge.key.trim()==="";if(E&&Pe)return pe(ge);if(!(!Pe&&!M&&Be)){if(wt){const xt=Bf(ge.key,ue());z.current=w&&xt?null:ge.key}if(w){Ae&&(cr(ge),Pe?(L.current=ah(d,ie.current),Q(ge)):n.setOpen(!0,pt(oh,ge.nativeEvent,ge.currentTarget)));return}it&&(ve.current!=null&&(L.current=ve.current),cr(ge),!Pe&&M?n.setOpen(!0,pt(oh,ge.nativeEvent,ge.currentTarget)):pe(ge),Pe&&Q(ge))}},onFocus(ge){n.select("open")&&!E&&(L.current=-1,Q(ge))},onPointerDown:be,onPointerEnter:be,onMouseDown:Z,onClick:Z}},[pe,ie,T,d,w,Q,n,M,D,ue,S,ve,E]),Te=y.useMemo(()=>({...De,...we}),[De,we]);return y.useMemo(()=>g?{reference:Te,floating:Ce,item:J,trigger:we}:{},[g,Te,Ce,we,J])}const p6=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function rM(e,t={}){const n="rootStore"in e?e.rootStore:e,a=n.useState("open"),i=n.useState("floatingId"),s=n.useState("domReferenceElement"),c=n.useState("floatingElement"),{role:d="dialog"}=t,h=Os(),f=(s==null?void 0:s.id)||h,g=y.useMemo(()=>{var C;return((C=ju(c))==null?void 0:C.id)||i},[c,i]),m=p6.get(d)??d,x=Mo()!=null,w=y.useMemo(()=>m==="tooltip"||d==="label"?En:{"aria-haspopup":m==="alertdialog"?"dialog":m,"aria-expanded":"false",...m==="listbox"&&{role:"combobox"},...m==="menu"&&x&&{role:"menuitem"},...d==="select"&&{"aria-autocomplete":"none"},...d==="combobox"&&{"aria-autocomplete":"list"}},[m,x,d]),S=y.useMemo(()=>m==="tooltip"||d==="label"?{[`aria-${d==="label"?"labelledby":"describedby"}`]:a?g:void 0}:{...w,"aria-expanded":a?"true":"false","aria-controls":a?g:void 0,...m==="menu"&&{id:f}},[m,g,a,f,d,w]),E=y.useMemo(()=>{const C={id:g,...m&&{role:m}};return m==="tooltip"||d==="label"?C:{...C,...m==="menu"&&{"aria-labelledby":f}}},[m,g,f,d]),T=y.useCallback(({active:C,selected:M})=>{const O={role:"option",...C&&{id:`${g}-fui-option`}};switch(d){case"select":case"combobox":return{...O,"aria-selected":M}}return{}},[g,d]);return y.useMemo(()=>({reference:S,floating:E,item:T,trigger:w}),[S,E,w,T])}function aM(e,t){const n="rootStore"in e?e.rootStore:e,a=n.context.dataRef,i=n.useState("open"),{listRef:s,activeIndex:c,onMatch:d,onTypingChange:h,enabled:f=!0,resetMs:g=750,selectedIndex:m=null}=t,b=Dn(),x=y.useRef(""),w=y.useRef(m??c??-1),S=y.useRef(null);Ue(()=>{!i&&m!==null||(b.clear(),S.current=null,x.current!==""&&(x.current=""))},[i,m,b]),Ue(()=>{i&&x.current===""&&(w.current=m??c??-1)},[i,m,c]);const E=He(D=>{D?a.current.typing||(a.current.typing=D,h==null||h(D)):a.current.typing&&(a.current.typing=D,h==null||h(D))}),T=He(D=>{function k(I,H,F){const Y=H.find(_=>(_==null?void 0:_.toLocaleLowerCase().indexOf(F.toLocaleLowerCase()))===0);return Y?I.indexOf(Y):-1}const A=s.current;if(x.current.length>0&&x.current[0]!==" "&&(k(A,A,x.current)===-1?E(!1):D.key===" "&&cr(D)),A==null||D.key.length!==1||D.ctrlKey||D.metaKey||D.altKey)return;i&&D.key!==" "&&(cr(D),E(!0));const j=x.current==="";j&&(w.current=m??c??-1),A.every(I=>{var H,F;return I?((H=I[0])==null?void 0:H.toLocaleLowerCase())!==((F=I[1])==null?void 0:F.toLocaleLowerCase()):!0})&&x.current===D.key&&(x.current="",w.current=S.current),x.current+=D.key,b.start(g,()=>{x.current="",w.current=S.current,E(!1)});const G=j?m??c??-1:w.current,K=k(A,[...A.slice((G||0)+1),...A.slice(0,(G||0)+1)],x.current);K!==-1?(d==null||d(K),S.current=K):D.key!==" "&&(x.current="",E(!1))}),C=He(D=>{const k=D.relatedTarget,A=n.select("domReferenceElement"),j=n.select("floatingElement"),B=Ot(A,k),G=Ot(j,k);B||G||(b.clear(),x.current="",w.current=S.current,E(!1))}),M=y.useMemo(()=>({onKeyDown:T,onBlur:C}),[T,C]),O=y.useMemo(()=>({onKeyDown:T,onKeyUp(D){D.key===" "&&E(!1)},onBlur:C}),[T,C,E]);return y.useMemo(()=>f?{reference:M,floating:O}:{},[f,M,O])}function lR(e,t){const[n,a]=e;let i=!1;const s=t.length;for(let c=0,d=s-1;c<s;d=c++){const[h,f]=t[c]||[0,0],[g,m]=t[d]||[0,0];f>=a!=m>=a&&n<=(g-h)*(a-f)/(m-f)+h&&(i=!i)}return i}function g6(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function oM(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:a=!0}=e,i=new Ba;let s=!1,c=null,d=null,h=typeof performance<"u"?performance.now():0;function f(m,b){const x=performance.now(),w=x-h;if(c===null||d===null||w===0)return c=m,d=b,h=x,null;const S=m-c,E=b-d,C=Math.sqrt(S*S+E*E)/w;return c=m,d=b,h=x,C}const g=({x:m,y:b,placement:x,elements:w,onClose:S,nodeId:E,tree:T})=>function(M){function O(){i.clear(),S()}if(i.clear(),!w.domReference||!w.floating||x==null||m==null||b==null)return;const{clientX:D,clientY:k}=M,A=[D,k],j=pr(M),B=M.type==="mouseleave",G=Ot(w.floating,j),K=Ot(w.domReference,j),I=w.domReference.getBoundingClientRect(),H=w.floating.getBoundingClientRect(),F=x.split("-")[0],Y=m>H.right-H.width/2,_=b>H.bottom-H.height/2,L=g6(A,I),z=H.width>I.width,V=H.height>I.height,Q=(z?I:H).left,P=(z?I:H).right,q=(V?I:H).top,X=(V?I:H).bottom;if(G&&(s=!0,!B))return;if(K&&(s=!1),K&&!B){s=!0;return}if(B&&tn(M.relatedTarget)&&Ot(w.floating,M.relatedTarget)||T&&ms(T.nodesRef.current,E).some(({context:ie})=>ie==null?void 0:ie.open))return;if(F==="top"&&b>=I.bottom-1||F==="bottom"&&b<=I.top+1||F==="left"&&m>=I.right-1||F==="right"&&m<=I.left+1)return O();let W=[];switch(F){case"top":W=[[Q,I.top+1],[Q,H.bottom-1],[P,H.bottom-1],[P,I.top+1]];break;case"bottom":W=[[Q,H.top+1],[Q,I.bottom-1],[P,I.bottom-1],[P,H.top+1]];break;case"left":W=[[H.right-1,X],[H.right-1,q],[I.left+1,q],[I.left+1,X]];break;case"right":W=[[I.right-1,X],[I.right-1,q],[H.left+1,q],[H.left+1,X]];break}function ce([ie,de]){switch(F){case"top":{const ve=[z?ie+t/2:Y?ie+t*4:ie-t*4,de+t+1],Se=[z?ie-t/2:Y?ie+t*4:ie-t*4,de+t+1],Me=[[H.left,Y||z?H.bottom-t:H.top],[H.right,Y?z?H.bottom-t:H.top:H.bottom-t]];return[ve,Se,...Me]}case"bottom":{const ve=[z?ie+t/2:Y?ie+t*4:ie-t*4,de-t],Se=[z?ie-t/2:Y?ie+t*4:ie-t*4,de-t],Me=[[H.left,Y||z?H.top+t:H.bottom],[H.right,Y?z?H.top+t:H.bottom:H.top+t]];return[ve,Se,...Me]}case"left":{const ve=[ie+t+1,V?de+t/2:_?de+t*4:de-t*4],Se=[ie+t+1,V?de-t/2:_?de+t*4:de-t*4];return[...[[_||V?H.right-t:H.left,H.top],[_?V?H.right-t:H.left:H.right-t,H.bottom]],ve,Se]}case"right":{const ve=[ie-t,V?de+t/2:_?de+t*4:de-t*4],Se=[ie-t,V?de-t/2:_?de+t*4:de-t*4],Me=[[_||V?H.left+t:H.right,H.top],[_?V?H.left+t:H.right:H.left+t,H.bottom]];return[ve,Se,...Me]}default:return[]}}if(!lR([D,k],W)){if(s&&!L)return O();if(!B&&a){const ie=f(M.clientX,M.clientY);if(ie!==null&&ie<.1)return O()}lR([D,k],ce([m,b]))?!s&&a&&i.start(40,O):O()}};return g.__options={blockPointerEvents:n},g}let y6=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),v6=(function(e){return e[e.open=rs.open]="open",e[e.closed=rs.closed]="closed",e[e.startingStyle=rs.startingStyle]="startingStyle",e[e.endingStyle=rs.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const iM=y.createContext(void 0);function b6(){const e=y.useContext(iM);if(e===void 0)throw new Error(pn(26));return e}const wl="ArrowUp",as="ArrowDown",Lu="ArrowLeft",Sl="ArrowRight",ad="Home",od="End",sM=new Set([Lu,Sl]),x6=new Set([Lu,Sl,ad,od]),lM=new Set([wl,as]),w6=new Set([wl,as,ad,od]),cM=new Set([...sM,...lM]),S6=new Set([...cM,ad,od]),Ib=new Set([wl,as,Lu,Sl,ad,od]),E6="Shift",R6="Control",T6="Alt",C6="Meta",O6=new Set([E6,R6,T6,C6]);function M6(e){return vn(e)&&e.tagName==="INPUT"}function cR(e){return!!(M6(e)&&e.selectionStart!=null||vn(e)&&e.tagName==="TEXTAREA")}function uR(e,t,n,a){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,s=e.scrollTop;const c=e.clientWidth<e.scrollWidth,d=e.clientHeight<e.scrollHeight;if(c&&a!=="vertical"){const h=dR(e,t,"left"),f=Ff(e),g=Ff(t);n==="ltr"&&(h+t.offsetWidth+g.scrollMarginRight>e.scrollLeft+e.clientWidth-f.scrollPaddingRight?i=h+t.offsetWidth+g.scrollMarginRight-e.clientWidth+f.scrollPaddingRight:h-g.scrollMarginLeft<e.scrollLeft+f.scrollPaddingLeft&&(i=h-g.scrollMarginLeft-f.scrollPaddingLeft)),n==="rtl"&&(h-g.scrollMarginRight<e.scrollLeft+f.scrollPaddingLeft?i=h-g.scrollMarginLeft-f.scrollPaddingLeft:h+t.offsetWidth+g.scrollMarginRight>e.scrollLeft+e.clientWidth-f.scrollPaddingRight&&(i=h+t.offsetWidth+g.scrollMarginRight-e.clientWidth+f.scrollPaddingRight))}if(d&&a!=="horizontal"){const h=dR(e,t,"top"),f=Ff(e),g=Ff(t);h-g.scrollMarginTop<e.scrollTop+f.scrollPaddingTop?s=h-g.scrollMarginTop-f.scrollPaddingTop:h+t.offsetHeight+g.scrollMarginBottom>e.scrollTop+e.clientHeight-f.scrollPaddingBottom&&(s=h+t.offsetHeight+g.scrollMarginBottom-e.clientHeight+f.scrollPaddingBottom)}e.scrollTo({left:i,top:s,behavior:"auto"})}function dR(e,t,n){const a=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[a],t.offsetParent!==e);)t=t.offsetParent;return i}function Ff(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}}const N6={...qa,...Co,nestedDialogOpen(e){return e?{[v6.nestedDialogOpen]:""}:null}},zb=y.forwardRef(function(t,n){const{className:a,finalFocus:i,initialFocus:s,render:c,...d}=t,{store:h}=Oi(),f=h.useState("descriptionElementId"),g=h.useState("disablePointerDismissal"),m=h.useState("floatingRootContext"),b=h.useState("popupProps"),x=h.useState("modal"),w=h.useState("mounted"),S=h.useState("nested"),E=h.useState("nestedOpenDialogCount"),T=h.useState("open"),C=h.useState("openMethod"),M=h.useState("titleElementId"),O=h.useState("transitionStatus"),D=h.useState("role");b6(),Oo({open:T,ref:h.context.popupRef,onComplete(){var K,I;T&&((I=(K=h.context).onOpenChangeComplete)==null||I.call(K,!0))}});function k(K){return K==="touch"?h.context.popupRef.current:!0}const A=s===void 0?k:s,j=E>0,G=Mt("div",t,{state:{open:T,nested:S,transitionStatus:O,nestedDialogOpen:j},props:[b,{"aria-labelledby":M??void 0,"aria-describedby":f??void 0,role:D,tabIndex:-1,hidden:!w,onKeyDown(K){Ib.has(K.key)&&K.stopPropagation()},style:{[y6.nestedDialogs]:E}},d],ref:[n,h.context.popupRef,h.useStateSetter("popupElement")],stateAttributesMapping:N6});return R.jsx(Cb,{context:m,openInteractionType:C,disabled:!w,closeOnFocusOut:!g,initialFocus:A,returnFocus:i,modal:x!==!1,restoreFocus:"popup",children:G})});function Pb(e){return ib(19)?e:e?"true":void 0}const Ub=y.forwardRef(function(t,n){const{cutout:a,...i}=t;let s;if(a){const c=a==null?void 0:a.getBoundingClientRect();s=`polygon(
|
|
288
|
-
0% 0%,
|
|
289
|
-
100% 0%,
|
|
290
|
-
100% 100%,
|
|
291
|
-
0% 100%,
|
|
292
|
-
0% 0%,
|
|
293
|
-
${c.left}px ${c.top}px,
|
|
294
|
-
${c.left}px ${c.bottom}px,
|
|
295
|
-
${c.right}px ${c.bottom}px,
|
|
296
|
-
${c.right}px ${c.top}px,
|
|
297
|
-
${c.left}px ${c.top}px
|
|
298
|
-
)`}return R.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})}),Hb=y.forwardRef(function(t,n){const{keepMounted:a=!1,...i}=t,{store:s}=Oi(),c=s.useState("mounted"),d=s.useState("modal"),h=s.useState("open");return c||a?R.jsx(iM.Provider,{value:a,children:R.jsxs(Rb,{ref:n,...i,children:[c&&d===!0&&R.jsx(Ub,{ref:s.context.internalBackdropRef,inert:Pb(!h)}),t.children]})}):null});function sm(e){const t=y.useRef(!0);t.current&&(t.current=!1,e())}let fR={},hR={},mR="";function A6(e){if(typeof document>"u")return!1;const t=Yt(e);return kn(t).innerWidth-t.documentElement.clientWidth>0}function D6(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Yt(e),a=n.documentElement,i=n.body,s=Ti(a)?a:i,c=s.style.overflowY,d=a.style.scrollbarGutter;a.style.scrollbarGutter="stable",s.style.overflowY="scroll";const h=s.offsetWidth;s.style.overflowY="hidden";const f=s.offsetWidth;return s.style.overflowY=c,a.style.scrollbarGutter=d,h===f}function k6(e){const t=Yt(e),n=t.documentElement,a=t.body,i=Ti(n)?n:a,s={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(i.style,s)}}function j6(e){var b;const t=Yt(e),n=t.documentElement,a=t.body,i=kn(n);let s=0,c=0,d=!1;const h=An.create();if(Wh&&(((b=i.visualViewport)==null?void 0:b.scale)??1)!==1)return()=>{};function f(){const x=i.getComputedStyle(n),w=i.getComputedStyle(a),T=(x.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,c=n.scrollLeft,fR={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},mR=n.style.scrollBehavior,hR={position:a.style.position,height:a.style.height,width:a.style.width,boxSizing:a.style.boxSizing,overflowY:a.style.overflowY,overflowX:a.style.overflowX,scrollBehavior:a.style.scrollBehavior};const C=n.scrollHeight>n.clientHeight,M=n.scrollWidth>n.clientWidth,O=x.overflowY==="scroll"||w.overflowY==="scroll",D=x.overflowX==="scroll"||w.overflowX==="scroll",k=Math.max(0,i.innerWidth-a.clientWidth),A=Math.max(0,i.innerHeight-a.clientHeight),j=parseFloat(w.marginTop)+parseFloat(w.marginBottom),B=parseFloat(w.marginLeft)+parseFloat(w.marginRight),G=Ti(n)?n:a;if(d=D6(e),d){n.style.scrollbarGutter=T,G.style.overflowY="hidden",G.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:T,overflowY:"hidden",overflowX:"hidden"}),(C||O)&&(n.style.overflowY="scroll"),(M||D)&&(n.style.overflowX="scroll"),Object.assign(a.style,{position:"relative",height:j||A?`calc(100dvh - ${j+A}px)`:"100dvh",width:B||k?`calc(100vw - ${B+k}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),a.scrollTop=s,a.scrollLeft=c,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function g(){Object.assign(n.style,fR),Object.assign(a.style,hR),d||(n.scrollTop=s,n.scrollLeft=c,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=mR)}function m(){g(),h.request(f)}return f(),i.addEventListener("resize",m),()=>{h.cancel(),g(),typeof i.removeEventListener=="function"&&i.removeEventListener("resize",m)}}class L6{constructor(){We(this,"lockCount",0);We(this,"restore",null);We(this,"timeoutLock",Ba.create());We(this,"timeoutUnlock",Ba.create());We(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});We(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 a=Yt(t).documentElement,i=kn(a).getComputedStyle(a).overflowY;if(i==="hidden"||i==="clip"){this.restore=Or;return}const s=JC||!A6(t);this.restore=s?k6(t):j6(t)}}const _6=new L6;function Bb(e=!0,t=null){Ue(()=>{if(e)return _6.acquire(t)},[e,t])}function I6(e){const t=y.useRef(""),n=y.useCallback(i=>{i.defaultPrevented||(t.current=i.pointerType,e(i,i.pointerType))},[e]);return{onClick:y.useCallback(i=>{if(i.detail===0){e(i,"keyboard");return}"pointerType"in i?e(i,i.pointerType):e(i,t.current),t.current=""},[e]),onPointerDown:n}}function Fb(e){const[t,n]=y.useState(null),a=He((d,h)=>{e||n(h||(JC?"touch":""))}),i=y.useCallback(()=>{n(null)},[]),{onClick:s,onPointerDown:c}=I6(a);return y.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:s,onPointerDown:c}}),[t,i,s,c])}function uM(e){const{store:t,parentContext:n,actionsRef:a}=e,i=t.useState("open"),s=t.useState("disablePointerDismissal"),c=t.useState("modal"),d=t.useState("popupElement"),{openMethod:h,triggerProps:f,reset:g}=Fb(i);Ab(t);const{forceUnmount:m}=Db(i,t,()=>{g()}),b=He(G=>{const K=pt(G);return K.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},K}),x=y.useCallback(()=>{t.setOpen(!1,b(bb))},[t,b]);y.useImperativeHandle(a,()=>({unmount:m,close:x}),[m,x]);const w=Lb({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[S,E]=y.useState(0),T=S===0,C=rM(w),M=am(w,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:c==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(G){if(!t.context.outsidePressEnabledRef.current||"button"in G&&G.button!==0||"touches"in G&&G.touches.length!==1)return!1;const K=pr(G);if(T&&!s){const I=K;return c&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===I||t.context.backdropRef.current===I||Ot(I,d)&&!(I!=null&&I.hasAttribute("data-base-ui-portal")):!0}return!1},escapeKey:T});Bb(i&&c===!0,d);const{getReferenceProps:O,getFloatingProps:D,getTriggerProps:k}=rd([C,M]);t.useContextCallback("onNestedDialogOpen",G=>{E(G+1)}),t.useContextCallback("onNestedDialogClose",()=>{E(0)}),y.useEffect(()=>(n!=null&&n.onNestedDialogOpen&&i&&n.onNestedDialogOpen(S),n!=null&&n.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n!=null&&n.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,S]);const A=y.useMemo(()=>O(f),[O,f]),j=y.useMemo(()=>k(f),[k,f]),B=y.useMemo(()=>D(),[D]);t.useSyncedValues({openMethod:h,activeTriggerProps:A,inactiveTriggerProps:j,popupProps:B,floatingRootContext:w,nestedOpenDialogCount:S})}const z6={...jb,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 dM extends om{constructor(n){super(P6(n),{popupRef:y.createRef(),backdropRef:y.createRef(),internalBackdropRef:y.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new nd,onOpenChange:void 0,onOpenChangeComplete:void 0},z6);We(this,"setOpen",(n,a)=>{var d,h,f,g;if(a.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&a.trigger==null&&this.state.activeTriggerId!=null&&(a.trigger=this.state.activeTriggerElement??void 0),(h=(d=this.context).onOpenChange)==null||h.call(d,n,a),a.isCanceled)return;const i={open:n,nativeEvent:a.event,reason:a.reason,nested:this.state.nested};(f=this.state.floatingRootContext.context.events)==null||f.emit("openchange",i);const s={open:n},c=((g=a.trigger)==null?void 0:g.id)??null;(c||n)&&(s.activeTriggerId=c,s.activeTriggerElement=a.trigger??null),this.update(s)})}}function P6(e={}){return{...kb(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function fM(e){const{children:t,open:n,defaultOpen:a=!1,onOpenChange:i,onOpenChangeComplete:s,disablePointerDismissal:c=!1,modal:d=!0,actionsRef:h,handle:f,triggerId:g,defaultTriggerId:m=null}=e,b=Oi(!0),x=!!b,w=Kn(()=>(f==null?void 0:f.store)??new dM({open:a,openProp:n,activeTriggerId:m,triggerIdProp:g,modal:d,disablePointerDismissal:c,nested:x})).current;sm(()=>{n===void 0&&w.state.open===!1&&a===!0&&w.update({open:!0,activeTriggerId:m})}),w.useControlledProp("openProp",n),w.useControlledProp("triggerIdProp",g),w.useSyncedValues({disablePointerDismissal:c,nested:x,modal:d}),w.useContextCallback("onOpenChange",i),w.useContextCallback("onOpenChangeComplete",s);const S=w.useState("payload");uM({store:w,actionsRef:h,parentContext:b==null?void 0:b.store.context});const E=y.useMemo(()=>({store:w}),[w]);return R.jsx(xb.Provider,{value:E,children:typeof t=="function"?t({payload:S}):t})}const Vb=y.forwardRef(function(t,n){const{render:a,className:i,id:s,...c}=t,{store:d}=Oi(),h=Ra(s);return d.useSyncedValueWithCleanup("titleElementId",h),Mt("h2",t,{ref:n,props:[{id:h},c]})});function U6({...e}){return R.jsx(fM,{"data-slot":"sheet",...e})}function H6({...e}){return R.jsx(Hb,{"data-slot":"sheet-portal",...e})}function B6({className:e,...t}){return R.jsx(wb,{"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})}const F6="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-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10";function V6({className:e,children:t,side:n="right",showCloseButton:a=!0,animation:i="slide",...s}){return R.jsxs(H6,{children:[R.jsx(B6,{}),R.jsxs(zb,{"data-slot":"sheet-content","data-side":n,className:Le("bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 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",i==="slide"&&F6,i==="bottom-up"&&"data-open:slide-in-from-bottom-16 data-closed:slide-out-to-bottom-16",i==="top-down"&&"data-open:slide-in-from-top-16 data-closed:slide-out-to-top-16",e),...s,children:[t,a&&R.jsxs(tm,{"data-slot":"sheet-close",render:R.jsx(Rn,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[R.jsx(Hl,{}),R.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Y6({className:e,...t}){return R.jsx("div",{"data-slot":"sheet-header",className:Le("gap-0.5 p-4 flex flex-col",e),...t})}function q6({className:e,...t}){return R.jsx(Vb,{"data-slot":"sheet-title",className:Le("text-foreground text-base font-medium",e),...t})}function $6({className:e,...t}){return R.jsx(Sb,{"data-slot":"sheet-description",className:Le("text-muted-foreground text-sm",e),...t})}const hM=y.createContext(void 0);function id(e){const t=y.useContext(hM);if(t===void 0&&!e)throw new Error(pn(72));return t}const K6={...jb,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 Yb extends om{constructor(n){super({...G6(),...n},{popupRef:y.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new nd},K6);We(this,"setOpen",(n,a)=>{var f,g;const i=a.reason,s=i===ur,c=n&&i===vl,d=!n&&(i===Ss||i===em);if(a.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},(g=(f=this.context).onOpenChange)==null||g.call(f,n,a),a.isCanceled)return;const h=()=>{var x;const m={open:n,openChangeReason:i};c?m.instantType="focus":d?m.instantType="dismiss":i===ur&&(m.instantType=void 0);const b=((x=a.trigger)==null?void 0:x.id)??null;(b||n)&&(m.activeTriggerId=b,m.activeTriggerElement=a.trigger??null),this.update(m)};s?or.flushSync(h):h()})}static useStore(n,a){const i=Kn(()=>new Yb(a)).current,s=n??i,c=Lb({popupStore:s,onOpenChange:s.setOpen});return s.state.floatingRootContext=c,s}}function G6(){return{...kb(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}const X6=Mb(function(t){const{disabled:n=!1,defaultOpen:a=!1,open:i,disableHoverablePopup:s=!1,trackCursorAxis:c="none",actionsRef:d,onOpenChange:h,onOpenChangeComplete:f,handle:g,triggerId:m,defaultTriggerId:b=null,children:x}=t,w=Yb.useStore(g==null?void 0:g.store,{open:a,openProp:i,activeTriggerId:b,triggerIdProp:m});sm(()=>{i===void 0&&w.state.open===!1&&a===!0&&w.update({open:!0,activeTriggerId:b})}),w.useControlledProp("openProp",i),w.useControlledProp("triggerIdProp",m),w.useContextCallback("onOpenChange",h),w.useContextCallback("onOpenChangeComplete",f);const S=w.useState("open"),E=!n&&S,T=w.useState("activeTriggerId"),C=w.useState("payload");w.useSyncedValues({trackCursorAxis:c,disableHoverablePopup:s}),Ue(()=>{S&&n&&w.setOpen(!1,pt(gU))},[S,n,w]),w.useSyncedValue("disabled",n),Ab(w);const{forceUnmount:M,transitionStatus:O}=Db(E,w),D=w.useState("isInstantPhase"),k=w.useState("instantType"),A=w.useState("lastOpenChangeReason"),j=y.useRef(null);Ue(()=>{O==="ending"&&A===wa||O!=="ending"&&D?(k!=="delay"&&(j.current=k),w.set("instantType","delay")):j.current!==null&&(w.set("instantType",j.current),j.current=null)},[O,D,A,k,w]),Ue(()=>{E&&T==null&&w.set("payload",void 0)},[w,T,E]);const B=y.useCallback(()=>{w.setOpen(!1,W6(w,bb))},[w]);y.useImperativeHandle(d,()=>({unmount:M,close:B}),[M,B]);const G=w.useState("floatingRootContext"),K=am(G,{enabled:!n,referencePress:!0}),I=BU(G,{enabled:!n&&c!=="none",axis:c==="none"?void 0:c}),{getReferenceProps:H,getFloatingProps:F,getTriggerProps:Y}=rd([K,I]),_=y.useMemo(()=>H(),[H]),L=y.useMemo(()=>Y(),[Y]),z=y.useMemo(()=>F(),[F]);return w.useSyncedValues({activeTriggerProps:_,inactiveTriggerProps:L,popupProps:z}),R.jsx(hM.Provider,{value:w,children:typeof x=="function"?x({payload:C}):x})});function W6(e,t){const n=pt(t);return n.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},n}const Q6=y.createContext(void 0);function Z6(){return y.useContext(Q6)}let J6=(function(e){return e[e.popupOpen=Ch.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const eB=600,tB=GO(function(t,n){const{className:a,render:i,handle:s,payload:c,disabled:d,delay:h,closeDelay:f,id:g,...m}=t,b=id(!0),x=(s==null?void 0:s.store)??b;if(!x)throw new Error(pn(82));const w=Ra(g),S=x.useState("isTriggerActive",w),E=x.useState("isOpenedByTrigger",w),T=x.useState("floatingRootContext"),C=y.useRef(null),M=h??eB,O=f??0,{registerTrigger:D,isMountedByThisTrigger:k}=WO(w,C,x,{payload:c,closeDelay:O}),A=Z6(),{delayRef:j,isInstantPhase:B,hasProvider:G}=DU(T,{open:E});x.useSyncedValue("isInstantPhase",B);const K=x.useState("disabled"),I=d??K,H=x.useState("trackCursorAxis"),F=x.useState("disableHoverablePopup"),Y=tM(T,{enabled:!I,mouseOnly:!0,move:!1,handleClose:!F&&H!=="both"?oM():null,restMs(){const Q=A==null?void 0:A.delay,P=typeof j.current=="object"?j.current.open:void 0;let q=M;return G&&(P!==0?q=h??Q??M:q=0),q},delay(){const Q=typeof j.current=="object"?j.current.close:void 0;let P=O;return f==null&&G&&(P=Q),{close:P}},triggerElementRef:C,isActiveTrigger:S}),_=ZO(T,{enabled:!I}).reference,L={open:E},z=x.useState("triggerProps",k);return Mt("button",t,{state:L,ref:[n,D,C],props:[Y,_,z,{id:w,[J6.triggerDisabled]:I?"":void 0},m],stateAttributesMapping:CO})}),mM=y.createContext(void 0);function nB(){const e=y.useContext(mM);if(e===void 0)throw new Error(pn(70));return e}const rB=y.forwardRef(function(t,n){const{children:a,container:i,className:s,render:c,...d}=t,{portalNode:h,portalSubtree:f}=IO({container:i,ref:n,componentProps:t,elementProps:d});return!f&&!h?null:R.jsxs(y.Fragment,{children:[f,h&&or.createPortal(a,h)]})}),aB=y.forwardRef(function(t,n){const{keepMounted:a=!1,...i}=t;return id().useState("mounted")||a?R.jsx(mM.Provider,{value:a,children:R.jsx(rB,{ref:n,...i})}):null}),pM=y.createContext(void 0);function gM(){const e=y.useContext(pM);if(e===void 0)throw new Error(pn(71));return e}const oB=y.createContext(void 0);function tc(){const e=y.useContext(oB);return(e==null?void 0:e.direction)??"ltr"}const iB=e=>({name:"arrow",options:e,async fn(t){var V,Q;const{x:n,y:a,placement:i,rects:s,platform:c,elements:d,middlewareData:h}=t,{element:f,padding:g=0,offsetParent:m="real"}=Ro(e,t)||{};if(f==null)return{};const b=lO(g),x={x:n,y:a},w=gb(i),S=pb(w),E=await c.getDimensions(f),T=w==="y",C=T?"top":"left",M=T?"bottom":"right",O=T?"clientHeight":"clientWidth",D=s.reference[S]+s.reference[w]-x[w]-s.floating[S],k=x[w]-s.reference[w],A=m==="real"?await((V=c.getOffsetParent)==null?void 0:V.call(c,f)):d.floating;let j=d.floating[O]||s.floating[S];(!j||!await((Q=c.isElement)==null?void 0:Q.call(c,A)))&&(j=d.floating[O]||s.floating[S]);const B=D/2-k/2,G=j/2-E[S]/2-1,K=Math.min(b[C],G),I=Math.min(b[M],G),H=K,F=j-E[S]-I,Y=j/2-E[S]/2+B,_=nv(H,Y,F),L=!h.arrow&&Ci(i)!=null&&Y!==_&&s.reference[S]/2-(Y<H?K:I)-E[S]/2<0,z=L?Y<H?Y-H:Y-F:0;return{[w]:x[w]+z,data:{[w]:_,centerOffset:Y-_-z,...L&&{alignmentOffset:z}},reset:L}}}),sB=(e,t)=>({...iB(e),options:[e,t]}),lB={name:"hide",async fn(e){var d;const{width:t,height:n,x:a,y:i}=e.rects.reference,s=t===0&&n===0&&a===0&&i===0;return{data:{referenceHidden:((d=(await MH().fn(e)).data)==null?void 0:d.referenceHidden)||s}}}},ch={sideX:"left",sideY:"top"},cB={name:"adaptiveOrigin",async fn(e){var C,M;const{x:t,y:n,rects:{floating:a},elements:{floating:i},platform:s,strategy:c,placement:d}=e,h=kn(i),f=h.getComputedStyle(i);if(!(f.transitionDuration!=="0s"&&f.transitionDuration!==""))return{x:t,y:n,data:ch};const m=await((C=s.getOffsetParent)==null?void 0:C.call(s,i));let b={width:0,height:0};if(c==="fixed"&&(h!=null&&h.visualViewport))b={width:h.visualViewport.width,height:h.visualViewport.height};else if(m===h){const O=Yt(i);b={width:O.documentElement.clientWidth,height:O.documentElement.clientHeight}}else await((M=s.isElement)==null?void 0:M.call(s,m))&&(b=await s.getDimensions(m));const x=Mr(d);let w=t,S=n;x==="left"&&(w=b.width-(t+a.width)),x==="top"&&(S=b.height-(n+a.height));const E=x==="left"?"right":ch.sideX,T=x==="top"?"bottom":ch.sideY;return{x:w,y:S,data:{sideX:E,sideY:T}}}};function yM(e,t,n){const a=e==="inline-start"||e==="inline-end";return{top:"top",right:a?n?"inline-start":"inline-end":"right",bottom:"bottom",left:a?n?"inline-end":"inline-start":"left"}[t]}function pR(e,t,n){const{rects:a,placement:i}=e;return{side:yM(t,Mr(i),n),align:Ci(i)||"center",anchor:{width:a.reference.width,height:a.reference.height},positioner:{width:a.floating.width,height:a.floating.height}}}function qb(e){var jt,nn;const{anchor:t,positionMethod:n="absolute",side:a="bottom",sideOffset:i=0,align:s="center",alignOffset:c=0,collisionBoundary:d,collisionPadding:h=5,sticky:f=!1,arrowPadding:g=5,disableAnchorTracking:m=!1,keepMounted:b=!1,floatingRootContext:x,mounted:w,collisionAvoidance:S,shiftCrossAxis:E=!1,nodeId:T,adaptiveOrigin:C,lazyFlip:M=!1,externalTree:O}=e,[D,k]=y.useState(null);!w&&D!==null&&k(null);const A=S.side||"flip",j=S.align||"flip",B=S.fallbackAxisSide||"end",G=typeof t=="function"?t:void 0,K=He(G),I=G?K:t,H=Zn(t),Y=tc()==="rtl",_=D||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":Y?"left":"right","inline-start":Y?"right":"left"}[a],L=s==="center"?_:`${_}-${s}`;let z=h;const V=1,Q=a==="bottom"?V:0,P=a==="top"?V:0,q=a==="right"?V:0,X=a==="left"?V:0;typeof z=="number"?z={top:z+Q,right:z+X,bottom:z+P,left:z+q}:z&&(z={top:(z.top||0)+Q,right:(z.right||0)+X,bottom:(z.bottom||0)+P,left:(z.left||0)+q});const W={boundary:d==="clipping-ancestors"?"clippingAncestors":d,padding:z},ce=y.useRef(null),ie=Zn(i),de=Zn(c),Me=[EH(ht=>{const Ct=pR(ht,a,Y),et=typeof ie.current=="function"?ie.current(Ct):ie.current,lt=typeof de.current=="function"?de.current(Ct):de.current;return{mainAxis:et,crossAxis:lt,alignmentAxis:lt}},[typeof i!="function"?i:0,typeof c!="function"?c:0,Y,a])],ke=j==="none"&&A!=="shift",J=!ke&&(f||E||A==="shift"),ue=A==="none"?null:CH({...W,padding:{top:z.top+V,right:z.right+V,bottom:z.bottom+V,left:z.left+V},mainAxis:!E&&A==="flip",crossAxis:j==="flip"?"alignment":!1,fallbackAxisSideDirection:B}),pe=ke?null:RH(ht=>{const Ct=Yt(ht.elements.floating).documentElement;return{...W,rootBoundary:E?{x:0,y:0,width:Ct.clientWidth,height:Ct.clientHeight}:void 0,mainAxis:j!=="none",crossAxis:J,limiter:f||E?void 0:TH(et=>{if(!ce.current)return{};const{width:lt,height:mt}=ce.current.getBoundingClientRect(),Ve=oa(Mr(et.placement)),Et=Ve==="y"?lt:mt,Dt=Ve==="y"?z.left+z.right:z.top+z.bottom;return{offset:Et/2+Dt/2}})}},[W,f,E,z,j]);A==="shift"||j==="shift"||s==="center"?Me.push(pe,ue):Me.push(ue,pe),Me.push(OH({...W,apply({elements:{floating:ht},rects:{reference:Ct},availableWidth:et,availableHeight:lt}){const mt=ht.style;mt.setProperty("--available-width",`${et}px`),mt.setProperty("--available-height",`${lt}px`),mt.setProperty("--anchor-width",`${Ct.width}px`),mt.setProperty("--anchor-height",`${Ct.height}px`)}}),sB(()=>({element:ce.current||document.createElement("div"),padding:g,offsetParent:"floating"}),[g]),{name:"transformOrigin",fn(ht){var $e,tt,vt;const{elements:Ct,middlewareData:et,placement:lt,rects:mt,y:Ve}=ht,Et=Mr(lt),Dt=oa(Et),St=ce.current,rn=(($e=et.arrow)==null?void 0:$e.x)||0,It=((tt=et.arrow)==null?void 0:tt.y)||0,Xe=(St==null?void 0:St.clientWidth)||0,Rt=(St==null?void 0:St.clientHeight)||0,$=rn+Xe/2,ne=It+Rt/2,le=Math.abs(((vt=et.shift)==null?void 0:vt.y)||0),Ee=mt.reference.height/2,je=typeof i=="function"?i(pR(ht,a,Y)):i,Ze=le>je,Qe={top:`${$}px calc(100% + ${je}px)`,bottom:`${$}px ${-je}px`,left:`calc(100% + ${je}px) ${ne}px`,right:`${-je}px ${ne}px`}[Et],Fe=`${$}px ${mt.reference.y+Ee-Ve}px`;return Ct.floating.style.setProperty("--transform-origin",J&&Dt==="y"&&Ze?Fe:Qe),{}}},lB,C),Ue(()=>{!w&&x&&x.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[w,x]);const De=y.useMemo(()=>({elementResize:!m&&typeof ResizeObserver<"u",layoutShift:!m&&typeof IntersectionObserver<"u"}),[m]),{refs:Ce,elements:we,x:Te,y:Z,middlewareData:be,update:ge,placement:Pe,context:Be,isPositioned:Ae,floatingStyles:it}=i6({rootContext:x,placement:L,middleware:Me,strategy:n,whileElementsMounted:b?void 0:(...ht)=>tR(...ht,De),nodeId:T,externalTree:O}),{sideX:wt,sideY:xt}=be.adaptiveOrigin||ch,oe=Ae?n:"fixed",xe=y.useMemo(()=>{const ht=C?{position:oe,[wt]:Te,[xt]:Z}:{position:oe,...it};return Ae||(ht.opacity=0),ht},[C,oe,wt,Te,xt,Z,it,Ae]),Ie=y.useRef(null);Ue(()=>{if(!w)return;const ht=H.current,Ct=typeof ht=="function"?ht():ht,lt=(gR(Ct)?Ct.current:Ct)||null||null;lt!==Ie.current&&(Ce.setPositionReference(lt),Ie.current=lt)},[w,Ce,I,H]),y.useEffect(()=>{if(!w)return;const ht=H.current;typeof ht!="function"&&gR(ht)&&ht.current!==Ie.current&&(Ce.setPositionReference(ht.current),Ie.current=ht.current)},[w,Ce,I,H]),y.useEffect(()=>{if(b&&w&&we.domReference&&we.floating)return tR(we.domReference,we.floating,ge,De)},[b,w,we,ge,De]);const qe=Mr(Pe),Ke=yM(a,qe,Y),st=Ci(Pe)||"center",ze=!!((jt=be.hide)!=null&&jt.referenceHidden);Ue(()=>{M&&w&&Ae&&k(qe)},[M,w,Ae,qe]);const Je=y.useMemo(()=>{var ht,Ct;return{position:"absolute",top:(ht=be.arrow)==null?void 0:ht.y,left:(Ct=be.arrow)==null?void 0:Ct.x}},[be.arrow]),ft=((nn=be.arrow)==null?void 0:nn.centerOffset)!==0;return y.useMemo(()=>({positionerStyles:xe,arrowStyles:Je,arrowRef:ce,arrowUncentered:ft,side:Ke,align:st,physicalSide:qe,anchorHidden:ze,refs:Ce,context:Be,isPositioned:Ae,update:ge}),[xe,Je,ce,ft,Ke,st,qe,ze,Ce,Be,Ae,ge])}function gR(e){return e!=null&&"current"in e}function nc(e){return e==="starting"?c3:En}const uB=y.forwardRef(function(t,n){const{render:a,className:i,anchor:s,positionMethod:c="absolute",side:d="top",align:h="center",sideOffset:f=0,alignOffset:g=0,collisionBoundary:m="clipping-ancestors",collisionPadding:b=5,arrowPadding:x=5,sticky:w=!1,disableAnchorTracking:S=!1,collisionAvoidance:E=LC,...T}=t,C=id(),M=nB(),O=C.useState("open"),D=C.useState("mounted"),k=C.useState("trackCursorAxis"),A=C.useState("disableHoverablePopup"),j=C.useState("floatingRootContext"),B=C.useState("instantType"),G=C.useState("transitionStatus"),K=C.useState("hasViewport"),I=qb({anchor:s,positionMethod:c,floatingRootContext:j,mounted:D,side:d,sideOffset:f,align:h,alignOffset:g,collisionBoundary:m,collisionPadding:b,sticky:w,arrowPadding:x,disableAnchorTracking:S,keepMounted:M,collisionAvoidance:E,adaptiveOrigin:K?cB:void 0}),H=y.useMemo(()=>{const L={};return(!O||k==="both"||A)&&(L.pointerEvents="none"),{role:"presentation",hidden:!D,style:{...I.positionerStyles,...L}}},[O,k,A,D,I.positionerStyles]),F=y.useMemo(()=>({open:O,side:I.side,align:I.align,anchorHidden:I.anchorHidden,instant:k!=="none"?"tracking-cursor":B}),[O,I.side,I.align,I.anchorHidden,k,B]),Y=y.useMemo(()=>({...F,arrowRef:I.arrowRef,arrowStyles:I.arrowStyles,arrowUncentered:I.arrowUncentered}),[F,I.arrowRef,I.arrowStyles,I.arrowUncentered]),_=Mt("div",t,{state:F,props:[H,nc(G),T],ref:[n,C.useStateSetter("positionerElement")],stateAttributesMapping:qa});return R.jsx(pM.Provider,{value:Y,children:_})}),dB={...qa,...Co},fB=y.forwardRef(function(t,n){const{className:a,render:i,...s}=t,c=id(),{side:d,align:h}=gM(),f=c.useState("open"),g=c.useState("instantType"),m=c.useState("transitionStatus"),b=c.useState("popupProps"),x=c.useState("floatingRootContext");Oo({open:f,ref:c.context.popupRef,onComplete(){var C,M;f&&((M=(C=c.context).onOpenChangeComplete)==null||M.call(C,!0))}});const w=c.useState("disabled"),S=c.useState("closeDelay");return eM(x,{enabled:!w,closeDelay:S}),Mt("div",t,{state:{open:f,side:d,align:h,instant:g,transitionStatus:m},ref:[n,c.context.popupRef,c.useStateSetter("popupElement")],props:[b,nc(m),s],stateAttributesMapping:dB})}),hB=y.forwardRef(function(t,n){const{className:a,render:i,...s}=t,d=id().useState("instantType"),{open:h,arrowRef:f,side:g,align:m,arrowUncentered:b,arrowStyles:x}=gM();return Mt("div",t,{state:{open:h,side:g,align:m,uncentered:b,instant:d},ref:[n,f],props:[{style:x,"aria-hidden":!0},s],stateAttributesMapping:qa})});function mB({...e}){return R.jsx(X6,{"data-slot":"tooltip",...e})}function pB({...e}){return R.jsx(tB,{"data-slot":"tooltip-trigger",...e})}function gB({className:e,side:t="top",sideOffset:n=4,align:a="center",alignOffset:i=0,children:s,...c}){return R.jsx(aB,{children:R.jsx(uB,{align:a,alignOffset:i,side:t,sideOffset:n,className:"isolate z-50",children:R.jsxs(fB,{"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),...c,children:[s,R.jsx(hB,{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 yB="sidebar_state",vB=3600*24*7,sy="100vw",bB="3rem",xB="b",au=320,Nh=320,wB=450,ly="tmex_sidebar_width";function SB(){const e=typeof window>"u"?Number.POSITIVE_INFINITY:window.innerWidth;return Math.max(Nh,e-wB)}function Vf(e){return Math.min(SB(),Math.max(Nh,Math.round(e)))}const vM=y.createContext(null);function Yr(){const e=y.useContext(vM);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function EB({defaultOpen:e=!0,open:t,onOpenChange:n,className:a,style:i,children:s,...c}){const d=g3(),[h,f]=y.useState(!1),g=y.useRef(au),[m,b]=y.useState(()=>{if(typeof window>"u")return au;const j=Number(window.localStorage.getItem(ly)),B=Number.isFinite(j)&&j>0?Math.max(Nh,Math.round(j)):au;return g.current=B,Vf(B)}),[x,w]=y.useState(!1),S=y.useCallback(j=>{const B=Math.max(Nh,Math.round(j));g.current=B,b(Vf(j)),window.localStorage.setItem(ly,String(B))},[]),E=y.useCallback(()=>{g.current=au,b(Vf(au)),window.localStorage.removeItem(ly)},[]);y.useEffect(()=>{const j=()=>{b(Vf(g.current))};return window.addEventListener("resize",j),()=>window.removeEventListener("resize",j)},[]);const[T,C]=y.useState(e),M=t??T,O=y.useCallback(j=>{const B=typeof j=="function"?j(M):j;n?n(B):C(B),document.cookie=`${yB}=${B}; path=/; max-age=${vB}`},[n,M]),D=y.useCallback(()=>d?f(j=>!j):O(j=>!j),[d,O,f]);y.useEffect(()=>{const j=B=>{B.defaultPrevented||B.target instanceof HTMLElement&&B.target.closest(".xterm")||B.key===xB&&(B.metaKey||B.ctrlKey)&&(B.preventDefault(),D())};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[D]);const k=M?"expanded":"collapsed",A=y.useMemo(()=>({state:k,open:M,setOpen:O,isMobile:d,openMobile:h,setOpenMobile:f,toggleSidebar:D,width:m,setWidth:S,resetWidth:E,isResizing:x,setIsResizing:w}),[k,M,O,d,h,f,D,m,S,E,x]);return R.jsx(vM.Provider,{value:A,children:R.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":`${m}px`,"--sidebar-width-icon":bB,...i},className:Le("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",a),...c,children:s})})}function RB({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:a,children:i,dir:s,...c}){const{isMobile:d,state:h,openMobile:f,setOpenMobile:g,isResizing:m}=Yr();return n==="none"?R.jsx("div",{"data-slot":"sidebar",className:Le("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",a),...c,children:i}):d?R.jsx(U6,{open:f,onOpenChange:g,...c,children:R.jsxs(V6,{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 border-none",style:{"--sidebar-width":sy,width:sy,maxWidth:sy},side:e,animation:"top-down",children:[R.jsxs(Y6,{className:"sr-only",children:[R.jsx(q6,{children:"Sidebar"}),R.jsx($6,{children:"Displays the mobile sidebar."})]}),R.jsx("div",{className:"flex h-full w-full flex-col","data-testid":"sidebar",style:{paddingBottom:"var(--tmex-safe-area-bottom)"},children:i})]})}):R.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":h,"data-collapsible":h==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[R.jsx("div",{"data-slot":"sidebar-gap",className:Le(!m&&"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)")}),R.jsxs("div",{"data-slot":"sidebar-container","data-side":e,className:Le(!m&&"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",a),...c,children:[R.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:i}),h==="expanded"&&R.jsx(TB,{side:e})]})]})}function TB({side:e}){const{width:t,setWidth:n,resetWidth:a,setIsResizing:i}=Yr(),s=y.useRef(null);return R.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:c=>{c.preventDefault(),s.current={pointerId:c.pointerId,startX:c.clientX,startWidth:t},c.currentTarget.setPointerCapture(c.pointerId),i(!0)},onPointerMove:c=>{const d=s.current;if(!d||d.pointerId!==c.pointerId)return;const h=c.clientX-d.startX;n(d.startWidth+(e==="left"?h:-h))},onPointerUp:c=>{var d;((d=s.current)==null?void 0:d.pointerId)===c.pointerId&&(s.current=null,i(!1))},onPointerCancel:c=>{var d;((d=s.current)==null?void 0:d.pointerId)===c.pointerId&&(s.current=null,i(!1))},onDoubleClick:a})}function CB({className:e,onClick:t,...n}){const{toggleSidebar:a,isMobile:i}=Yr();return R.jsxs(Rn,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:Le(e),onClick:s=>{t==null||t(s),a()},...n,children:[i?R.jsx(SP,{}):R.jsx(OP,{}),R.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function OB({className:e,...t}){return R.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 MB({className:e,...t}){return R.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:Le("gap-2 p-2 flex flex-col",e),...t})}function NB({className:e,...t}){return R.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:Le("gap-2 p-2 flex flex-col",e),...t})}function AB({className:e,...t}){return R.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 bM({className:e,...t}){return R.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 DB({className:e,...t}){return R.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:Le("gap-0 flex w-full min-w-0 flex-col",e),...t})}function kB({className:e,...t}){return R.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:Le("group/menu-item relative",e),...t})}const jB=Vh("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 LB({render:e,isActive:t=!1,variant:n="default",size:a="default",tooltip:i,className:s,...c}){const{isMobile:d,state:h}=Yr(),f=Fh({defaultTagName:"button",props:la({className:Le(jB({variant:n,size:a}),s)},c),render:i?pB:e,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:a,active:t}});return i?(typeof i=="string"&&(i={children:i}),R.jsxs(mB,{children:[f,R.jsx(gB,{side:"right",align:"center",hidden:h!=="collapsed"||d,...i})]})):f}function _B({className:e,render:t,showOnHover:n=!1,...a}){return Fh({defaultTagName:"button",props:la({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)},a),render:t,state:{slot:"sidebar-menu-action",sidebar:"menu-action"}})}function IB({className:e,...t}){return R.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 zB({className:e,...t}){return R.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:Le("group/menu-sub-item relative",e),...t})}function PB({render:e,size:t="md",isActive:n=!1,className:a,...i}){return Fh({defaultTagName:"a",props:la({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",a)},i),render:e,state:{slot:"sidebar-menu-sub-button",sidebar:"menu-sub-button",size:t,active:n}})}function UB(){const e=Xv(),{isMobile:t,setOpenMobile:n}=Yr();return y.useEffect(()=>(b1((a,i)=>e(a,i??{})),()=>b1(null)),[e]),y.useEffect(()=>(x1({isMobile:t,setOpenMobile:n}),()=>x1(null)),[t,n]),null}const yR="tmex:connectedDevices",xM=y.createContext(null);function HB(){const e=y.useContext(xM);if(!e)throw new Error("useGlobalDevice must be used within GlobalDeviceProvider");return e}function BB({children:e}){const t=Va(),[n,a]=y.useState(()=>{try{const m=localStorage.getItem(yR);if(m){const b=JSON.parse(m);return new Set(b)}}catch{}return new Set}),i=mn(m=>m.connectDevice),s=mn(m=>m.disconnectDevice),c=mn(m=>m.connectedDevices);y.useEffect(()=>{try{localStorage.setItem(yR,JSON.stringify([...n]))}catch{}},[n]),y.useEffect(()=>{const m=t.pathname.match(/^\/devices\/([^/]+)/),b=m==null?void 0:m[1];b&&!c.has(b)&&i(b)},[t.pathname,c,i]);const d=y.useCallback(m=>{a(b=>{const x=new Set(b);return x.add(m),x}),c.has(m)||i(m)},[c,i]),h=y.useCallback(m=>{a(b=>{const x=new Set(b);return x.delete(m),x}),c.has(m)&&s(m)},[c,s]),f=y.useCallback((m,b)=>{b?h(m):d(m)},[d,h]),g=y.useMemo(()=>({persistedDevices:n,connectDevice:d,disconnectDevice:h,toggleDevice:f}),[n,d,h,f]);return R.jsx(xM.Provider,{value:g,children:e})}const wM=y.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function FB(){return y.useContext(wM)}function lm(e){const{children:t,elementsRef:n,labelsRef:a,onMapChange:i}=e,s=He(i),c=y.useRef(0),d=Kn(YB).current,h=Kn(VB).current,[f,g]=y.useState(0),m=y.useRef(f),b=He((T,C)=>{h.set(T,C??null),m.current+=1,g(m.current)}),x=He(T=>{h.delete(T),m.current+=1,g(m.current)}),w=y.useMemo(()=>{const T=new Map;return Array.from(h.keys()).filter(M=>M.isConnected).sort(qB).forEach((M,O)=>{const D=h.get(M)??{};T.set(M,{...D,index:O})}),T},[h,f]);Ue(()=>{if(typeof MutationObserver!="function"||w.size===0)return;const T=new MutationObserver(C=>{const M=new Set,O=D=>M.has(D)?M.delete(D):M.add(D);C.forEach(D=>{D.removedNodes.forEach(O),D.addedNodes.forEach(O)}),M.size===0&&(m.current+=1,g(m.current))});return w.forEach((C,M)=>{M.parentElement&&T.observe(M.parentElement,{childList:!0})}),()=>{T.disconnect()}},[w]),Ue(()=>{m.current===f&&(n.current.length!==w.size&&(n.current.length=w.size),a&&a.current.length!==w.size&&(a.current.length=w.size),c.current=w.size),s(w)},[s,w,n,a,f]),Ue(()=>()=>{n.current=[]},[n]),Ue(()=>()=>{a&&(a.current=[])},[a]);const S=He(T=>(d.add(T),()=>{d.delete(T)}));Ue(()=>{d.forEach(T=>T(w))},[d,w]);const E=y.useMemo(()=>({register:b,unregister:x,subscribeMapChange:S,elementsRef:n,labelsRef:a,nextIndexRef:c}),[b,x,S,n,a,c]);return R.jsx(wM.Provider,{value:E,children:t})}function VB(){return new Map}function YB(){return new Set}function qB(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 SM=y.createContext(void 0);function EM(){const e=y.useContext(SM);if(e===void 0)throw new Error(pn(64));return e}let $B=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const RM={tabActivationDirection:e=>({[$B.activationDirection]:e})},KB=y.forwardRef(function(t,n){const{className:a,defaultValue:i=0,onValueChange:s,orientation:c="horizontal",render:d,value:h,...f}=t,g=tc(),m=Object.hasOwn(t,"defaultValue"),b=y.useRef([]),[x,w]=y.useState(()=>new Map),[S,E]=Vl({controlled:h,default:i,name:"Tabs",state:"value"}),T=h!==void 0,[C,M]=y.useState(()=>new Map),[O,D]=y.useState("none"),k=He((L,z)=>{s==null||s(L,z),!z.isCanceled&&(E(L),D(z.activationDirection))}),A=He((L,z)=>{w(V=>{if(V.get(L)===z)return V;const Q=new Map(V);return Q.set(L,z),Q})}),j=He((L,z)=>{w(V=>{if(!V.has(L)||V.get(L)!==z)return V;const Q=new Map(V);return Q.delete(L),Q})}),B=y.useCallback(L=>x.get(L),[x]),G=y.useCallback(L=>{for(const z of C.values())if(L===(z==null?void 0:z.value))return z==null?void 0:z.id},[C]),K=y.useCallback(L=>{if(L===void 0)return null;for(const[z,V]of C.entries())if(V!=null&&L===(V.value??V.index))return z;return null},[C]),I=y.useMemo(()=>({direction:g,getTabElementBySelectedValue:K,getTabIdByPanelValue:G,getTabPanelIdByValue:B,onValueChange:k,orientation:c,registerMountedTabPanel:A,setTabMap:M,unregisterMountedTabPanel:j,tabActivationDirection:O,value:S}),[g,K,G,B,k,c,A,M,j,O,S]),H=y.useMemo(()=>{for(const L of C.values())if(L!=null&&L.value===S)return L},[C,S]),F=y.useMemo(()=>{for(const L of C.values())if(L!=null&&!L.disabled)return L.value},[C]);Ue(()=>{if(T||C.size===0)return;const L=H==null?void 0:H.disabled,z=H==null&&S!==null;if(m&&L&&S===i||!L&&!z)return;const Q=F??null;S!==Q&&(E(Q),D("none"))},[i,F,m,T,H,D,E,C,S]);const _=Mt("div",t,{state:{orientation:c,tabActivationDirection:O},ref:n,props:f,stateAttributesMapping:RM});return R.jsx(SM.Provider,{value:I,children:R.jsx(lm,{elementsRef:b,children:_})})}),TM="data-composite-item-active";let CM=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function $b(e={}){const{label:t,metadata:n,textRef:a,indexGuessBehavior:i,index:s}=e,{register:c,unregister:d,subscribeMapChange:h,elementsRef:f,labelsRef:g,nextIndexRef:m}=FB(),b=y.useRef(-1),[x,w]=y.useState(s??(i===CM.GuessFromOrder?()=>{if(b.current===-1){const T=m.current;m.current+=1,b.current=T}return b.current}:-1)),S=y.useRef(null),E=y.useCallback(T=>{var C;if(S.current=T,x!==-1&&T!==null&&(f.current[x]=T,g)){const M=t!==void 0;g.current[x]=M?t:((C=a==null?void 0:a.current)==null?void 0:C.textContent)??T.textContent}},[x,f,g,t,a]);return Ue(()=>{if(s!=null)return;const T=S.current;if(T)return c(T,n),()=>{d(T)}},[s,c,d,n]),Ue(()=>{if(s==null)return h(T=>{var M;const C=S.current?(M=T.get(S.current))==null?void 0:M.index:null;C!=null&&w(C)})},[s,h,w]),y.useMemo(()=>({ref:E,index:x}),[x,E])}function OM(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:a}=ub(),{ref:i,index:s}=$b(e),c=n===s,d=y.useRef(null),h=xa(i,d);return{compositeProps:y.useMemo(()=>({tabIndex:c?0:-1,onFocus(){a(s)},onMouseMove(){const g=d.current;if(!t||!g)return;const m=g.hasAttribute("disabled")||g.ariaDisabled==="true";!c&&!m&&g.focus()}}),[c,a,s,t]),compositeRef:h,index:s}}const MM=y.createContext(void 0);function GB(){const e=y.useContext(MM);if(e===void 0)throw new Error(pn(65));return e}const XB=y.forwardRef(function(t,n){const{className:a,disabled:i=!1,render:s,value:c,id:d,nativeButton:h=!0,...f}=t,{value:g,getTabPanelIdByValue:m,orientation:b}=EM(),{activateOnFocus:x,highlightedTabIndex:w,onTabActivation:S,setHighlightedTabIndex:E,tabsListElement:T}=GB(),C=Ra(d),M=y.useMemo(()=>({disabled:i,id:C,value:c}),[i,C,c]),{compositeProps:O,compositeRef:D,index:k}=OM({metadata:M}),A=c===g,j=y.useRef(!1);Ue(()=>{if(j.current){j.current=!1;return}if(!(A&&k>-1&&w!==k))return;const V=T;if(V!=null){const Q=Hr(Yt(V));if(Q&&Ot(V,Q))return}i||E(k)},[A,k,w,E,i,T]);const{getButtonProps:B,buttonRef:G}=To({disabled:i,native:h,focusableWhenDisabled:!0}),K=m(c),I=y.useRef(!1),H=y.useRef(!1);function F(V){A||i||S(c,pt(wa,V.nativeEvent,void 0,{activationDirection:"none"}))}function Y(V){A||(k>-1&&!i&&E(k),!i&&x&&(!I.current||I.current&&H.current)&&S(c,pt(wa,V.nativeEvent,void 0,{activationDirection:"none"})))}function _(V){if(A||i)return;I.current=!0;function Q(){I.current=!1,H.current=!1}(!V.button||V.button===0)&&(H.current=!0,Yt(V.currentTarget).addEventListener("pointerup",Q,{once:!0}))}return Mt("button",t,{state:{disabled:i,active:A,orientation:b},ref:[n,G,D],props:[O,{role:"tab","aria-controls":K,"aria-selected":A,id:C,onClick:F,onFocus:Y,onPointerDown:_,[TM]:A?"":void 0,onKeyDownCapture(){j.current=!0}},f,B]})}),WB=y.createContext(void 0),QB={disableStyleElements:!1};function NM(){return y.useContext(WB)??QB}function ZB(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const JB=[];function e8(e){const{itemSizes:t,cols:n=1,loopFocus:a=!0,dense:i=!1,orientation:s="both",direction:c,highlightedIndex:d,onHighlightedIndexChange:h,rootRef:f,enableHomeAndEndKeys:g=!1,stopEventPropagation:m=!1,disabledIndices:b,modifierKeys:x=JB}=e,[w,S]=y.useState(0),E=n>1,T=y.useRef(null),C=xa(T,f),M=y.useRef([]),O=y.useRef(!1),D=d??w,k=He((B,G=!1)=>{if((h??S)(B),G){const K=M.current[B];uR(T.current,K,c,s)}}),A=He(B=>{if(B.size===0||O.current)return;O.current=!0;const G=Array.from(B.keys()),K=G.find(H=>H==null?void 0:H.hasAttribute(TM))??null,I=K?G.indexOf(K):-1;I!==-1&&k(I),uR(T.current,K,c,s)}),j=y.useMemo(()=>({"aria-orientation":s==="both"?void 0:s,ref:C,onFocus(B){!T.current||!cR(B.target)||B.target.setSelectionRange(0,B.target.value.length??0)},onKeyDown(B){const G=g?S6:cM;if(!G.has(B.key)||t8(B,x)||!T.current)return;const I=c==="rtl",H=I?Lu:Sl,F={horizontal:H,vertical:as,both:H}[s],Y=I?Sl:Lu,_={horizontal:Y,vertical:wl,both:Y}[s];if(cR(B.target)&&!ZB(B.target)){const X=B.target.selectionStart,W=B.target.selectionEnd,ce=B.target.value??"";if(X==null||B.shiftKey||X!==W||B.key!==_&&X<ce.length||B.key!==F&&X>0)return}let L=D;const z=ah(M,b),V=av(M,b);if(E){const X=t||Array.from({length:M.current.length},()=>({width:1,height:1})),W=uO(X,n,i),ce=W.findIndex(de=>de!=null&&!wi(M,de,b)),ie=W.reduce((de,ve,Se)=>ve!=null&&!wi(M,ve,b)?Se:de,-1);L=W[cO({current:W.map(de=>de?M.current[de]:null)},{event:B,orientation:s,loopFocus:a,cols:n,disabledIndices:fO([...b||M.current.map((de,ve)=>wi(M,ve)?ve:void 0),void 0],W),minIndex:ce,maxIndex:ie,prevIndex:dO(D>V?z:D,X,W,n,B.key===as?"bl":B.key===Sl?"tr":"tl"),rtl:I})]}const Q={horizontal:[H],vertical:[as],both:[H,as]}[s],P={horizontal:[Y],vertical:[wl],both:[Y,wl]}[s],q=E?G:{horizontal:g?x6:sM,vertical:g?w6:lM,both:G}[s];g&&(B.key===ad?L=z:B.key===od&&(L=V)),L===D&&(Q.includes(B.key)||P.includes(B.key))&&(a&&L===V&&Q.includes(B.key)?L=z:a&&L===z&&P.includes(B.key)?L=V:L=ar(M,{startingIndex:L,decrement:P.includes(B.key),disabledIndices:b})),L!==D&&!gl(M,L)&&(m&&B.stopPropagation(),q.has(B.key)&&B.preventDefault(),k(L,!0),queueMicrotask(()=>{var X;(X=M.current[L])==null||X.focus()}))}}),[n,i,c,b,M,g,D,E,t,a,C,x,k,s,m]);return y.useMemo(()=>({props:j,highlightedIndex:D,onHighlightedIndexChange:k,elementsRef:M,disabledIndices:b,onMapChange:A,relayKeyboardEvent:j.onKeyDown}),[j,D,k,M,b,A])}function t8(e,t){for(const n of O6.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function n8(e){const{render:t,className:n,refs:a=Si,props:i=Si,state:s=En,stateAttributesMapping:c,highlightedIndex:d,onHighlightedIndexChange:h,orientation:f,dense:g,itemSizes:m,loopFocus:b,cols:x,enableHomeAndEndKeys:w,onMapChange:S,stopEventPropagation:E=!0,rootRef:T,disabledIndices:C,modifierKeys:M,highlightItemOnHover:O=!1,tag:D="div",...k}=e,A=tc(),{props:j,highlightedIndex:B,onHighlightedIndexChange:G,elementsRef:K,onMapChange:I,relayKeyboardEvent:H}=e8({itemSizes:m,cols:x,loopFocus:b,dense:g,orientation:f,highlightedIndex:d,onHighlightedIndexChange:h,rootRef:T,stopEventPropagation:E,enableHomeAndEndKeys:w,direction:A,disabledIndices:C,modifierKeys:M}),F=Mt(D,e,{state:s,ref:a,props:[j,...i,k],stateAttributesMapping:c}),Y=y.useMemo(()=>({highlightedIndex:B,onHighlightedIndexChange:G,highlightItemOnHover:O,relayKeyboardEvent:H}),[B,G,O,H]);return R.jsx(WC.Provider,{value:Y,children:R.jsx(lm,{elementsRef:K,onMapChange:_=>{S==null||S(_),I(_)},children:F})})}const r8=y.forwardRef(function(t,n){const{activateOnFocus:a=!1,className:i,loopFocus:s=!0,render:c,...d}=t,{getTabElementBySelectedValue:h,onValueChange:f,orientation:g,value:m,setTabMap:b,tabActivationDirection:x}=EM(),[w,S]=y.useState(0),[E,T]=y.useState(null),C=a8(m,g,E,h),M=He((A,j)=>{if(A!==m){const B=C(A);j.activationDirection=B,f(A,j)}}),O={orientation:g,tabActivationDirection:x},D={"aria-orientation":g==="vertical"?"vertical":void 0,role:"tablist"},k=y.useMemo(()=>({activateOnFocus:a,highlightedTabIndex:w,onTabActivation:M,setHighlightedTabIndex:S,tabsListElement:E,value:m}),[a,w,M,S,E,m]);return R.jsx(MM.Provider,{value:k,children:R.jsx(n8,{render:c,className:i,state:O,refs:[n,T],props:[D,d],stateAttributesMapping:RM,highlightedIndex:w,enableHomeAndEndKeys:!0,loopFocus:s,orientation:g,onHighlightedIndexChange:S,onMapChange:b,disabledIndices:Si})})});function vR(e,t){const{left:n,top:a}=e.getBoundingClientRect(),{left:i,top:s}=t.getBoundingClientRect(),c=n-i,d=a-s;return{left:c,top:d}}function a8(e,t,n,a){const[i,s]=y.useState(null);return Ue(()=>{if(e==null||n==null){s(null);return}const c=a(e);if(c==null){s(null);return}const{left:d,top:h}=vR(c,n);s(t==="horizontal"?d:h)},[t,a,n,e]),y.useCallback(c=>{if(c===e)return"none";if(c==null)return s(null),"none";if(c!=null&&n!=null){const d=a(c);if(d!=null){const{left:h,top:f}=vR(d,n);if(i==null)return s(t==="horizontal"?h:f),"none";if(t==="horizontal"){if(h<i)return s(h),"left";if(h>i)return s(h),"right"}else{if(f<i)return s(f),"up";if(f>i)return s(f),"down"}}}return"none"},[a,t,i,n,e])}function o8({className:e,orientation:t="horizontal",...n}){return R.jsx(KB,{"data-slot":"tabs","data-orientation":t,className:Le("gap-2 group/tabs flex data-horizontal:flex-col",e),...n})}const i8=Vh("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 s8({className:e,variant:t="default",...n}){return R.jsx(r8,{"data-slot":"tabs-list","data-variant":t,className:Le(i8({variant:t}),e),...n})}function cy({className:e,...t}){return R.jsx(XB,{"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 l8(e){const{open:t,defaultOpen:n,onOpenChange:a,disabled:i}=e,s=t!==void 0,[c,d]=Vl({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:h,setMounted:f,transitionStatus:g}=td(c,!0,!0),[m,b]=y.useState(c),[{height:x,width:w},S]=y.useState({height:void 0,width:void 0}),E=Ra(),[T,C]=y.useState(),M=T??E,[O,D]=y.useState(!1),[k,A]=y.useState(!1),j=y.useRef(null),B=y.useRef(null),G=y.useRef(null),K=y.useRef(null),I=EO(K,!1),H=He(F=>{const Y=!c,_=pt(Ss,F.nativeEvent);if(a(Y,_),_.isCanceled)return;const L=K.current;B.current==="css-animation"&&L!=null&&L.style.removeProperty("animation-name"),!O&&!k&&(B.current!=null&&B.current!=="css-animation"&&!h&&Y&&f(!0),B.current==="css-animation"&&(!m&&Y&&b(!0),!h&&Y&&f(!0))),d(Y),B.current==="none"&&h&&!Y&&f(!1)});return Ue(()=>{s&&B.current==="none"&&!k&&!c&&f(!1)},[s,k,c,t,f]),y.useMemo(()=>({abortControllerRef:j,animationTypeRef:B,disabled:i,handleTrigger:H,height:x,mounted:h,open:c,panelId:M,panelRef:K,runOnceAnimationsFinish:I,setDimensions:S,setHiddenUntilFound:D,setKeepMounted:A,setMounted:f,setOpen:d,setPanelIdState:C,setVisible:b,transitionDimensionRef:G,transitionStatus:g,visible:m,width:w}),[j,B,i,H,x,h,c,M,K,I,S,D,A,f,d,b,G,g,m,w])}const AM=y.createContext(void 0);function DM(){const e=y.useContext(AM);if(e===void 0)throw new Error(pn(15));return e}let bu=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=ws.startingStyle]="startingStyle",e[e.endingStyle=ws.endingStyle]="endingStyle",e})({}),c8=(function(e){return e.panelOpen="data-panel-open",e})({});const u8={[bu.open]:""},d8={[bu.closed]:""},f8={open(e){return e?{[c8.panelOpen]:""}:null}},h8={open(e){return e?u8:d8}},kM={...h8,...Co},m8=y.forwardRef(function(t,n){const{render:a,className:i,defaultOpen:s=!1,disabled:c=!1,onOpenChange:d,open:h,...f}=t,g=He(d),m=l8({open:h,defaultOpen:s,onOpenChange:g,disabled:c}),b=y.useMemo(()=>({open:m.open,disabled:m.disabled,transitionStatus:m.transitionStatus}),[m.open,m.disabled,m.transitionStatus]),x=y.useMemo(()=>({...m,onOpenChange:g,state:b}),[m,g,b]),w=Mt("div",t,{state:b,ref:n,props:f,stateAttributesMapping:kM});return R.jsx(AM.Provider,{value:x,children:w})}),p8={...f8,...Co},g8=y.forwardRef(function(t,n){const{panelId:a,open:i,handleTrigger:s,state:c,disabled:d}=DM(),{className:h,disabled:f=d,id:g,render:m,nativeButton:b=!0,...x}=t,{getButtonProps:w,buttonRef:S}=To({disabled:f,focusableWhenDisabled:!0,native:b}),E=y.useMemo(()=>({"aria-controls":i?a:void 0,"aria-expanded":i,onClick:s}),[a,i,s]);return Mt("button",t,{state:c,ref:[n,S],props:[E,x,w],stateAttributesMapping:p8})});let y8=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e})({});function v8(e){const{abortControllerRef:t,animationTypeRef:n,externalRef:a,height:i,hiddenUntilFound:s,keepMounted:c,id:d,mounted:h,onOpenChange:f,open:g,panelRef:m,runOnceAnimationsFinish:b,setDimensions:x,setMounted:w,setOpen:S,setVisible:E,transitionDimensionRef:T,visible:C,width:M}=e,O=y.useRef(!1),D=y.useRef(null),k=y.useRef(g),A=y.useRef(g),j=ed(),B=y.useMemo(()=>n.current==="css-animation"?!C:!g&&!h,[g,h,C,n]),G=He(I=>{if(!I)return;if(n.current==null||T.current==null){const Y=getComputedStyle(I),_=Y.animationName!=="none"&&Y.animationName!=="",L=Y.transitionDuration!=="0s"&&Y.transitionDuration!=="";_&&L||(Y.animationName==="none"&&Y.transitionDuration!=="0s"?n.current="css-transition":Y.animationName!=="none"&&Y.transitionDuration==="0s"?n.current="css-animation":n.current="none"),I.getAttribute(y8.orientation)==="horizontal"||Y.transitionProperty.indexOf("width")>-1?T.current="width":T.current="height"}if(n.current!=="css-transition")return;(i===void 0||M===void 0)&&(x({height:I.scrollHeight,width:I.scrollWidth}),A.current&&I.style.setProperty("transition-duration","0s"));let H=-1,F=-1;return H=An.request(()=>{A.current=!1,F=An.request(()=>{setTimeout(()=>{I.style.removeProperty("transition-duration")})})}),()=>{An.cancel(H),An.cancel(F)}}),K=xa(a,m,G);return Ue(()=>{if(n.current!=="css-transition")return;const I=m.current;if(!I)return;let H=-1;if(t.current!=null&&(t.current.abort(),t.current=null),g){const F={"justify-content":I.style.justifyContent,"align-items":I.style.alignItems,"align-content":I.style.alignContent,"justify-items":I.style.justifyItems};Object.keys(F).forEach(Y=>{I.style.setProperty(Y,"initial","important")}),!A.current&&!c&&I.setAttribute(bu.startingStyle,""),x({height:I.scrollHeight,width:I.scrollWidth}),H=An.request(()=>{Object.entries(F).forEach(([Y,_])=>{_===""?I.style.removeProperty(Y):I.style.setProperty(Y,_)})})}else{if(I.scrollHeight===0&&I.scrollWidth===0)return;x({height:I.scrollHeight,width:I.scrollWidth});const F=new AbortController;t.current=F;const Y=F.signal;let _=null;const L=bu.endingStyle;return _=new MutationObserver(z=>{z.some(Q=>Q.type==="attributes"&&Q.attributeName===L)&&(_==null||_.disconnect(),_=null,b(()=>{x({height:0,width:0}),I.style.removeProperty("content-visibility"),w(!1),t.current===F&&(t.current=null)},Y))}),_.observe(I,{attributes:!0,attributeFilter:[L]}),()=>{_==null||_.disconnect(),j.cancel(),t.current===F&&(F.abort(),t.current=null)}}return()=>{An.cancel(H)}},[t,n,j,s,c,h,g,m,b,x,w]),Ue(()=>{if(n.current!=="css-animation")return;const I=m.current;I&&(D.current=I.style.animationName||D.current,I.style.setProperty("animation-name","none"),x({height:I.scrollHeight,width:I.scrollWidth}),!k.current&&!O.current&&I.style.removeProperty("animation-name"),g?(t.current!=null&&(t.current.abort(),t.current=null),w(!0),E(!0)):(t.current=new AbortController,b(()=>{w(!1),E(!1),t.current=null},t.current.signal)))},[t,n,g,m,b,x,w,E,C]),Xh(()=>{const I=An.request(()=>{k.current=!1});return()=>An.cancel(I)}),Ue(()=>{if(!s)return;const I=m.current;if(!I)return;let H=-1,F=-1;return g&&O.current&&(I.style.transitionDuration="0s",x({height:I.scrollHeight,width:I.scrollWidth}),H=An.request(()=>{O.current=!1,F=An.request(()=>{setTimeout(()=>{I.style.removeProperty("transition-duration")})})})),()=>{An.cancel(H),An.cancel(F)}},[s,g,m,x]),Ue(()=>{const I=m.current;I&&s&&B&&(I.setAttribute("hidden","until-found"),n.current==="css-transition"&&I.setAttribute(bu.startingStyle,""))},[s,B,n,m]),y.useEffect(function(){const H=m.current;if(!H)return;function F(Y){O.current=!0,S(!0),f(!0,pt(wa,Y))}return H.addEventListener("beforematch",F),()=>{H.removeEventListener("beforematch",F)}},[f,m,S]),y.useMemo(()=>({props:{hidden:B,id:d,ref:K}}),[B,d,K])}let bR=(function(e){return e.collapsiblePanelHeight="--collapsible-panel-height",e.collapsiblePanelWidth="--collapsible-panel-width",e})({});const b8=y.forwardRef(function(t,n){const{className:a,hiddenUntilFound:i,keepMounted:s,render:c,id:d,...h}=t,{abortControllerRef:f,animationTypeRef:g,height:m,mounted:b,onOpenChange:x,open:w,panelId:S,panelRef:E,runOnceAnimationsFinish:T,setDimensions:C,setHiddenUntilFound:M,setKeepMounted:O,setMounted:D,setPanelIdState:k,setOpen:A,setVisible:j,state:B,transitionDimensionRef:G,visible:K,width:I,transitionStatus:H}=DM(),F=i??!1,Y=s??!1;Ue(()=>{if(d)return k(d),()=>{k(void 0)}},[d,k]),Ue(()=>{M(F)},[M,F]),Ue(()=>{O(Y)},[O,Y]);const{props:_}=v8({abortControllerRef:f,animationTypeRef:g,externalRef:n,height:m,hiddenUntilFound:F,id:S,keepMounted:Y,mounted:b,onOpenChange:x,open:w,panelRef:E,runOnceAnimationsFinish:T,setDimensions:C,setMounted:D,setOpen:A,setVisible:j,transitionDimensionRef:G,visible:K,width:I});Oo({open:w&&H==="idle",ref:E,onComplete(){w&&C({height:void 0,width:void 0})}});const L=y.useMemo(()=>({...B,transitionStatus:H}),[B,H]),z=Mt("div",t,{state:L,ref:[n,E],props:[_,{style:{[bR.collapsiblePanelHeight]:m===void 0?"auto":`${m}px`,[bR.collapsiblePanelWidth]:I===void 0?"auto":`${I}px`}},h],stateAttributesMapping:kM});return Y||F||!Y&&b?z:null});function jM({...e}){return R.jsx(m8,{"data-slot":"collapsible",...e})}function LM({...e}){return R.jsx(g8,{"data-slot":"collapsible-trigger",...e})}function _M({...e}){return R.jsx(b8,{"data-slot":"collapsible-content",...e})}function Ah({children:e,onClick:t,...n}){const{isMobile:a,setOpenMobile:i}=Yr(),s=c=>{a&&i(!1),t==null||t(c)};return R.jsx(eb,{...n,onClick:s,children:e})}function x8({items:e}){const{t}=gr();return R.jsx(bM,{children:R.jsx(DB,{children:e.map(n=>{var a,i;return R.jsxs(jM,{defaultOpen:n.isActive,render:R.jsx(kB,{}),children:[R.jsx(Ah,{to:n.url,children:R.jsxs(LB,{tooltip:t(n.title),children:[R.jsx(n.icon,{}),R.jsx("span",{children:t(n.title)})]})}),(a=n.items)!=null&&a.length?R.jsxs(R.Fragment,{children:[R.jsxs(LM,{render:R.jsx(_B,{className:"data-[state=open]:rotate-90"}),children:[R.jsx(EC,{}),R.jsx("span",{className:"sr-only",children:"Toggle"})]}),R.jsx(_M,{children:R.jsx(IB,{children:(i=n.items)==null?void 0:i.map(s=>R.jsx(zB,{children:R.jsx(Ah,{to:s.url,children:R.jsx(PB,{children:R.jsx("span",{children:t(s.title)})})})},s.title))})})]}):null]},n.title)})})})}const w8=Vh("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 $l({className:e,variant:t="default",render:n,...a}){return Fh({defaultTagName:"span",props:la({className:Le(w8({className:e,variant:t}))},a),render:n,state:{slot:"badge",variant:t}})}const S8={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 E8({deviceId:e,className:t}){const{t:n}=gr(),a=mn(s=>s.deviceReconnecting[e]),i=mn(s=>s.deviceErrors[e]);if(a)return R.jsxs($l,{variant:"outline",title:a.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:[R.jsx(OC,{className:"h-3 w-3 animate-spin"}),R.jsx("span",{className:"truncate max-w-[120px]",children:a.message})]});if(i){const s=S8[i.type]??"unknown",c=n(`deviceStatus.errorBadge.${s}`),d=[c,i.message,i.rawMessage].filter(Boolean).join(`
|
|
299
|
-
`);return R.jsxs($l,{variant:"outline",title:d,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:[R.jsx(lP,{className:"h-3 w-3"}),R.jsx("span",{className:"truncate max-w-[120px]",children:c})]})}return null}function R8(e){const{children:t,open:n,defaultOpen:a=!1,onOpenChange:i,onOpenChangeComplete:s,actionsRef:c,handle:d,triggerId:h,defaultTriggerId:f=null}=e,g=Oi(),m=!!g,b=Kn(()=>(d==null?void 0:d.store)??new dM({open:a,openProp:n,activeTriggerId:f,triggerIdProp:h,modal:!0,disablePointerDismissal:!0,nested:m,role:"alertdialog"})).current;b.useControlledProp("openProp",n),b.useControlledProp("triggerIdProp",h),b.useSyncedValue("nested",m),b.useContextCallback("onOpenChange",i),b.useContextCallback("onOpenChangeComplete",s);const x=b.useState("payload");uM({store:b,actionsRef:c,parentContext:g==null?void 0:g.store.context});const w=y.useMemo(()=>({store:b}),[b]);return R.jsx(xb.Provider,{value:w,children:typeof t=="function"?t({payload:x}):t})}function dv({...e}){return R.jsx(R8,{"data-slot":"alert-dialog",...e})}function T8({...e}){return R.jsx(Hb,{"data-slot":"alert-dialog-portal",...e})}function C8({className:e,...t}){return R.jsx(wb,{"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 fv({className:e,size:t="default",...n}){return R.jsxs(T8,{children:[R.jsx(C8,{}),R.jsx(zb,{"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 hv({className:e,...t}){return R.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 mv({className:e,...t}){return R.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 xR({className:e,...t}){return R.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 pv({className:e,...t}){return R.jsx(Vb,{"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 gv({className:e,...t}){return R.jsx(Sb,{"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 yv({className:e,...t}){return R.jsx(Rn,{"data-slot":"alert-dialog-action",className:Le(e),...t})}function vv({className:e,variant:t="outline",size:n="default",...a}){return R.jsx(tm,{"data-slot":"alert-dialog-cancel",className:Le(e),render:R.jsx(Rn,{variant:t,size:n}),...a})}function bv({...e}){return R.jsx(fM,{"data-slot":"dialog",...e})}function O8({...e}){return R.jsx(Hb,{"data-slot":"dialog-portal",...e})}function M8({className:e,...t}){return R.jsx(wb,{"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 xv({className:e,children:t,showCloseButton:n=!0,...a}){return R.jsxs(O8,{children:[R.jsx(M8,{}),R.jsxs(zb,{"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),...a,children:[t,n&&R.jsxs(tm,{"data-slot":"dialog-close",render:R.jsx(Rn,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[R.jsx(Hl,{}),R.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function wv({className:e,...t}){return R.jsx("div",{"data-slot":"dialog-header",className:Le("gap-2 flex flex-col",e),...t})}function wR({className:e,showCloseButton:t=!1,children:n,...a}){return R.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),...a,children:[n,t&&R.jsx(tm,{render:R.jsx(Rn,{variant:"outline"}),children:"Close"})]})}function Sv({className:e,...t}){return R.jsx(Vb,{"data-slot":"dialog-title",className:Le("text-base leading-none font-medium",e),...t})}function IM({className:e,...t}){return R.jsx(Sb,{"data-slot":"dialog-description",className:Le("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",e),...t})}const zM=y.createContext(void 0);function PM(e){const t=y.useContext(zM);if(t===void 0&&!e)throw new Error(pn(33));return t}const UM=y.createContext(void 0);function Ni(e){const t=y.useContext(UM);if(t===void 0&&!e)throw new Error(pn(36));return t}const N8=y.createContext(void 0);function sd(e=!0){const t=y.useContext(N8);if(t===void 0&&!e)throw new Error(pn(25));return t}const A8={...qa,...Co},D8=y.forwardRef(function(t,n){const{className:a,render:i,...s}=t,{store:c}=Ni(),d=c.useState("open"),h=c.useState("mounted"),f=c.useState("transitionStatus"),g=c.useState("lastOpenChangeReason"),m=sd(),b={open:d,transitionStatus:f};return Mt("div",t,{ref:m!=null&&m.backdropRef?[n,m.backdropRef]:n,state:b,stateAttributesMapping:A8,props:[{role:"presentation",hidden:!h,style:{pointerEvents:g===ur?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},s]})});function k8(e){const{closeOnClick:t,highlighted:n,id:a,nodeId:i,store:s,itemRef:c,itemMetadata:d}=e,{events:h}=s.useState("floatingTreeRoot"),f=sd(!0),g=f!==void 0;return y.useMemo(()=>({id:a,role:"menuitem",tabIndex:n?0:-1,onMouseMove(m){i&&h.emit("itemhover",{nodeId:i,target:m.currentTarget})},onClick(m){t&&h.emit("close",{domEvent:m,reason:yu})},onMouseUp(m){if(f){const b=f.initialCursorPointRef.current;if(f.initialCursorPointRef.current=null,g&&b&&Math.abs(m.clientX-b.x)<=1&&Math.abs(m.clientY-b.y)<=1)return}c.current&&s.context.allowMouseUpTriggerRef.current&&(!g||m.button===2)&&(!d||d.type==="regular-item")&&c.current.click()}}),[t,n,a,h,i,s,c,f,g,d])}const j8={type:"regular-item"};function L8(e){const{closeOnClick:t,disabled:n=!1,highlighted:a,id:i,store:s,nativeButton:c,itemMetadata:d,nodeId:h}=e,f=y.useRef(null),{getButtonProps:g,buttonRef:m}=To({disabled:n,focusableWhenDisabled:!0,native:c}),b=k8({closeOnClick:t,highlighted:a,id:i,nodeId:h,store:s,itemRef:f,itemMetadata:d}),x=y.useCallback(S=>la(b,{onMouseEnter(){d.type==="submenu-trigger"&&d.setActive()},onKeyUp(E){E.key===" "&&s.context.typingRef.current&&E.preventBaseUIHandler()}},S,g),[b,g,s,d]),w=xa(f,m);return y.useMemo(()=>({getItemProps:x,itemRef:w}),[x,w])}const _8=y.forwardRef(function(t,n){const{render:a,className:i,id:s,label:c,nativeButton:d=!1,disabled:h=!1,closeOnClick:f=!0,...g}=t,m=$b({label:c}),b=PM(!0),x=Ra(s),{store:w}=Ni(),S=w.useState("isActive",m.index),E=w.useState("itemProps"),{getItemProps:T,itemRef:C}=L8({closeOnClick:f,disabled:h,highlighted:S,id:x,store:w,nativeButton:d,nodeId:b==null?void 0:b.nodeId,itemMetadata:j8});return Mt("div",t,{state:{disabled:h,highlighted:S},props:[E,g,T],ref:[C,n,m.ref]})}),I8=y.createContext(void 0);function HM(e){return y.useContext(I8)}const z8={...qa,...Co},P8=y.forwardRef(function(t,n){const{render:a,className:i,finalFocus:s,...c}=t,{store:d}=Ni(),{side:h,align:f}=PM(),g=HM()!=null,m=d.useState("open"),b=d.useState("transitionStatus"),x=d.useState("popupProps"),w=d.useState("mounted"),S=d.useState("instantType"),E=d.useState("activeTriggerElement"),T=d.useState("parent"),C=d.useState("lastOpenChangeReason"),M=d.useState("rootId"),O=d.useState("floatingRootContext"),D=d.useState("floatingTreeRoot"),k=d.useState("closeDelay"),A=d.useState("activeTriggerElement"),j=T.type==="context-menu";Oo({open:m,ref:d.context.popupRef,onComplete(){var F,Y;m&&((Y=(F=d.context).onOpenChangeComplete)==null||Y.call(F,!0))}}),y.useEffect(()=>{function F(Y){d.setOpen(!1,pt(Y.reason,Y.domEvent))}return D.events.on("close",F),()=>{D.events.off("close",F)}},[D.events,d]);const B=d.useState("hoverEnabled"),G=d.useState("disabled");eM(O,{enabled:B&&!G&&!j&&T.type!=="menubar",closeDelay:k});const K={transitionStatus:b,side:h,align:f,open:m,nested:T.type==="menu",instant:S},I=Mt("div",t,{state:K,ref:[n,d.context.popupRef],stateAttributesMapping:z8,props:[x,{onKeyDown(F){g&&Ib.has(F.key)&&F.stopPropagation()}},nc(b),c,{"data-rootownerid":M}]});let H=T.type===void 0||j;return(E||T.type==="menubar"&&C!==Jh)&&(H=!0),R.jsx(Cb,{context:O,modal:j,disabled:!w,returnFocus:s===void 0?H:s,initialFocus:T.type!=="menu",restoreFocus:!0,externalTree:T.type!=="menubar"?D:void 0,previousFocusableElement:A,nextFocusableElement:T.type===void 0?d.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:T.type===void 0?d.context.beforeContentFocusGuardRef:void 0,children:I})}),BM=y.createContext(void 0);function U8(){const e=y.useContext(BM);if(e===void 0)throw new Error(pn(32));return e}const H8=y.forwardRef(function(t,n){const{keepMounted:a=!1,...i}=t,{store:s}=Ni();return s.useState("mounted")||a?R.jsx(BM.Provider,{value:a,children:R.jsx(Rb,{ref:n,...i})}):null}),B8=y.forwardRef(function(t,n){var ke;const{anchor:a,positionMethod:i="absolute",className:s,render:c,side:d,align:h,sideOffset:f=0,alignOffset:g=0,collisionBoundary:m="clipping-ancestors",collisionPadding:b=5,arrowPadding:x=5,sticky:w=!1,disableAnchorTracking:S=!1,collisionAvoidance:E=jC,...T}=t,{store:C}=Ni(),M=U8(),O=sd(!0),D=C.useState("parent"),k=C.useState("floatingRootContext"),A=C.useState("floatingTreeRoot"),j=C.useState("mounted"),B=C.useState("open"),G=C.useState("modal"),K=C.useState("activeTriggerElement"),I=C.useState("transitionStatus"),H=C.useState("lastOpenChangeReason"),F=C.useState("floatingNodeId"),Y=C.useState("floatingParentNodeId");let _=a,L=f,z=g,V=h,Q=E;D.type==="context-menu"&&(_=a??((ke=D.context)==null?void 0:ke.anchor),V=V??"start",!d&&V!=="center"&&(z=t.alignOffset??2,L=t.sideOffset??-5));let P=d,q=V;D.type==="menu"?(P=P??"inline-end",q=q??"start",Q=t.collisionAvoidance??LC):D.type==="menubar"&&(P=P??"bottom",q=q??"start");const X=D.type==="context-menu",W=qb({anchor:_,floatingRootContext:k,positionMethod:O?"fixed":i,mounted:j,side:P,sideOffset:L,align:q,alignOffset:z,arrowPadding:X?0:x,collisionBoundary:m,collisionPadding:b,sticky:w,nodeId:F,keepMounted:M,disableAnchorTracking:S,collisionAvoidance:Q,shiftCrossAxis:X&&!("side"in Q&&Q.side==="flip"),externalTree:A}),ce=y.useMemo(()=>{const J={};return B||(J.pointerEvents="none"),{role:"presentation",hidden:!j,style:{...W.positionerStyles,...J}}},[B,j,W.positionerStyles]);y.useEffect(()=>{function J(ue){ue.open&&(ue.parentNodeId===F&&C.set("hoverEnabled",!1),ue.nodeId!==F&&ue.parentNodeId===C.select("floatingParentNodeId")&&C.setOpen(!1,pt(ih)))}return A.events.on("menuopenchange",J),()=>{A.events.off("menuopenchange",J)}},[C,A.events,F]),y.useEffect(()=>{if(C.select("floatingParentNodeId")==null)return;function J(ue){if(ue.open||ue.nodeId!==C.select("floatingParentNodeId"))return;const pe=ue.reason??ih;C.setOpen(!1,pt(pe))}return A.events.on("menuopenchange",J),()=>{A.events.off("menuopenchange",J)}},[A.events,C]),y.useEffect(()=>{function J(ue){!B||ue.nodeId!==C.select("floatingParentNodeId")||ue.target&&K&&K!==ue.target&&C.setOpen(!1,pt(ih))}return A.events.on("itemhover",J),()=>{A.events.off("itemhover",J)}},[A.events,B,K,C]),y.useEffect(()=>{const J={open:B,nodeId:F,parentNodeId:Y,reason:C.select("lastOpenChangeReason")};A.events.emit("menuopenchange",J)},[A.events,B,C,F,Y]);const ie={open:B,side:W.side,align:W.align,anchorHidden:W.anchorHidden,nested:D.type==="menu"},de=y.useMemo(()=>({side:W.side,align:W.align,arrowRef:W.arrowRef,arrowUncentered:W.arrowUncentered,arrowStyles:W.arrowStyles,nodeId:W.context.nodeId}),[W.side,W.align,W.arrowRef,W.arrowUncentered,W.arrowStyles,W.context.nodeId]),ve=Mt("div",t,{state:ie,stateAttributesMapping:qa,ref:[n,C.useStateSetter("positionerElement")],props:[ce,nc(I),T]}),Se=j&&D.type!=="menu"&&(D.type!=="menubar"&&G&&H!==ur||D.type==="menubar"&&D.context.modal);let Me=null;return D.type==="menubar"?Me=D.context.contentElement:D.type===void 0&&(Me=K),R.jsxs(zM.Provider,{value:de,children:[Se&&R.jsx(Ub,{ref:D.type==="context-menu"||D.type==="nested-context-menu"?D.context.internalBackdropRef:null,inert:Pb(!B),cutout:Me}),R.jsx(MU,{id:F,children:R.jsx(lm,{elementsRef:C.context.itemDomElements,labelsRef:C.context.itemLabels,children:ve})})]})}),F8=y.createContext(null);function FM(e){return y.useContext(F8)}const V8={...jb,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 Kb extends om{constructor(n){super({...Y8(),...n},{positionerRef:y.createRef(),popupRef:y.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:y.createRef(),beforeContentFocusGuardRef:y.createRef(),onOpenChangeComplete:void 0,triggerElements:new nd},V8);We(this,"unsubscribeParentListener",null);this.unsubscribeParentListener=this.observe("parent",a=>{var i;if((i=this.unsubscribeParentListener)==null||i.call(this),a.type==="menu"){this.unsubscribeParentListener=a.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=a.store.context.allowMouseUpTriggerRef;return}a.type!==void 0&&(this.context.allowMouseUpTriggerRef=a.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(n,a){this.state.floatingRootContext.context.events.emit("setOpen",{open:n,eventDetails:a})}static useStore(n,a){const i=Kn(()=>new Kb(a)).current;return n??i}}function Y8(){return{...kb(),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 Eb,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:En,keyboardEventRelay:void 0,closeDelay:0}}const q8=y.createContext(void 0);function $8(){return y.useContext(q8)}const K8=Mb(function(t){const{children:n,open:a,onOpenChange:i,onOpenChangeComplete:s,defaultOpen:c=!1,disabled:d=!1,modal:h,loopFocus:f=!0,orientation:g="vertical",actionsRef:m,closeParentOnEsc:b=!1,handle:x,triggerId:w,defaultTriggerId:S=null,highlightItemOnHover:E=!0}=t,T=sd(!0),C=Ni(!0),M=FM(!0),O=$8(),D=y.useMemo(()=>O&&C?{type:"menu",store:C.store}:M?{type:"menubar",context:M}:T&&!C?{type:"context-menu",context:T}:{type:void 0},[T,C,M,O]),k=Kb.useStore(x==null?void 0:x.store,{open:c,openProp:a,activeTriggerId:S,triggerIdProp:w,parent:D});sm(()=>{a===void 0&&k.state.open===!1&&c===!0&&k.update({open:!0,activeTriggerId:S})}),k.useControlledProp("openProp",a),k.useControlledProp("triggerIdProp",w),k.useContextCallback("onOpenChangeComplete",s);const A=k.useState("floatingTreeRoot"),j=AO(A),B=Mo();Ue(()=>{T&&!C?k.update({parent:{type:"context-menu",context:T},floatingNodeId:j,floatingParentNodeId:B}):C&&k.update({floatingNodeId:j,floatingParentNodeId:B})},[T,C,j,B,k]);const G=k.useState("open"),K=k.useState("activeTriggerElement"),I=k.useState("positionerElement"),H=k.useState("hoverEnabled"),F=k.useState("modal"),Y=k.useState("disabled"),_=k.useState("lastOpenChangeReason"),L=k.useState("parent"),z=k.useState("activeIndex"),V=k.useState("payload"),Q=k.useState("floatingParentNodeId"),P=y.useRef(null),q=Q!=null;let X;k.useSyncedValues({disabled:d,modal:L.type===void 0?h:void 0,rootId:Os()});const{openMethod:W,triggerProps:ce,reset:ie}=Fb(G);Ab(k);const{forceUnmount:de}=Db(G,k,()=>{k.update({allowMouseEnter:!1,stickIfOpen:!0}),ie()}),ve=y.useRef(L.type!=="context-menu"),Se=Dn();y.useEffect(()=>{if(G||(P.current=null),L.type==="context-menu"){if(!G){Se.clear(),ve.current=!1;return}Se.start(500,()=>{ve.current=!0})}},[Se,G,L.type]),Bb(G&&F&&_!==ur&&W!=="touch",I),Ue(()=>{!G&&!H&&k.set("hoverEnabled",!0)},[G,H,k]);const Me=y.useRef(!0),ke=Dn(),J=He((ze,Je)=>{var mt;const ft=Je.reason;if(G===ze&&Je.trigger===K&&_===ft||(Je.preventUnmountOnClose=()=>{k.set("preventUnmountingOnClose",!0)},!ze&&Je.trigger==null&&(Je.trigger=K??void 0),i==null||i(ze,Je),Je.isCanceled))return;const jt={open:ze,nativeEvent:Je.event,reason:Je.reason,nested:q};X==null||X.emit("openchange",jt);const nn=Je.event;if(ze===!1&&(nn==null?void 0:nn.type)==="click"&&nn.pointerType==="touch"&&!Me.current)return;if(!ze&&z!==null){const Ve=k.context.itemDomElements.current[z];queueMicrotask(()=>{Ve==null||Ve.setAttribute("tabindex","-1")})}ze&&ft===vl?(Me.current=!1,ke.start(300,()=>{Me.current=!0})):(Me.current=!0,ke.clear());const ht=(ft===Ss||ft===yu)&&nn.detail===0&&(nn==null?void 0:nn.isTrusted),Ct=!ze&&(ft===em||ft==null),et={open:ze,openChangeReason:ft};P.current=Je.event??null;const lt=((mt=Je.trigger)==null?void 0:mt.id)??null;(lt||ze)&&(et.activeTriggerId=lt,et.activeTriggerElement=Je.trigger??null),k.update(et),L.type==="menubar"&&(ft===vl||ft===Es||ft===ur||ft===oh||ft===ih)?k.set("instantType","group"):ht||Ct?k.set("instantType",ht?"click":"dismiss"):k.set("instantType",void 0)}),ue=y.useCallback(ze=>{const Je=pt(ze);return Je.preventUnmountOnClose=()=>{k.set("preventUnmountingOnClose",!0)},Je},[k]),pe=y.useCallback(()=>{k.setOpen(!1,ue(bb))},[k,ue]);y.useImperativeHandle(m,()=>({unmount:de,close:pe}),[de,pe]);let De;L.type==="context-menu"&&(De=L.context),y.useImperativeHandle(De==null?void 0:De.positionerRef,()=>I,[I]),y.useImperativeHandle(De==null?void 0:De.actionsRef,()=>({setOpen:J}),[J]);const Ce=Lb({popupStore:k,onOpenChange:J});X=Ce.context.events,y.useEffect(()=>{const ze=({open:Je,eventDetails:ft})=>J(Je,ft);return X.on("setOpen",ze),()=>{X==null||X.off("setOpen",ze)}},[X,J]);const we=am(Ce,{enabled:!Y,bubbles:{escapeKey:b&&L.type==="menu"},outsidePress(){var ze;return L.type!=="context-menu"||((ze=P.current)==null?void 0:ze.type)==="contextmenu"?!0:ve.current},externalTree:q?A:void 0}),Te=rM(Ce,{role:"menu"}),Z=tc(),be=y.useCallback(ze=>{k.select("activeIndex")!==ze&&k.set("activeIndex",ze)},[k]),ge=nM(Ce,{enabled:!Y,listRef:k.context.itemDomElements,activeIndex:z,nested:L.type!==void 0,loopFocus:f,orientation:g,parentOrientation:L.type==="menubar"?L.context.orientation:void 0,rtl:Z==="rtl",disabledIndices:Si,onNavigate:be,openOnArrowKeyDown:L.type!=="context-menu",externalTree:q?A:void 0,focusItemOnHover:E}),Pe=y.useCallback(ze=>{k.context.typingRef.current=ze},[k]),Be=aM(Ce,{listRef:k.context.itemLabels,activeIndex:z,resetMs:s3,onMatch:ze=>{G&&ze!==z&&k.set("activeIndex",ze)},onTypingChange:Pe}),{getReferenceProps:Ae,getFloatingProps:it,getItemProps:wt,getTriggerProps:xt}=rd([we,Te,ge,Be]),oe=y.useMemo(()=>{const ze=la(Ae(),{onMouseMove(){k.set("allowMouseEnter",!0)}},ce);return delete ze.role,ze},[Ae,k,ce]),xe=y.useMemo(()=>{const ze=xt();if(!ze)return ze;const Je=la(ze,ce);return delete Je.role,delete Je["aria-controls"],Je},[xt,ce]),Ie=y.useMemo(()=>it({onMouseMove(){k.set("allowMouseEnter",!0),L.type==="menu"&&k.set("hoverEnabled",!1)},onClick(){k.select("hoverEnabled")&&k.set("hoverEnabled",!1)},onKeyDown(ze){const Je=k.select("keyboardEventRelay");Je&&!ze.isPropagationStopped()&&Je(ze)}}),[it,L.type,k]),qe=y.useMemo(()=>wt(),[wt]);k.useSyncedValues({floatingRootContext:Ce,activeTriggerProps:oe,inactiveTriggerProps:xe,popupProps:Ie,itemProps:qe});const Ke=y.useMemo(()=>({store:k,parent:D}),[k,D]),st=R.jsx(UM.Provider,{value:Ke,children:typeof n=="function"?n({payload:V}):n});return L.type===void 0||L.type==="context-menu"?R.jsx(NU,{externalTree:A,children:st}):st});function VM(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),a=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||a.content!=="none"))return t;const s=parseFloat(n.width)||0,c=parseFloat(n.height)||0,d=parseFloat(a.width)||0,h=parseFloat(a.height)||0,f=Math.max(t.width,s,d),g=Math.max(t.height,c,h),m=f-t.width,b=g-t.height;return{left:t.left-m/2,right:t.right+m/2,top:t.top-b/2,bottom:t.bottom+b/2}}function G8(e){const{render:t,className:n,state:a=En,props:i=Si,refs:s=Si,metadata:c,stateAttributesMapping:d,tag:h="div",...f}=e,{compositeProps:g,compositeRef:m}=OM({metadata:c});return Mt(h,e,{state:a,ref:[...s,m],props:[g,...i,f],stateAttributesMapping:d})}function YM(e){if(vn(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!za(e))return YM(Ha(e))}function X8(e){const{enabled:t=!0,mouseDownAction:n,open:a}=e,i=y.useRef(!1);return y.useMemo(()=>t?{onMouseDown:s=>{(n==="open"&&!a||n==="close"&&a)&&(i.current=!0,Yt(s.currentTarget).addEventListener("click",()=>{i.current=!1},{once:!0}))},onClick:s=>{i.current&&(i.current=!1,s.preventBaseUIHandler())}}:En,[t,n,a])}const Yf=2,W8=GO(function(t,n){const{render:a,className:i,disabled:s=!1,nativeButton:c=!0,id:d,openOnHover:h,delay:f=100,closeDelay:g=0,handle:m,payload:b,...x}=t,w=Ni(!0),S=(m==null?void 0:m.store)??(w==null?void 0:w.store);if(!S)throw new Error(pn(85));const E=Ra(d),T=S.useState("isTriggerActive",E),C=S.useState("floatingRootContext"),M=S.useState("isOpenedByTrigger",E),O=y.useRef(null),D=Z8(),k=ub(!0),A=Mi(),j=y.useMemo(()=>A??new Eb,[A]),B=AO(j),G=Mo(),{registerTrigger:K,isMountedByThisTrigger:I}=WO(E,O,S,{payload:b,closeDelay:g,parent:D,floatingTreeRoot:j,floatingNodeId:B,floatingParentNodeId:G,keyboardEventRelay:k==null?void 0:k.relayKeyboardEvent}),H=D.type==="menubar",F=S.useState("disabled"),Y=s||F||H&&D.context.disabled,{getButtonProps:_,buttonRef:L}=To({disabled:Y,native:c});y.useEffect(()=>{!M&&D.type===void 0&&(S.context.allowMouseUpTriggerRef.current=!1)},[S,M,D.type]);const z=y.useRef(null),V=Dn(),Q=He(we=>{if(!z.current)return;V.clear(),S.context.allowMouseUpTriggerRef.current=!1;const Te=we.target;if(Ot(z.current,Te)||Ot(S.select("positionerElement"),Te)||Te===z.current||Te!=null&&YM(Te)===S.select("rootId"))return;const Z=VM(z.current);we.clientX>=Z.left-Yf&&we.clientX<=Z.right+Yf&&we.clientY>=Z.top-Yf&&we.clientY<=Z.bottom+Yf||j.events.emit("close",{domEvent:we,reason:RO})});y.useEffect(()=>{M&&S.select("lastOpenChangeReason")===ur&&Yt(z.current).addEventListener("mouseup",Q,{once:!0})},[M,Q,S]);const P=H&&D.context.hasSubmenuOpen,X=tM(C,{enabled:(h??P)&&!Y&&D.type!=="context-menu"&&(!H||P&&!I),handleClose:oM({blockPointerEvents:!H}),mouseOnly:!0,move:!1,restMs:D.type===void 0?f:void 0,delay:{close:g},triggerElementRef:O,externalTree:j,isActiveTrigger:T}),W=Q8(M,S.select("lastOpenChangeReason")),ce=zO(C,{enabled:!Y&&D.type!=="context-menu",event:M&&H?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:D.type===void 0?W:!1}),ie=ZO(C,{enabled:!Y&&P}),de=X8({open:M,enabled:H,mouseDownAction:"open"}),ve=rd([ce,ie]),Se={disabled:Y,open:M},Me=S.useState("triggerProps",I),ke=[z,n,L,K,O],J=[ve.getReferenceProps(),X??En,Me,{"aria-haspopup":"menu",id:E,onMouseDown:we=>{if(S.select("open"))return;V.start(200,()=>{S.context.allowMouseUpTriggerRef.current=!0}),Yt(we.currentTarget).addEventListener("mouseup",Q,{once:!0})}},H?{role:"menuitem"}:{},de,x,_],ue=y.useRef(null),pe=He(we=>{or.flushSync(()=>{S.setOpen(!1,pt(Es,we.nativeEvent,we.currentTarget))});const Te=uU(ue.current);Te==null||Te.focus()}),De=He(we=>{var Z;const Te=S.select("positionerElement");if(Te&&yl(we,Te))(Z=S.context.beforeContentFocusGuardRef.current)==null||Z.focus();else{or.flushSync(()=>{S.setOpen(!1,pt(Es,we.nativeEvent,we.currentTarget))});let be=cU(S.context.triggerFocusTargetRef.current||O.current);for(;be!==null&&Ot(Te,be);){const ge=be;if(be=yb(be),be===ge)break}be==null||be.focus()}}),Ce=Mt("button",t,{enabled:!H,stateAttributesMapping:sv,state:Se,ref:ke,props:J});return H?R.jsx(G8,{tag:"button",render:a,className:i,state:Se,refs:ke,props:J,stateAttributesMapping:sv}):M?R.jsxs(y.Fragment,{children:[R.jsx(ql,{ref:ue,onFocus:pe},`${E}-pre-focus-guard`),R.jsx(y.Fragment,{children:Ce},E),R.jsx(ql,{ref:S.context.triggerFocusTargetRef,onFocus:De},`${E}-post-focus-guard`)]}):R.jsx(y.Fragment,{children:Ce},E)});function Q8(e,t){const n=Dn(),[a,i]=y.useState(!1);return Ue(()=>{e&&t==="trigger-hover"?(i(!0),n.start(l3,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),a}function Z8(){const e=sd(!0),t=Ni(!0),n=FM();return y.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}function Gb({...e}){return R.jsx(K8,{"data-slot":"dropdown-menu",...e})}function Xb({...e}){return R.jsx(W8,{"data-slot":"dropdown-menu-trigger",...e})}function Wb({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:a=4,backdrop:i=!1,className:s,...c}){return R.jsxs(H8,{children:[i&&R.jsx(D8,{className:"fixed inset-0 z-50"}),R.jsx(B8,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:a,children:R.jsx(P8,{"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",s),...c})})]})}function pi({className:e,inset:t,variant:n="default",...a}){return R.jsx(_8,{"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),...a})}function V7({className:e,...t}){return R.jsx(TO,{"data-slot":"dropdown-menu-separator",className:Le("bg-border -mx-1 my-1 h-px",e),...t})}const qM=y.createContext(void 0);function cm(){const e=y.useContext(qM);if(e===void 0)throw new Error(pn(53));return e}let Dh=(function(e){return e.scrollAreaCornerHeight="--scroll-area-corner-height",e.scrollAreaCornerWidth="--scroll-area-corner-width",e})({});const qf=500,SR=16;function ia(e,t,n){if(!e)return 0;const a=getComputedStyle(e),i=n==="x"?"Inline":"Block";return n==="x"&&t==="margin"?parseFloat(a[`${t}InlineStart`])*2:parseFloat(a[`${t}${i}Start`])+parseFloat(a[`${t}${i}End`])}let J8=(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})({});const $f="base-ui-disable-scrollbar",_u={className:$f,getElement(e){return R.jsx("style",{nonce:e,href:$f,precedence:"base-ui:low",children:`.${$f}{scrollbar-width:none}.${$f}::-webkit-scrollbar{display:none}`})}};let cl=(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 Qb={hasOverflowX:e=>e?{[cl.hasOverflowX]:""}:null,hasOverflowY:e=>e?{[cl.hasOverflowY]:""}:null,overflowXStart:e=>e?{[cl.overflowXStart]:""}:null,overflowXEnd:e=>e?{[cl.overflowXEnd]:""}:null,overflowYStart:e=>e?{[cl.overflowYStart]:""}:null,overflowYEnd:e=>e?{[cl.overflowYEnd]:""}:null,cornerHidden:()=>null},eF={x:0,y:0},ER={width:0,height:0},tF={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},nF={x:!1,y:!1,corner:!1},rF=y.forwardRef(function(t,n){const{render:a,className:i,overflowEdgeThreshold:s,...c}=t,d=aF(s),h=Ra(),f=Dn(),g=Dn(),{nonce:m,disableStyleElements:b}=NM(),[x,w]=y.useState(!1),[S,E]=y.useState(!1),[T,C]=y.useState(!1),[M,O]=y.useState(!1),[D,k]=y.useState(ER),[A,j]=y.useState(ER),[B,G]=y.useState(tF),[K,I]=y.useState(nF),H=y.useRef(null),F=y.useRef(null),Y=y.useRef(null),_=y.useRef(null),L=y.useRef(null),z=y.useRef(null),V=y.useRef(null),Q=y.useRef(!1),P=y.useRef(0),q=y.useRef(0),X=y.useRef(0),W=y.useRef(0),ce=y.useRef("vertical"),ie=y.useRef(eF),de=He(we=>{const Te=we.x-ie.current.x,Z=we.y-ie.current.y;ie.current=we,Z!==0&&(C(!0),f.start(qf,()=>{C(!1)})),Te!==0&&(E(!0),g.start(qf,()=>{E(!1)}))}),ve=He(we=>{we.button===0&&(Q.current=!0,P.current=we.clientY,q.current=we.clientX,ce.current=we.currentTarget.getAttribute(J8.orientation),F.current&&(X.current=F.current.scrollTop,W.current=F.current.scrollLeft),L.current&&ce.current==="vertical"&&L.current.setPointerCapture(we.pointerId),z.current&&ce.current==="horizontal"&&z.current.setPointerCapture(we.pointerId))}),Se=He(we=>{if(!Q.current)return;const Te=we.clientY-P.current,Z=we.clientX-q.current;if(F.current){const be=F.current.scrollHeight,ge=F.current.clientHeight,Pe=F.current.scrollWidth,Be=F.current.clientWidth;if(L.current&&Y.current&&ce.current==="vertical"){const Ae=ia(Y.current,"padding","y"),it=ia(L.current,"margin","y"),wt=L.current.offsetHeight,xt=Y.current.offsetHeight-wt-Ae-it,oe=Te/xt;F.current.scrollTop=X.current+oe*(be-ge),we.preventDefault(),C(!0),f.start(qf,()=>{C(!1)})}if(z.current&&_.current&&ce.current==="horizontal"){const Ae=ia(_.current,"padding","x"),it=ia(z.current,"margin","x"),wt=z.current.offsetWidth,xt=_.current.offsetWidth-wt-Ae-it,oe=Z/xt;F.current.scrollLeft=W.current+oe*(Pe-Be),we.preventDefault(),E(!0),g.start(qf,()=>{E(!1)})}}}),Me=He(we=>{Q.current=!1,L.current&&ce.current==="vertical"&&L.current.releasePointerCapture(we.pointerId),z.current&&ce.current==="horizontal"&&z.current.releasePointerCapture(we.pointerId)});function ke(we){O(we.pointerType==="touch")}function J(we){if(ke(we),we.pointerType!=="touch"){const Te=Ot(H.current,we.target);w(Te)}}const ue=y.useMemo(()=>({scrolling:S||T,hasOverflowX:!K.x,hasOverflowY:!K.y,overflowXStart:B.xStart,overflowXEnd:B.xEnd,overflowYStart:B.yStart,overflowYEnd:B.yEnd,cornerHidden:K.corner}),[S,T,K.x,K.y,K.corner,B]),pe={role:"presentation",onPointerEnter:J,onPointerMove:J,onPointerDown:ke,onPointerLeave(){w(!1)},style:{position:"relative",[Dh.scrollAreaCornerHeight]:`${D.height}px`,[Dh.scrollAreaCornerWidth]:`${D.width}px`}},De=Mt("div",t,{state:ue,ref:[n,H],props:[pe,c],stateAttributesMapping:Qb}),Ce=y.useMemo(()=>({handlePointerDown:ve,handlePointerMove:Se,handlePointerUp:Me,handleScroll:de,cornerSize:D,setCornerSize:k,thumbSize:A,setThumbSize:j,touchModality:M,cornerRef:V,scrollingX:S,setScrollingX:E,scrollingY:T,setScrollingY:C,hovering:x,setHovering:w,viewportRef:F,rootRef:H,scrollbarYRef:Y,scrollbarXRef:_,thumbYRef:L,thumbXRef:z,rootId:h,hiddenState:K,setHiddenState:I,overflowEdges:B,setOverflowEdges:G,viewportState:ue,overflowEdgeThreshold:d}),[ve,Se,Me,de,D,A,M,S,E,T,C,x,w,h,K,B,ue,d]);return R.jsxs(qM.Provider,{value:Ce,children:[!b&&_u.getElement(m),De]})});function aF(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 oF=y.createContext(void 0);function xo(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function iF(e,t){if(typeof IntersectionObserver>"u")return()=>{};const n=new IntersectionObserver(a=>{a.forEach(i=>{i.intersectionRatio>0&&(t(),n.disconnect())})});return n.observe(e),()=>{n.disconnect()}}let gi=(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 RR=1;function TR(e,t){if(t<=0)return 0;const n=xo(e,0,t),a=n,i=t-n,s=a<=RR,c=i<=RR;return s&&c?a<=i?0:t:s?0:c?t:n}let CR=!1;function sF(){CR||Wh||(typeof CSS<"u"&&"registerProperty"in CSS&&[gi.scrollAreaOverflowXStart,gi.scrollAreaOverflowXEnd,gi.scrollAreaOverflowYStart,gi.scrollAreaOverflowYEnd].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),CR=!0)}const lF=y.forwardRef(function(t,n){const{render:a,className:i,...s}=t,{viewportRef:c,scrollbarYRef:d,scrollbarXRef:h,thumbYRef:f,thumbXRef:g,cornerRef:m,cornerSize:b,setCornerSize:x,setThumbSize:w,rootId:S,setHiddenState:E,hiddenState:T,handleScroll:C,setHovering:M,setOverflowEdges:O,overflowEdges:D,overflowEdgeThreshold:k,scrollingX:A,scrollingY:j}=cm(),B=tc(),G=y.useRef(!0),K=Dn(),I=Dn(),H=He(()=>{const V=c.current,Q=d.current,P=h.current,q=f.current,X=g.current,W=m.current;if(!V)return;const ce=V.scrollHeight,ie=V.scrollWidth,de=V.clientHeight,ve=V.clientWidth,Se=V.scrollTop,Me=V.scrollLeft;if(ce===0||ie===0)return;const ke=de>=ce,J=ve>=ie,ue=ve/ie,pe=de/ce,De=Math.max(0,ie-ve),Ce=Math.max(0,ce-de);let we=0,Te=0;if(!J){let et=0;B==="rtl"?et=xo(-Me,0,De):et=xo(Me,0,De),we=TR(et,De),Te=De-we}const Z=ke?0:xo(Se,0,Ce),be=ke?0:TR(Z,Ce),ge=ke?0:Ce-be,Pe=J?0:ve,Be=ke?0:de;let Ae=0,it=0;!J&&!ke&&(Ae=(Q==null?void 0:Q.offsetWidth)||0,it=(P==null?void 0:P.offsetHeight)||0);const wt=b.width===0&&b.height===0,xt=wt?Ae:0,oe=wt?it:0,xe=ia(P,"padding","x"),Ie=ia(Q,"padding","y"),qe=ia(X,"margin","x"),Ke=ia(q,"margin","y"),st=Pe-xe-qe,ze=Be-Ie-Ke,Je=P?Math.min(P.offsetWidth-xt,st):st,ft=Q?Math.min(Q.offsetHeight-oe,ze):ze,jt=Math.max(SR,Je*ue),nn=Math.max(SR,ft*pe);if(w(et=>et.height===nn&&et.width===jt?et:{width:jt,height:nn}),Q&&q){const et=Q.offsetHeight-nn-Ie-Ke,lt=ce-de,mt=lt===0?0:Se/lt,Ve=Math.min(et,Math.max(0,mt*et));q.style.transform=`translate3d(0,${Ve}px,0)`}if(P&&X){const et=P.offsetWidth-jt-xe-qe,lt=ie-ve,mt=lt===0?0:Me/lt,Ve=B==="rtl"?xo(mt*et,-et,0):xo(mt*et,0,et);X.style.transform=`translate3d(${Ve}px,0,0)`}const ht=[[gi.scrollAreaOverflowXStart,we],[gi.scrollAreaOverflowXEnd,Te],[gi.scrollAreaOverflowYStart,be],[gi.scrollAreaOverflowYEnd,ge]];for(const[et,lt]of ht)V.style.setProperty(et,`${lt}px`);W&&(J||ke?x({width:0,height:0}):!J&&!ke&&x({width:Ae,height:it})),E(et=>{const lt=ke||J;return et.y===ke&&et.x===J&&et.corner===lt?et:{y:ke,x:J,corner:lt}});const Ct={xStart:!J&&we>k.xStart,xEnd:!J&&Te>k.xEnd,yStart:!ke&&be>k.yStart,yEnd:!ke&&ge>k.yEnd};O(et=>et.xStart===Ct.xStart&&et.xEnd===Ct.xEnd&&et.yStart===Ct.yStart&&et.yEnd===Ct.yEnd?et:Ct)});Ue(()=>{if(!c.current)return;sF();let V=!1;return iF(c.current,()=>{if(!V){V=!0;return}H()})},[H,c]),Ue(()=>{queueMicrotask(H)},[H,T,B]),Ue(()=>{var V;(V=c.current)!=null&&V.matches(":hover")&&M(!0)},[c,M]),y.useEffect(()=>{const V=c.current;if(typeof ResizeObserver>"u"||!V)return;let Q=!1;const P=new ResizeObserver(()=>{if(!Q){Q=!0;return}H()});return P.observe(V),I.start(0,()=>{const q=V.getAnimations({subtree:!0});q.length!==0&&Promise.allSettled(q.map(X=>X.finished)).then(H).catch(()=>{})}),()=>{P.disconnect(),I.clear()}},[H,c,I]);function F(){G.current=!1}const Y={role:"presentation",...S&&{"data-id":`${S}-viewport`},...(!T.x||!T.y)&&{tabIndex:0},className:_u.className,style:{overflow:"scroll"},onScroll(){c.current&&(H(),G.current||C({x:c.current.scrollLeft,y:c.current.scrollTop}),K.start(100,()=>{G.current=!0}))},onWheel:F,onTouchMove:F,onPointerMove:F,onPointerEnter:F,onKeyDown:F},_=y.useMemo(()=>({scrolling:A||j,hasOverflowX:!T.x,hasOverflowY:!T.y,overflowXStart:D.xStart,overflowXEnd:D.xEnd,overflowYStart:D.yStart,overflowYEnd:D.yEnd,cornerHidden:T.corner}),[A,j,T.x,T.y,T.corner,D]),L=Mt("div",t,{ref:[n,c],state:_,props:[Y,s],stateAttributesMapping:Qb}),z=y.useMemo(()=>({computeThumbPosition:H}),[H]);return R.jsx(oF.Provider,{value:z,children:L})}),$M=y.createContext(void 0);function cF(){const e=y.useContext($M);if(e===void 0)throw new Error(pn(54));return e}let kh=(function(e){return e.scrollAreaThumbHeight="--scroll-area-thumb-height",e.scrollAreaThumbWidth="--scroll-area-thumb-width",e})({});const uF=y.forwardRef(function(t,n){const{render:a,className:i,orientation:s="vertical",keepMounted:c=!1,...d}=t,{hovering:h,scrollingX:f,scrollingY:g,hiddenState:m,overflowEdges:b,scrollbarYRef:x,scrollbarXRef:w,viewportRef:S,thumbYRef:E,thumbXRef:T,handlePointerDown:C,handlePointerUp:M,rootId:O,thumbSize:D}=cm(),k={hovering:h,scrolling:{horizontal:f,vertical:g}[s],orientation:s,hasOverflowX:!m.x,hasOverflowY:!m.y,overflowXStart:b.xStart,overflowXEnd:b.xEnd,overflowYStart:b.yStart,overflowYEnd:b.yEnd,cornerHidden:m.corner},A=tc();y.useEffect(()=>{const H=S.current,F=s==="vertical"?x.current:w.current;if(!F)return;function Y(_){if(!(!H||!F||_.ctrlKey)){if(_.preventDefault(),s==="vertical"){if(H.scrollTop===0&&_.deltaY<0)return}else if(H.scrollLeft===0&&_.deltaX<0)return;if(s==="vertical"){if(H.scrollTop===H.scrollHeight-H.clientHeight&&_.deltaY>0)return}else if(H.scrollLeft===H.scrollWidth-H.clientWidth&&_.deltaX>0)return;s==="vertical"?H.scrollTop+=_.deltaY:H.scrollLeft+=_.deltaX}}return F.addEventListener("wheel",Y,{passive:!1}),()=>{F.removeEventListener("wheel",Y)}},[s,w,x,S]);const j={...O&&{"data-id":`${O}-scrollbar`},onPointerDown(H){if(H.button===0&&H.currentTarget===H.target&&S.current){if(E.current&&x.current&&s==="vertical"){const F=ia(E.current,"margin","y"),Y=ia(x.current,"padding","y"),_=E.current.offsetHeight,L=x.current.getBoundingClientRect(),z=H.clientY-L.top-_/2-Y+F/2,V=S.current.scrollHeight,Q=S.current.clientHeight,P=x.current.offsetHeight-_-Y-F,X=z/P*(V-Q);S.current.scrollTop=X}if(T.current&&w.current&&s==="horizontal"){const F=ia(T.current,"margin","x"),Y=ia(w.current,"padding","x"),_=T.current.offsetWidth,L=w.current.getBoundingClientRect(),z=H.clientX-L.left-_/2-Y+F/2,V=S.current.scrollWidth,Q=S.current.clientWidth,P=w.current.offsetWidth-_-Y-F,q=z/P;let X;A==="rtl"?(X=(1-q)*(V-Q),S.current.scrollLeft<=0&&(X=-X)):X=q*(V-Q),S.current.scrollLeft=X}C(H)}},onPointerUp:M,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",...s==="vertical"&&{top:0,bottom:`var(${Dh.scrollAreaCornerHeight})`,insetInlineEnd:0,[kh.scrollAreaThumbHeight]:`${D.height}px`},...s==="horizontal"&&{insetInlineStart:0,insetInlineEnd:`var(${Dh.scrollAreaCornerWidth})`,bottom:0,[kh.scrollAreaThumbWidth]:`${D.width}px`}}},B=Mt("div",t,{ref:[n,s==="vertical"?x:w],state:k,props:[j,d],stateAttributesMapping:Qb}),G=y.useMemo(()=>({orientation:s}),[s]),K=s==="vertical"?m.y:m.x;return c||!K?R.jsx($M.Provider,{value:G,children:B}):null}),dF=y.forwardRef(function(t,n){const{render:a,className:i,...s}=t,{thumbYRef:c,thumbXRef:d,handlePointerDown:h,handlePointerMove:f,handlePointerUp:g,setScrollingX:m,setScrollingY:b}=cm(),{orientation:x}=cF();return Mt("div",t,{ref:[n,x==="vertical"?c:d],state:{orientation:x},props:[{onPointerDown:h,onPointerMove:f,onPointerUp(E){x==="vertical"&&b(!1),x==="horizontal"&&m(!1),g(E)},style:{...x==="vertical"&&{height:`var(${kh.scrollAreaThumbHeight})`},...x==="horizontal"&&{width:`var(${kh.scrollAreaThumbWidth})`}}},s]})}),fF=y.forwardRef(function(t,n){const{render:a,className:i,...s}=t,{cornerRef:c,cornerSize:d,hiddenState:h}=cm(),f=Mt("div",t,{ref:[n,c],props:[{style:{position:"absolute",bottom:0,insetInlineEnd:0,width:d.width,height:d.height}},s]});return h.corner?null:f});function hF({className:e,children:t,...n}){return R.jsxs(rF,{"data-slot":"scroll-area",className:Le("relative",e),...n,children:[R.jsx(lF,{"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}),R.jsx(mF,{}),R.jsx(fF,{})]})}function mF({className:e,orientation:t="vertical",...n}){return R.jsx(uF,{"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:R.jsx(dF,{"data-slot":"scroll-area-thumb",className:"rounded-full bg-border relative flex-1"})})}const KM=y.createContext(void 0);function pF(){const e=y.useContext(KM);if(e===void 0)throw new Error(pn(63));return e}let OR=(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 GM={...db,checked(e){return e?{[OR.checked]:""}:{[OR.unchecked]:""}}};function XM(e,t){const n=y.useRef(e),a=He(t);Ue(()=>{n.current!==e&&a(n.current)},[e,a]),Ue(()=>{n.current=e},[e])}const gF=y.forwardRef(function(t,n){const{checked:a,className:i,defaultChecked:s,id:c,inputRef:d,name:h,nativeButton:f=!1,onCheckedChange:g,readOnly:m=!1,required:b=!1,disabled:x=!1,render:w,uncheckedValue:S,value:E,...T}=t,{clearErrors:C}=fb(),{state:M,setTouched:O,setDirty:D,validityData:k,setFilled:A,setFocused:j,shouldValidateOnChange:B,validationMode:G,disabled:K,name:I,validation:H}=Zl(),{labelId:F}=Gh(),Y=K||x,_=I??h,L=He(g),z=y.useRef(null),V=xa(z,d,H.inputRef),Q=y.useRef(null),P=Ra(),q=Zh({id:c,implicit:!1,controlRef:Q}),X=f?void 0:q,[W,ce]=Vl({controlled:a,default:!!s,name:"Switch",state:"checked"});vb({id:P,commit:H.commit,value:W,controlRef:Q,name:_,getValue:()=>W}),Ue(()=>{z.current&&A(z.current.checked)},[z,A]),XM(W,()=>{C(_),D(W!==k.initialValue),A(W),B()?H.commit(W):H.commit(W,!0)});const{getButtonProps:ie,buttonRef:de}=To({disabled:Y,native:f}),ve={id:f?q:P,role:"switch","aria-checked":W,"aria-readonly":m||void 0,"aria-required":b||void 0,"aria-labelledby":F,onFocus(){Y||j(!0)},onBlur(){const J=z.current;!J||Y||(O(!0),j(!1),G==="onBlur"&&H.commit(J.checked))},onClick(J){var ue;m||Y||(J.preventDefault(),(ue=z.current)==null||ue.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:J.shiftKey,ctrlKey:J.ctrlKey,altKey:J.altKey,metaKey:J.metaKey})))}},Se=y.useMemo(()=>la({checked:W,disabled:Y,id:X,name:_,required:b,style:_?kO:nm,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:V,onChange(J){if(J.nativeEvent.defaultPrevented)return;const ue=J.target.checked,pe=pt(wa,J.nativeEvent);L==null||L(ue,pe),!pe.isCanceled&&ce(ue)},onFocus(){var J;(J=Q.current)==null||J.focus()}},H.getInputValidationProps,E!==void 0?{value:E}:En),[W,Y,V,X,_,L,b,ce,H,E]),Me=y.useMemo(()=>({...M,checked:W,disabled:Y,readOnly:m,required:b}),[M,W,Y,m,b]),ke=Mt("span",t,{state:Me,ref:[n,Q,de],props:[ve,H.getValidationProps,T,ie],stateAttributesMapping:GM});return R.jsxs(KM.Provider,{value:Me,children:[ke,!W&&_&&S!==void 0&&R.jsx("input",{type:"hidden",name:_,value:S}),R.jsx("input",{...Se})]})}),yF=y.forwardRef(function(t,n){const{render:a,className:i,...s}=t,{state:c}=Zl(),d=pF(),h={...c,...d};return Mt("span",t,{state:h,ref:n,stateAttributesMapping:GM,props:s})});function Ev({className:e,size:t="default",...n}){return R.jsx(gF,{"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:R.jsx(yF,{"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"})})}const vF=(e,t)=>["watch-rules",e,t],WM=e=>["watch-rule-state",e];async function rc(e,t){try{return(await e.json()).error??t}catch{return t}}async function bF(e,t){const n=new URLSearchParams({deviceId:e,paneId:t}),a=await fetch(`/api/watch/rules?${n}`);if(!a.ok)throw new Error(await rc(a,"Failed to load watch rules"));return(await a.json()).rules}async function xF(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 rc(t,"Failed to create watch rule"));return await t.json()}async function QM(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 rc(n,"Failed to update watch rule"));return await n.json()}async function wF(e){const t=await fetch(`/api/watch/rules/${e}`,{method:"DELETE"});if(!t.ok)throw new Error(await rc(t,"Failed to delete watch rule"))}async function ZM(e){const t=await fetch(`/api/watch/rules/${e}/state`);if(!t.ok)throw new Error(await rc(t,"Failed to load watch rule state"));return await t.json()}async function SF(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 rc(t,"Failed to generate regex"));return await t.json()}const JM=y.createContext(null),e2=y.createContext(null);function $a(){const e=y.useContext(JM);if(e===null)throw new Error(pn(60));return e}function t2(){const e=y.useContext(e2);if(e===null)throw new Error(pn(61));return e}const EF=(e,t)=>Object.is(e,t);function Kl(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function RF(e,t,n){return!e||e.length===0?!1:e.some(a=>a===void 0?!1:Kl(t,a,n))}function xu(e,t,n){return!e||e.length===0?-1:e.findIndex(a=>a===void 0?!1:Kl(a,t,n))}function TF(e,t,n){return e.filter(a=>!Kl(t,a,n))}function Rv(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function n2(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function CF(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(n2(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 OF(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 Rv(e)}function fl(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Rv(e.value):Rv(e)}function r2(e,t,n){function a(){return OF(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]??a();if(Array.isArray(t)){const i=n2(t)?t.flatMap(s=>s.items):t;if(e==null||typeof e!="object"){const s=i.find(c=>c.value===e);return s&&s.label!=null?s.label:a()}if("value"in e){const s=i.find(c=>c&&c.value===e.value);if(s&&s.label!=null)return s.label}}return a()}function MF(e,t,n){return e.reduce((a,i,s)=>(s>0&&a.push(", "),a.push(R.jsx(y.Fragment,{children:r2(i,t,n)},s)),a),[])}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:a}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:fl(t,a)!==""}),hasNullItemLabel:Ye((e,t)=>t?CF(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 a=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(s=>Kl(n,s,a)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Kl(n,i,a)}),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 NF(e){const{id:t,value:n,defaultValue:a=null,onValueChange:i,open:s,defaultOpen:c=!1,onOpenChange:d,name:h,autoComplete:f,disabled:g=!1,readOnly:m=!1,required:b=!1,modal:x=!0,actionsRef:w,inputRef:S,onOpenChangeComplete:E,items:T,multiple:C=!1,itemToStringLabel:M,itemToStringValue:O,isItemEqualToValue:D=EF,highlightItemOnHover:k=!0,children:A}=e,{clearErrors:j}=fb(),{setDirty:B,setTouched:G,setFocused:K,shouldValidateOnChange:I,validityData:H,setFilled:F,name:Y,disabled:_,validation:L,validationMode:z}=Zl(),V=Zh({id:t}),Q=_||g,P=Y??h,[q,X]=Vl({controlled:n,default:C?a??Si:a,name:"Select",state:"value"}),[W,ce]=Vl({controlled:s,default:c,name:"Select",state:"open"}),ie=y.useRef([]),de=y.useRef([]),ve=y.useRef(null),Se=y.useRef(null),Me=y.useRef(0),ke=y.useRef(null),J=y.useRef([]),ue=y.useRef(!1),pe=y.useRef(!1),De=y.useRef(null),Ce=y.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),we=y.useRef(!1),{mounted:Te,setMounted:Z,transitionStatus:be}=td(W),{openMethod:ge,triggerProps:Pe,reset:Be}=Fb(W),Ae=Kn(()=>new XO({id:V,modal:x,multiple:C,itemToStringLabel:M,itemToStringValue:O,isItemEqualToValue:D,value:q,open:W,mounted:Te,transitionStatus:be,items:T,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,it=bt(Ae,yt.activeIndex),wt=bt(Ae,yt.selectedIndex),xt=bt(Ae,yt.triggerElement),oe=bt(Ae,yt.positionerElement),xe=y.useMemo(()=>C&&Array.isArray(q)&&q.length===0?"":fl(q,O),[C,q,O]),Ie=y.useMemo(()=>C&&Array.isArray(q)?q.map(Xe=>fl(Xe,O)):fl(q,O),[C,q,O]),qe=Zn(Ae.state.triggerElement);vb({id:V,commit:L.commit,value:q,controlRef:qe,name:P,getValue:()=>Ie});const Ke=y.useRef(q);Ue(()=>{q!==Ke.current&&Ae.set("forceMount",!0)},[Ae,q]),Ue(()=>{F(C?Array.isArray(q)&&q.length>0:q!=null)},[C,q,F]),Ue(function(){if(W)return;const Rt=J.current;if(C){const ne=Array.isArray(q)?q:[];if(ne.length===0){Ae.set("selectedIndex",null);return}const le=ne[ne.length-1],Ee=xu(Rt,le,D);Ae.set("selectedIndex",Ee===-1?null:Ee);return}const $=xu(Rt,q,D);Ae.set("selectedIndex",$===-1?null:$)},[C,W,q,J,D,Ae]),XM(q,()=>{j(P),B(q!==H.initialValue),I()?L.commit(q):L.commit(q,!0)});const st=He((Xe,Rt)=>{if(d==null||d(Xe,Rt),!Rt.isCanceled&&(ce(Xe),!Xe&&(Rt.reason===Es||Rt.reason===Jh)&&(G(!0),K(!1),z==="onBlur"&&L.commit(q)),!Xe&&Ae.state.activeIndex!==null)){const $=ie.current[Ae.state.activeIndex];queueMicrotask(()=>{$==null||$.setAttribute("tabindex","-1")})}}),ze=He(()=>{Z(!1),Ae.set("activeIndex",null),Be(),E==null||E(!1)});Oo({enabled:!w,open:W,ref:ve,onComplete(){W||ze()}}),y.useImperativeHandle(w,()=>({unmount:ze}),[ze]);const Je=He((Xe,Rt)=>{i==null||i(Xe,Rt),!Rt.isCanceled&&X(Xe)}),ft=He(()=>{const Xe=Ae.state.listElement||ve.current;if(!Xe)return;const Rt=Xe.scrollTop,$=Xe.scrollTop+Xe.clientHeight,ne=Rt>1,le=$<Xe.scrollHeight-1;Ae.state.scrollUpArrowVisible!==ne&&Ae.set("scrollUpArrowVisible",ne),Ae.state.scrollDownArrowVisible!==le&&Ae.set("scrollDownArrowVisible",le)}),jt=QO({open:W,onOpenChange:st,elements:{reference:xt,floating:oe}}),nn=zO(jt,{enabled:!m&&!Q,event:"mousedown"}),ht=am(jt,{bubbles:!1}),Ct=nM(jt,{enabled:!m&&!Q,listRef:ie,activeIndex:it,selectedIndex:wt,disabledIndices:Si,onNavigate(Xe){Xe===null&&!W||Ae.set("activeIndex",Xe)},focusItemOnHover:!1}),et=aM(jt,{enabled:!m&&!Q&&(W||!C),listRef:de,activeIndex:it,selectedIndex:wt,onMatch(Xe){W?Ae.set("activeIndex",Xe):Je(J.current[Xe],pt("none"))},onTypingChange(Xe){ue.current=Xe}}),{getReferenceProps:lt,getFloatingProps:mt,getItemProps:Ve}=rd([nn,ht,Ct,et]),Et=y.useMemo(()=>la(lt(),Pe,V?{id:V}:En),[lt,Pe,V]);sm(()=>{Ae.update({popupProps:mt(),triggerProps:Et})}),Ue(()=>{Ae.update({id:V,modal:x,multiple:C,value:q,open:W,mounted:Te,transitionStatus:be,popupProps:mt(),triggerProps:Et,items:T,itemToStringLabel:M,itemToStringValue:O,isItemEqualToValue:D,openMethod:ge})},[Ae,V,x,C,q,W,Te,be,mt,Et,T,M,O,D,ge]);const Dt=y.useMemo(()=>({store:Ae,name:P,required:b,disabled:Q,readOnly:m,multiple:C,itemToStringLabel:M,itemToStringValue:O,highlightItemOnHover:k,setValue:Je,setOpen:st,listRef:ie,popupRef:ve,scrollHandlerRef:Se,handleScrollArrowVisibility:ft,scrollArrowsMountedCountRef:Me,getItemProps:Ve,events:jt.context.events,valueRef:ke,valuesRef:J,labelsRef:de,typingRef:ue,selectionRef:Ce,selectedItemTextRef:De,validation:L,onOpenChangeComplete:E,keyboardActiveRef:pe,alignItemWithTriggerActiveRef:we,initialValueRef:Ke}),[Ae,P,b,Q,m,C,M,O,k,Je,st,Ve,jt.context.events,L,E,ft]),St=xa(S,L.inputRef),rn=C&&Array.isArray(q)&&q.length>0,It=y.useMemo(()=>!C||!Array.isArray(q)||!P?null:q.map(Xe=>{const Rt=fl(Xe,O);return R.jsx("input",{type:"hidden",name:P,value:Rt},Rt)}),[C,q,P,O]);return R.jsx(JM.Provider,{value:Dt,children:R.jsxs(e2.Provider,{value:jt,children:[A,R.jsx("input",{...L.getInputValidationProps({onFocus(){var Xe;(Xe=Ae.state.triggerElement)==null||Xe.focus({focusVisible:!0})},onChange(Xe){if(Xe.nativeEvent.defaultPrevented)return;const Rt=Xe.target.value,$=pt(wa,Xe.nativeEvent);function ne(){if(C)return;const le=J.current.find(Ee=>fl(Ee,O).toLowerCase()===Rt.toLowerCase());le!=null&&(B(le!==H.initialValue),Je(le,$),I()&&L.commit(le))}Ae.set("forceMount",!0),queueMicrotask(ne)}}),name:C?void 0:P,autoComplete:f,value:xe,disabled:Q,required:b&&!rn,readOnly:m,ref:St,style:P?kO:nm,tabIndex:-1,"aria-hidden":!0}),It]})})}const Kf=2,AF=400,MR=200,DF={...sv,...db,value:()=>null},kF=y.forwardRef(function(t,n){const{render:a,className:i,id:s,disabled:c=!1,nativeButton:d=!0,...h}=t,{setTouched:f,setFocused:g,validationMode:m,state:b,disabled:x}=Zl(),{labelId:w}=Gh(),{store:S,setOpen:E,selectionRef:T,validation:C,readOnly:M,required:O,alignItemWithTriggerActiveRef:D,disabled:k,keyboardActiveRef:A}=$a(),j=x||k||c,B=bt(S,yt.open),G=bt(S,yt.value),K=bt(S,yt.triggerProps),I=bt(S,yt.positionerElement),H=bt(S,yt.listElement),F=bt(S,yt.id),Y=bt(S,yt.hasSelectedValue),_=!Y&&B,L=bt(S,yt.hasNullItemLabel,_),z=s??F;Zh({id:z});const V=Zn(I),Q=y.useRef(null),{getButtonProps:P,buttonRef:q}=To({disabled:j,native:d}),X=He(J=>{S.set("triggerElement",J)}),W=xa(n,Q,q,X),ce=Dn(),ie=Dn(),de=Dn(),ve=Dn();y.useEffect(()=>{if(B)return!(Y||L)?de.start(AF,()=>{T.current.allowUnselectedMouseUp=!0,T.current.allowSelectedMouseUp=!0}):ve.start(MR,()=>{T.current.allowUnselectedMouseUp=!0,de.start(MR,()=>{T.current.allowSelectedMouseUp=!0})}),()=>{de.clear(),ve.clear()};T.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},ie.clear()},[B,Y,L,T,ie,de,ve]);const Se=y.useMemo(()=>{var J;return(H==null?void 0:H.id)??((J=ju(I))==null?void 0:J.id)},[H,I]),Me=la(K,{id:z,role:"combobox","aria-expanded":B?"true":"false","aria-haspopup":"listbox","aria-controls":B?Se:void 0,"aria-labelledby":w,"aria-readonly":M||void 0,"aria-required":O||void 0,tabIndex:j?-1:0,ref:W,onFocus(J){g(!0),B&&D.current&&E(!1,pt(wa,J.nativeEvent)),ce.start(0,()=>{S.set("forceMount",!0)})},onBlur(J){Ot(I,J.relatedTarget)||(f(!0),g(!1),m==="onBlur"&&C.commit(G))},onPointerMove(){A.current=!1},onKeyDown(){A.current=!0},onMouseDown(J){if(B)return;const ue=Yt(J.currentTarget);function pe(De){if(!Q.current)return;const Ce=De.target;if(Ot(Q.current,Ce)||Ot(V.current,Ce)||Ce===Q.current)return;const we=VM(Q.current);De.clientX>=we.left-Kf&&De.clientX<=we.right+Kf&&De.clientY>=we.top-Kf&&De.clientY<=we.bottom+Kf||E(!1,pt(RO,De))}ie.start(0,()=>{ue.addEventListener("mouseup",pe,{once:!0})})}},C.getValidationProps,h,P);Me.role="combobox";const ke={...b,open:B,disabled:j,value:G,readOnly:M,placeholder:!Y};return Mt("button",t,{ref:[n,Q],state:ke,stateAttributesMapping:DF,props:Me})}),jF={value:()=>null},LF=y.forwardRef(function(t,n){const{className:a,render:i,children:s,placeholder:c,...d}=t,{store:h,valueRef:f}=$a(),g=bt(h,yt.value),m=bt(h,yt.items),b=bt(h,yt.itemToStringLabel),x=bt(h,yt.hasSelectedValue),w=!x&&c!=null&&s==null,S=bt(h,yt.hasNullItemLabel,w),E={value:g,placeholder:!x};let T=null;return typeof s=="function"?T=s(g):s!=null?T=s:!x&&c!=null&&!S?T=c:Array.isArray(g)?T=MF(g,m,b):T=r2(g,m,b),Mt("span",t,{state:E,ref:[n,f],props:[{children:T},d],stateAttributesMapping:jF})}),_F=y.forwardRef(function(t,n){const{className:a,render:i,...s}=t,{store:c}=$a(),h={open:bt(c,yt.open)};return Mt("span",t,{state:h,ref:n,props:[{"aria-hidden":!0,children:"▼"},s],stateAttributesMapping:CO})}),IF=y.createContext(void 0),zF=y.forwardRef(function(t,n){const{store:a}=$a(),i=bt(a,yt.mounted),s=bt(a,yt.forceMount);return i||s?R.jsx(IF.Provider,{value:!0,children:R.jsx(Rb,{ref:n,...t})}):null}),a2=y.createContext(void 0);function Zb(){const e=y.useContext(a2);if(!e)throw new Error(pn(59));return e}function jh(e,t){e&&Object.assign(e.style,t)}const o2={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},PF={position:"fixed"},UF=y.forwardRef(function(t,n){const{anchor:a,positionMethod:i="absolute",className:s,render:c,side:d="bottom",align:h="center",sideOffset:f=0,alignOffset:g=0,collisionBoundary:m="clipping-ancestors",collisionPadding:b,arrowPadding:x=5,sticky:w=!1,disableAnchorTracking:S,alignItemWithTrigger:E=!0,collisionAvoidance:T=jC,...C}=t,{store:M,listRef:O,labelsRef:D,alignItemWithTriggerActiveRef:k,selectedItemTextRef:A,valuesRef:j,initialValueRef:B,popupRef:G,setValue:K}=$a(),I=t2(),H=bt(M,yt.open),F=bt(M,yt.mounted),Y=bt(M,yt.modal),_=bt(M,yt.value),L=bt(M,yt.openMethod),z=bt(M,yt.positionerElement),V=bt(M,yt.triggerElement),Q=bt(M,yt.isItemEqualToValue),P=bt(M,yt.transitionStatus),q=y.useRef(null),X=y.useRef(null),[W,ce]=y.useState(E),ie=F&&W&&L!=="touch";!F&&W!==E&&ce(E),Ue(()=>{F||(yt.scrollUpArrowVisible(M.state)&&M.set("scrollUpArrowVisible",!1),yt.scrollDownArrowVisible(M.state)&&M.set("scrollDownArrowVisible",!1))},[M,F]),y.useImperativeHandle(k,()=>ie),Bb((ie||Y)&&H&&L!=="touch",V);const de=qb({anchor:a,floatingRootContext:I,positionMethod:i,mounted:F,side:d,sideOffset:f,align:h,alignOffset:g,arrowPadding:x,collisionBoundary:m,collisionPadding:b,sticky:w,disableAnchorTracking:S??ie,collisionAvoidance:T,keepMounted:!0}),ve=ie?"none":de.side,Se=ie?PF:de.positionerStyles,Me=y.useMemo(()=>{const we={};return H||(we.pointerEvents="none"),{role:"presentation",hidden:!F,style:{...Se,...we}}},[H,F,Se]),ke={open:H,side:ve,align:de.align,anchorHidden:de.anchorHidden},J=He(we=>{M.set("positionerElement",we)}),ue=Mt("div",t,{ref:[n,J],state:ke,stateAttributesMapping:qa,props:[Me,nc(P),C]}),pe=y.useRef(0),De=He(we=>{if(we.size===0&&pe.current===0||j.current.length===0)return;const Te=pe.current;if(pe.current=we.size,we.size===Te)return;const Z=pt(wa);if(Te!==0&&!M.state.multiple&&_!==null&&xu(j.current,_,Q)===-1){const ge=B.current,Be=ge!=null&&xu(j.current,ge,Q)!==-1?ge:null;K(Be,Z),Be===null&&(M.set("selectedIndex",null),A.current=null)}if(Te!==0&&M.state.multiple&&Array.isArray(_)){const be=Pe=>xu(j.current,Pe,Q)!==-1,ge=_.filter(Pe=>be(Pe));(ge.length!==_.length||ge.some(Pe=>!RF(_,Pe,Q)))&&(K(ge,Z),ge.length===0&&(M.set("selectedIndex",null),A.current=null))}if(H&&ie){M.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const be={height:""};jh(z,be),jh(G.current,be)}}),Ce=y.useMemo(()=>({...de,side:ve,alignItemWithTriggerActive:ie,setControlledAlignItemWithTrigger:ce,scrollUpArrowRef:q,scrollDownArrowRef:X}),[de,ve,ie,ce]);return R.jsx(lm,{elementsRef:O,labelsRef:D,onMapChange:De,children:R.jsxs(a2.Provider,{value:Ce,children:[F&&Y&&R.jsx(Ub,{inert:Pb(!H),cutout:V}),ue]})})});function i2(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 Zi=1,HF={...qa,...Co},BF=y.forwardRef(function(t,n){const{render:a,className:i,finalFocus:s,...c}=t,{store:d,popupRef:h,onOpenChangeComplete:f,setOpen:g,valueRef:m,selectedItemTextRef:b,keyboardActiveRef:x,multiple:w,handleScrollArrowVisibility:S,scrollHandlerRef:E,highlightItemOnHover:T}=$a(),{side:C,align:M,alignItemWithTriggerActive:O,setControlledAlignItemWithTrigger:D,scrollDownArrowRef:k,scrollUpArrowRef:A}=Zb(),j=HM()!=null,B=t2(),{nonce:G,disableStyleElements:K}=NM(),I=Dn(),H=bt(d,yt.id),F=bt(d,yt.open),Y=bt(d,yt.mounted),_=bt(d,yt.popupProps),L=bt(d,yt.transitionStatus),z=bt(d,yt.triggerElement),V=bt(d,yt.positionerElement),Q=bt(d,yt.listElement),P=y.useRef(0),q=y.useRef(!1),X=y.useRef(0),W=y.useRef(!1),ce=y.useRef({}),ie=ed(),de=He(ke=>{if(!V||!h.current||!W.current)return;if(q.current||!O){S();return}const J=V.style.top==="0px",ue=V.style.bottom==="0px",pe=V.getBoundingClientRect().height,De=Yt(V),Ce=getComputedStyle(V),we=parseFloat(Ce.marginTop),Te=parseFloat(Ce.marginBottom),Z=NR(getComputedStyle(h.current)),be=Math.min(De.documentElement.clientHeight-we-Te,Z),ge=ke.scrollTop,Pe=AR(ke);let Be=0,Ae=null,it=!1,wt=!1;const xt=xe=>{V.style.height=`${xe}px`},oe=(xe,Ie)=>{const qe=xo(xe,0,be-pe);qe>0&&xt(pe+qe),ke.scrollTop=Ie,be-(pe+qe)<=Zi&&(q.current=!0),S()};if(J){const xe=Pe-ge,Ie=pe+xe,qe=Math.min(Ie,be);if(Be=qe,xe<=Zi){oe(xe,Pe);return}be-qe>Zi?wt=!0:it=!0}else if(ue){const xe=ge,Ie=pe+xe,qe=Math.min(Ie,be),Ke=Ie-be;if(Be=qe,xe<=Zi){oe(xe,0);return}be-qe>Zi?Ae=0:(it=!0,ge<Pe&&(Ae=ge-(xe-Ke)))}if(Be=Math.ceil(Be),Be!==0&&xt(Be),wt||Ae!=null){const xe=AR(ke),Ie=wt?xe:xo(Ae,0,xe);Math.abs(ke.scrollTop-Ie)>Zi&&(ke.scrollTop=Ie)}(it||Be>=be-Zi)&&(q.current=!0),S()});y.useImperativeHandle(E,()=>de,[de]),Oo({open:F,ref:h,onComplete(){F&&(f==null||f(!0))}});const ve={open:F,transitionStatus:L,side:C,align:M};Ue(()=>{!V||!h.current||Object.keys(ce.current).length||(ce.current={top:V.style.top||"0",left:V.style.left||"0",right:V.style.right,height:V.style.height,bottom:V.style.bottom,minHeight:V.style.minHeight,maxHeight:V.style.maxHeight,marginTop:V.style.marginTop,marginBottom:V.style.marginBottom})},[h,V]),Ue(()=>{F||O||(W.current=!1,q.current=!1,P.current=0,X.current=0,jh(V,ce.current))},[F,O,V,h]),Ue(()=>{const ke=h.current;if(!(!F||!z||!V||!ke||d.state.transitionStatus==="ending")){if(!O){W.current=!0,ie.request(S),ke.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{var ue;const J=FF(ke);ke.style.removeProperty("--transform-origin");try{const pe=getComputedStyle(V),De=getComputedStyle(ke),Ce=Yt(z),we=kn(V),Te=z.getBoundingClientRect(),Z=V.getBoundingClientRect(),be=Te.left,ge=Te.height,Pe=Q||ke,Be=Pe.scrollHeight,Ae=parseFloat(De.borderBottomWidth),it=parseFloat(pe.marginTop)||10,wt=parseFloat(pe.marginBottom)||10,xt=parseFloat(pe.minHeight)||100,oe=NR(De),xe=5,Ie=5,qe=20,Ke=Ce.documentElement.clientHeight-it-wt,st=Ce.documentElement.clientWidth,ze=Ke-Te.bottom+ge,Je=b.current,ft=m.current;let jt,nn=0,ht=0;if(Je&&ft){const Rt=ft.getBoundingClientRect();jt=Je.getBoundingClientRect();const $=Rt.left-be,ne=jt.left-Z.left,le=Rt.top-Te.top+Rt.height/2,Ee=jt.top-Z.top+jt.height/2;nn=$-ne,ht=Ee-le}const Ct=ze+ht+wt+Ae;let et=Math.min(Ke,Ct);const lt=Ke-it-wt,mt=Ct-et,Ve=Math.max(xe,be+nn),Et=st-Ie,Dt=Math.max(0,Ve+Z.width-Et);V.style.left=`${Ve-Dt}px`,V.style.height=`${et}px`,V.style.maxHeight="auto",V.style.marginTop=`${it}px`,V.style.marginBottom=`${wt}px`,ke.style.height="100%";const St=Pe.scrollHeight-Pe.clientHeight,rn=mt>=St;rn&&(et=Math.min(Ke,Z.height)-(mt-St));const It=Te.top<qe||Te.bottom>Ke-qe||et<Math.min(Be,xt),Xe=(((ue=we.visualViewport)==null?void 0:ue.scale)??1)!==1&&Wh;if(It||Xe){W.current=!0,jh(V,ce.current),or.flushSync(()=>D(!1));return}if(rn){const Rt=Math.max(0,Ke-Ct);V.style.top=Z.height>=lt?"0":`${Rt}px`,V.style.height=`${et}px`,Pe.scrollTop=Pe.scrollHeight-Pe.clientHeight,P.current=Math.max(xt,et)}else V.style.bottom="0",P.current=Math.max(xt,et),Pe.scrollTop=mt;if(jt){const Rt=Z.top,$=Z.height,ne=jt.top+jt.height/2,le=$>0?(ne-Rt)/$*100:50,Ee=xo(le,0,100);ke.style.setProperty("--transform-origin",`50% ${Ee}%`)}(P.current===Ke||et>=oe)&&(q.current=!0),S(),setTimeout(()=>{W.current=!0})}finally{J()}})}},[d,F,V,z,m,b,h,S,O,D,ie,k,A,Q]),y.useEffect(()=>{if(!O||!V||!F)return;const ke=kn(V);function J(ue){g(!1,pt(yU,ue))}return ke.addEventListener("resize",J),()=>{ke.removeEventListener("resize",J)}},[g,O,V,F]);const Se={...Q?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":w||void 0,id:`${H}-list`},onKeyDown(ke){x.current=!0,j&&Ib.has(ke.key)&&ke.stopPropagation()},onMouseMove(){x.current=!1},onPointerLeave(ke){if(!T||i2(ke)||ke.pointerType==="touch")return;const J=ke.currentTarget;I.start(0,()=>{d.set("activeIndex",null),J.focus({preventScroll:!0})})},onScroll(ke){Q||de(ke.currentTarget)},...O&&{style:Q?{height:"100%"}:o2}},Me=Mt("div",t,{ref:[n,h],state:ve,stateAttributesMapping:HF,props:[_,Se,nc(L),{className:!Q&&O?_u.className:void 0},c]});return R.jsxs(y.Fragment,{children:[!K&&_u.getElement(G),R.jsx(Cb,{context:B,modal:!1,disabled:!Y,returnFocus:s,restoreFocus:!0,children:Me})]})});function NR(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function AR(e){return Math.max(0,e.scrollHeight-e.clientHeight)}const DR=[["transform","none"],["scale","1"],["translate","0 0"]];function FF(e){const{style:t}=e,n={};for(const[a,i]of DR)n[a]=t.getPropertyValue(a),t.setProperty(a,i,"important");return()=>{for(const[a]of DR){const i=n[a];i?t.setProperty(a,i):t.removeProperty(a)}}}const VF=y.forwardRef(function(t,n){const{className:a,render:i,...s}=t,{store:c,scrollHandlerRef:d}=$a(),{alignItemWithTriggerActive:h}=Zb(),f=bt(c,yt.hasScrollArrows),g=bt(c,yt.openMethod),m=bt(c,yt.multiple),x={id:`${bt(c,yt.id)}-list`,role:"listbox","aria-multiselectable":m||void 0,onScroll(S){var E;(E=d.current)==null||E.call(d,S.currentTarget)},...h&&{style:o2},className:f&&g!=="touch"?_u.className:void 0},w=He(S=>{c.set("listElement",S)});return Mt("div",t,{ref:[n,w],props:[x,s]})}),s2=y.createContext(void 0);function Jb(){const e=y.useContext(s2);if(!e)throw new Error(pn(57));return e}const YF=y.memo(y.forwardRef(function(t,n){const{render:a,className:i,value:s=null,label:c,disabled:d=!1,nativeButton:h=!1,...f}=t,g=y.useRef(null),m=$b({label:c,textRef:g,indexGuessBehavior:CM.GuessFromOrder}),{store:b,getItemProps:x,setOpen:w,setValue:S,selectionRef:E,typingRef:T,valuesRef:C,keyboardActiveRef:M,multiple:O,highlightItemOnHover:D}=$a(),k=Dn(),A=bt(b,yt.isActive,m.index),j=bt(b,yt.isSelected,m.index,s),B=bt(b,yt.isSelectedByFocus,m.index),G=bt(b,yt.isItemEqualToValue),K=m.index,I=K!==-1,H=y.useRef(null),F=Zn(K);Ue(()=>{if(!I)return;const ie=C.current;return ie[K]=s,()=>{delete ie[K]}},[I,K,s,C]),Ue(()=>{if(!I)return;const ie=b.state.value;let de=ie;O&&Array.isArray(ie)&&ie.length>0&&(de=ie[ie.length-1]),de!==void 0&&Kl(s,de,G)&&b.set("selectedIndex",K)},[I,K,O,G,b,s]);const Y={disabled:d,selected:j,highlighted:A},_=x({active:A,selected:j});_.onFocus=void 0,_.id=void 0;const L=y.useRef(null),z=y.useRef("mouse"),V=y.useRef(!1),{getButtonProps:Q,buttonRef:P}=To({disabled:d,focusableWhenDisabled:!0,native:h});function q(ie){const de=b.state.value;if(O){const ve=Array.isArray(de)?de:[],Se=j?TF(ve,s,G):[...ve,s];S(Se,pt(yu,ie))}else S(s,pt(yu,ie)),w(!1,pt(yu,ie))}const X={role:"option","aria-selected":j,tabIndex:A?0:-1,onFocus(){b.set("activeIndex",K)},onMouseEnter(){!M.current&&b.state.selectedIndex===null&&D&&b.set("activeIndex",K)},onMouseMove(){D&&b.set("activeIndex",K)},onMouseLeave(ie){!D||M.current||i2(ie)||k.start(0,()=>{b.state.activeIndex===K&&b.set("activeIndex",null)})},onTouchStart(){E.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(ie){L.current=ie.key,b.set("activeIndex",K)},onClick(ie){V.current=!1,!(ie.type==="keydown"&&L.current===null)&&(d||L.current===" "&&T.current||z.current!=="touch"&&!A||(L.current=null,q(ie.nativeEvent)))},onPointerEnter(ie){z.current=ie.pointerType},onPointerDown(ie){z.current=ie.pointerType,V.current=!0},onMouseUp(ie){if(d)return;if(V.current){V.current=!1;return}const de=!E.current.allowSelectedMouseUp&&j,ve=!E.current.allowUnselectedMouseUp&&!j;de||ve||z.current!=="touch"&&!A||q(ie.nativeEvent)}},W=Mt("div",t,{ref:[P,n,m.ref,H],state:Y,props:[_,X,f,Q]}),ce=y.useMemo(()=>({selected:j,indexRef:F,textRef:g,selectedByFocus:B,hasRegistered:I}),[j,F,g,B,I]);return R.jsx(s2.Provider,{value:ce,children:W})})),qF=y.forwardRef(function(t,n){const a=t.keepMounted??!1,{selected:i}=Jb();return a||i?R.jsx($F,{...t,ref:n}):null}),$F=y.memo(y.forwardRef((e,t)=>{const{render:n,className:a,keepMounted:i,...s}=e,{selected:c}=Jb(),d=y.useRef(null),{transitionStatus:h,setMounted:f}=td(c),m=Mt("span",e,{ref:[t,d],state:{selected:c,transitionStatus:h},props:[{"aria-hidden":!0,children:"✔️"},s],stateAttributesMapping:Co});return Oo({open:c,ref:d,onComplete(){c||f(!1)}}),m})),KF=y.memo(y.forwardRef(function(t,n){const{indexRef:a,textRef:i,selectedByFocus:s,hasRegistered:c}=Jb(),{selectedItemTextRef:d}=$a(),{className:h,render:f,...g}=t,m=y.useCallback(x=>{if(!x||!c)return;const w=d.current===null||!d.current.isConnected;(s||w&&a.current===0)&&(d.current=x)},[d,a,s,c]);return Mt("div",t,{ref:[m,n,i],props:g})})),l2=y.forwardRef(function(t,n){const{render:a,className:i,direction:s,keepMounted:c=!1,...d}=t,{store:h,popupRef:f,listRef:g,handleScrollArrowVisibility:m,scrollArrowsMountedCountRef:b}=$a(),{side:x,scrollDownArrowRef:w,scrollUpArrowRef:S}=Zb(),E=s==="up"?yt.scrollUpArrowVisible:yt.scrollDownArrowVisible,T=bt(h,E),C=bt(h,yt.openMethod),M=T&&C!=="touch",O=Dn(),D=s==="up"?S:w,{transitionStatus:k,setMounted:A}=td(M);Ue(()=>(b.current+=1,h.state.hasScrollArrows||h.set("hasScrollArrows",!0),()=>{b.current=Math.max(0,b.current-1),b.current===0&&h.state.hasScrollArrows&&h.set("hasScrollArrows",!1)}),[h,b]),Oo({open:M,ref:D,onComplete(){M||A(!1)}});const G=Mt("div",t,{ref:[n,D],state:{direction:s,visible:M,side:x,transitionStatus:k},props:[{"aria-hidden":!0,children:s==="up"?"▲":"▼",style:{position:"absolute"},onMouseMove(I){if(I.movementX===0&&I.movementY===0||O.isStarted())return;h.set("activeIndex",null);function H(){var z;const F=h.state.listElement??f.current;if(!F)return;h.set("activeIndex",null),m();const Y=F.scrollTop===0,_=Math.round(F.scrollTop+F.clientHeight)>=F.scrollHeight;if(g.current.length===0&&(s==="up"?h.set("scrollUpArrowVisible",!Y):h.set("scrollDownArrowVisible",!_)),s==="up"&&Y||s==="down"&&_){O.clear();return}if((h.state.listElement||f.current)&&g.current&&g.current.length>0){const V=g.current,Q=((z=D.current)==null?void 0:z.offsetHeight)||0;if(s==="up"){let P=0;const q=F.scrollTop+Q;for(let W=0;W<V.length;W+=1){const ce=V[W];if(ce&&ce.offsetTop>=q){P=W;break}}const X=Math.max(0,P-1);if(X<P){const W=V[X];W&&(F.scrollTop=Math.max(0,W.offsetTop-Q))}else F.scrollTop=0}else{let P=V.length-1;const q=F.scrollTop+F.clientHeight-Q;for(let W=0;W<V.length;W+=1){const ce=V[W];if(ce&&ce.offsetTop+ce.offsetHeight>q){P=Math.max(0,W-1);break}}const X=Math.min(V.length-1,P+1);if(X>P){const W=V[X];W&&(F.scrollTop=W.offsetTop+W.offsetHeight-F.clientHeight+Q)}else F.scrollTop=F.scrollHeight-F.clientHeight}}O.start(40,H)}O.start(40,H)},onMouseLeave(){O.clear()}},d]});return M||c?G:null}),GF=y.forwardRef(function(t,n){return R.jsx(l2,{...t,ref:n,direction:"down"})}),XF=y.forwardRef(function(t,n){return R.jsx(l2,{...t,ref:n,direction:"up"})}),c2=y.createContext(void 0);function WF(){const e=y.useContext(c2);if(e===void 0)throw new Error(pn(56));return e}const QF=y.forwardRef(function(t,n){const{className:a,render:i,...s}=t,[c,d]=y.useState(),h=y.useMemo(()=>({labelId:c,setLabelId:d}),[c,d]),f=Mt("div",t,{ref:n,props:[{role:"group","aria-labelledby":c},s]});return R.jsx(c2.Provider,{value:h,children:f})}),ZF=y.forwardRef(function(t,n){const{className:a,render:i,id:s,...c}=t,{setLabelId:d}=WF(),h=Ra(s);return Ue(()=>{d(h)},[h,d]),Mt("div",t,{ref:n,props:[{id:h},c]})}),uy=NF;function Y7({className:e,...t}){return R.jsx(QF,{"data-slot":"select-group",className:Le("scroll-my-1 p-1",e),...t})}function dy({className:e,...t}){return R.jsx(LF,{"data-slot":"select-value",className:Le("flex flex-1 text-left",e),...t})}function fy({className:e,size:t="default",children:n,...a}){return R.jsxs(kF,{"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),...a,children:[n,R.jsx(_F,{render:R.jsx(SC,{className:"text-muted-foreground size-4 pointer-events-none"})})]})}function hy({className:e,children:t,side:n="bottom",sideOffset:a=4,align:i="center",alignOffset:s=0,alignItemWithTrigger:c=!0,...d}){return R.jsx(zF,{children:R.jsx(UF,{side:n,sideOffset:a,align:i,alignOffset:s,alignItemWithTrigger:c,className:"isolate z-50",children:R.jsxs(BF,{"data-slot":"select-content","data-align-trigger":c,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),...d,children:[R.jsx(JF,{}),R.jsx(VF,{children:t}),R.jsx(eV,{})]})})})}function q7({className:e,...t}){return R.jsx(ZF,{"data-slot":"select-label",className:Le("text-muted-foreground px-1.5 py-1 text-xs",e),...t})}function Ji({className:e,children:t,...n}){return R.jsxs(YF,{"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:[R.jsx(KF,{className:"flex flex-1 gap-2 shrink-0 whitespace-nowrap",children:t}),R.jsx(qF,{render:R.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:R.jsx(nP,{className:"pointer-events-none"})})]})}function JF({className:e,...t}){return R.jsx(XF,{"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:R.jsx(iP,{})})}function eV({className:e,...t}){return R.jsx(GF,{"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:R.jsx(SC,{})})}function tV({className:e,...t}){return R.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})}const nV=["match","unchanged","llm"],my="__default__";function kR(e){return e==="llm"?30:5}function rV({deviceId:e,paneId:t,rule:n,onSaved:a,onCancel:i}){var Te;const{t:s}=gr(),c=y.useId(),[d,h]=y.useState((n==null?void 0:n.name)??""),[f,g]=y.useState((n==null?void 0:n.triggerType)??"match"),[m,b]=y.useState((n==null?void 0:n.pattern)??""),[x,w]=y.useState((n==null?void 0:n.patternFlags)??""),[S,E]=y.useState((n==null?void 0:n.extractGroup)??0),[T,C]=y.useState((n==null?void 0:n.unchangedMinutes)??10),[M,O]=y.useState((n==null?void 0:n.noMatchBehavior)??"reset"),[D,k]=y.useState((n==null?void 0:n.conditionPrompt)??""),[A,j]=y.useState((n==null?void 0:n.providerId)??null),[B,G]=y.useState((n==null?void 0:n.modelId)??""),[K,I]=y.useState((n==null?void 0:n.confirmWithLlm)??!1),[H,F]=y.useState((n==null?void 0:n.summarizeWithLlm)??!1),[Y,_]=y.useState((n==null?void 0:n.intervalSeconds)??30),[L,z]=y.useState((n==null?void 0:n.fireMode)??"once"),[V,Q]=y.useState((n==null?void 0:n.cooldownSeconds)??600),[P,q]=y.useState(""),[X,W]=y.useState(null),ie=((Te=Ku({queryKey:["llm-providers"],queryFn:async()=>{const Z=await fetch("/api/llm/providers");if(!Z.ok)throw new Error("Failed to load providers");return await Z.json()},throwOnError:!1}).data)==null?void 0:Te.providers)??[],de=ie.filter(Z=>Z.enabled),ve=ie.find(Z=>Z.id===A),Se=(ve==null?void 0:ve.models)??[],Me=f==="match"||f==="unchanged",ke=f==="llm"||K||H,J=kR(f),ue=Z=>{g(Z);const be=kR(Z);_(ge=>ge<be?Z==="llm"?60:30:ge)},pe=()=>{if(!d.trim())return s("watch.validation.nameRequired");if(Me){if(!m)return s("watch.validation.patternRequired");try{new RegExp(m,x.replace(/g/g,""))}catch(Z){return s("watch.validation.patternInvalid",{detail:Z instanceof Error?Z.message:String(Z)})}if(f==="unchanged"&&(!T||T<=0))return s("watch.validation.unchangedMinutesInvalid")}else if(!D.trim())return s("watch.validation.conditionPromptRequired");return!Number.isInteger(Y)||Y<J?s("watch.validation.intervalMin",{min:J}):null},De=Cu({mutationFn:async()=>{const Z={name:d.trim(),triggerType:f,pattern:Me?m:null,patternFlags:Me?x:"",extractGroup:S,conditionPrompt:f==="llm"?D:null,providerId:A,modelId:A&&B.trim()||null,confirmWithLlm:Me?K:!1,summarizeWithLlm:Me?H:!1,intervalSeconds:Y,unchangedMinutes:f==="unchanged"?T:null,noMatchBehavior:M,fireMode:L,cooldownSeconds:V};if(n){const ge=Z;return await QM(n.id,ge),!1}const be={...Z,deviceId:e,paneId:t,enabled:!0};return await xF(be),!0},onSuccess:Z=>{cn.success(s(Z?"watch.toast.created":"watch.toast.updated")),a(Z)},onError:Z=>{cn.error(Z instanceof Error?Z.message:String(Z))}}),Ce=Cu({mutationFn:async()=>SF({description:P.trim(),deviceId:e,paneId:t,providerId:A,modelId:A&&B.trim()||null}),onSuccess:Z=>{b(Z.pattern),w(Z.flags),E(Z.extractGroup),W(Z)},onError:Z=>{cn.error(Z instanceof Error?Z.message:String(Z))}}),we=()=>{const Z=pe();if(Z){cn.error(Z);return}De.mutate()};return R.jsxs("form",{"data-testid":"watch-rule-form",className:"space-y-4",onSubmit:Z=>{Z.preventDefault(),we()},children:[R.jsxs("div",{className:"space-y-2",children:[R.jsx("label",{className:"block text-sm font-medium",htmlFor:`${c}-name`,children:s("watch.form.name")}),R.jsx(ya,{id:`${c}-name`,"data-testid":"watch-form-name",value:d,maxLength:120,onChange:Z=>h(Z.target.value),placeholder:s("watch.form.namePlaceholder")})]}),R.jsxs("div",{className:"space-y-2",children:[R.jsx("span",{className:"block text-sm font-medium",children:s("watch.form.triggerType")}),R.jsx("div",{className:"grid gap-2",children:nV.map(Z=>R.jsxs("button",{type:"button","data-testid":`watch-form-type-${Z}`,onClick:()=>ue(Z),className:Le("rounded-lg border px-3 py-2 text-left transition-colors",f===Z?"border-primary/50 bg-primary/10":"border-border hover:bg-accent/40"),children:[R.jsx("span",{className:"block text-sm font-medium",children:s(`watch.type.${Z}`)}),R.jsx("span",{className:"block text-xs text-muted-foreground",children:s(`watch.typeDesc.${Z}`)})]},Z))})]}),Me&&R.jsxs(R.Fragment,{children:[R.jsxs("div",{className:"space-y-2 rounded-lg border border-dashed border-border p-3",children:[R.jsx("label",{className:"block text-sm font-medium",htmlFor:`${c}-assist`,children:s("watch.form.assistLabel")}),R.jsxs("div",{className:"flex gap-2",children:[R.jsx(ya,{id:`${c}-assist`,"data-testid":"watch-form-assist-input",value:P,onChange:Z=>q(Z.target.value),placeholder:s("watch.form.assistPlaceholder")}),R.jsxs(Rn,{type:"button",variant:"secondary","data-testid":"watch-form-assist-generate",disabled:!P.trim()||Ce.isPending,onClick:()=>Ce.mutate(),children:[Ce.isPending?R.jsx(Ul,{className:"h-4 w-4 animate-spin"}):R.jsx(FP,{className:"h-4 w-4"}),s("watch.form.assistButton")]})]}),X&&R.jsxs("div",{className:"space-y-1 text-xs","data-testid":"watch-form-assist-result",children:[R.jsxs("p",{className:"text-muted-foreground",children:[R.jsxs("span",{className:"font-medium text-foreground",children:[s("watch.form.assistExplanation"),":"]})," ",X.explanation]}),R.jsxs("p",{className:"font-medium text-foreground",children:[s("watch.form.assistPreview"),":"]}),X.preview.length===0?R.jsx("p",{className:"text-muted-foreground",children:s("watch.form.assistPreviewEmpty")}):R.jsx("ul",{className:"max-h-24 space-y-0.5 overflow-y-auto",children:X.preview.map((Z,be)=>R.jsx("li",{className:"truncate rounded bg-muted px-1.5 py-0.5 font-mono",children:Z},be))})]})]}),R.jsxs("div",{className:"grid grid-cols-[1fr_5rem] gap-2",children:[R.jsxs("div",{className:"space-y-2",children:[R.jsx("label",{className:"block text-sm font-medium",htmlFor:`${c}-pattern`,children:s("watch.form.pattern")}),R.jsx(ya,{id:`${c}-pattern`,"data-testid":"watch-form-pattern",value:m,onChange:Z=>b(Z.target.value),placeholder:s("watch.form.patternPlaceholder"),className:"font-mono"})]}),R.jsxs("div",{className:"space-y-2",children:[R.jsx("label",{className:"block text-sm font-medium",htmlFor:`${c}-flags`,children:s("watch.form.flags")}),R.jsx(ya,{id:`${c}-flags`,"data-testid":"watch-form-flags",value:x,onChange:Z=>w(Z.target.value),placeholder:s("watch.form.flagsPlaceholder"),className:"font-mono"})]})]})]}),f==="unchanged"&&R.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[R.jsxs("div",{className:"space-y-2",children:[R.jsx("label",{className:"block text-sm font-medium",htmlFor:`${c}-extract-group`,children:s("watch.form.extractGroup")}),R.jsx(ya,{id:`${c}-extract-group`,"data-testid":"watch-form-extract-group",type:"number",min:0,step:1,value:S,onChange:Z=>E(Math.max(0,Number(Z.target.value)||0))}),R.jsx("p",{className:"text-xs text-muted-foreground",children:s("watch.form.extractGroupHint")})]}),R.jsxs("div",{className:"space-y-2",children:[R.jsx("label",{className:"block text-sm font-medium",htmlFor:`${c}-unchanged-minutes`,children:s("watch.form.unchangedMinutes")}),R.jsx(ya,{id:`${c}-unchanged-minutes`,"data-testid":"watch-form-unchanged-minutes",type:"number",min:1,step:1,value:T,onChange:Z=>C(Math.max(1,Number(Z.target.value)||1))})]}),R.jsxs("div",{className:"col-span-2 space-y-2",children:[R.jsx("span",{className:"block text-sm font-medium",children:s("watch.form.noMatchBehavior")}),R.jsxs(uy,{value:M,onValueChange:Z=>{(Z==="reset"||Z==="ignore")&&O(Z)},children:[R.jsx(fy,{className:"w-full","data-testid":"watch-form-no-match-behavior",children:R.jsx(dy,{children:s(M==="reset"?"watch.form.noMatchReset":"watch.form.noMatchIgnore")})}),R.jsxs(hy,{children:[R.jsx(Ji,{value:"reset",children:s("watch.form.noMatchReset")}),R.jsx(Ji,{value:"ignore",children:s("watch.form.noMatchIgnore")})]})]})]})]}),f==="llm"&&R.jsxs("div",{className:"space-y-2",children:[R.jsx("label",{className:"block text-sm font-medium",htmlFor:`${c}-condition`,children:s("watch.form.conditionPrompt")}),R.jsx(tV,{id:`${c}-condition`,"data-testid":"watch-form-condition-prompt",value:D,onChange:Z=>k(Z.target.value),placeholder:s("watch.form.conditionPromptPlaceholder"),rows:3})]}),R.jsxs("div",{className:"space-y-2",children:[R.jsx("span",{className:"block text-sm font-medium",children:s("watch.form.model")}),R.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[R.jsxs(uy,{value:A??my,onValueChange:Z=>{if(!Z)return;const be=Z===my?null:Z;j(be),be===null&&G("")},children:[R.jsx(fy,{className:"w-full","data-testid":"watch-form-provider",children:R.jsx(dy,{children:A?(ve==null?void 0:ve.name)??s("watch.form.providerUnavailable"):s("watch.form.followGlobalDefault")})}),R.jsxs(hy,{children:[R.jsx(Ji,{value:my,children:s("watch.form.followGlobalDefault")}),A&&!de.some(Z=>Z.id===A)&&R.jsx(Ji,{value:A,children:ve?`${ve.name} (${s("watch.form.providerDisabled")})`:s("watch.form.providerUnavailable")}),de.map(Z=>R.jsx(Ji,{value:Z.id,children:Z.name},Z.id))]})]}),R.jsx(ya,{"data-testid":"watch-form-model",list:`${c}-model-options`,value:B,disabled:!A,onChange:Z=>G(Z.target.value),placeholder:s("watch.form.modelPlaceholder")}),R.jsx("datalist",{id:`${c}-model-options`,children:Se.map(Z=>R.jsx("option",{value:Z},Z))})]}),ke&&R.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")})]}),Me&&R.jsxs("div",{className:"space-y-3",children:[R.jsxs("div",{className:"flex items-center justify-between gap-2",children:[R.jsxs("div",{children:[R.jsx("span",{className:"block text-sm font-medium",children:s("watch.form.confirmWithLlm")}),R.jsx("span",{className:"block text-xs text-muted-foreground",children:s("watch.form.confirmWithLlmDesc")})]}),R.jsx(Ev,{checked:K,onCheckedChange:Z=>I(!!Z),"data-testid":"watch-form-confirm-llm"})]}),R.jsxs("div",{className:"flex items-center justify-between gap-2",children:[R.jsxs("div",{children:[R.jsx("span",{className:"block text-sm font-medium",children:s("watch.form.summarizeWithLlm")}),R.jsx("span",{className:"block text-xs text-muted-foreground",children:s("watch.form.summarizeWithLlmDesc")})]}),R.jsx(Ev,{checked:H,onCheckedChange:Z=>F(!!Z),"data-testid":"watch-form-summarize-llm"})]})]}),R.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[R.jsxs("div",{className:"space-y-2",children:[R.jsx("label",{className:"block text-sm font-medium",htmlFor:`${c}-interval`,children:s("watch.form.intervalSeconds")}),R.jsx(ya,{id:`${c}-interval`,"data-testid":"watch-form-interval",type:"number",min:J,step:1,value:Y,onChange:Z=>_(Number(Z.target.value)||0)}),R.jsx("p",{className:"text-xs text-muted-foreground",children:s("watch.form.intervalHint",{min:J})})]}),R.jsxs("div",{className:"space-y-2",children:[R.jsx("span",{className:"block text-sm font-medium",children:s("watch.form.fireMode")}),R.jsxs(uy,{value:L,onValueChange:Z=>{(Z==="once"||Z==="repeat")&&z(Z)},children:[R.jsx(fy,{className:"w-full","data-testid":"watch-form-fire-mode",children:R.jsx(dy,{children:s(L==="once"?"watch.form.fireOnce":"watch.form.fireRepeat")})}),R.jsxs(hy,{children:[R.jsx(Ji,{value:"once",children:s("watch.form.fireOnce")}),R.jsx(Ji,{value:"repeat",children:s("watch.form.fireRepeat")})]})]}),L==="repeat"&&R.jsx(ya,{"data-testid":"watch-form-cooldown",type:"number",min:0,step:1,value:V,onChange:Z=>Q(Math.max(0,Number(Z.target.value)||0)),"aria-label":s("watch.form.cooldownSeconds"),placeholder:s("watch.form.cooldownSeconds")})]})]}),R.jsxs("div",{className:"flex justify-end gap-2",children:[R.jsx(Rn,{type:"button",variant:"outline",onClick:i,"data-testid":"watch-form-cancel",children:s("common.cancel")}),R.jsxs(Rn,{type:"submit",disabled:De.isPending,"data-testid":"watch-form-save",children:[De.isPending&&R.jsx(Ul,{className:"h-4 w-4 animate-spin"}),s(n?"watch.form.save":"watch.form.create")]})]})]})}function du(e){if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t.toLocaleString()}function aV({open:e,onOpenChange:t,deviceId:n,paneId:a}){const{t:i}=gr(),s=$u(),[c,d]=y.useState({mode:"list"}),[h,f]=y.useState(null),[g,m]=y.useState(!1);y.useEffect(()=>{e||(d({mode:"list"}),f(null),m(!1))},[e]);const b=Ku({queryKey:vF(n,a),queryFn:()=>bF(n,a),enabled:e,throwOnError:!1}),x=()=>{s.invalidateQueries({queryKey:["watch-rules"]})},w=Cu({mutationFn:async({rule:C,enabled:M})=>{await QM(C.id,{enabled:M})},onSuccess:x,onError:C=>{cn.error(C instanceof Error?C.message:String(C)),x()}}),S=Cu({mutationFn:async C=>{await wF(C.id)},onSuccess:()=>{cn.success(i("watch.toast.deleted")),x()},onError:C=>{cn.error(C instanceof Error?C.message:String(C))}}),E=C=>{x(),d({mode:"list"}),C&&typeof Notification<"u"&&Notification.permission==="default"&&m(!0)},T=b.data??[];return R.jsxs(R.Fragment,{children:[R.jsx(bv,{open:e,onOpenChange:t,children:R.jsxs(xv,{className:"sm:max-w-lg max-h-[85dvh] grid-rows-[auto_minmax(0,1fr)]","data-testid":"watch-dialog",children:[R.jsxs(wv,{children:[R.jsxs(Sv,{children:[c.mode==="list"&&i("watch.title"),c.mode==="form"&&(c.rule?i("watch.form.editTitle"):i("watch.form.createTitle")),c.mode==="state"&&i("watch.state.title")]}),R.jsx(IM,{children:c.mode==="list"?i("watch.dialogDesc"):null})]}),R.jsxs("div",{className:"min-h-0 overflow-y-auto pr-1",children:[c.mode==="list"&&R.jsxs("div",{className:"space-y-3",children:[g&&R.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:[R.jsx(J5,{className:"mt-0.5 h-4 w-4 shrink-0 text-primary"}),R.jsxs("div",{className:"min-w-0 flex-1",children:[R.jsx("p",{className:"text-sm font-medium",children:i("watch.notifPermission.title")}),R.jsx("p",{className:"text-xs text-muted-foreground",children:i("watch.notifPermission.desc")}),R.jsxs("div",{className:"mt-2 flex gap-2",children:[R.jsx(Rn,{size:"sm","data-testid":"watch-notif-enable",onClick:()=>{Notification.requestPermission().finally(()=>m(!1))},children:i("watch.notifPermission.enable")}),R.jsx(Rn,{size:"sm",variant:"ghost",onClick:()=>m(!1),children:i("watch.notifPermission.dismiss")})]})]})]}),b.isLoading&&R.jsx("div",{className:"flex justify-center py-6",children:R.jsx(Ul,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),!b.isLoading&&T.length===0&&R.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground","data-testid":"watch-rules-empty",children:i("watch.rules.empty")}),T.map(C=>R.jsx(oV,{rule:C,onToggle:M=>w.mutate({rule:C,enabled:M}),onEdit:()=>d({mode:"form",rule:C}),onViewState:()=>d({mode:"state",rule:C}),onDelete:()=>f(C)},C.id)),R.jsxs(Rn,{variant:"outline",className:"w-full","data-testid":"watch-rule-add",onClick:()=>d({mode:"form",rule:null}),children:[R.jsx(ob,{className:"h-4 w-4"}),i("watch.rules.addRule")]})]}),c.mode==="form"&&R.jsx(rV,{deviceId:n,paneId:a,rule:c.rule,onSaved:E,onCancel:()=>d({mode:"list"})}),c.mode==="state"&&R.jsx(iV,{rule:c.rule,onBack:()=>d({mode:"list"})})]})]})}),R.jsx(dv,{open:h!==null,onOpenChange:C=>!C&&f(null),children:R.jsxs(fv,{"data-testid":"watch-rule-delete-dialog",children:[R.jsxs(hv,{children:[R.jsx(pv,{children:i("watch.rules.deleteTitle")}),R.jsx(gv,{children:i("watch.rules.deleteDesc",{name:(h==null?void 0:h.name)??""})})]}),R.jsxs(mv,{children:[R.jsx(vv,{children:i("common.cancel")}),R.jsx(yv,{variant:"destructive","data-testid":"watch-rule-delete-confirm",onClick:()=>{h&&S.mutate(h),f(null)},children:i("watch.rules.deleteConfirm")})]})]})})]})}function oV({rule:e,onToggle:t,onEdit:n,onViewState:a,onDelete:i}){var h,f;const{t:s}=gr(),c=Ku({queryKey:WM(e.id),queryFn:()=>ZM(e.id),throwOnError:!1}),d=du((f=(h=c.data)==null?void 0:h.state)==null?void 0:f.lastTriggeredAt);return R.jsxs("div",{className:"rounded-lg border border-border p-3","data-testid":`watch-rule-item-${e.id}`,"data-rule-name":e.name,children:[R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:e.name}),R.jsx($l,{variant:"secondary",children:s(`watch.type.${e.triggerType}`)}),R.jsx(Ev,{checked:e.enabled,onCheckedChange:g=>t(!!g),"data-testid":`watch-rule-toggle-${e.id}`})]}),R.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2",children:[R.jsx("span",{className:"truncate text-xs text-muted-foreground",children:d?s("watch.rules.lastTriggered",{time:d}):s("watch.rules.neverTriggered")}),R.jsxs("div",{className:"flex shrink-0 gap-1",children:[R.jsx(Rn,{variant:"ghost",size:"icon-xs",onClick:a,title:s("watch.rules.viewState"),"aria-label":s("watch.rules.viewState"),"data-testid":`watch-rule-state-${e.id}`,children:R.jsx(X5,{className:"h-3.5 w-3.5"})}),R.jsx(Rn,{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:R.jsx(ab,{className:"h-3.5 w-3.5"})}),R.jsx(Rn,{variant:"ghost",size:"icon-xs",onClick:i,title:s("watch.rules.delete"),"aria-label":s("watch.rules.delete"),"data-testid":`watch-rule-delete-${e.id}`,children:R.jsx(MC,{className:"h-3.5 w-3.5 text-destructive"})})]})]})]})}function iV({rule:e,onBack:t}){var h,f;const{t:n}=gr(),a=Ku({queryKey:WM(e.id),queryFn:()=>ZM(e.id),refetchInterval:5e3,throwOnError:!1}),i=((h=a.data)==null?void 0:h.state)??null,s=((f=a.data)==null?void 0:f.samples)??[],c=n("watch.state.none"),d=[{label:n("watch.state.lastSampledAt"),value:du(i==null?void 0:i.lastSampledAt)??c},{label:n("watch.state.lastValue"),value:(i==null?void 0:i.lastValue)??c},{label:n("watch.state.lastValueChangedAt"),value:du(i==null?void 0:i.lastValueChangedAt)??c},{label:n("watch.state.lastTriggeredAt"),value:du(i==null?void 0:i.lastTriggeredAt)??c},{label:n("watch.state.consecutiveErrors"),value:i?String(i.consecutiveErrors):c},{label:n("watch.state.lastError"),value:(i==null?void 0:i.lastError)??c}];return R.jsxs("div",{className:"space-y-3","data-testid":"watch-rule-state-view",children:[R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx(Rn,{variant:"ghost",size:"icon-sm",onClick:t,"aria-label":n("watch.state.back"),children:R.jsx(Q5,{className:"h-4 w-4"})}),R.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:e.name}),R.jsx($l,{variant:"secondary",children:n(`watch.type.${e.triggerType}`)})]}),a.isLoading?R.jsx("div",{className:"flex justify-center py-6",children:R.jsx(Ul,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):R.jsxs(R.Fragment,{children:[R.jsx("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 text-sm",children:d.map(g=>R.jsxs("div",{className:"contents",children:[R.jsx("dt",{className:"text-muted-foreground",children:g.label}),R.jsx("dd",{className:"min-w-0 break-all",children:g.value})]},g.label))}),R.jsxs("div",{className:"space-y-1.5",children:[R.jsx("p",{className:"text-sm font-medium",children:n("watch.state.samples")}),s.length===0?R.jsx("p",{className:"text-xs text-muted-foreground",children:n("watch.state.samplesEmpty")}):R.jsx("ul",{className:"max-h-48 space-y-0.5 overflow-y-auto text-xs",children:[...s].reverse().map(g=>R.jsxs("li",{className:"flex items-center gap-2 rounded bg-muted/60 px-2 py-1",children:[R.jsx("span",{className:"shrink-0 font-mono text-muted-foreground",children:du(g.at)??g.at}),R.jsx("span",{className:"min-w-0 flex-1 truncate font-mono",children:g.value??c}),g.hit&&R.jsx($l,{variant:"default",className:"h-4 px-1 text-[10px]",children:n("watch.state.hit")})]},g.at))})]})]})]})}function fu(){return{texts:[],reasonings:[],toolCalls:[],staleBarrier:!1}}function El(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function u2(e){if(El(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 d2(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>El(t)&&typeof t.text=="string"?t.text:"").filter(Boolean).join(`
|
|
300
|
-
`):""}function sV(e){const t=[],n=new Map;for(const a of e){const i=El(a.content)?a.content:null;if(!i)continue;const s=i.content;switch(a.role){case"user":{const c=d2(s);c&&t.push({kind:"user",key:`m${a.seq}`,text:c});break}case"assistant":{if(typeof s=="string"){s&&t.push({kind:"assistant-text",key:`m${a.seq}`,text:s,streaming:!1});break}if(!Array.isArray(s))break;s.forEach((c,d)=>{if(!El(c))return;const h=`m${a.seq}p${d}`;if(c.type==="text"&&typeof c.text=="string"&&c.text){t.push({kind:"assistant-text",key:h,text:c.text,streaming:!1});return}if(c.type==="reasoning"&&typeof c.text=="string"&&c.text){t.push({kind:"reasoning",key:h,text:c.text,streaming:!1});return}if(c.type==="tool-call"&&typeof c.toolCallId=="string"){const f={toolCallId:c.toolCallId,toolName:typeof c.toolName=="string"?c.toolName:"unknown",input:c.input,isError:!1,denied:!1,resolved:!1};n.set(f.toolCallId,f),t.push({kind:"tool-call",key:h,call:f})}});break}case"tool":{if(!Array.isArray(s))break;for(const c of s){if(!El(c)||c.type!=="tool-result")continue;const d=typeof c.toolCallId=="string"?c.toolCallId:"",h=n.get(d),{value:f,isError:g,denied:m}=u2(c.output);h&&(h.output=f,h.isError=g,h.denied=m,h.resolved=!0)}break}}}return{blocks:t,toolBlocksById:n}}function $7(e,t){const{blocks:n,toolBlocksById:a}=sV(e??[]);if(!t)return n;for(const i of t.toolCalls){const s=a.get(i.toolCallId);if(s){!s.resolved&&i.resolved&&(s.output=i.output,s.isError=i.isError,s.denied=i.denied,s.resolved=!0);continue}n.push({kind:"tool-call",key:`live-tool-${i.toolCallId}`,call:i})}for(const i of t.reasonings)i.text&&n.push({kind:"reasoning",key:`live-reasoning-${i.messageId}`,text:i.text,streaming:!0});for(const i of t.texts)i.text&&n.push({kind:"assistant-text",key:`live-text-${i.messageId}`,text:i.text,streaming:!0});return n}function Tv(e){return!e||e.length===0?-1:e[e.length-1].seq}function K7(e){if(!e)return null;for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role!=="user")continue;const a=El(n.content)?n.content:null,i=a?d2(a.content):"";if(i)return i}return null}async function fr(e,t){try{return(await e.json()).error??t}catch{return t}}function ou(e){return Object.values(e).filter(t=>!!t).sort((t,n)=>t.updatedAt<n.updatedAt?1:-1).map(t=>t.id)}function jR(e,t){if(!e||e.length===0)return[...t].sort((a,i)=>a.seq-i.seq);const n=new Map;for(const a of e)n.set(a.seq,a);for(const a of t)n.set(a.seq,a);return[...n.values()].sort((a,i)=>a.seq-i.seq)}let LR=!1;const ei=new Set,lV=40,ps=new Map;let iu=null;const cV=120,wu=new Map,py=new Set,Cv=new Set;function uV(e){const t=wu.get(e);t&&(clearTimeout(t),wu.delete(e)),ps.delete(e),Cv.delete(e)}function Ov(e){const t=M5(e);Sn().send(t.kind,t.payload)}function _R(e){const t=N5(e);Sn().send(t.kind,t.payload)}function IR(e,t,n,a){let i=ps.get(e);i||(i={texts:new Map,reasonings:new Map},ps.set(e,i));const s=i[t];s.set(n,(s.get(n)??"")+a)}function dV(e){const t=()=>{if(iu&&(clearTimeout(iu),iu=null),ps.size===0)return;const a=new Map(ps);ps.clear(),e(i=>{const s={...i.inProgress};for(const[c,d]of a){const h=s[c]??fu(),f={...h,texts:[...h.texts],reasonings:[...h.reasonings]};for(const g of["texts","reasonings"])for(const[m,b]of d[g]){const x=f[g],w=x.findIndex(S=>S.messageId===m);w>=0?x[w]={...x[w],text:x[w].text+b}:x.push({messageId:m,text:b,stale:!1})}s[c]=f}return{inProgress:s}})};return{flush:t,schedule:()=>{iu||(iu=setTimeout(t,lV))}}}function fV(e,t){if(LR)return;LR=!0;const n=Sn(),a=dV(e),i=E=>{wu.get(E)||wu.set(E,setTimeout(()=>{wu.delete(E),t().loadHistory(E)},cV))},s=(E,T)=>{ps.delete(E),e(M=>{const O=M.sessions[E],D=fu();return T.inProgressText&&D.texts.push({messageId:"__sync__",text:T.inProgressText,stale:!1}),T.inProgressReasoning&&D.reasonings.push({messageId:"__sync_reasoning__",text:T.inProgressReasoning,stale:!1}),{sessions:O?{...M.sessions,[E]:{...O,status:T.status,lastError:T.lastError}}:M.sessions,inProgress:{...M.inProgress,[E]:D},pendingConfirmations:{...M.pendingConfirmations,[E]:T.pendingConfirmations.map(k=>({id:k.confirmationId,toolCallId:k.toolCallId,toolName:k.toolName,input:k.input,createdAt:k.createdAt}))},queued:{...M.queued,[E]:T.queuedMessages.map(k=>({id:k.id,sessionId:E,seq:k.seq,text:k.text,createdAt:k.createdAt}))}}});const C=t();(T.lastMessageSeq>Tv(C.messages[E])||!C.historyLoaded[E])&&C.loadHistory(E)},c=(E,T)=>{const C=!!t().sessions[E];if(e(M=>{const O=M.sessions[E];return O?{sessions:{...M.sessions,[E]:{...O,status:T.status,lastError:T.lastError!==void 0?T.lastError:O.lastError}}}:M}),!C){t().loadSessions();return}t().refreshSession(E)},d=(E,T)=>{a.flush(),e(C=>{const M=C.inProgress[E]??fu(),O=[...M.toolCalls],D=O.findIndex(A=>A.toolCallId===T.toolCallId),k={toolCallId:T.toolCallId,toolName:T.toolName,input:T.input,isError:!1,denied:!1,resolved:!1,stale:!1};return D>=0?O[D]={...O[D],...k}:O.push(k),{inProgress:{...C.inProgress,[E]:{...M,toolCalls:O}}}})},h=(E,T)=>{a.flush();const{value:C,isError:M,denied:O}=u2(T.output);e(D=>{const k=D.inProgress[E]??fu(),A=[...k.toolCalls],j=A.findIndex(B=>B.toolCallId===T.toolCallId);return j>=0?A[j]={...A[j],output:C,isError:!!T.isError||M,denied:O,resolved:!0}:A.push({toolCallId:T.toolCallId,toolName:T.toolName,input:void 0,output:C,isError:!!T.isError||M,denied:O,resolved:!0,stale:k.staleBarrier}),{inProgress:{...D.inProgress,[E]:{...k,toolCalls:A}}}})},f=(E,T)=>{e(C=>{const M=C.pendingConfirmations[E]??[];return M.some(O=>O.id===T.confirmationId)?C:{pendingConfirmations:{...C.pendingConfirmations,[E]:[...M,{id:T.confirmationId,toolCallId:T.toolCallId,toolName:T.toolName,input:T.input,createdAt:new Date().toISOString()}]}}})},g=(E,T)=>{e(C=>{const M=C.pendingConfirmations[E];return!M||!M.some(O=>O.id===T.confirmationId)?C:{pendingConfirmations:{...C.pendingConfirmations,[E]:M.filter(O=>O.id!==T.confirmationId)}}})},m=(E,T)=>{a.flush(),(T.role==="assistant"||T.role==="tool")&&e(C=>{const M=C.inProgress[E];return M?{inProgress:{...C.inProgress,[E]:{texts:M.texts.map(O=>({...O,stale:!0})),reasonings:M.reasonings.map(O=>({...O,stale:!0})),toolCalls:M.toolCalls.map(O=>O.resolved?{...O,stale:!0}:O),staleBarrier:!0}}}:C}),i(E)},b=(E,T)=>{a.flush(),e(C=>{const M=C.sessions[E];return{sessions:M?{...C.sessions,[E]:{...M,status:T.sessionStatus}}:C.sessions,inProgress:{...C.inProgress,[E]:fu()}}}),T.lastMessageSeq>Tv(t().messages[E])&&i(E)},x=(E,T)=>{const C=t().sessions[E];cn.error(qt.t("agent.toast.errorTitle",{title:(C==null?void 0:C.title)??"Agent"}),{description:T.message})},w=(E,T)=>{cn.warning(qt.t("agent.toast.credentialWarningTitle"),{description:qt.t("agent.toast.credentialWarningDescription",{types:T.types.join(", ")}),duration:1e4})},S=(E,T)=>{e(C=>({queued:{...C.queued,[E]:T.queued.map(M=>({id:M.id,sessionId:E,seq:M.seq,text:M.text,createdAt:M.createdAt}))}}))};n.onMessage(E=>{if(E.kind!==Tk)return;let T;try{T=Aa(jj,E.payload)}catch(O){console.error("[agent] failed to decode AGENT_EVENT:",O);return}let C;try{C=JSON.parse(new TextDecoder().decode(T.payload))}catch(O){console.error("[agent] failed to parse AGENT_EVENT payload:",O);return}const M=T.sessionId;switch(T.eventType){case Ok:s(M,C);return;case Mk:c(M,C);return;case Nk:{const O=C;IR(M,"texts",O.messageId,O.delta),a.schedule();return}case Ak:{const O=C;IR(M,"reasonings",O.messageId,O.delta),a.schedule();return}case Dk:d(M,C);return;case kk:h(M,C);return;case jk:f(M,C);return;case Lk:g(M,C);return;case _k:m(M,C);return;case Ik:x(M,C);return;case zk:b(M,C);return;case Pk:w(M,C);return;case Uk:S(M,C);return;default:return}}),n.onStateChange(E=>{if(E!=="READY")return;for(const C of ei)Ov(C);const T=t().activeSessionId;T&&t().loadHistory(T)})}const es=Bh()(bC((e,t)=>({sessions:{},sessionOrder:[],sessionsLoaded:!1,activeSessionId:null,messages:{},historyLoaded:{},inProgress:{},pendingConfirmations:{},queued:{},sending:{},draft:null,defaultWriteMode:"confirm",ensureInitialized(){fV(e,t),Sn().connect();const n=t().activeSessionId;n&&!ei.has(n)&&(ei.add(n),Ov(n))},async loadSessions(){try{const n=await fetch("/api/agent/sessions");if(!n.ok)throw new Error(await fr(n,"Failed to load agent sessions"));const a=await n.json();e(()=>{const s={};for(const c of a.sessions)s[c.id]=c;return{sessions:s,sessionOrder:ou(s),sessionsLoaded:!0}});const i=t();i.activeSessionId&&!i.sessions[i.activeSessionId]&&i.setActiveSession(null)}catch(n){console.error("[agent] loadSessions failed:",n)}},async refreshSession(n){try{const a=await fetch(`/api/agent/sessions/${n}`);if(a.status===404){await t().loadSessions();return}if(!a.ok)throw new Error(await fr(a,"Failed to load agent session"));const i=await a.json();e(s=>{const c={...s.sessions,[n]:i.session};return{sessions:c,sessionOrder:ou(c)}})}catch(a){console.error("[agent] refreshSession failed:",a)}},setActiveSession(n){const a=t().activeSessionId;a!==n&&(a&&ei.has(a)&&(ei.delete(a),_R(a)),e({activeSessionId:n,draft:null}),n&&(ei.add(n),Ov(n),t().historyLoaded[n]||t().loadHistory(n)))},async createSession(n,a,i){try{const s=await fetch("/api/agent/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceId:n,paneId:a,...(i==null?void 0:i.providerId)!==void 0?{providerId:i.providerId}:{},...(i==null?void 0:i.modelId)!==void 0&&i.modelId!==null?{modelId:i.modelId}:{},...(i==null?void 0:i.providerHostedTools)!==void 0?{providerHostedTools:i.providerHostedTools}:{},...(i==null?void 0:i.originPaneTitle)!==void 0?{originPaneTitle:i.originPaneTitle}:{},writeMode:(i==null?void 0:i.writeMode)??t().defaultWriteMode})});if(!s.ok)throw new Error(await fr(s,"Failed to create agent session"));const d=(await s.json()).session;return e(h=>{const f={...h.sessions,[d.id]:d};return{sessions:f,sessionOrder:ou(f),messages:{...h.messages,[d.id]:[]},historyLoaded:{...h.historyLoaded,[d.id]:!0}}}),t().setActiveSession(d.id),d}catch(s){return cn.error(s instanceof Error?s.message:String(s)),null}},async renameSession(n,a){try{const i=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:a})});if(!i.ok)throw new Error(await fr(i,"Failed to rename agent session"));const s=await i.json();return e(c=>{const d={...c.sessions,[n]:s.session};return{sessions:d,sessionOrder:ou(d)}}),!0}catch(i){return cn.error(i instanceof Error?i.message:String(i)),!1}},async deleteSession(n){try{const a=await fetch(`/api/agent/sessions/${n}`,{method:"DELETE"});if(!a.ok)throw new Error(await fr(a,"Failed to delete agent session"));return t().activeSessionId===n&&t().setActiveSession(null),uV(n),e(i=>{const s={...i.sessions};delete s[n];const c={...i.messages};delete c[n];const d={...i.historyLoaded};delete d[n];const h={...i.inProgress};delete h[n];const f={...i.pendingConfirmations};delete f[n];const g={...i.queued};return delete g[n],{sessions:s,sessionOrder:ou(s),messages:c,historyLoaded:d,inProgress:h,pendingConfirmations:f,queued:g}}),!0}catch(a){return cn.error(a instanceof Error?a.message:String(a)),!1}},async setWriteMode(n,a){try{const i=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({writeMode:a})});if(!i.ok)throw new Error(await fr(i,"Failed to update write mode"));const s=await i.json();e(c=>({sessions:{...c.sessions,[n]:s.session}}))}catch(i){cn.error(i instanceof Error?i.message:String(i))}},setDefaultWriteMode(n){e({defaultWriteMode:n})},async setSessionModel(n,a,i){try{const s=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerId:a,modelId:i})});if(!s.ok)throw new Error(await fr(s,"Failed to update model"));const c=await s.json();e(d=>({sessions:{...d.sessions,[n]:c.session}}))}catch(s){cn.error(s instanceof Error?s.message:String(s))}},async rebindPane(n,a){try{const i=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({paneId:a})});if(!i.ok)throw new Error(await fr(i,"Failed to rebind pane"));const s=await i.json();e(c=>({sessions:{...c.sessions,[n]:s.session}}))}catch(i){cn.error(i instanceof Error?i.message:String(i))}},async loadHistory(n){if(py.has(n)){Cv.add(n);return}py.add(n);try{const a=t(),i=a.historyLoaded[n]?Tv(a.messages[n]):-1,s=i>=0?`?afterSeq=${i}`:"",c=await fetch(`/api/agent/sessions/${n}/messages${s}`);if(!c.ok)throw new Error(await fr(c,"Failed to load agent messages"));const d=await c.json();e(h=>{const f=jR(i>=0?h.messages[n]:void 0,d.messages),g=h.inProgress[n],m=g&&{texts:g.texts.filter(b=>!b.stale),reasonings:g.reasonings.filter(b=>!b.stale),toolCalls:g.toolCalls.filter(b=>!b.stale),staleBarrier:!1};return{messages:{...h.messages,[n]:f},historyLoaded:{...h.historyLoaded,[n]:!0},inProgress:m?{...h.inProgress,[n]:m}:h.inProgress}})}catch(a){console.error("[agent] loadHistory failed:",a)}finally{py.delete(n),Cv.delete(n)&&t().loadHistory(n)}},async sendMessage(n,a){e(i=>({sending:{...i.sending,[n]:!0}}));try{const i=await fetch(`/api/agent/sessions/${n}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:a})});if(!i.ok)throw new Error(await fr(i,"Failed to send message"));const s=await i.json();if(s.message){const c=s.message;e(d=>{const h=d.sessions[n];return{messages:{...d.messages,[n]:jR(d.messages[n],[c])},sessions:h?{...d.sessions,[n]:{...h,status:"running",lastError:null}}:d.sessions}})}return!0}catch(i){return cn.error(i instanceof Error?i.message:String(i)),!1}finally{e(i=>({sending:{...i.sending,[n]:!1}}))}},async enqueueMessage(n,a,i=!1){try{const s=await fetch(`/api/agent/sessions/${n}/queue`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:a,steer:i})});if(!s.ok)throw new Error(await fr(s,"Failed to queue message"))}catch(s){cn.error(s instanceof Error?s.message:String(s))}},async editQueuedMessage(n,a,i){try{const s=await fetch(`/api/agent/queue/${a}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:i})});if(!s.ok)throw new Error(await fr(s,"Failed to edit queued message"))}catch(s){cn.error(s instanceof Error?s.message:String(s))}},async withdrawQueuedMessage(n,a){try{const i=await fetch(`/api/agent/queue/${a}`,{method:"DELETE"});if(!i.ok)throw new Error(await fr(i,"Failed to withdraw queued message"))}catch(i){cn.error(i instanceof Error?i.message:String(i))}},startDraft(n,a,i,s){const c=t().activeSessionId;c&&ei.has(c)&&(ei.delete(c),_R(c)),e({activeSessionId:null,draft:{deviceId:n,paneId:a,providerId:null,modelId:null,paneTitle:i,prompt:s??null}})},updateDraft(n){e(a=>a.draft?{draft:{...a.draft,...n}}:a)},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 a=await fetch(`/api/agent/sessions/${n}/stop`,{method:"POST"});if(!a.ok)throw new Error(await fr(a,"Failed to stop agent session"));const i=await a.json();if(i.session){const s=i.session;e(c=>({sessions:{...c.sessions,[n]:s}}))}}catch(a){cn.error(a instanceof Error?a.message:String(a))}},async decideConfirmation(n,a,i,s){const c=()=>{e(d=>{const h=d.pendingConfirmations[n];return h?{pendingConfirmations:{...d.pendingConfirmations,[n]:h.filter(f=>f.id!==a)}}:d})};try{const d=await fetch(`/api/agent/confirmations/${a}/decide`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s===void 0?{approved:i}:{approved:i,reason:s})});if(d.status===409){c();try{const h=await fetch(`/api/agent/sessions/${n}/confirmations`);if(h.ok){const f=await h.json();e(g=>({pendingConfirmations:{...g.pendingConfirmations,[n]:f.confirmations.map(m=>({id:m.id,toolCallId:m.toolCallId,toolName:m.toolName,input:m.input,createdAt:m.createdAt}))}}))}}catch{}return}if(!d.ok)throw new Error(await fr(d,"Failed to decide confirmation"));c()}catch(d){cn.error(d instanceof Error?d.message:String(d))}}}),{name:"tmex-agent",partialize:e=>({activeSessionId:e.activeSessionId,defaultWriteMode:e.defaultWriteMode})}));function hV(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.useMemo(()=>a=>{t.forEach(i=>i(a))},t)}const um=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ac(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function e0(e){return"nodeType"in e}function Nr(e){var t,n;return e?ac(e)?e:e0(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function t0(e){const{Document:t}=Nr(e);return e instanceof t}function ld(e){return ac(e)?!1:e instanceof Nr(e).HTMLElement}function f2(e){return e instanceof Nr(e).SVGElement}function oc(e){return e?ac(e)?e.document:e0(e)?t0(e)?e:ld(e)||f2(e)?e.ownerDocument:document:document:document}const Fa=um?y.useLayoutEffect:y.useEffect;function n0(e){const t=y.useRef(e);return Fa(()=>{t.current=e}),y.useCallback(function(){for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return t.current==null?void 0:t.current(...a)},[])}function mV(){const e=y.useRef(null),t=y.useCallback((a,i)=>{e.current=setInterval(a,i)},[]),n=y.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Iu(e,t){t===void 0&&(t=[e]);const n=y.useRef(e);return Fa(()=>{n.current!==e&&(n.current=e)},t),n}function cd(e,t){const n=y.useRef();return y.useMemo(()=>{const a=e(n.current);return n.current=a,a},[...t])}function Lh(e){const t=n0(e),n=y.useRef(null),a=y.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,a]}function Mv(e){const t=y.useRef();return y.useEffect(()=>{t.current=e},[e]),t.current}let gy={};function ud(e,t){return y.useMemo(()=>{if(t)return t;const n=gy[e]==null?0:gy[e]+1;return gy[e]=n,e+"-"+n},[e,t])}function h2(e){return function(t){for(var n=arguments.length,a=new Array(n>1?n-1:0),i=1;i<n;i++)a[i-1]=arguments[i];return a.reduce((s,c)=>{const d=Object.entries(c);for(const[h,f]of d){const g=s[h];g!=null&&(s[h]=g+e*f)}return s},{...t})}}const Rl=h2(1),zu=h2(-1);function pV(e){return"clientX"in e&&"clientY"in e}function r0(e){if(!e)return!1;const{KeyboardEvent:t}=Nr(e.target);return t&&e instanceof t}function gV(e){if(!e)return!1;const{TouchEvent:t}=Nr(e.target);return t&&e instanceof t}function Nv(e){if(gV(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return pV(e)?{x:e.clientX,y:e.clientY}:null}const Ts=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Ts.Translate.toString(e),Ts.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:a}=e;return t+" "+n+"ms "+a}}}),zR="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function yV(e){return e.matches(zR)?e:e.querySelector(zR)}const vV={display:"none"};function bV(e){let{id:t,value:n}=e;return _e.createElement("div",{id:t,style:vV},n)}function xV(e){let{id:t,announcement:n,ariaLiveType:a="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return _e.createElement("div",{id:t,style:i,role:"status","aria-live":a,"aria-atomic":!0},n)}function wV(){const[e,t]=y.useState("");return{announce:y.useCallback(a=>{a!=null&&t(a)},[]),announcement:e}}const m2=y.createContext(null);function SV(e){const t=y.useContext(m2);y.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function EV(){const[e]=y.useState(()=>new Set),t=y.useCallback(a=>(e.add(a),()=>e.delete(a)),[e]);return[y.useCallback(a=>{let{type:i,event:s}=a;e.forEach(c=>{var d;return(d=c[i])==null?void 0:d.call(c,s)})},[e]),t]}const RV={draggable:`
|
|
301
|
-
To pick up a draggable item, press the space bar.
|
|
302
|
-
While dragging, use the arrow keys to move the item.
|
|
303
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
304
|
-
`},TV={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function CV(e){let{announcements:t=TV,container:n,hiddenTextDescribedById:a,screenReaderInstructions:i=RV}=e;const{announce:s,announcement:c}=wV(),d=ud("DndLiveRegion"),[h,f]=y.useState(!1);if(y.useEffect(()=>{f(!0)},[]),SV(y.useMemo(()=>({onDragStart(m){let{active:b}=m;s(t.onDragStart({active:b}))},onDragMove(m){let{active:b,over:x}=m;t.onDragMove&&s(t.onDragMove({active:b,over:x}))},onDragOver(m){let{active:b,over:x}=m;s(t.onDragOver({active:b,over:x}))},onDragEnd(m){let{active:b,over:x}=m;s(t.onDragEnd({active:b,over:x}))},onDragCancel(m){let{active:b,over:x}=m;s(t.onDragCancel({active:b,over:x}))}}),[s,t])),!h)return null;const g=_e.createElement(_e.Fragment,null,_e.createElement(bV,{id:a,value:i.draggable}),_e.createElement(xV,{id:d,announcement:c}));return n?or.createPortal(g,n):g}var Yn;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Yn||(Yn={}));function _h(){}function yy(e,t){return y.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function OV(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.useMemo(()=>[...t].filter(a=>a!=null),[...t])}const Sa=Object.freeze({x:0,y:0});function p2(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function g2(e,t){let{data:{value:n}}=e,{data:{value:a}}=t;return n-a}function MV(e,t){let{data:{value:n}}=e,{data:{value:a}}=t;return a-n}function PR(e){let{left:t,top:n,height:a,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+a},{x:t+i,y:n+a}]}function y2(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function UR(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const a0=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:a}=e;const i=UR(t,t.left,t.top),s=[];for(const c of a){const{id:d}=c,h=n.get(d);if(h){const f=p2(UR(h),i);s.push({id:d,data:{droppableContainer:c,value:f}})}}return s.sort(g2)},NV=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:a}=e;const i=PR(t),s=[];for(const c of a){const{id:d}=c,h=n.get(d);if(h){const f=PR(h),g=i.reduce((b,x,w)=>b+p2(f[w],x),0),m=Number((g/4).toFixed(4));s.push({id:d,data:{droppableContainer:c,value:m}})}}return s.sort(g2)};function AV(e,t){const n=Math.max(t.top,e.top),a=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),c=i-a,d=s-n;if(a<i&&n<s){const h=t.width*t.height,f=e.width*e.height,g=c*d,m=g/(h+f-g);return Number(m.toFixed(4))}return 0}const DV=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:a}=e;const i=[];for(const s of a){const{id:c}=s,d=n.get(c);if(d){const h=AV(d,t);h>0&&i.push({id:c,data:{droppableContainer:s,value:h}})}}return i.sort(MV)};function kV(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function v2(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Sa}function jV(e){return function(n){for(var a=arguments.length,i=new Array(a>1?a-1:0),s=1;s<a;s++)i[s-1]=arguments[s];return i.reduce((c,d)=>({...c,top:c.top+e*d.y,bottom:c.bottom+e*d.y,left:c.left+e*d.x,right:c.right+e*d.x}),{...n})}}const LV=jV(1);function _V(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function IV(e,t,n){const a=_V(t);if(!a)return e;const{scaleX:i,scaleY:s,x:c,y:d}=a,h=e.left-c-(1-i)*parseFloat(n),f=e.top-d-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),g=i?e.width/i:e.width,m=s?e.height/s:e.height;return{width:g,height:m,top:f,right:h+g,bottom:f+m,left:h}}const zV={ignoreTransform:!1};function ic(e,t){t===void 0&&(t=zV);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:f,transformOrigin:g}=Nr(e).getComputedStyle(e);f&&(n=IV(n,f,g))}const{top:a,left:i,width:s,height:c,bottom:d,right:h}=n;return{top:a,left:i,width:s,height:c,bottom:d,right:h}}function HR(e){return ic(e,{ignoreTransform:!0})}function PV(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function UV(e,t){return t===void 0&&(t=Nr(e).getComputedStyle(e)),t.position==="fixed"}function HV(e,t){t===void 0&&(t=Nr(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const s=t[i];return typeof s=="string"?n.test(s):!1})}function dm(e,t){const n=[];function a(i){if(t!=null&&n.length>=t||!i)return n;if(t0(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!ld(i)||f2(i)||n.includes(i))return n;const s=Nr(e).getComputedStyle(i);return i!==e&&HV(i,s)&&n.push(i),UV(i,s)?n:a(i.parentNode)}return e?a(e):n}function b2(e){const[t]=dm(e,1);return t??null}function vy(e){return!um||!e?null:ac(e)?e:e0(e)?t0(e)||e===oc(e).scrollingElement?window:ld(e)?e:null:null}function x2(e){return ac(e)?e.scrollX:e.scrollLeft}function w2(e){return ac(e)?e.scrollY:e.scrollTop}function Av(e){return{x:x2(e),y:w2(e)}}var Qn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Qn||(Qn={}));function S2(e){return!um||!e?!1:e===document.scrollingElement}function E2(e){const t={x:0,y:0},n=S2(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},a={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,c=e.scrollTop>=a.y,d=e.scrollLeft>=a.x;return{isTop:i,isLeft:s,isBottom:c,isRight:d,maxScroll:a,minScroll:t}}const BV={x:.2,y:.2};function FV(e,t,n,a,i){let{top:s,left:c,right:d,bottom:h}=n;a===void 0&&(a=10),i===void 0&&(i=BV);const{isTop:f,isBottom:g,isLeft:m,isRight:b}=E2(e),x={x:0,y:0},w={x:0,y:0},S={height:t.height*i.y,width:t.width*i.x};return!f&&s<=t.top+S.height?(x.y=Qn.Backward,w.y=a*Math.abs((t.top+S.height-s)/S.height)):!g&&h>=t.bottom-S.height&&(x.y=Qn.Forward,w.y=a*Math.abs((t.bottom-S.height-h)/S.height)),!b&&d>=t.right-S.width?(x.x=Qn.Forward,w.x=a*Math.abs((t.right-S.width-d)/S.width)):!m&&c<=t.left+S.width&&(x.x=Qn.Backward,w.x=a*Math.abs((t.left+S.width-c)/S.width)),{direction:x,speed:w}}function VV(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:c}=window;return{top:0,left:0,right:s,bottom:c,width:s,height:c}}const{top:t,left:n,right:a,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:a,bottom:i,width:e.clientWidth,height:e.clientHeight}}function R2(e){return e.reduce((t,n)=>Rl(t,Av(n)),Sa)}function YV(e){return e.reduce((t,n)=>t+x2(n),0)}function qV(e){return e.reduce((t,n)=>t+w2(n),0)}function $V(e,t){if(t===void 0&&(t=ic),!e)return;const{top:n,left:a,bottom:i,right:s}=t(e);b2(e)&&(i<=0||s<=0||n>=window.innerHeight||a>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const KV=[["x",["left","right"],YV],["y",["top","bottom"],qV]];class o0{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const a=dm(n),i=R2(a);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,c,d]of KV)for(const h of c)Object.defineProperty(this,h,{get:()=>{const f=d(a),g=i[s]-f;return this.rect[h]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Su{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var a;return(a=this.target)==null?void 0:a.removeEventListener(...n)})},this.target=t}add(t,n,a){var i;(i=this.target)==null||i.addEventListener(t,n,a),this.listeners.push([t,n,a])}}function GV(e){const{EventTarget:t}=Nr(e);return e instanceof t?e:oc(e)}function by(e,t){const n=Math.abs(e.x),a=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+a**2)>t:"x"in t&&"y"in t?n>t.x&&a>t.y:"x"in t?n>t.x:"y"in t?a>t.y:!1}var aa;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(aa||(aa={}));function BR(e){e.preventDefault()}function XV(e){e.stopPropagation()}var Qt;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Qt||(Qt={}));const T2={start:[Qt.Space,Qt.Enter],cancel:[Qt.Esc],end:[Qt.Space,Qt.Enter,Qt.Tab]},WV=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Qt.Right:return{...n,x:n.x+25};case Qt.Left:return{...n,x:n.x-25};case Qt.Down:return{...n,y:n.y+25};case Qt.Up:return{...n,y:n.y-25}}};class i0{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Su(oc(n)),this.windowListeners=new Su(Nr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(aa.Resize,this.handleCancel),this.windowListeners.add(aa.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(aa.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,a=t.node.current;a&&$V(a),n(Sa)}handleKeyDown(t){if(r0(t)){const{active:n,context:a,options:i}=this.props,{keyboardCodes:s=T2,coordinateGetter:c=WV,scrollBehavior:d="smooth"}=i,{code:h}=t;if(s.end.includes(h)){this.handleEnd(t);return}if(s.cancel.includes(h)){this.handleCancel(t);return}const{collisionRect:f}=a.current,g=f?{x:f.left,y:f.top}:Sa;this.referenceCoordinates||(this.referenceCoordinates=g);const m=c(t,{active:n,context:a.current,currentCoordinates:g});if(m){const b=zu(m,g),x={x:0,y:0},{scrollableAncestors:w}=a.current;for(const S of w){const E=t.code,{isTop:T,isRight:C,isLeft:M,isBottom:O,maxScroll:D,minScroll:k}=E2(S),A=VV(S),j={x:Math.min(E===Qt.Right?A.right-A.width/2:A.right,Math.max(E===Qt.Right?A.left:A.left+A.width/2,m.x)),y:Math.min(E===Qt.Down?A.bottom-A.height/2:A.bottom,Math.max(E===Qt.Down?A.top:A.top+A.height/2,m.y))},B=E===Qt.Right&&!C||E===Qt.Left&&!M,G=E===Qt.Down&&!O||E===Qt.Up&&!T;if(B&&j.x!==m.x){const K=S.scrollLeft+b.x,I=E===Qt.Right&&K<=D.x||E===Qt.Left&&K>=k.x;if(I&&!b.y){S.scrollTo({left:K,behavior:d});return}I?x.x=S.scrollLeft-K:x.x=E===Qt.Right?S.scrollLeft-D.x:S.scrollLeft-k.x,x.x&&S.scrollBy({left:-x.x,behavior:d});break}else if(G&&j.y!==m.y){const K=S.scrollTop+b.y,I=E===Qt.Down&&K<=D.y||E===Qt.Up&&K>=k.y;if(I&&!b.x){S.scrollTo({top:K,behavior:d});return}I?x.y=S.scrollTop-K:x.y=E===Qt.Down?S.scrollTop-D.y:S.scrollTop-k.y,x.y&&S.scrollBy({top:-x.y,behavior:d});break}}this.handleMove(t,Rl(zu(m,this.referenceCoordinates),x))}}}handleMove(t,n){const{onMove:a}=this.props;t.preventDefault(),a(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}i0.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:a=T2,onActivation:i}=t,{active:s}=n;const{code:c}=e.nativeEvent;if(a.start.includes(c)){const d=s.activatorNode.current;return d&&e.target!==d?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function FR(e){return!!(e&&"distance"in e)}function VR(e){return!!(e&&"delay"in e)}class s0{constructor(t,n,a){var i;a===void 0&&(a=GV(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:c}=s;this.props=t,this.events=n,this.document=oc(c),this.documentListeners=new Su(this.document),this.listeners=new Su(a),this.windowListeners=new Su(Nr(c)),this.initialCoordinates=(i=Nv(s))!=null?i:Sa,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:a}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(aa.Resize,this.handleCancel),this.windowListeners.add(aa.DragStart,BR),this.windowListeners.add(aa.VisibilityChange,this.handleCancel),this.windowListeners.add(aa.ContextMenu,BR),this.documentListeners.add(aa.Keydown,this.handleKeydown),n){if(a!=null&&a({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(VR(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(FR(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:a,onPending:i}=this.props;i(a,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(aa.Click,XV,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(aa.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:a,initialCoordinates:i,props:s}=this,{onMove:c,options:{activationConstraint:d}}=s;if(!i)return;const h=(n=Nv(t))!=null?n:Sa,f=zu(i,h);if(!a&&d){if(FR(d)){if(d.tolerance!=null&&by(f,d.tolerance))return this.handleCancel();if(by(f,d.distance))return this.handleStart()}if(VR(d)&&by(f,d.tolerance))return this.handleCancel();this.handlePending(d,f);return}t.cancelable&&t.preventDefault(),c(h)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Qt.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const QV={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class C2 extends s0{constructor(t){const{event:n}=t,a=oc(n.target);super(t,QV,a)}}C2.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:a}=t;return!n.isPrimary||n.button!==0?!1:(a==null||a({event:n}),!0)}}];const ZV={move:{name:"mousemove"},end:{name:"mouseup"}};var Dv;(function(e){e[e.RightClick=2]="RightClick"})(Dv||(Dv={}));class O2 extends s0{constructor(t){super(t,ZV,oc(t.event.target))}}O2.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:a}=t;return n.button===Dv.RightClick?!1:(a==null||a({event:n}),!0)}}];const xy={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class M2 extends s0{constructor(t){super(t,xy)}static setup(){return window.addEventListener(xy.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(xy.move.name,t)};function t(){}}}M2.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:a}=t;const{touches:i}=n;return i.length>1?!1:(a==null||a({event:n}),!0)}}];var Eu;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Eu||(Eu={}));var Ih;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ih||(Ih={}));function JV(e){let{acceleration:t,activator:n=Eu.Pointer,canScroll:a,draggingRect:i,enabled:s,interval:c=5,order:d=Ih.TreeOrder,pointerCoordinates:h,scrollableAncestors:f,scrollableAncestorRects:g,delta:m,threshold:b}=e;const x=t9({delta:m,disabled:!s}),[w,S]=mV(),E=y.useRef({x:0,y:0}),T=y.useRef({x:0,y:0}),C=y.useMemo(()=>{switch(n){case Eu.Pointer:return h?{top:h.y,bottom:h.y,left:h.x,right:h.x}:null;case Eu.DraggableRect:return i}},[n,i,h]),M=y.useRef(null),O=y.useCallback(()=>{const k=M.current;if(!k)return;const A=E.current.x*T.current.x,j=E.current.y*T.current.y;k.scrollBy(A,j)},[]),D=y.useMemo(()=>d===Ih.TreeOrder?[...f].reverse():f,[d,f]);y.useEffect(()=>{if(!s||!f.length||!C){S();return}for(const k of D){if((a==null?void 0:a(k))===!1)continue;const A=f.indexOf(k),j=g[A];if(!j)continue;const{direction:B,speed:G}=FV(k,j,C,t,b);for(const K of["x","y"])x[K][B[K]]||(G[K]=0,B[K]=0);if(G.x>0||G.y>0){S(),M.current=k,w(O,c),E.current=G,T.current=B;return}}E.current={x:0,y:0},T.current={x:0,y:0},S()},[t,O,a,S,s,c,JSON.stringify(C),JSON.stringify(x),w,f,D,g,JSON.stringify(b)])}const e9={x:{[Qn.Backward]:!1,[Qn.Forward]:!1},y:{[Qn.Backward]:!1,[Qn.Forward]:!1}};function t9(e){let{delta:t,disabled:n}=e;const a=Mv(t);return cd(i=>{if(n||!a||!i)return e9;const s={x:Math.sign(t.x-a.x),y:Math.sign(t.y-a.y)};return{x:{[Qn.Backward]:i.x[Qn.Backward]||s.x===-1,[Qn.Forward]:i.x[Qn.Forward]||s.x===1},y:{[Qn.Backward]:i.y[Qn.Backward]||s.y===-1,[Qn.Forward]:i.y[Qn.Forward]||s.y===1}}},[n,t,a])}function n9(e,t){const n=t!=null?e.get(t):void 0,a=n?n.node.current:null;return cd(i=>{var s;return t==null?null:(s=a??i)!=null?s:null},[a,t])}function r9(e,t){return y.useMemo(()=>e.reduce((n,a)=>{const{sensor:i}=a,s=i.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,a)}));return[...n,...s]},[]),[e,t])}var Pu;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Pu||(Pu={}));var kv;(function(e){e.Optimized="optimized"})(kv||(kv={}));const YR=new Map;function a9(e,t){let{dragging:n,dependencies:a,config:i}=t;const[s,c]=y.useState(null),{frequency:d,measure:h,strategy:f}=i,g=y.useRef(e),m=E(),b=Iu(m),x=y.useCallback(function(T){T===void 0&&(T=[]),!b.current&&c(C=>C===null?T:C.concat(T.filter(M=>!C.includes(M))))},[b]),w=y.useRef(null),S=cd(T=>{if(m&&!n)return YR;if(!T||T===YR||g.current!==e||s!=null){const C=new Map;for(let M of e){if(!M)continue;if(s&&s.length>0&&!s.includes(M.id)&&M.rect.current){C.set(M.id,M.rect.current);continue}const O=M.node.current,D=O?new o0(h(O),O):null;M.rect.current=D,D&&C.set(M.id,D)}return C}return T},[e,s,n,m,h]);return y.useEffect(()=>{g.current=e},[e]),y.useEffect(()=>{m||x()},[n,m]),y.useEffect(()=>{s&&s.length>0&&c(null)},[JSON.stringify(s)]),y.useEffect(()=>{m||typeof d!="number"||w.current!==null||(w.current=setTimeout(()=>{x(),w.current=null},d))},[d,m,x,...a]),{droppableRects:S,measureDroppableContainers:x,measuringScheduled:s!=null};function E(){switch(f){case Pu.Always:return!1;case Pu.BeforeDragging:return n;default:return!n}}}function N2(e,t){return cd(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function o9(e,t){return N2(e,t)}function i9(e){let{callback:t,disabled:n}=e;const a=n0(t),i=y.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(a)},[a,n]);return y.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function fm(e){let{callback:t,disabled:n}=e;const a=n0(t),i=y.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(a)},[n]);return y.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function s9(e){return new o0(ic(e),e)}function qR(e,t,n){t===void 0&&(t=s9);const[a,i]=y.useState(null);function s(){i(h=>{if(!e)return null;if(e.isConnected===!1){var f;return(f=h??n)!=null?f:null}const g=t(e);return JSON.stringify(h)===JSON.stringify(g)?h:g})}const c=i9({callback(h){if(e)for(const f of h){const{type:g,target:m}=f;if(g==="childList"&&m instanceof HTMLElement&&m.contains(e)){s();break}}}}),d=fm({callback:s});return Fa(()=>{s(),e?(d==null||d.observe(e),c==null||c.observe(document.body,{childList:!0,subtree:!0})):(d==null||d.disconnect(),c==null||c.disconnect())},[e]),a}function l9(e){const t=N2(e);return v2(e,t)}const $R=[];function c9(e){const t=y.useRef(e),n=cd(a=>e?a&&a!==$R&&e&&t.current&&e.parentNode===t.current.parentNode?a:dm(e):$R,[e]);return y.useEffect(()=>{t.current=e},[e]),n}function u9(e){const[t,n]=y.useState(null),a=y.useRef(e),i=y.useCallback(s=>{const c=vy(s.target);c&&n(d=>d?(d.set(c,Av(c)),new Map(d)):null)},[]);return y.useEffect(()=>{const s=a.current;if(e!==s){c(s);const d=e.map(h=>{const f=vy(h);return f?(f.addEventListener("scroll",i,{passive:!0}),[f,Av(f)]):null}).filter(h=>h!=null);n(d.length?new Map(d):null),a.current=e}return()=>{c(e),c(s)};function c(d){d.forEach(h=>{const f=vy(h);f==null||f.removeEventListener("scroll",i)})}},[i,e]),y.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,c)=>Rl(s,c),Sa):R2(e):Sa,[e,t])}function KR(e,t){t===void 0&&(t=[]);const n=y.useRef(null);return y.useEffect(()=>{n.current=null},t),y.useEffect(()=>{const a=e!==Sa;a&&!n.current&&(n.current=e),!a&&n.current&&(n.current=null)},[e]),n.current?zu(e,n.current):Sa}function d9(e){y.useEffect(()=>{if(!um)return;const t=e.map(n=>{let{sensor:a}=n;return a.setup==null?void 0:a.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function f9(e,t){return y.useMemo(()=>e.reduce((n,a)=>{let{eventName:i,handler:s}=a;return n[i]=c=>{s(c,t)},n},{}),[e,t])}function A2(e){return y.useMemo(()=>e?PV(e):null,[e])}const GR=[];function h9(e,t){t===void 0&&(t=ic);const[n]=e,a=A2(n?Nr(n):null),[i,s]=y.useState(GR);function c(){s(()=>e.length?e.map(h=>S2(h)?a:new o0(t(h),h)):GR)}const d=fm({callback:c});return Fa(()=>{d==null||d.disconnect(),c(),e.forEach(h=>d==null?void 0:d.observe(h))},[e]),i}function m9(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ld(t)?t:e}function p9(e){let{measure:t}=e;const[n,a]=y.useState(null),i=y.useCallback(f=>{for(const{target:g}of f)if(ld(g)){a(m=>{const b=t(g);return m?{...m,width:b.width,height:b.height}:b});break}},[t]),s=fm({callback:i}),c=y.useCallback(f=>{const g=m9(f);s==null||s.disconnect(),g&&(s==null||s.observe(g)),a(g?t(g):null)},[t,s]),[d,h]=Lh(c);return y.useMemo(()=>({nodeRef:d,rect:n,setRef:h}),[n,d,h])}const g9=[{sensor:C2,options:{}},{sensor:i0,options:{}}],y9={current:{}},uh={draggable:{measure:HR},droppable:{measure:HR,strategy:Pu.WhileDragging,frequency:kv.Optimized},dragOverlay:{measure:ic}};class Ru extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,a;return(n=(a=this.get(t))==null?void 0:a.node.current)!=null?n:void 0}}const v9={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ru,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:_h},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:uh,measureDroppableContainers:_h,windowRect:null,measuringScheduled:!1},b9={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:_h,draggableNodes:new Map,over:null,measureDroppableContainers:_h},hm=y.createContext(b9),D2=y.createContext(v9);function x9(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ru}}}function w9(e,t){switch(t.type){case Yn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Yn.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Yn.DragEnd:case Yn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Yn.RegisterDroppable:{const{element:n}=t,{id:a}=n,i=new Ru(e.droppable.containers);return i.set(a,n),{...e,droppable:{...e.droppable,containers:i}}}case Yn.SetDroppableDisabled:{const{id:n,key:a,disabled:i}=t,s=e.droppable.containers.get(n);if(!s||a!==s.key)return e;const c=new Ru(e.droppable.containers);return c.set(n,{...s,disabled:i}),{...e,droppable:{...e.droppable,containers:c}}}case Yn.UnregisterDroppable:{const{id:n,key:a}=t,i=e.droppable.containers.get(n);if(!i||a!==i.key)return e;const s=new Ru(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function S9(e){let{disabled:t}=e;const{active:n,activatorEvent:a,draggableNodes:i}=y.useContext(hm),s=Mv(a),c=Mv(n==null?void 0:n.id);return y.useEffect(()=>{if(!t&&!a&&s&&c!=null){if(!r0(s)||document.activeElement===s.target)return;const d=i.get(c);if(!d)return;const{activatorNode:h,node:f}=d;if(!h.current&&!f.current)return;requestAnimationFrame(()=>{for(const g of[h.current,f.current]){if(!g)continue;const m=yV(g);if(m){m.focus();break}}})}},[a,t,i,c,s]),null}function E9(e,t){let{transform:n,...a}=t;return e!=null&&e.length?e.reduce((i,s)=>s({transform:i,...a}),n):n}function R9(e){return y.useMemo(()=>({draggable:{...uh.draggable,...e==null?void 0:e.draggable},droppable:{...uh.droppable,...e==null?void 0:e.droppable},dragOverlay:{...uh.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function T9(e){let{activeNode:t,measure:n,initialRect:a,config:i=!0}=e;const s=y.useRef(!1),{x:c,y:d}=typeof i=="boolean"?{x:i,y:i}:i;Fa(()=>{if(!c&&!d||!t){s.current=!1;return}if(s.current||!a)return;const f=t==null?void 0:t.node.current;if(!f||f.isConnected===!1)return;const g=n(f),m=v2(g,a);if(c||(m.x=0),d||(m.y=0),s.current=!0,Math.abs(m.x)>0||Math.abs(m.y)>0){const b=b2(f);b&&b.scrollBy({top:m.y,left:m.x})}},[t,c,d,a,n])}const k2=y.createContext({...Sa,scaleX:1,scaleY:1});var ti;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ti||(ti={}));const l0=y.memo(function(t){var n,a,i,s;let{id:c,accessibility:d,autoScroll:h=!0,children:f,sensors:g=g9,collisionDetection:m=DV,measuring:b,modifiers:x,...w}=t;const S=y.useReducer(w9,void 0,x9),[E,T]=S,[C,M]=EV(),[O,D]=y.useState(ti.Uninitialized),k=O===ti.Initialized,{draggable:{active:A,nodes:j,translate:B},droppable:{containers:G}}=E,K=A!=null?j.get(A):null,I=y.useRef({initial:null,translated:null}),H=y.useMemo(()=>{var lt;return A!=null?{id:A,data:(lt=K==null?void 0:K.data)!=null?lt:y9,rect:I}:null},[A,K]),F=y.useRef(null),[Y,_]=y.useState(null),[L,z]=y.useState(null),V=Iu(w,Object.values(w)),Q=ud("DndDescribedBy",c),P=y.useMemo(()=>G.getEnabled(),[G]),q=R9(b),{droppableRects:X,measureDroppableContainers:W,measuringScheduled:ce}=a9(P,{dragging:k,dependencies:[B.x,B.y],config:q.droppable}),ie=n9(j,A),de=y.useMemo(()=>L?Nv(L):null,[L]),ve=et(),Se=o9(ie,q.draggable.measure);T9({activeNode:A!=null?j.get(A):null,config:ve.layoutShiftCompensation,initialRect:Se,measure:q.draggable.measure});const Me=qR(ie,q.draggable.measure,Se),ke=qR(ie?ie.parentElement:null),J=y.useRef({activatorEvent:null,active:null,activeNode:ie,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:j,draggingNode:null,draggingNodeRect:null,droppableContainers:G,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ue=G.getNodeFor((n=J.current.over)==null?void 0:n.id),pe=p9({measure:q.dragOverlay.measure}),De=(a=pe.nodeRef.current)!=null?a:ie,Ce=k?(i=pe.rect)!=null?i:Me:null,we=!!(pe.nodeRef.current&&pe.rect),Te=l9(we?null:Me),Z=A2(De?Nr(De):null),be=c9(k?ue??ie:null),ge=h9(be),Pe=E9(x,{transform:{x:B.x-Te.x,y:B.y-Te.y,scaleX:1,scaleY:1},activatorEvent:L,active:H,activeNodeRect:Me,containerNodeRect:ke,draggingNodeRect:Ce,over:J.current.over,overlayNodeRect:pe.rect,scrollableAncestors:be,scrollableAncestorRects:ge,windowRect:Z}),Be=de?Rl(de,B):null,Ae=u9(be),it=KR(Ae),wt=KR(Ae,[Me]),xt=Rl(Pe,it),oe=Ce?LV(Ce,Pe):null,xe=H&&oe?m({active:H,collisionRect:oe,droppableRects:X,droppableContainers:P,pointerCoordinates:Be}):null,Ie=y2(xe,"id"),[qe,Ke]=y.useState(null),st=we?Pe:Rl(Pe,wt),ze=kV(st,(s=qe==null?void 0:qe.rect)!=null?s:null,Me),Je=y.useRef(null),ft=y.useCallback((lt,mt)=>{let{sensor:Ve,options:Et}=mt;if(F.current==null)return;const Dt=j.get(F.current);if(!Dt)return;const St=lt.nativeEvent,rn=new Ve({active:F.current,activeNode:Dt,event:St,options:Et,context:J,onAbort(Xe){if(!j.get(Xe))return;const{onDragAbort:$}=V.current,ne={id:Xe};$==null||$(ne),C({type:"onDragAbort",event:ne})},onPending(Xe,Rt,$,ne){if(!j.get(Xe))return;const{onDragPending:Ee}=V.current,je={id:Xe,constraint:Rt,initialCoordinates:$,offset:ne};Ee==null||Ee(je),C({type:"onDragPending",event:je})},onStart(Xe){const Rt=F.current;if(Rt==null)return;const $=j.get(Rt);if(!$)return;const{onDragStart:ne}=V.current,le={activatorEvent:St,active:{id:Rt,data:$.data,rect:I}};or.unstable_batchedUpdates(()=>{ne==null||ne(le),D(ti.Initializing),T({type:Yn.DragStart,initialCoordinates:Xe,active:Rt}),C({type:"onDragStart",event:le}),_(Je.current),z(St)})},onMove(Xe){T({type:Yn.DragMove,coordinates:Xe})},onEnd:It(Yn.DragEnd),onCancel:It(Yn.DragCancel)});Je.current=rn;function It(Xe){return async function(){const{active:$,collisions:ne,over:le,scrollAdjustedTranslate:Ee}=J.current;let je=null;if($&&Ee){const{cancelDrop:Ze}=V.current;je={activatorEvent:St,active:$,collisions:ne,delta:Ee,over:le},Xe===Yn.DragEnd&&typeof Ze=="function"&&await Promise.resolve(Ze(je))&&(Xe=Yn.DragCancel)}F.current=null,or.unstable_batchedUpdates(()=>{T({type:Xe}),D(ti.Uninitialized),Ke(null),_(null),z(null),Je.current=null;const Ze=Xe===Yn.DragEnd?"onDragEnd":"onDragCancel";if(je){const Qe=V.current[Ze];Qe==null||Qe(je),C({type:Ze,event:je})}})}}},[j]),jt=y.useCallback((lt,mt)=>(Ve,Et)=>{const Dt=Ve.nativeEvent,St=j.get(Et);if(F.current!==null||!St||Dt.dndKit||Dt.defaultPrevented)return;const rn={active:St};lt(Ve,mt.options,rn)===!0&&(Dt.dndKit={capturedBy:mt.sensor},F.current=Et,ft(Ve,mt))},[j,ft]),nn=r9(g,jt);d9(g),Fa(()=>{Me&&O===ti.Initializing&&D(ti.Initialized)},[Me,O]),y.useEffect(()=>{const{onDragMove:lt}=V.current,{active:mt,activatorEvent:Ve,collisions:Et,over:Dt}=J.current;if(!mt||!Ve)return;const St={active:mt,activatorEvent:Ve,collisions:Et,delta:{x:xt.x,y:xt.y},over:Dt};or.unstable_batchedUpdates(()=>{lt==null||lt(St),C({type:"onDragMove",event:St})})},[xt.x,xt.y]),y.useEffect(()=>{const{active:lt,activatorEvent:mt,collisions:Ve,droppableContainers:Et,scrollAdjustedTranslate:Dt}=J.current;if(!lt||F.current==null||!mt||!Dt)return;const{onDragOver:St}=V.current,rn=Et.get(Ie),It=rn&&rn.rect.current?{id:rn.id,rect:rn.rect.current,data:rn.data,disabled:rn.disabled}:null,Xe={active:lt,activatorEvent:mt,collisions:Ve,delta:{x:Dt.x,y:Dt.y},over:It};or.unstable_batchedUpdates(()=>{Ke(It),St==null||St(Xe),C({type:"onDragOver",event:Xe})})},[Ie]),Fa(()=>{J.current={activatorEvent:L,active:H,activeNode:ie,collisionRect:oe,collisions:xe,droppableRects:X,draggableNodes:j,draggingNode:De,draggingNodeRect:Ce,droppableContainers:G,over:qe,scrollableAncestors:be,scrollAdjustedTranslate:xt},I.current={initial:Ce,translated:oe}},[H,ie,xe,oe,j,De,Ce,X,G,qe,be,xt]),JV({...ve,delta:B,draggingRect:oe,pointerCoordinates:Be,scrollableAncestors:be,scrollableAncestorRects:ge});const ht=y.useMemo(()=>({active:H,activeNode:ie,activeNodeRect:Me,activatorEvent:L,collisions:xe,containerNodeRect:ke,dragOverlay:pe,draggableNodes:j,droppableContainers:G,droppableRects:X,over:qe,measureDroppableContainers:W,scrollableAncestors:be,scrollableAncestorRects:ge,measuringConfiguration:q,measuringScheduled:ce,windowRect:Z}),[H,ie,Me,L,xe,ke,pe,j,G,X,qe,W,be,ge,q,ce,Z]),Ct=y.useMemo(()=>({activatorEvent:L,activators:nn,active:H,activeNodeRect:Me,ariaDescribedById:{draggable:Q},dispatch:T,draggableNodes:j,over:qe,measureDroppableContainers:W}),[L,nn,H,Me,T,Q,j,qe,W]);return _e.createElement(m2.Provider,{value:M},_e.createElement(hm.Provider,{value:Ct},_e.createElement(D2.Provider,{value:ht},_e.createElement(k2.Provider,{value:ze},f)),_e.createElement(S9,{disabled:(d==null?void 0:d.restoreFocus)===!1})),_e.createElement(CV,{...d,hiddenTextDescribedById:Q}));function et(){const lt=(Y==null?void 0:Y.autoScrollEnabled)===!1,mt=typeof h=="object"?h.enabled===!1:h===!1,Ve=k&&!lt&&!mt;return typeof h=="object"?{...h,enabled:Ve}:{enabled:Ve}}}),C9=y.createContext(null),XR="button",O9="Draggable";function M9(e){let{id:t,data:n,disabled:a=!1,attributes:i}=e;const s=ud(O9),{activators:c,activatorEvent:d,active:h,activeNodeRect:f,ariaDescribedById:g,draggableNodes:m,over:b}=y.useContext(hm),{role:x=XR,roleDescription:w="draggable",tabIndex:S=0}=i??{},E=(h==null?void 0:h.id)===t,T=y.useContext(E?k2:C9),[C,M]=Lh(),[O,D]=Lh(),k=f9(c,t),A=Iu(n);Fa(()=>(m.set(t,{id:t,key:s,node:C,activatorNode:O,data:A}),()=>{const B=m.get(t);B&&B.key===s&&m.delete(t)}),[m,t]);const j=y.useMemo(()=>({role:x,tabIndex:S,"aria-disabled":a,"aria-pressed":E&&x===XR?!0:void 0,"aria-roledescription":w,"aria-describedby":g.draggable}),[a,x,S,E,w,g.draggable]);return{active:h,activatorEvent:d,activeNodeRect:f,attributes:j,isDragging:E,listeners:a?void 0:k,node:C,over:b,setNodeRef:M,setActivatorNodeRef:D,transform:T}}function N9(){return y.useContext(D2)}const A9="Droppable",D9={timeout:25};function k9(e){let{data:t,disabled:n=!1,id:a,resizeObserverConfig:i}=e;const s=ud(A9),{active:c,dispatch:d,over:h,measureDroppableContainers:f}=y.useContext(hm),g=y.useRef({disabled:n}),m=y.useRef(!1),b=y.useRef(null),x=y.useRef(null),{disabled:w,updateMeasurementsFor:S,timeout:E}={...D9,...i},T=Iu(S??a),C=y.useCallback(()=>{if(!m.current){m.current=!0;return}x.current!=null&&clearTimeout(x.current),x.current=setTimeout(()=>{f(Array.isArray(T.current)?T.current:[T.current]),x.current=null},E)},[E]),M=fm({callback:C,disabled:w||!c}),O=y.useCallback((j,B)=>{M&&(B&&(M.unobserve(B),m.current=!1),j&&M.observe(j))},[M]),[D,k]=Lh(O),A=Iu(t);return y.useEffect(()=>{!M||!D.current||(M.disconnect(),m.current=!1,M.observe(D.current))},[D,M]),y.useEffect(()=>(d({type:Yn.RegisterDroppable,element:{id:a,key:s,disabled:n,node:D,rect:b,data:A}}),()=>d({type:Yn.UnregisterDroppable,key:s,id:a})),[a]),y.useEffect(()=>{n!==g.current.disabled&&(d({type:Yn.SetDroppableDisabled,id:a,key:s,disabled:n}),g.current.disabled=n)},[a,s,n,d]),{active:c,rect:b,isOver:(h==null?void 0:h.id)===a,node:D,over:h,setNodeRef:k}}function dd(e,t,n){const a=e.slice();return a.splice(n<0?a.length+n:n,0,a.splice(t,1)[0]),a}function j9(e,t){return e.reduce((n,a,i)=>{const s=t.get(a);return s&&(n[i]=s),n},Array(e.length))}function Gf(e){return e!==null&&e>=0}function L9(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function _9(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const j2=e=>{let{rects:t,activeIndex:n,overIndex:a,index:i}=e;const s=dd(t,a,n),c=t[i],d=s[i];return!d||!c?null:{x:d.left-c.left,y:d.top-c.top,scaleX:d.width/c.width,scaleY:d.height/c.height}},Xf={scaleX:1,scaleY:1},c0=e=>{var t;let{activeIndex:n,activeNodeRect:a,index:i,rects:s,overIndex:c}=e;const d=(t=s[n])!=null?t:a;if(!d)return null;if(i===n){const f=s[c];return f?{x:0,y:n<c?f.top+f.height-(d.top+d.height):f.top-d.top,...Xf}:null}const h=I9(s,i,n);return i>n&&i<=c?{x:0,y:-d.height-h,...Xf}:i<n&&i>=c?{x:0,y:d.height+h,...Xf}:{x:0,y:0,...Xf}};function I9(e,t,n){const a=e[t],i=e[t-1],s=e[t+1];return a?n<t?i?a.top-(i.top+i.height):s?s.top-(a.top+a.height):0:s?s.top-(a.top+a.height):i?a.top-(i.top+i.height):0:0}const L2="Sortable",_2=_e.createContext({activeIndex:-1,containerId:L2,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:j2,disabled:{draggable:!1,droppable:!1}});function u0(e){let{children:t,id:n,items:a,strategy:i=j2,disabled:s=!1}=e;const{active:c,dragOverlay:d,droppableRects:h,over:f,measureDroppableContainers:g}=N9(),m=ud(L2,n),b=d.rect!==null,x=y.useMemo(()=>a.map(k=>typeof k=="object"&&"id"in k?k.id:k),[a]),w=c!=null,S=c?x.indexOf(c.id):-1,E=f?x.indexOf(f.id):-1,T=y.useRef(x),C=!L9(x,T.current),M=E!==-1&&S===-1||C,O=_9(s);Fa(()=>{C&&w&&g(x)},[C,x,w,g]),y.useEffect(()=>{T.current=x},[x]);const D=y.useMemo(()=>({activeIndex:S,containerId:m,disabled:O,disableTransforms:M,items:x,overIndex:E,useDragOverlay:b,sortedRects:j9(x,h),strategy:i}),[S,m,O.draggable,O.droppable,M,x,E,h,b,i]);return _e.createElement(_2.Provider,{value:D},t)}const z9=e=>{let{id:t,items:n,activeIndex:a,overIndex:i}=e;return dd(n,a,i).indexOf(t)},P9=e=>{let{containerId:t,isSorting:n,wasDragging:a,index:i,items:s,newIndex:c,previousItems:d,previousContainerId:h,transition:f}=e;return!f||!a||d!==s&&i===c?!1:n?!0:c!==i&&t===h},U9={duration:200,easing:"ease"},I2="transform",H9=Ts.Transition.toString({property:I2,duration:0,easing:"linear"}),B9={roleDescription:"sortable"};function F9(e){let{disabled:t,index:n,node:a,rect:i}=e;const[s,c]=y.useState(null),d=y.useRef(n);return Fa(()=>{if(!t&&n!==d.current&&a.current){const h=i.current;if(h){const f=ic(a.current,{ignoreTransform:!0}),g={x:h.left-f.left,y:h.top-f.top,scaleX:h.width/f.width,scaleY:h.height/f.height};(g.x||g.y)&&c(g)}}n!==d.current&&(d.current=n)},[t,n,a,i]),y.useEffect(()=>{s&&c(null)},[s]),s}function d0(e){let{animateLayoutChanges:t=P9,attributes:n,disabled:a,data:i,getNewIndex:s=z9,id:c,strategy:d,resizeObserverConfig:h,transition:f=U9}=e;const{items:g,containerId:m,activeIndex:b,disabled:x,disableTransforms:w,sortedRects:S,overIndex:E,useDragOverlay:T,strategy:C}=y.useContext(_2),M=V9(a,x),O=g.indexOf(c),D=y.useMemo(()=>({sortable:{containerId:m,index:O,items:g},...i}),[m,i,O,g]),k=y.useMemo(()=>g.slice(g.indexOf(c)),[g,c]),{rect:A,node:j,isOver:B,setNodeRef:G}=k9({id:c,data:D,disabled:M.droppable,resizeObserverConfig:{updateMeasurementsFor:k,...h}}),{active:K,activatorEvent:I,activeNodeRect:H,attributes:F,setNodeRef:Y,listeners:_,isDragging:L,over:z,setActivatorNodeRef:V,transform:Q}=M9({id:c,data:D,attributes:{...B9,...n},disabled:M.draggable}),P=hV(G,Y),q=!!K,X=q&&!w&&Gf(b)&&Gf(E),W=!T&&L,ce=W&&X?Q:null,de=X?ce??(d??C)({rects:S,activeNodeRect:H,activeIndex:b,overIndex:E,index:O}):null,ve=Gf(b)&&Gf(E)?s({id:c,items:g,activeIndex:b,overIndex:E}):O,Se=K==null?void 0:K.id,Me=y.useRef({activeId:Se,items:g,newIndex:ve,containerId:m}),ke=g!==Me.current.items,J=t({active:K,containerId:m,isDragging:L,isSorting:q,id:c,index:O,items:g,newIndex:Me.current.newIndex,previousItems:Me.current.items,previousContainerId:Me.current.containerId,transition:f,wasDragging:Me.current.activeId!=null}),ue=F9({disabled:!J,index:O,node:j,rect:A});return y.useEffect(()=>{q&&Me.current.newIndex!==ve&&(Me.current.newIndex=ve),m!==Me.current.containerId&&(Me.current.containerId=m),g!==Me.current.items&&(Me.current.items=g)},[q,ve,m,g]),y.useEffect(()=>{if(Se===Me.current.activeId)return;if(Se!=null&&Me.current.activeId==null){Me.current.activeId=Se;return}const De=setTimeout(()=>{Me.current.activeId=Se},50);return()=>clearTimeout(De)},[Se]),{active:K,activeIndex:b,attributes:F,data:D,rect:A,index:O,newIndex:ve,items:g,isOver:B,isSorting:q,isDragging:L,listeners:_,node:j,overIndex:E,over:z,setNodeRef:P,setActivatorNodeRef:V,setDroppableNodeRef:G,setDraggableNodeRef:Y,transform:ue??de,transition:pe()};function pe(){if(ue||ke&&Me.current.newIndex===O)return H9;if(!(W&&!r0(I)||!f)&&(q||J))return Ts.Transition.toString({...f,property:I2})}}function V9(e,t){var n,a;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(a=e==null?void 0:e.droppable)!=null?a:t.droppable}}function zh(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const Y9=[Qt.Down,Qt.Right,Qt.Up,Qt.Left],q9=(e,t)=>{let{context:{active:n,collisionRect:a,droppableRects:i,droppableContainers:s,over:c,scrollableAncestors:d}}=t;if(Y9.includes(e.code)){if(e.preventDefault(),!n||!a)return;const h=[];s.getEnabled().forEach(m=>{if(!m||m!=null&&m.disabled)return;const b=i.get(m.id);if(b)switch(e.code){case Qt.Down:a.top<b.top&&h.push(m);break;case Qt.Up:a.top>b.top&&h.push(m);break;case Qt.Left:a.left>b.left&&h.push(m);break;case Qt.Right:a.left<b.left&&h.push(m);break}});const f=NV({collisionRect:a,droppableRects:i,droppableContainers:h});let g=y2(f,"id");if(g===(c==null?void 0:c.id)&&f.length>1&&(g=f[1].id),g!=null){const m=s.get(n.id),b=s.get(g),x=b?i.get(b.id):null,w=b==null?void 0:b.node.current;if(w&&x&&m&&b){const E=dm(w).some((k,A)=>d[A]!==k),T=z2(m,b),C=$9(m,b),M=E||!T?{x:0,y:0}:{x:C?a.width-x.width:0,y:C?a.height-x.height:0},O={x:x.left,y:x.top};return M.x&&M.y?O:zu(O,M)}}}};function z2(e,t){return!zh(e)||!zh(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function $9(e,t){return!zh(e)||!zh(t)||!z2(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function K9(){const e=bs.getState().settings;return(e==null?void 0:e.siteName)||"tmex"}function WR(e){const t=e==null?void 0:e.trim();return t&&t.length>0?t:"?"}function G7({paneIdx:e,windowIdx:t,paneTitle:n,windowName:a,windowCustomName:i,deviceName:s}){const c=t??"?",d=e??"?",h=WR(i??n??a),f=WR(s);return`${c}/${d}: ${h}@${f}`}function f0(e){var d,h;const t=(d=e.customName)==null?void 0:d.trim(),n=e.panes.find(f=>f.active)??e.panes[0],a=e.name.trim(),i=(h=n==null?void 0:n.title)==null?void 0:h.trim(),s=t||i||a;return{title:s,processName:!!a&&a!==s?a:void 0}}function G9(e){const{title:t,processName:n}=f0(e);return n?`${n}: ${t}`:t}function X7(e){const t=K9();return e!=null&&e.trim()?`[${t}]${e}`:t}function W7(e){return e}function P2(e){return encodeURIComponent(e)}function U2({status:e}){return R.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 h0(){return OV(yy(O2,{activationConstraint:{distance:8}}),yy(M2,{activationConstraint:{delay:250,tolerance:5}}),yy(i0,{coordinateGetter:q9}))}function X9(){const{t:e}=gr(),t=Va(),n=Xv(),{isMobile:a,setOpenMobile:i}=Yr(),{toggleDevice:s}=HB(),c=es(oe=>oe.sessions),d=es(oe=>oe.activeSessionId),h=Fr(oe=>oe.setSidebarTab);y.useEffect(()=>{const oe=es.getState();oe.ensureInitialized(),oe.loadSessions()},[]);const f=Pl("/devices/:deviceId/windows/:windowId/panes/:paneId",t.pathname),g=f==null?void 0:f.params.deviceId,m=f==null?void 0:f.params.windowId,b=f==null?void 0:f.params.paneId,x=mn(oe=>oe.snapshots),w=mn(oe=>oe.connectedDevices),S=mn(oe=>oe.closeWindow),E=mn(oe=>oe.closePane),T=mn(oe=>oe.renameWindow),C=bs(oe=>{var xe;return((xe=oe.settings)==null?void 0:xe.language)??"en_US"}),{data:M}=Ku({queryKey:["devices"],queryFn:async()=>{const oe=await fetch("/api/devices");if(!oe.ok)throw new Error("Failed to fetch devices");return oe.json()},throwOnError:!1}),O=mn(oe=>oe.hydrateDeviceErrors);y.useEffect(()=>{M!=null&&M.devices&&O(M.devices.map(oe=>({deviceId:oe.id,lastError:oe.lastError??null,lastErrorType:oe.lastErrorType??null})))},[M,O]);const D=y.useCallback((oe,xe)=>{n(oe,{replace:(xe==null?void 0:xe.replace)??!0}),a&&!(xe!=null&&xe.keepSidebarOpen)&&i(!1)},[n,a,i]),k=y.useCallback((oe,xe,Ie,qe)=>{G.current=null,window.dispatchEvent(new CustomEvent("tmex:user-initiated-selection",{detail:{deviceId:oe,windowId:xe,paneId:Ie}})),D(`/devices/${oe}/windows/${xe}/panes/${P2(Ie)}`,{keepSidebarOpen:qe==null?void 0:qe.keepSidebarOpen})},[D]),A=y.useCallback(oe=>{var xe,Ie;if(es.getState().setActiveSession(oe.id),h("agent"),oe.deviceId&&oe.paneId){const qe=(Ie=(xe=mn.getState().snapshots[oe.deviceId])==null?void 0:xe.session)==null?void 0:Ie.windows,Ke=qe==null?void 0:qe.find(st=>st.panes.some(ze=>ze.id===oe.paneId));Ke&&k(oe.deviceId,Ke.id,oe.paneId,{keepSidebarOpen:!0})}},[h,k]),j=y.useCallback((oe,xe,Ie)=>{k(oe,xe,Ie.id,{keepSidebarOpen:!0}),es.getState().startDraft(oe,Ie.id,Ie.title??null),h("agent")},[k,h]),B=mn(oe=>oe.selectWindow),G=y.useRef(null);y.useEffect(()=>{var Je,ft;const oe=G.current;if(!oe)return;if(Date.now()-oe.at>5e3){G.current=null;return}const{deviceId:xe,windowId:Ie}=oe,qe=x[xe],Ke=(Je=qe==null?void 0:qe.session)==null?void 0:Je.windows;if(!Ke)return;const st=Ke.find(jt=>jt.id===Ie);if(!((ft=st==null?void 0:st.panes)!=null&&ft.length))return;G.current=null;const ze=st.panes.find(jt=>jt.active)??st.panes[0];k(xe,Ie,ze.id)},[x,k]);const K=y.useCallback((oe,xe,Ie)=>{B(oe,xe);const qe=Ie.find(Ke=>Ke.active)??Ie[0];qe?(k(oe,xe,qe.id),G.current=null):G.current={deviceId:oe,windowId:xe,at:Date.now()}},[k,B]),I=y.useCallback((oe,xe)=>{xe?oe===g&&D("/devices"):D(`/devices/${oe}`),s(oe,xe)},[s,g,D]),H=y.useCallback((oe,xe)=>{oe===g&&xe===m&&D("/devices"),S(oe,xe)},[S,g,m,D]),[F,Y]=y.useState(null),_=y.useCallback((oe,xe)=>{var Ke,st;const Ie=(st=(Ke=mn.getState().snapshots[oe])==null?void 0:Ke.session)==null?void 0:st.windows,qe=Ie==null?void 0:Ie.find(ze=>ze.id===xe);Y({kind:"window",deviceId:oe,windowId:xe,name:qe?G9(qe):""})},[]),L=y.useCallback((oe,xe,Ie)=>{var st,ze,Je,ft;const qe=(ze=(st=mn.getState().snapshots[oe])==null?void 0:st.session)==null?void 0:ze.windows,Ke=(ft=(Je=qe==null?void 0:qe.find(jt=>jt.id===xe))==null?void 0:Je.panes)==null?void 0:ft.find(jt=>jt.id===Ie);Y({kind:"pane",deviceId:oe,paneId:Ie,name:(Ke==null?void 0:Ke.title)||`Pane ${(Ke==null?void 0:Ke.index)??""}`})},[]),z=y.useCallback(()=>{F&&(F.kind==="window"?H(F.deviceId,F.windowId):E(F.deviceId,F.paneId),Y(null))},[F,H,E]),[V,Q]=y.useState(null),[P,q]=y.useState(""),X=y.useCallback((oe,xe)=>{var Ke,st;const Ie=(st=(Ke=mn.getState().snapshots[oe])==null?void 0:Ke.session)==null?void 0:st.windows,qe=Ie==null?void 0:Ie.find(ze=>ze.id===xe);qe&&(q(qe.customName??f0(qe).title),Q({deviceId:oe,windowId:xe,hasCustomName:!!qe.customName}))},[]),W=y.useCallback(()=>{if(!V)return;const oe=P.trim();oe&&(T(V.deviceId,V.windowId,oe),Q(null))},[V,P,T]),ce=y.useCallback(()=>{V&&(T(V.deviceId,V.windowId,""),Q(null))},[V,T]),ie=y.useCallback(oe=>{mn.getState().createWindow(oe)},[]),[de,ve]=y.useState(null),Se=y.useCallback((oe,xe)=>{ve({deviceId:oe,paneId:xe})},[]),[Me,ke]=y.useState(null),[J,ue]=y.useState(""),[pe,De]=y.useState(null),Ce=y.useCallback(oe=>{ue(oe.title),ke(oe)},[]),we=y.useCallback(()=>{if(!Me)return;const oe=J.trim();oe&&(es.getState().renameSession(Me.id,oe),ke(null))},[Me,J]),Te=y.useCallback(oe=>{De(oe)},[]),Z=y.useCallback(()=>{pe&&(es.getState().deleteSession(pe.id),De(null))},[pe]),be=$u(),ge=h0(),Pe=Cu({mutationFn:async oe=>{const xe=await fetch("/api/devices/order",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceIds:oe})});if(!xe.ok)throw new Error("Failed to reorder devices");return xe.json()},onMutate:async oe=>{await be.cancelQueries({queryKey:["devices"]});const xe=be.getQueryData(["devices"]);if(xe){const Ie=new Map(xe.devices.map(st=>[st.id,st])),qe=oe.map((st,ze)=>{const Je=Ie.get(st);return Je?{...Je,sortOrder:ze}:void 0}).filter(st=>st!==void 0),Ke=xe.devices.filter(st=>!oe.includes(st.id));be.setQueryData(["devices"],{devices:[...qe,...Ke]})}return{previous:xe}},onError:(oe,xe,Ie)=>{Ie!=null&&Ie.previous&&be.setQueryData(["devices"],Ie.previous),cn.error(e("device.reorderFailed"))},onSettled:()=>{be.invalidateQueries({queryKey:["devices"]})}}),Be=(M==null?void 0:M.devices)??[],Ae=y.useMemo(()=>[...Be].sort((oe,xe)=>oe.sortOrder-xe.sortOrder||oe.name.localeCompare(xe.name,CT(C),{numeric:!0,sensitivity:"base"})),[Be,C]),it=y.useCallback(oe=>{const{active:xe,over:Ie}=oe;if(!Ie||xe.id===Ie.id)return;const qe=Ae.map(ze=>ze.id),Ke=qe.indexOf(String(xe.id)),st=qe.indexOf(String(Ie.id));Ke<0||st<0||Pe.mutate(dd(qe,Ke,st))},[Ae,Pe]),{sessionsByPane:wt,orphanSessions:xt}=y.useMemo(()=>{const oe=new Set(Be.map(Ke=>Ke.id)),xe=new Map,Ie=[],qe=Object.values(c).filter(Ke=>!!Ke).sort((Ke,st)=>Ke.updatedAt<st.updatedAt?1:-1);for(const Ke of qe){if(!Ke.deviceId||!Ke.paneId||!oe.has(Ke.deviceId)){Ie.push(Ke);continue}const st=`${Ke.deviceId}:${Ke.paneId}`,ze=xe.get(st);ze?ze.push(Ke):xe.set(st,[Ke])}return{sessionsByPane:xe,orphanSessions:Ie}},[c,Be]);return R.jsxs(bM,{className:"flex flex-col flex-1 min-h-0 pt-0",children:[R.jsx(l0,{sensors:ge,collisionDetection:a0,onDragEnd:it,children:R.jsx(hF,{className:"flex-1 min-h-0",children:R.jsxs("div",{className:"space-y-1.5 pb-2 pt-1 select-none [-webkit-user-select:none] [-webkit-touch-callout:none]",children:[R.jsx(u0,{items:Ae.map(oe=>oe.id),strategy:c0,children:Ae.map(oe=>{var xe,Ie;return R.jsx(W9,{device:oe,windows:((Ie=(xe=x[oe.id])==null?void 0:xe.session)==null?void 0:Ie.windows)??null,isConnected:w.has(oe.id),isSelected:oe.id===g,selectedWindowId:m,selectedPaneId:b,onConnectToggle:()=>I(oe.id,w.has(oe.id)),onCreateWindow:ie,onCloseWindow:_,onClosePane:L,onRenameWindow:X,onPaneClick:k,onWindowClick:K,onWatchPane:Se,sessionsByPane:wt,activeSessionId:d,onSelectSession:A,onCreateSessionForPane:j,onRenameSession:Ce,onDeleteSession:Te},oe.id)})}),Ae.length===0&&R.jsx("div",{className:"text-center text-sm text-muted-foreground py-4",children:e("sidebar.noDevices")}),xt.length>0&&R.jsx(J9,{sessions:xt,activeSessionId:d,onSelectSession:A,onRenameSession:Ce,onDeleteSession:Te})]})})}),R.jsx(dv,{open:F!==null,onOpenChange:oe=>!oe&&Y(null),children:R.jsxs(fv,{children:[R.jsxs(hv,{children:[R.jsx(xR,{className:"bg-destructive/10",children:R.jsx(Hl,{className:"h-5 w-5 text-destructive"})}),R.jsx(pv,{children:(F==null?void 0:F.kind)==="pane"?e("window.closePaneConfirmTitle"):e("window.closeConfirmTitle")}),R.jsx(gv,{children:e("window.closeConfirmDesc",{name:(F==null?void 0:F.name)??""})})]}),R.jsxs(mv,{children:[R.jsx(vv,{children:e("common.cancel")}),R.jsx(yv,{variant:"destructive",disabled:!F,onClick:z,children:e("common.close")})]})]})}),R.jsx(bv,{open:V!==null,onOpenChange:oe=>!oe&&Q(null),children:R.jsx(xv,{"data-testid":"window-rename-dialog",children:R.jsxs("form",{onSubmit:oe=>{oe.preventDefault(),W()},children:[R.jsxs(wv,{children:[R.jsx(Sv,{children:e("window.rename")}),R.jsx(IM,{children:e("window.renameDesc")})]}),R.jsx("div",{className:"py-4",children:R.jsx(ya,{autoFocus:!0,maxLength:64,value:P,onChange:oe=>q(oe.target.value),placeholder:e("window.renamePlaceholder"),"data-testid":"window-rename-input"})}),R.jsxs(wR,{children:[(V==null?void 0:V.hasCustomName)&&R.jsx(Rn,{type:"button",variant:"ghost",onClick:ce,"data-testid":"window-rename-reset",children:e("window.renameReset")}),R.jsx(Rn,{type:"button",variant:"outline",onClick:()=>Q(null),children:e("common.cancel")}),R.jsx(Rn,{type:"submit",disabled:!P.trim(),"data-testid":"window-rename-save",children:e("common.save")})]})]})})}),R.jsx(bv,{open:Me!==null,onOpenChange:oe=>!oe&&ke(null),children:R.jsx(xv,{"data-testid":"agent-session-rename-dialog",children:R.jsxs("form",{onSubmit:oe=>{oe.preventDefault(),we()},children:[R.jsx(wv,{children:R.jsx(Sv,{children:e("agent.session.renameTitle")})}),R.jsx("div",{className:"py-4",children:R.jsx(ya,{autoFocus:!0,maxLength:120,value:J,onChange:oe=>ue(oe.target.value),placeholder:e("agent.session.renamePlaceholder"),"data-testid":"agent-session-rename-input"})}),R.jsxs(wR,{children:[R.jsx(Rn,{type:"button",variant:"outline",onClick:()=>ke(null),children:e("agent.session.cancel")}),R.jsx(Rn,{type:"submit",disabled:!J.trim(),"data-testid":"agent-session-rename-save",children:e("agent.session.save")})]})]})})}),R.jsx(dv,{open:pe!==null,onOpenChange:oe=>!oe&&De(null),children:R.jsxs(fv,{children:[R.jsxs(hv,{children:[R.jsx(xR,{className:"bg-destructive/10",children:R.jsx(Hl,{className:"h-5 w-5 text-destructive"})}),R.jsx(pv,{children:e("agent.session.deleteTitle")}),R.jsx(gv,{children:e("agent.session.deleteDesc",{title:(pe==null?void 0:pe.title)??""})})]}),R.jsxs(mv,{children:[R.jsx(vv,{children:e("common.cancel")}),R.jsx(yv,{variant:"destructive",disabled:!pe,onClick:Z,"data-testid":"agent-session-delete-confirm",children:e("agent.session.deleteConfirm")})]})]})}),de&&R.jsx(aV,{open:!0,onOpenChange:oe=>!oe&&ve(null),deviceId:de.deviceId,paneId:de.paneId})]})}function W9({device:e,windows:t,isConnected:n,isSelected:a,selectedWindowId:i,selectedPaneId:s,onConnectToggle:c,onCreateWindow:d,onCloseWindow:h,onClosePane:f,onRenameWindow:g,onPaneClick:m,onWindowClick:b,onWatchPane:x,sessionsByPane:w,activeSessionId:S,onSelectSession:E,onCreateSessionForPane:T,onRenameSession:C,onDeleteSession:M}){const{t:O}=gr(),D=e.type==="local"?CC:gP,{attributes:k,listeners:A,setNodeRef:j,setActivatorNodeRef:B,transform:G,transition:K,isDragging:I}=d0({id:e.id}),H=h0(),F=Y=>{const{active:_,over:L}=Y;if(!L||_.id===L.id||!t)return;const z=t.map(P=>P.id),V=z.indexOf(String(_.id)),Q=z.indexOf(String(L.id));V<0||Q<0||mn.getState().reorderWindows(e.id,dd(z,V,Q))};return R.jsxs("div",{ref:j,style:{transform:Ts.Translate.toString(G),transition:K},"data-testid":`device-item-${e.id}`,className:Le("group/device rounded-xl border border-border/60 overflow-hidden",a?"bg-chat-surface":n?"bg-muted/40":"bg-muted/20",I&&"opacity-60 shadow-lg"),onClick:n?void 0:c,children:[R.jsxs("div",{className:"relative px-3 py-1.5",children:[a&&R.jsx("span",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-muted-foreground/70"}),R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx("button",{type:"button",ref:B,...k,...A,"aria-label":O("device.dragHandle"),onClick:Y=>Y.stopPropagation(),className:"touch-none cursor-grab shrink-0 -ml-1 text-muted-foreground/50 hover:text-muted-foreground opacity-100",children:R.jsx(rb,{className:"h-3.5 w-3.5 [@media(any-pointer:coarse)]:h-5 [@media(any-pointer:coarse)]:w-5"})}),R.jsx(D,{className:"h-4 w-4 text-muted-foreground shrink-0"}),R.jsx("span",{className:"flex-1 truncate text-xs font-medium",children:e.name}),R.jsx(E8,{deviceId:e.id,className:"shrink-0"}),R.jsx("div",{className:Le("h-2 w-2 rounded-full shrink-0",n?"bg-emerald-500":"bg-gray-400")}),R.jsx(Rn,{variant:"ghost",size:"icon-xs",onClick:Y=>{Y.stopPropagation(),c()},"data-testid":n?`device-disconnect-${e.id}`:`device-connect-${e.id}`,title:O(n?"device.disconnect":"device.connect"),children:n?R.jsx(jP,{className:"h-3.5 w-3.5 text-orange-500"}):R.jsx(_P,{className:"h-3.5 w-3.5 text-emerald-500"})})]})]}),n&&R.jsxs("div",{className:"p-1.5 space-y-1.5 [@media(any-pointer:coarse)]:space-y-2",children:[!t&&R.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1.5 text-center",children:O("device.connecting")}),(t==null?void 0:t.length)===0&&R.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1.5 text-center",children:O("window.noWindows")}),t&&t.length>0&&R.jsx(l0,{sensors:H,collisionDetection:a0,onDragEnd:F,children:R.jsx(u0,{items:t.map(Y=>Y.id),strategy:c0,children:t.map(Y=>R.jsx(Q9,{deviceId:e.id,window:Y,isSelected:Y.id===i,selectedPaneId:s,onPaneClick:m,onWindowClick:b,onCloseWindow:h,onClosePane:f,onRenameWindow:g,onWatchPane:x,sessionsByPane:w,activeSessionId:S,onSelectSession:E,onCreateSessionForPane:T,onRenameSession:C,onDeleteSession:M},Y.id))})}),R.jsxs("button",{type:"button","data-testid":`window-create-${e.id}`,onPointerDown:Y=>Y.stopPropagation(),onMouseDown:Y=>Y.stopPropagation(),onClick:()=>d(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:[R.jsx(ob,{className:"h-3.5 w-3.5 shrink-0"}),R.jsx("span",{className:"text-xs",children:O("window.new")})]})]})]})}function Q9({deviceId:e,window:t,isSelected:n,selectedPaneId:a,onPaneClick:i,onWindowClick:s,onCloseWindow:c,onClosePane:d,onRenameWindow:h,onWatchPane:f,sessionsByPane:g,activeSessionId:m,onSelectSession:b,onCreateSessionForPane:x,onRenameSession:w,onDeleteSession:S}){const{t:E}=gr(),{isMobile:T}=Yr(),C=t.panes.length>1,M=f0(t),O=t.panes.find(L=>L.active)??t.panes[0],D=O==null?void 0:O.currentPath,k=t.panes.find(L=>L.id===a),A=n&&!!k,{attributes:j,listeners:B,setNodeRef:G,setActivatorNodeRef:K,transform:I,transition:H,isDragging:F}=d0({id:t.id}),Y=h0(),_=L=>{const{active:z,over:V}=L;if(!V||z.id===V.id)return;const Q=t.panes.map(X=>X.id),P=Q.indexOf(String(z.id)),q=Q.indexOf(String(V.id));P<0||q<0||mn.getState().reorderPanes(e,t.id,dd(Q,P,q))};return R.jsxs("div",{ref:G,style:{transform:Ts.Translate.toString(I),transition:H},className:Le("space-y-1",F&&"opacity-60"),children:[R.jsxs("div",{className:"group relative flex items-center gap-1",children:[R.jsx("button",{type:"button",ref:K,...j,...B,"aria-label":E("window.dragHandle"),onClick:L=>L.stopPropagation(),className:Le("touch-none cursor-grab shrink-0 flex items-center justify-center text-muted-foreground/50 hover:text-muted-foreground opacity-100",T?"h-9 w-4":"h-6 w-3.5 [@media(any-pointer:coarse)]:h-9 [@media(any-pointer:coarse)]:w-4"),children:R.jsx(rb,{className:Le(T?"h-4 w-4":"h-3.5 w-3.5")})}),R.jsxs("button",{type:"button",onClick:()=>s(e,t.id,t.panes),"data-testid":`window-item-${t.id}`,className:Le("flex-1 min-w-0 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",T&&"py-2.5 pr-13",A?"bg-primary/10 text-primary":t.active?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-foreground"),children:[R.jsx($l,{variant:A?"default":"outline",className:"h-5 text-[10px] px-1.5 shrink-0",children:t.index}),R.jsxs("span",{className:"flex-1 min-w-0",children:[R.jsx("span",{className:"font-mono text-[11px] leading-tight font-medium line-clamp-2 [overflow-wrap:break-word]",children:M.title}),M.processName&&R.jsx("span",{className:"font-mono text-[10.5px] leading-tight text-muted-foreground line-clamp-1 break-all",children:D?`${M.processName}@${D}`:M.processName})]})]}),R.jsxs(Gb,{children:[R.jsx(Xb,{"data-testid":`window-menu-${t.id}`,"aria-label":E("window.menu"),title:E("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",T?"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",A?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),children:R.jsx(RC,{className:Le(T?"h-5 w-5":"h-3.5 w-3.5 [@media(any-pointer:coarse)]:h-4.5 [@media(any-pointer:coarse)]:w-4.5")})}),R.jsxs(Wb,{align:"end",backdrop:!0,className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:[R.jsxs(pi,{"data-testid":`window-menu-rename-${t.id}`,className:Le("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",T&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>h(e,t.id),children:[R.jsx(ab,{className:Le("h-4 w-4",T&&"h-5 w-5")}),E("window.rename")]}),R.jsxs(pi,{"data-testid":`window-menu-new-session-${t.id}`,className:Le("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",T&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>x(e,t.id,k||t.panes[0]),children:[R.jsx(ob,{className:Le("h-4 w-4",T&&"h-5 w-5")}),E("agent.session.new")]}),D&&R.jsxs(pi,{className:Le("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",T&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>mn.getState().createWindow(e,void 0,D),children:[R.jsx(TC,{className:Le("h-4 w-4",T&&"h-5 w-5")}),E("window.newInCwd")]}),R.jsxs(pi,{variant:"destructive","data-testid":`window-menu-close-${t.id}`,className:Le("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",T&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>c(e,t.id),children:[R.jsx(Hl,{className:Le("h-4 w-4",T&&"h-5 w-5")}),E("window.close")]})]})]})]}),C&&R.jsx("div",{className:"ml-4 pl-2 border-l border-border/50 space-y-1 [@media(any-pointer:coarse)]:space-y-1.5",children:R.jsx(l0,{sensors:Y,collisionDetection:a0,onDragEnd:_,children:R.jsx(u0,{items:t.panes.map(L=>L.id),strategy:c0,children:t.panes.map(L=>R.jsx(Z9,{deviceId:e,windowId:t.id,pane:L,isActive:L.id===a,isMobile:T,onPaneClick:i,onClosePane:d,onWatchPane:f,sessions:g.get(`${e}:${L.id}`),activeSessionId:m,onSelectSession:b,onRenameSession:w,onDeleteSession:S},L.id))})})}),!C&&t.panes[0]&&R.jsx("div",{className:"ml-[36px] pl-2 border-l border-border/50",children:R.jsx(B2,{sessions:g.get(`${e}:${t.panes[0].id}`),activeSessionId:m,onSelectSession:b,onRenameSession:w,onDeleteSession:S})})]})}function Z9({deviceId:e,windowId:t,pane:n,isActive:a,isMobile:i,onPaneClick:s,onClosePane:c,onWatchPane:d,sessions:h,activeSessionId:f,onSelectSession:g,onRenameSession:m,onDeleteSession:b}){const{t:x}=gr(),{attributes:w,listeners:S,setNodeRef:E,setActivatorNodeRef:T,transform:C,transition:M,isDragging:O}=d0({id:n.id});return R.jsxs("div",{ref:E,style:{transform:Ts.Translate.toString(C),transition:M},className:Le("group relative",O&&"opacity-60"),children:[R.jsxs("div",{className:"flex items-center gap-1",children:[R.jsx("button",{type:"button",ref:T,...w,...S,"aria-label":x("window.dragHandlePane"),onClick:D=>D.stopPropagation(),className:Le("touch-none cursor-grab shrink-0 flex items-center justify-center text-muted-foreground/50 hover:text-muted-foreground opacity-100",i?"h-9 w-4":"h-6 w-3 [@media(any-pointer:coarse)]:h-9 [@media(any-pointer:coarse)]:w-4"),children:R.jsx(rb,{className:Le(i?"h-4 w-4":"h-3 w-3")})}),R.jsxs("button",{type:"button",onClick:()=>s(e,t,n.id),"data-testid":`pane-item-${n.id}`,className:Le("flex-1 min-w-0 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",i&&"py-2.5 pr-24",a?"bg-primary/10 text-primary":n.active?"bg-accent text-accent-foreground":"hover:bg-accent/30 text-muted-foreground"),children:[R.jsx("span",{className:"text-[10px] font-mono opacity-60 w-4",children:n.index}),R.jsx("span",{className:"flex-1 text-xs line-clamp-2 break-all",children:n.title||`Pane ${n.index}`})]})]}),R.jsxs(Gb,{children:[R.jsx(Xb,{"data-testid":`pane-menu-${n.id}`,"aria-label":x("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",i?"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",a?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),children:R.jsx(RC,{className:Le(i?"h-5 w-5":"h-3.5 w-3.5")})}),R.jsxs(Wb,{align:"end",backdrop:!0,className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:[n.currentPath&&R.jsxs(pi,{className:Le("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",i&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>mn.getState().createWindow(e,void 0,n.currentPath),children:[R.jsx(TC,{className:Le("h-4 w-4",i&&"h-5 w-5")}),x("window.newInCwd")]}),R.jsxs(pi,{"data-testid":`pane-watch-${n.id}`,className:Le("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",i&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>d(e,n.id),children:[R.jsx(zP,{className:Le("h-4 w-4",i&&"h-5 w-5")}),x("watch.openMonitor")]})]})]}),R.jsx("button",{type:"button",onClick:D=>{D.stopPropagation(),c(e,t,n.id)},"data-testid":`pane-close-${n.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",i?"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",a?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),title:x("window.closePane"),children:R.jsx("span",{className:Le("leading-none",i?"text-base":"text-xs"),children:"×"})}),R.jsx(B2,{sessions:h,activeSessionId:f,onSelectSession:g,onRenameSession:m,onDeleteSession:b})]})}function H2({session:e,onRenameSession:t,onDeleteSession:n,className:a,enlargeOnTouch:i=!1}){const{t:s}=gr(),{isMobile:c}=Yr(),d=i&&c;return R.jsxs(Gb,{children:[R.jsx(Xb,{render:R.jsx(Rn,{variant:"ghost",size:"icon-sm","data-testid":`agent-session-menu-${e.id}`,"aria-label":s("agent.session.rename"),onClick:h=>h.stopPropagation(),className:Le("size-5 shrink-0 text-muted-foreground transition-opacity data-popup-open:opacity-100",c?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100",d&&"size-9",a)}),children:R.jsx(dP,{className:Le("size-3.5",d&&"size-5")})}),R.jsxs(Wb,{align:"end",backdrop:!0,className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:[R.jsxs(pi,{"data-testid":"agent-session-rename",className:Le("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",c&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>t(e),children:[R.jsx(ab,{className:Le("h-4 w-4",c&&"h-5 w-5")}),s("agent.session.rename")]}),R.jsxs(pi,{variant:"destructive","data-testid":"agent-session-delete",className:Le("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",c&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>n(e),children:[R.jsx(MC,{className:Le("h-4 w-4",c&&"h-5 w-5")}),s("agent.session.delete")]})]})]})}function B2({sessions:e,activeSessionId:t,onSelectSession:n,onRenameSession:a,onDeleteSession:i}){const{isMobile:s}=Yr();return R.jsx("div",{className:"mt-1 space-y-0.5 [@media(any-pointer:coarse)]:space-y-1",children:e==null?void 0:e.map(c=>{const d=c.id===t;return R.jsxs("div",{className:"group relative",children:[R.jsxs("button",{type:"button","data-testid":`agent-session-item-${c.id}`,onClick:()=>n(c),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",s&&"min-h-11 py-2 pr-12",d?"bg-primary/10 text-primary":"hover:bg-accent/30 text-muted-foreground"),children:[R.jsx(nb,{className:"size-3 shrink-0 opacity-70"}),R.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px]",children:c.title}),R.jsx(U2,{status:c.status})]}),R.jsx("div",{className:"absolute right-0.5 top-1/2 -translate-y-1/2",children:R.jsx(H2,{session:c,onRenameSession:a,onDeleteSession:i,enlargeOnTouch:!0})})]},c.id)})})}function J9({sessions:e,activeSessionId:t,onSelectSession:n,onRenameSession:a,onDeleteSession:i}){const{t:s}=gr(),[c,d]=y.useState(!1),h=bs(f=>{var g;return((g=f.settings)==null?void 0:g.language)??"en_US"});return R.jsxs(jM,{open:c,onOpenChange:d,className:"rounded-xl border border-border/60 bg-muted/20",children:[R.jsxs(LM,{"data-testid":"agent-orphan-sessions-trigger",className:"flex w-full items-center gap-2 px-3 py-1.5 text-left",children:[R.jsx(bP,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),R.jsx("span",{className:"flex-1 truncate text-xs font-medium text-muted-foreground",children:s("agent.orphan.title",{count:e.length})}),R.jsx(EC,{className:Le("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform",c&&"rotate-90")})]}),R.jsx(_M,{className:"space-y-0.5 px-1.5 pb-1.5",children:e.map(f=>{const g=f.id===t,m=[f.originPaneTitle,f.originProcessName,f.createdAt?new Date(f.createdAt).toLocaleString(CT(h)):null].filter(b=>!!b);return R.jsxs("div",{className:"group relative",children:[R.jsxs("button",{type:"button","data-testid":`agent-orphan-session-${f.id}`,onClick:()=>n(f),className:Le("w-full flex flex-col gap-0.5 px-2 py-1.5 pr-7 rounded-lg text-left transition-colors",g?"bg-primary/10 text-primary":"hover:bg-accent/30"),children:[R.jsxs("span",{className:"flex items-center gap-1.5",children:[R.jsx(nb,{className:"size-3 shrink-0 opacity-70"}),R.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px]",children:f.title}),R.jsx(U2,{status:f.status})]}),m.length>0&&R.jsx("span",{className:"truncate pl-[18px] text-[10px] text-muted-foreground",children:m.join(" · ")})]}),R.jsx("div",{className:"absolute right-0.5 top-1.5",children:R.jsx(H2,{session:f,onRenameSession:a,onDeleteSession:i})})]},f.id)})})]})}function e7(){const{t:e}=gr(),{isMobile:t,setOpenMobile:n}=Yr(),a=bs(g=>{var m;return(m=g.settings)==null?void 0:m.siteName}),i=bs(g=>g.fetchSettings);y.useEffect(()=>{i()},[i]);const s=a??"tmex",c=Fr(g=>g.theme),d=Fr(g=>g.setTheme),h=c==="dark",f=()=>{const g=h?"light":"dark";d(g),document.documentElement.classList.toggle("dark",g==="dark")};return R.jsxs("div",{className:"flex items-center gap-2 px-2",children:[t&&R.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:R.jsx(Hl,{className:"h-4 w-4"})}),R.jsxs(Ah,{to:"/",className:"flex flex-1 items-center gap-3 overflow-hidden",children:[R.jsx("div",{className:"h-8 w-8 shrink-0 overflow-hidden rounded-lg border-2 border-black",children:R.jsx("img",{src:"/logo.png",alt:s,className:"h-full w-full object-cover"})}),R.jsx("span",{className:"truncate text-sm font-semibold tracking-tight",children:s})]}),R.jsx(t7,{}),R.jsx("button",{type:"button",onClick:f,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(h?"settings.themeLight":"settings.themeDark"),title:e(h?"settings.themeLight":"settings.themeDark"),children:h?R.jsx(YP,{className:"h-4 w-4"}):R.jsx(TP,{className:"h-4 w-4"})}),R.jsx(Ah,{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:R.jsx(HP,{className:"h-4 w-4"})})]})}function t7(){const e=mn(n=>n.wsLatencyMs);if(e===null)return null;const t=e>=200;return R.jsxs("span",{className:`inline-flex h-8 shrink-0 items-center text-xs tabular-nums ${t?"text-orange-400":"text-muted-foreground"}`,children:[e,"ms"]})}const n7=y.lazy(()=>So(()=>import("./agent-tab-DRxXq67W.js"),__vite__mapDeps([0,1,2,3])).then(e=>({default:e.AgentTab}))),r7=y.lazy(()=>So(()=>import("./files-tab-CozXv_f8.js"),__vite__mapDeps([4,5,6,7,8,9])).then(e=>({default:e.FilesTab}))),wy="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]",a7=[{title:"nav.manageDevices",url:"/devices",icon:CC}];function o7({...e}){const{t}=gr(),n=Fr(i=>i.sidebarTab),a=Fr(i=>i.setSidebarTab);return R.jsxs(RB,{variant:"inset",...e,children:[R.jsx("div",{className:"h-[var(--tmex-safe-area-top)]"}),R.jsxs(MB,{className:"gap-5 pt-3 pb-0",children:[R.jsx(e7,{}),R.jsx(o8,{className:"mb-2.5",value:n,onValueChange:i=>a(i),children:R.jsxs(s8,{className:"w-full p-1 rounded-xl border border-border/60 group-data-horizontal/tabs:h-11",children:[R.jsxs(cy,{value:"panes","data-testid":"sidebar-tab-panes",className:wy,children:[R.jsx(NP,{}),t("sidebar.tab.panes")]}),R.jsxs(cy,{value:"agent","data-testid":"sidebar-tab-agent",className:wy,children:[R.jsx(nb,{}),t("sidebar.tab.agent")]}),R.jsxs(cy,{value:"files","data-testid":"sidebar-tab-files",className:wy,children:[R.jsx(hP,{}),t("sidebar.tab.files")]})]})})]}),R.jsxs(AB,{className:"flex min-h-0 flex-col overflow-hidden",children:[n==="panes"&&R.jsx(X9,{}),n==="agent"&&R.jsx(y.Suspense,{fallback:null,children:R.jsx(n7,{})}),n==="files"&&R.jsx(y.Suspense,{fallback:null,children:R.jsx(r7,{})})]}),n==="panes"&&R.jsxs(NB,{children:[R.jsx(x8,{items:a7}),R.jsx("div",{className:"h-[var(--tmex-safe-area-bottom)]"})]})]})}let QR=!1;function i7(e,t,n){var i,s,c;let a=n;if(!a){const d=(s=(i=mn.getState().snapshots[e])==null?void 0:i.session)==null?void 0:s.windows;a=(c=d==null?void 0:d.find(h=>h.panes.some(f=>f.id===t)))==null?void 0:c.id}return a?`/devices/${e}/windows/${a}/panes/${P2(t)}`:`/devices/${e}`}function s7(e,t){const n=e.getQueriesData({queryKey:["watch-rules"]});for(const[,a]of n){const i=a==null?void 0:a.find(s=>s.id===t);if(i)return i.name}return null}async function l7(e,t){var a;const n=s7(e,t);if(n)return n;try{const i=await fetch(`/api/watch/rules/${t}`);return i.ok?((a=(await i.json()).rule)==null?void 0:a.name)??null:null}catch{return null}}function c7(e,t,n){if(!(typeof Notification>"u"||Notification.permission!=="granted"))try{const a=new Notification(e,{body:t});a.onclick=()=>{window.focus(),gh(n)}}catch{}}function u7(e,t){e.invalidateQueries({queryKey:["watch-rules"]}),e.invalidateQueries({queryKey:["watch-rule-state",t]})}async function d7(e,t,n,a,i){const c=await l7(e,t)??qt.t("watch.toast.triggeredTitle"),d=i.summary||i.matchedText||"",h=d.length>200?`${d.slice(0,200)}…`:d,f=i7(n,a,i.windowId);cn(c,{description:h,action:{label:qt.t("watch.toast.openTerminal"),onClick:()=>{gh(f)}}}),c7(c,h,f)}function f7(e){if(QR)return;QR=!0,Sn().onMessage(n=>{if(n.kind!==Ck)return;let a;try{a=Aa(Lj,n.payload)}catch(s){console.error("[watch] failed to decode WATCH_EVENT:",s);return}let i;try{i=JSON.parse(new TextDecoder().decode(a.payload))}catch(s){console.error("[watch] failed to parse WATCH_EVENT payload:",s);return}switch(u7(e,a.ruleId),a.eventType){case Hk:d7(e,a.ruleId,a.deviceId,a.paneId,i);return;case Bk:{const s=i;cn.warning(qt.t("watch.toast.modelUnavailableTitle"),{description:`${s.message} ${qt.t("watch.toast.modelUnavailableHint")}`});return}case Fk:{const s=i;cn.error(qt.t("watch.toast.ruleErrorTitle"),{description:s.message});return}default:return}})}function h7(){const e=$u(),t=mn(n=>n.ensureSocketConnected);return y.useEffect(()=>{f7(e),t()},[e,t]),null}let Uu=null;function Q7(e){Uu=e}function Z7(e){Uu===e&&(Uu=null)}function m7(){return Uu?Uu():null}const p7=60,g7=.02;function y7(e){if(Math.abs(e.viewportScale-1)>g7)return 0;const t=Math.round(e.windowInnerHeight-e.viewportHeight-e.viewportOffsetTop);return t>=p7?t:0}function v7(e){const t=e.windowInnerHeight-e.inset,a=e.cursorBottomClientY+e.appliedOffset+e.margin-t,i=e.maxOffset??e.inset;return Math.min(Math.max(0,Math.round(a)),i)}function J7(){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 b7(){return typeof window>"u"||typeof navigator>"u"?!1:"ontouchstart"in window||navigator.maxTouchPoints>0}const Wf={strategy:"none"},x7=8,w7=60,S7='[data-slot="sidebar-inset"]',ZR=".terminal-shortcuts-strip",JR="--tmex-kb-shortcut-lift";function E7(e,t){return e.strategy!==t.strategy?!1:e.strategy==="transform"&&t.strategy==="transform"?Math.abs(e.offset-t.offset)<1:e.strategy==="height"&&t.strategy==="height"?Math.abs(e.height-t.height)<1:!0}function R7(e,t){const[n,a]=y.useState(Wf);return y.useEffect(()=>{if(!b7())return;const i=window.visualViewport;if(!i)return;let s=null,c=null,d=Wf,h=null,f=0;const g=D=>{E7(d,D)||(d=D,a(D))},m=()=>{if((!h||!h.isConnected)&&(h=document.querySelector(S7)),!h)return 0;const D=window.getComputedStyle(h).transform;if(!D||D==="none")return 0;try{return-new DOMMatrix(D).m42}catch{return 0}},b=D=>{f=Math.round(D),document.documentElement.style.setProperty(JR,`${f}px`)},x=D=>{const k=document.querySelector(ZR);if(!k){b(0);return}const A=k.getBoundingClientRect().bottom,j=window.innerHeight-D;b(f+(A-j))},w=()=>{const D=document.querySelector(ZR);return D?D.offsetHeight:0},S=()=>{if(e)return 0;const D=document.activeElement;return D instanceof Element&&D.closest("[data-virtual-keyboard-avoid]")!==null?y7({windowInnerHeight:window.innerHeight,viewportHeight:i.height,viewportOffsetTop:i.offsetTop,viewportScale:i.scale}):0},E=()=>{const D=S();if(D<=0){b(0),g(Wf),M();return}if(t==="resize"){b(0);const k=window.innerHeight-D;k>=w7?g({strategy:"height",height:k}):g({strategy:"transform",offset:D}),M();return}if(t==="follow"){const k=m7();if(k){const A=w(),j=v7({cursorBottomClientY:k.bottom,appliedOffset:m(),windowInnerHeight:window.innerHeight,inset:D,margin:x7+A,maxOffset:D+A});g(j>0?{strategy:"transform",offset:j}:Wf),x(D)}else b(0),g({strategy:"transform",offset:D});C();return}b(0),g({strategy:"transform",offset:D}),M()},T=()=>{c=null,E()},C=()=>{c===null&&(c=window.requestAnimationFrame(T))},M=()=>{c!==null&&(window.cancelAnimationFrame(c),c=null)},O=()=>{s===null&&(s=window.requestAnimationFrame(()=>{s=null,E()}))};return E(),i.addEventListener("resize",O),i.addEventListener("scroll",O),window.addEventListener("resize",O),document.addEventListener("focusin",O),document.addEventListener("focusout",O),()=>{i.removeEventListener("resize",O),i.removeEventListener("scroll",O),window.removeEventListener("resize",O),document.removeEventListener("focusin",O),document.removeEventListener("focusout",O),s!==null&&window.cancelAnimationFrame(s),M(),document.documentElement.style.removeProperty(JR)}},[e,t]),n}const F2="NotoSansSymbols2Tmex";function V2(e){return Vg.find(t=>t.id===e)??Vg.find(t=>t.id===vC)??Vg[0]}function T7(e){return`${V2(e).cssFamily}, ${F2}, monospace`}const eT=new Set;function C7(e){const t=globalThis.document;if(!t||!e.files||eT.has(e.cssFamily))return;const n=t.createElement("style");n.dataset.tmexFont=e.id,n.textContent=`@font-face{font-family:${e.cssFamily};src:url("${e.files.regular}") format("woff2");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:${e.cssFamily};src:url("${e.files.bold}") format("woff2");font-weight:700;font-style:normal;font-display:swap}`,t.head.appendChild(n),eT.add(e.cssFamily)}async function O7(e,t){var i;const n=(i=globalThis.document)==null?void 0:i.fonts;if(!(n!=null&&n.load))return;const a=V2(e);a.isDefault||C7(a);try{await Promise.all([a.cssFamily,F2].flatMap(s=>[n.load(`${t}px ${s}`),n.load(`bold ${t}px ${s}`)]))}catch{}}function M7(){const e=Fr(n=>n.terminalFontId),t=Fr(n=>n.terminalFontSize);y.useEffect(()=>{O7(e,t);const n=globalThis.document;n==null||n.documentElement.style.setProperty("--font-mono",T7(e))},[e,t])}console.info(`tmex ${BD("0.15.2",!0)}`);function N7(){var e;try{const t=localStorage.getItem("tmex-ui");if(!t){document.documentElement.classList.add("dark");return}const n=JSON.parse(t),a=(e=n==null?void 0:n.state)==null?void 0:e.theme,i=a==="dark"||a===void 0;document.documentElement.classList.toggle("dark",i)}catch{document.documentElement.classList.add("dark")}}N7();const A7=new OD({defaultOptions:{queries:{staleTime:5e3,retry:1}}});function D7(){const{openMobile:e}=Yr(),t=Fr(n=>n.theme);return y.useEffect(()=>{const n=e?"--sidebar":"--background";document.body.style.backgroundColor=`var(${n})`,requestAnimationFrame(()=>{var s;const i=getComputedStyle(document.body).backgroundColor;(s=document.querySelector('meta[name="theme-color"]'))==null||s.setAttribute("content",i)})},[e,t]),null}function k7(){const e=Fr(t=>t.theme);return R.jsx(fz,{theme:e,richColors:!0,position:"top-right",closeButton:!0,offset:{top:"calc(16px + env(safe-area-inset-top, 0px))",right:"16px",bottom:"16px",left:"16px"},mobileOffset:{top:"calc(12px + env(safe-area-inset-top, 0px))",right:"12px",bottom:"12px",left:"12px"},toastOptions:{duration:6e3}})}function j7(){return M7(),R.jsxs(BB,{children:[R.jsx(h7,{}),R.jsxs(EB,{children:[R.jsx(D7,{}),R.jsx(UB,{}),R.jsx(o7,{}),R.jsx(L7,{})]})]})}function L7(){const{openMobile:e}=Yr(),t=Fr(s=>s.keyboardBehaviorMode),n=R7(e,t),a=n.strategy!=="none",i=n.strategy==="transform"?{transform:`translateY(-${n.offset}px)`,transition:t==="follow"?void 0:"transform 0.12s ease-out"}:n.strategy==="height"?{height:`${n.height}px`,transition:"height 0.12s ease-out"}:void 0;return R.jsxs(OB,{className:"h-dvh overflow-hidden md:h-[calc(100dvh-1rem)]",style:i,children:[R.jsx(nI,{}),R.jsx("div",{style:{height:a?0:"var(--tmex-safe-area-bottom)",transition:"height 0.12s ease-out"}})]})}function ul({moduleLoader:e}){const[t,n]=y.useState(null),a=L_();y.useEffect(()=>{e().then(n)},[e]);const i=t==null?void 0:t.default,s=t==null?void 0:t.PageTitle,c=t==null?void 0:t.PageActions;return R.jsxs(R.Fragment,{children:[R.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:[R.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-4",children:[R.jsx(CB,{className:"-ml-1 shrink-0","data-testid":"mobile-sidebar-open"}),R.jsx(xU,{orientation:"vertical",className:"mr-2 shrink-0 data-[orientation=vertical]:h-4"}),R.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:s?R.jsx(s,{...a}):""})]}),R.jsx("div",{className:"flex shrink-0 items-center gap-1 px-4",children:c&&R.jsx(c,{...a})})]}),R.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-4 !pt-0 p-2 md:p-4",children:R.jsx("div",{className:"bg-muted/50 min-h-0 flex-1 overflow-auto overscroll-auto rounded-xl [-webkit-overflow-scrolling:touch]",children:i?R.jsx(i,{}):null})})]})}const _7=()=>So(()=>import("./SettingsPage-BTLab-Z3.js"),__vite__mapDeps([10,11,6,12,5,2,13,1,14,9])),tT=()=>So(()=>import("./DevicesPage-DVAiqqAb.js"),__vite__mapDeps([15,11,3])),nT=()=>So(()=>import("./DevicePage-BvwXdfhK.js"),__vite__mapDeps([16,12,5,2,8])),I7=()=>So(()=>import("./FilePage-DzKIB_pN.js"),__vite__mapDeps([17,13,1,14,6,7])),z7=OI([{path:"/",Component:j7,children:[{index:!0,element:R.jsx(ul,{moduleLoader:tT})},{path:"devices",element:R.jsx(ul,{moduleLoader:tT})},{path:"devices/:deviceId",element:R.jsx(ul,{moduleLoader:nT})},{path:"devices/:deviceId/windows/:windowId/panes/:paneId",element:R.jsx(ul,{moduleLoader:nT})},{path:"settings",element:R.jsx(ul,{moduleLoader:_7})},{path:"file/:ref",element:R.jsx(ul,{moduleLoader:I7})}]}]),Y2=document.getElementById("root");if(!Y2)throw new Error("Root element not found");t5.catch(()=>{}).then(()=>{hL.createRoot(Y2).render(R.jsx(y.StrictMode,{children:R.jsxs(ND,{client:A7,children:[R.jsx(J_,{router:z7}),R.jsx(GP,{}),R.jsx(k7,{})]})}))});export{U6 as $,dv as A,Rn as B,bv as C,Gb as D,dP as E,xv as F,gP as G,wv as H,Sv as I,IM as J,ya as K,eb as L,CC as M,uy as N,fy as O,ob as P,dy as Q,hy as R,xU as S,MC as T,Ji as U,tV as V,wR as W,Le as X,Zt as Y,qt as Z,mT as _,$u as a,Yt as a$,V6 as a0,Y6 as a1,q6 as a2,$6 as a3,Hl as a4,Fr as a5,r5 as a6,n5 as a7,O7 as a8,T7 as a9,M2 as aA,O2 as aB,d0 as aC,rb as aD,Ts as aE,V2 as aF,Vg as aG,nP as aH,jM as aI,LM as aJ,EC as aK,_M as aL,lP as aM,Y7 as aN,q7 as aO,B7 as aP,$7 as aQ,K7 as aR,FP as aS,qn as aT,Os as aU,N8 as aV,UM as aW,K8 as aX,sd as aY,Ni as aZ,Dn as a_,Z7 as aa,ku as ab,Q7 as ac,L_ as ad,Xv as ae,W7 as af,J7 as ag,G7 as ah,P2 as ai,X7 as aj,es as ak,Ul as al,Ev as am,bF as an,vF as ao,zP as ap,aV as aq,OV as ar,yy as as,l0 as at,a0 as au,u0 as av,c0 as aw,dd as ax,q9 as ay,i0 as az,bs as b,Mt as b0,pr as b1,Ot as b2,sv as b3,cr as b4,YM as b5,pt as b6,RO as b7,Ss as b8,H8 as b9,B8 as ba,P8 as bb,TO as bc,_8 as bd,Bh as be,bC as bf,TC as bg,o5 as bh,F7 as bi,bM as bj,hF as bk,nb as bl,Yr as bm,Va as bn,Pl as bo,_e as bp,HP as bq,J5 as br,o8 as bs,s8 as bt,cy as bu,wy as bv,H7 as bw,So as bx,Ku as c,mn as d,Cu as e,fv as f,hv as g,xR as h,pv as i,R as j,gv as k,mv as l,vv as m,yv as n,cn as o,Xb as p,Wb as q,y as r,pi as s,CT as t,gr as u,ab as v,V7 as w,$l as x,E8 as y,S4 as z};
|